From 573036a4032c7754a2af2d28d6c96a6c5d38623b Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sat, 3 May 2008 18:30:26 +0300 Subject: [PATCH] Generate DocBook and XHTML with help2xml. The older help2doc script is no longer used for anything. To make future cherry-picking easier, this commit does not include the resulting changes in generated files. --- doc/Makefile | 24 ++++++++++++++++-------- doc/elinks.1.txt | 9 ++++++++- doc/elinks.conf.5.txt | 10 +++++++++- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index e516bbbdc..792591c9d 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -26,8 +26,6 @@ TXT_DOCS_NOINSTALL = \ features.txt \ keymap-actions.txt \ keymap-defaults.txt \ - option-command.txt \ - option-config.txt TXT_DOCS_ASIS = \ python.txt @@ -110,7 +108,7 @@ install-local: # Generated asciidoc files # Scripts and Dependencies -HELP2DOC = $(srcdir)tools/help2doc +HELP2XML = $(srcdir)tools/help2xml CONF2DOC = $(srcdir)tools/conf2doc KEYS2DOC = $(srcdir)tools/keys2doc ELINKS = $(top_builddir)/src/elinks @@ -123,8 +121,8 @@ LOCALES = LC_ALL=C LANGUAGE=en # FIXME: Keep generated .txt files relative to the source directory and files # they are included in. -quiet_cmd_help2doc = ' [$(LINK_COLOR)HELP2DOC$(END_COLOR)] $(RELPATH)$@' - cmd_help2doc = $(LOCALES) $(HELP2DOC) $(ELINKS) $@ > $@ +quiet_cmd_help2xml = ' [$(LINK_COLOR)HELP2XML$(END_COLOR)] $(RELPATH)$@' + cmd_help2xml = $(LOCALES) $(HELP2XML) $(ELINKS) $@ quiet_cmd_conf2doc = ' [$(LINK_COLOR)CONF2DOC$(END_COLOR)] $(RELPATH)$@' cmd_conf2doc = $(LOCALES) $(CONF2DOC) $(FEATURES) > $@ @@ -138,9 +136,11 @@ features.txt: $(FEATURES) $(CONF2DOC) keymap-%.txt: $(KBDBIND) $(KEYS2DOC) $(call cmd,keys2doc) -option-%.txt: $(ELINKS) $(HELP2DOC) - $(call cmd,help2doc) +option-%.frag.xml: $(ELINKS) $(HELP2XML) + $(call cmd,help2xml) +option-%.frag.xhtml: $(ELINKS) $(HELP2XML) + $(call cmd,help2xml) ############################################################################# # Build commands and macros @@ -166,7 +166,7 @@ backend = $(if $(findstring .xml,$@),docbook,xhtml11) outdir = $(if $(findstring -chunked,$@),$@,.) # Loosely track dependencies via asciidoc includes. -asciidoc_dep = sed -n 's/[{]builddir}//g;s@include::\(.*\)\[.*@$@: $< \1@p' < $< > .deps/$(@F).asciidoc +asciidoc_dep = sed -n 's/[{]builddir}//g;s@include1\{0,1\}::\(.*\)\[.*@$@: $< \1@p' < $< > .deps/$(@F).asciidoc -include .deps/*.asciidoc @@ -182,6 +182,14 @@ asciidoc_dep = sed -n 's/[{]builddir}//g;s@include::\(.*\)\[.*@$@: $< \1@p' < $< $(call cmd,asciidoc,docbook) @-$(call asciidoc_dep) +# asciidoc_dep above also generates these dependencies, but it runs +# only after asciidoc has succeeded, which won't happen if the files +# are missing. +elinks.1.xml: option-command.frag.xml +elinks.conf.5.xml: option-config.frag.xml +elinks.1.html: option-command.frag.xhtml +elinks.conf.5.html: option-config.frag.xhtml + %.1: %.1.xml $(call cmd,xmlto,man) diff --git a/doc/elinks.1.txt b/doc/elinks.1.txt index 231b879fc..71fceefdb 100644 --- a/doc/elinks.1.txt +++ b/doc/elinks.1.txt @@ -35,7 +35,14 @@ Most options can be set in the user interface or config file, so usually you do not need to care about them. Note that this list is roughly equivalent to the output of running ELinks with the option `--long-help`. -include::{builddir}option-command.txt[] +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +ifdef::backend-docbook[] +include1::{builddir}option-command.frag.xml[] +endif::backend-docbook[] +ifdef::backend-xhtml11[] +include1::{builddir}option-command.frag.xhtml[] +endif::backend-xhtml11[] +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ENVIRONMENT VARIABLES --------------------- diff --git a/doc/elinks.conf.5.txt b/doc/elinks.conf.5.txt index 9402f6e16..994a56f8c 100644 --- a/doc/elinks.conf.5.txt +++ b/doc/elinks.conf.5.txt @@ -56,7 +56,15 @@ Some sample settings: OPTIONS ------- -include::{builddir}option-config.txt[] + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +ifdef::backend-docbook[] +include1::{builddir}option-config.frag.xml[] +endif::backend-docbook[] +ifdef::backend-xhtml11[] +include1::{builddir}option-config.frag.xhtml[] +endif::backend-xhtml11[] +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SEE ALSO --------