If I understand it correctly, documentation lookup is done using the gschemdoc.sh script. If a symbol has a documentation= attribute, this is used for searching. As explained at http://geda.seul.org/wiki/geda:master_attributes_list#documentation, if you give a filename for the documentation parameter on a symbol, the code looks in your local documentation directory. Unfortunately, on most linux systems this will be something like /usr/share/doc/geda-gaf.
If a non-root user wants to create symbols and link them to locally-downloaded datasheets, he or she is currently stuck. My suggestion is to add an environment variable - maybe GEDA_DOCDIRS - which can be set by the user. Have it colon-separated and check in these directories first.
I've coded up a version of gschemdoc.sh to do this and will attach it to the bug report as a patch. I've checked it with bash, ksh and dash: hopefully that's ok, but I'm not sure what else I need to check it with.
Hi Rupert,
The git version of gschem doesn't use the gschemdoc shell script any more; the functionality has been ported to Scheme so it's usable on platforms without Bourne shells (i.e. Windows). http:// git.geda- project. org/geda- gaf/tree/ gschem/ scheme/ gschem/ gschemdoc. scm
Your approach seems reasonable... but what about adding a user doc dir in the default search list? Something like:
1) If the environment variable is set, use that list of search paths;
2) Otherwise search in (a) a user doc directory and then (b) the system doc directory.
WDYT?