diff options
author | Christoph Berg <cb@df7cb.de> | 2007-03-21 10:08:56 -0700 |
---|---|---|
committer | Christoph Berg <cb@df7cb.de> | 2007-03-21 10:08:56 -0700 |
commit | ae708b362940ed66fbccf2e4578057607a611250 (patch) | |
tree | 367b03ee2b90c319e8a07e542506be114d81cdfe /doc | |
parent | 44a89dc084e9e8aa12437542adc7e0d688f50a91 (diff) |
Pipe functions.h through cpp -C for the manual generation; factor out
makedoc-defs.h from init.h for use in functions.h.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/Makefile.am | 15 | ||||
-rw-r--r-- | doc/gen-map-doc | 48 | ||||
-rw-r--r-- | doc/manual.xml.tail | 266 |
3 files changed, 47 insertions, 282 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am index 891333a0..69039908 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -130,13 +130,14 @@ EDIT = sed -e 's,@sysconfdir\@,$(sysconfdir),g' \ mutt.1: $(srcdir)/mutt.man $(EDIT) $(srcdir)/mutt.man > $@ -stamp-doc-xml: $(top_srcdir)/makedoc.c $(top_srcdir)/init.h manual.xml.head \ - $(top_srcdir)/functions.h $(top_srcdir)/OPS* manual.xml.tail \ - $(top_srcdir)/VERSION $(top_srcdir)/ChangeLog +stamp-doc-xml: $(top_srcdir)/makedoc.c $(top_srcdir)/makedoc-defs.h $(top_srcdir)/init.h \ + manual.xml.head $(top_srcdir)/functions.h $(top_srcdir)/OPS* manual.xml.tail \ + $(srcdir)/gen-map-doc $(top_srcdir)/VERSION $(top_srcdir)/ChangeLog $(MAKE) ../makedoc$(EXEEXT) # we do not want to rebuild the documentation in tarball builds - ( date=`head -n 1 $(top_srcdir)/ChangeLog | LC_ALL=C cut -d ' ' -f 1`; \ - sed -e "s/@VERSION\@/`cat $(top_srcdir)/VERSION` ($$date)/" $(srcdir)/manual.xml.head ;\ - $(MAKEDOC_CPP) $(top_srcdir)/init.h | ../makedoc -s ;\ - perl $(srcdir)/gen-map-doc $(top_srcdir)/functions.h $(top_srcdir)/OPS* < $(srcdir)/manual.xml.tail \ + ( date=`head -n 1 $(top_srcdir)/ChangeLog | LC_ALL=C cut -d ' ' -f 1` && \ + sed -e "s/@VERSION\@/`cat $(top_srcdir)/VERSION` ($$date)/" $(srcdir)/manual.xml.head && \ + $(MAKEDOC_CPP) $(top_srcdir)/init.h | ../makedoc -s && \ + $(MAKEDOC_CPP) $(top_srcdir)/functions.h | \ + perl $(srcdir)/gen-map-doc $(srcdir)/manual.xml.tail $(top_srcdir)/OPS* \ ) > manual.xml touch stamp-doc-xml diff --git a/doc/gen-map-doc b/doc/gen-map-doc index 9e01cc01..fcbaeffb 100644 --- a/doc/gen-map-doc +++ b/doc/gen-map-doc @@ -2,9 +2,9 @@ use strict; -my (%OPS, %MAP, $map); +my (%OPS, %MAP, %DOC, $map); -my $functions_h = shift @ARGV; +my $xml = shift @ARGV; open F, "cat @ARGV |" or die "OPS*: $!"; while (<F>) { @@ -13,10 +13,13 @@ while (<F>) { } close F; -open F, $functions_h or die "$functions_h: $!"; -while (<F>) { +while (<STDIN>) { if (/^struct binding_t Op.*{ \/\* map: (.*) \*\//) { $map = $1; + $DOC{$map} = ""; + } + if ($map and /^\s*\*\*\s*(.*)/) { + $DOC{$map} .= "$1\n"; } if ($map and /{\s*"(.+)"\s*,\s*(\w+)\s*,\s*(?:"([^"]+)"|(\w+))\s*}/) { my ($function, $op, $binding) = ($1, $2, $3 || $4); @@ -40,16 +43,43 @@ while (<F>) { undef $map; } } -close F; -while (<STDIN>) { +open XML, $xml or die "$xml: $!"; +while (<XML>) { if (/__print_map\((.*)\)/) { - die "map $1 undefined" unless $MAP{$1}; - print $MAP{$1}; + my $map = $1; + unless ($MAP{$map}) { + warn "map $map undefined"; + next; + } + print <<EOT; +<sect2 id="${map}_map"> +<title>$map</title> +$DOC{$map} +<para> + +<table id="${map}_table"> +<title>Default $map function bindings</title> +<tgroup cols="3"> +<thead> +<row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> +</thead> +<tbody> +$MAP{$map} +</tbody> +</tgroup> +</table> + +</para> + +</sect2> + +EOT delete $MAP{$1}; } else { print; } } +close XML; -die "unprinted maps: ". join(" ", keys %MAP) if %MAP; +warn "unprinted maps: ". join(" ", keys %MAP) if %MAP; diff --git a/doc/manual.xml.tail b/doc/manual.xml.tail index 7bba58c2..1ebe1e49 100644 --- a/doc/manual.xml.tail +++ b/doc/manual.xml.tail @@ -11,285 +11,19 @@ functions can be changed with the <link linkend="bind">bind</link> command. </para> -<sect2 id="generic_map"> -<title>generic</title> - -<para> -The <emphasis>generic</emphasis> menu is not a real menu, but specifies common functions -(such as movement) available in all menus except for <emphasis>pager</emphasis> and -<emphasis>editor</emphasis>. Changing settings for this menu will affect the default -bindings for all menus (except as noted). -</para> - -<para> - -<table id="generic_table"> -<title>Default generic function bindings</title> -<tgroup cols="3"> -<thead> -<row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> -</thead> -<tbody> __print_map(generic) -</tbody> -</tgroup> -</table> - -</para> - -</sect2> - -<sect2 id="index_map"> -<title>index</title> - -<para> - -<table id="index_table"> -<title>Default index menu function bindings</title> -<tgroup cols="3"> -<thead> -<row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> -</thead> -<tbody> __print_map(index) -</tbody> -</tgroup> -</table> - -</para> - -</sect2> - -<sect2 id="pager_map"> -<title>pager</title> - -<para> - -<table id="pager_table"> -<title>Default pager menu function bindings</title> -<tgroup cols="3"> -<thead> -<row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> -</thead> -<tbody> __print_map(pager) -</tbody> -</tgroup> -</table> - -</para> - -</sect2> - -<sect2 id="alias_map"> -<title>alias</title> - -<para> - -<table id="alias_table"> -<title>Default alias menu function bindings</title> -<tgroup cols="3"> -<thead> -<row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> -</thead> -<tbody> __print_map(alias) -</tbody> -</tgroup> -</table> - -</para> - -</sect2> - -<sect2 id="query_map"> -<title>query</title> - -<para> - -<table id="query_table"> -<title>Default query menu function bindings</title> -<tgroup cols="3"> -<thead> -<row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> -</thead> -<tbody> __print_map(query) -</tbody> -</tgroup> -</table> - -</para> - -</sect2> - -<sect2 id="attach_map"> -<title>attach</title> - -<para> - -<table id="attach_table"> -<title>Default attach menu function bindings</title> -<tgroup cols="3"> -<thead> -<row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> -</thead> -<tbody> __print_map(attach) -</tbody> -</tgroup> -</table> - -</para> - -</sect2> - -<sect2 id="compose_map"> -<title>compose</title> - -<para> - -<table id="compose_table"> -<title>Default compose menu function bindings</title> -<tgroup cols="3"> -<thead> -<row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> -</thead> -<tbody> __print_map(compose) -</tbody> -</tgroup> -</table> - -</para> - -</sect2> - -<sect2 id="postpone_map"> -<title>postpone</title> - -<para> - -<table id="postpone_table"> -<title>Default postpone menu function bindings</title> -<tgroup cols="3"> -<thead> -<row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> -</thead> -<tbody> __print_map(postpone) -</tbody> -</tgroup> -</table> - -</para> - -</sect2> - -<sect2 id="browser_map"> -<title>browser</title> - -<para> - -<table id="browser_table"> -<title>Default browser menu function bindings</title> -<tgroup cols="3"> -<thead> -<row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> -</thead> -<tbody> __print_map(browser) -</tbody> -</tgroup> -</table> - -</para> - -</sect2> - -<sect2 id="pgp_map"> -<title>pgp</title> - -<para> - -<table id="pgp_table"> -<title>Default pgp menu function bindings</title> -<tgroup cols="3"> -<thead> -<row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> -</thead> -<tbody> __print_map(pgp) -</tbody> -</tgroup> -</table> - -</para> - -</sect2> - -<sect2 id="smime_map"> -<title>smime</title> - -<para> - -<table id="smime_table"> -<title>Default smime menu function bindings</title> -<tgroup cols="3"> -<thead> -<row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> -</thead> -<tbody> __print_map(smime) -</tbody> -</tgroup> -</table> - -</para> - -</sect2> - -<sect2 id="mix_map"> -<title>mix</title> - -<para> - -<table id="mix_table"> -<title>Default mix menu function bindings</title> -<tgroup cols="3"> -<thead> -<row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> -</thead> -<tbody> __print_map(mix) -</tbody> -</tgroup> -</table> - -</para> - -</sect2> - -<sect2 id="editor_map"> -<title>editor</title> - -<para> - -<table id="editor_table"> -<title>Default editor function bindings</title> -<tgroup cols="3"> -<thead> -<row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> -</thead> -<tbody> __print_map(editor) -</tbody> -</tgroup> -</table> - -</para> - -</sect2> </sect1> |