diff options
Diffstat (limited to 'Jamrules.jam')
-rw-r--r-- | Jamrules.jam | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Jamrules.jam b/Jamrules.jam index 9c6c018..c420b7a 100644 --- a/Jamrules.jam +++ b/Jamrules.jam @@ -469,6 +469,16 @@ else } } +actions QuickbookAction +{ + %QUICKBOOK_PATH%\bin\quickbook.exe --output-file $(<) --input-file $(>) >nul +} + +actions XSLTProcAction +{ + %QUICKBOOK_PATH%\bin\xsltproc.exe --path$(SPACE)$(XSLPATH) --stringparam$(SPACE)$(XSLPARAM) --output $(<) $(XSL) $(>) +} + rule MakeFileDir TARGET { local DIR = $(TARGET:D) ; @@ -588,3 +598,40 @@ rule Coverage TARGET : SOURCE CoverageAction $(TARGET) : $(FILES) ; Depends $(TARGET) : $(SOURCE) ; } + +rule Documentation TARGET : SOURCE +{ + # quickbook -> boostbook + local BOOSTBOOK = $(BUILD)/$(SOURCE:S=.bb.xml) ; + + MakeFileDir $(BOOSTBOOK) ; + QuickbookAction $(BOOSTBOOK) : $(SOURCE) ; + Depends $(BOOSTBOOK) : $(SOURCE) ; + + # boostbook -> docbook + local DOCBOOK = $(BUILD)/$(SOURCE:S=.db.xml) ; + + XSL on $(DOCBOOK) = %QUICKBOOK_PATH%/boostbook/xsl/docbook.xsl ; + XSLPATH on $(DOCBOOK) = %QUICKBOOK_PATH%/boostbook/dtd %QUICKBOOK_PATH%/docbook-xml ; + XSLTProcAction $(DOCBOOK) : $(BOOSTBOOK) ; + Depends $(DOCBOOK) : $(BOOSTBOOK) ; + + # docbook -> html + local HTML = $(TARGET) ; + + XSL on $(HTML) = %QUICKBOOK_PATH%/boostbook/xsl/html.xsl ; + XSLPATH on $(HTML) = %QUICKBOOK_PATH%/docbook-xml %QUICKBOOK_PATH%/docbook-xsl/html %QUICKBOOK_PATH%/docbook-xsl/lib ; + + XSLPARAM on $(HTML) = + "generate.manifest 0" + "html.stylesheet pugixml.css" + "root.filename $(TARGET:B)" + "generate.section.toc.level 1" + "toc.section.depth 3" + "admon.graphics.path images/" + "navig.graphics.path images/" + ; + + XSLTProcAction $(HTML) : $(DOCBOOK) ; + Depends $(HTML) : $(DOCBOOK) ; +} |