diff --git a/src/tools/docutils.jam b/src/tools/docutils.jam index 30aaf7f0c..ea980cfa7 100755 --- a/src/tools/docutils.jam +++ b/src/tools/docutils.jam @@ -19,11 +19,19 @@ type.register ReST : rst ; class rst-scanner : common-scanner { + rule __init__ ( paths * ) + { + common-scanner.__init__ . $(paths) ; + } + rule pattern ( ) { - return "^\\w*\\.\\.\\w+include::\w+(.*)" - "^\\w*\\.\\.\\w+image::\w+(.*)" - "^\\w*\\.\\.\\w+figure::\w+(.*)" + return "^[ ]*\\.\\.[ ]+include::[ ]+([^ +]+)" + "^[ ]*\\.\\.[ ]+image::[ ]+([^ +]+)" + "^[ ]*\\.\\.[ ]+figure::[ ]+([^ +]+)" ; } } @@ -51,18 +59,23 @@ rule init ( docutils-dir ? ) rule html ( target : source : properties * ) { local command-prefix = "python "$(.docutils-dir)/tools/ ; - command-prefix on $(target) = $(command-prefix:E="") ; + if ! [ on $(target) return $(RST2XXX) ] + { + RST2XXX on $(target) = $(command-prefix:E="")rst2html.py ; + } } feature docutils : : free ; feature docutils-html : : free ; +feature docutils-cmd : : free ; toolset.flags docutils COMMON-FLAGS : ; toolset.flags docutils HTML-FLAGS : ; +toolset.flags docutils RST2XXX : ; actions html { $(.setup) - $(command-prefix)rst2html.py $(COMMON-FLAGS) $(HTML-FLAGS) $(>) $(<) + $(RST2XXX) $(COMMON-FLAGS) $(HTML-FLAGS) $(>) $(<) }