summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2023-03-22 20:14:35 +0100
committerCarlos Garnacho <carlosg@gnome.org>2023-03-26 20:09:09 +0200
commitdec84daa07755426b0aca471112c010aa1b9777e (patch)
tree628a81a6df27e02d7866c09d0020cf192ceb54fe /docs
parent06a65ea73c62619b77763d3a917f17e2ee31b60f (diff)
downloadtracker-dec84daa07755426b0aca471112c010aa1b9777e.tar.gz
docs: Allow adding an extra substitution path
Since we have files in the sources dir and generated files in the build dir, we may want to generate documentation that inline files from both locations. Allow adding an additional lookup path for the file, so both can be tried.
Diffstat (limited to 'docs')
-rw-r--r--docs/reference/libtracker-sparql/embed-files.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/reference/libtracker-sparql/embed-files.py b/docs/reference/libtracker-sparql/embed-files.py
index 6e54db350..ce48558a0 100644
--- a/docs/reference/libtracker-sparql/embed-files.py
+++ b/docs/reference/libtracker-sparql/embed-files.py
@@ -17,7 +17,12 @@ for m in matches:
f = open(os.path.join(dirname, m.strip()))
embedded = f.read()
except:
- embedded = ''
+ if (len(sys.argv) > 2):
+ try:
+ f = open (os.path.join(sys.argv[3], m.strip()))
+ embedded = f.read()
+ except:
+ embedded = ''
escaped = embedded.replace('\\', '\\\\')
replace = re.compile('{{' + m + '}}')