Skip to content

Commit

Permalink
scons: look for xhtml.xsl in several dirs as its location can vary
Browse files Browse the repository at this point in the history
  • Loading branch information
loonycyborg committed Mar 27, 2018
1 parent a1c06fb commit 3221e22
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions doc/manual/SConscript
Expand Up @@ -8,6 +8,10 @@ if "manual" in COMMAND_LINE_TARGETS or "update-po4a" in COMMAND_LINE_TARGETS or
env.Command("manual.en.xml", "manual.txt",
"asciidoc -b docbook -d book -n -a toc -o $TARGET $SOURCE && dos2unix $TARGET")
manuals = Glob("*.xml")
env["XHTML_XSL"] = env.FindFile("xhtml.xsl", ["/usr/share/asciidoc/docbook-xsl", "/etc/asciidoc/docbook-xsl", "/usr/share/xml/docbook/stylesheet/docbook-xsl/xhtml"])
if not env["XHTML_XSL"]:
print("Warning: xhtml.xsl not found, needed for generating manual")
env["XHTML_XSL"] = File("xhtml.xsl.not.found")
for manual in manuals:
html = env.Command(manual.name.replace(".xml", ".html"), manual,
"""${SOURCES[0].exists() and \
Expand All @@ -17,8 +21,8 @@ if "manual" in COMMAND_LINE_TARGETS or "update-po4a" in COMMAND_LINE_TARGETS or
--stringparam admon.textlabel 1 \
--stringparam admon.graphics 0 \
--stringparam html.stylesheet ./styles/manual.css \
/usr/share/asciidoc/docbook-xsl/xhtml.xsl \
%s > %s' % (SOURCE, TARGET) \
%s \
%s > %s' % (XHTML_XSL.path, SOURCE, TARGET) \
or '@echo Skipped non-existant %s' % SOURCE} \
""")
env.Alias("manual", html)

0 comments on commit 3221e22

Please sign in to comment.