diff --git a/doc/Makefile.am b/doc/Makefile.am index a7491d76f6..ed10db6e13 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -18,6 +18,7 @@ hacking-doc: ../HACKING # when generating documentation, first try rst2html.py as it is the upstream default doc: geany.txt + (rst2html.py --version) < /dev/null > /dev/null 2>&1 && \ rst2html.py -stg --stylesheet=geany.css $(srcdir)/geany.txt geany.html || \ rst2html -stg --stylesheet=geany.css $(srcdir)/geany.txt geany.html diff --git a/waf b/waf index a5feecbbd1..6533688f00 100755 Binary files a/waf and b/waf differ diff --git a/wscript b/wscript index 5b9dfdc118..aa6dac4c46 100644 --- a/wscript +++ b/wscript @@ -418,13 +418,18 @@ def shutdown(): launch('doxygen ' + doxyfile, 'Generating API reference documentation') if Options.options.htmldoc: - os.chdir('doc') - # first try rst2html.py as it is the upstream default - ret = launch('rst2html.py -stg --stylesheet=geany.css geany.txt geany.html', - 'Generating HTML documentation') - if not ret == 0: - launch('rst2html -stg --stylesheet=geany.css geany.txt geany.html', - 'Generating HTML documentation (using fallback "rst2html")') + # first try rst2html.py as it is the upstream default, fall back to rst2html + cmd = Configure.find_program_impl(Build.bld.env, 'rst2html.py') + if not cmd: + cmd = Configure.find_program_impl(Build.bld.env, 'rst2html') + if cmd: + os.chdir('doc') + ret = launch(cmd + ' -stg --stylesheet=geany.css geany.txt geany.html', + 'Generating HTML documentation') + else: + Utils.pprint('RED', + 'rst2html.py could not be found. Please install the Python docutils package.') + sys.exit(1) if Options.options.update_po: # the following code was taken from midori's WAF script, thanks