diff --git a/doc/tools/doctool b/doc/tools/doctool index 78b5f0e66..97956a1d9 100755 --- a/doc/tools/doctool +++ b/doc/tools/doctool @@ -214,6 +214,19 @@ class LaTeXCustomWriter(latex2e.Writer): +def docutils_bug_workaround(acc, x): + """ + + Workarounds this bug: http://sourceforge.net/p/docutils/bugs/215/ + """ + problematic_parameter = '--stylesheet-path' + if str.find(x, problematic_parameter) == -1: + acc.append(x) + else: + acc.append(problematic_parameter) + acc.append([x[str.find(x,'=') + 1:]]) + return acc + class DocTool(object): def main(self, argv=None): @@ -271,7 +284,7 @@ class DocTool(object): publish_cmdline(writer_name="html", settings_overrides=HTML_SETTINGS, description=description, - argv=list(args), + argv=reduce(docutils_bug_workaround, list(args), []), ) def cmd_toplevel(self, cmd, *args):