Klap-In, your question got me thinking about this in more depth.
Section: Configuration Script
Configure script (the one inside dokuwiki's configuration section) would write two output files, one for namespaces, and one for pages.
If a namespace isn't configured directly, it inherits the settings from it's parent namespace.
If there is no parent namespace it is set to all negative values. (see example 2 below)
Example 1: Namespace configured directly
namespace_name;autolink_flag_value;autolinkDown_flag_value;autolinkUp_flag_value;excludeDown_flag_value;
excludeUp_flag_value
(should all be one line)
Example Two: an Un-configured Namespace with no parent to inherit from
namespace_name;0;0;0;1;1
Thus this namespace is excluded from all autolink procedures.
Example Three: A namespace inheriting from it's parent
namespace_name;;;;;
If a page isn't configured directly, it inherits the settings from the namespace in which it present.
Example Four : A file's configuration line
fully/qualified/file/name;autolink_flag_value;autolinkDown_flag_value;autolinkUp_flag_value;excludeDown_flag_value;
excludeUp_flag_value
Not the file's extension is not included. This way we can use the file name as our search for parameter.
Example Five: a configured file's entry
path/to/file;1;1;1;0;0
This file is auto linked, autolinked to files in the directory(ies) above (if they link down), and linked to pages below(if they link up).
Example Six: A File inheriting from its namespace
path/to/file;;;;;
Section: Maintenance Script
The maint script opens the namespace config file to see which namespaces it needs to scan.
Then it opens the files config, to see which files are linked to, where they should be processed at.
It then opens the text files in a namespace(all of them, one at a time) which is flagged for autolinking, and scans the files contents for words that match the files in the same namespace. IF one is found, it checks that files entry in the file config to see if it is excluded or not. If it is excluded, execution continues. If it is not excluded, a fully qualified two-part link is created like
[[path:to:file|original_text]], and execution continues.
It then re-scans the file for namespace above linking (if this namespace is flagged
AutolinkUp=True), and repeats the same process as above. This time the link is omitted if the namespace or file above is flagged
autolinkDown=False.
A third pass is made, this time linking downwards. The flags again are altered.
My mind is going a million miles a minute in three directions here, so I may have misstated the flags a bit. They simply need to check their opposites for exclusion.
Doing it this way requires two files rather than the config files, plus a file in each namespace, but the scripting might be a little more complex.
Personally I would use tabs as separators rather than semi-colons, but not being good with php, and not knowing Dokuwiki's code base, that choice would be to the author.
As you can see, this script would be a monstrous drag on the system, and a long one to run. That's why it would have to be a cron job. Probably even have to invoke php with some kind of over-ride on script time/resource limits.
Section: Afterthoughts
As written this only autlinks within a given namespace trunk. An additional flag (autlinkAllNamespaces) could be used with a fourth iteration to link across all namespaces.