Changeset 5013:92a0a184005d for doc

Show
Ignore:
Timestamp:
2007-03-21 10:08:56 (21 months ago)
Author:
Christoph Berg <cb@…>
Branch:
default
Message:

Pipe functions.h through cpp -C for the manual generation; factor out
makedoc-defs.h from init.h for use in functions.h.

Location:
doc
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • doc/Makefile.am

    r5001 r5013  
    131131        $(EDIT) $(srcdir)/mutt.man > $@ 
    132132 
    133 stamp-doc-xml: $(top_srcdir)/makedoc.c $(top_srcdir)/init.h manual.xml.head \ 
    134                $(top_srcdir)/functions.h $(top_srcdir)/OPS* manual.xml.tail \ 
    135                $(top_srcdir)/VERSION $(top_srcdir)/ChangeLog 
     133stamp-doc-xml: $(top_srcdir)/makedoc.c $(top_srcdir)/makedoc-defs.h $(top_srcdir)/init.h \ 
     134               manual.xml.head $(top_srcdir)/functions.h $(top_srcdir)/OPS* manual.xml.tail \ 
     135               $(srcdir)/gen-map-doc $(top_srcdir)/VERSION $(top_srcdir)/ChangeLog 
    136136        $(MAKE) ../makedoc$(EXEEXT) # we do not want to rebuild the documentation in tarball builds 
    137         ( date=`head -n 1 $(top_srcdir)/ChangeLog | LC_ALL=C cut -d ' ' -f 1`; \ 
    138           sed -e "s/@VERSION\@/`cat $(top_srcdir)/VERSION` ($$date)/" $(srcdir)/manual.xml.head ;\ 
    139           $(MAKEDOC_CPP) $(top_srcdir)/init.h | ../makedoc -s ;\ 
    140           perl $(srcdir)/gen-map-doc $(top_srcdir)/functions.h $(top_srcdir)/OPS* < $(srcdir)/manual.xml.tail \ 
     137        ( date=`head -n 1 $(top_srcdir)/ChangeLog | LC_ALL=C cut -d ' ' -f 1` && \ 
     138          sed -e "s/@VERSION\@/`cat $(top_srcdir)/VERSION` ($$date)/" $(srcdir)/manual.xml.head && \ 
     139          $(MAKEDOC_CPP) $(top_srcdir)/init.h | ../makedoc -s && \ 
     140          $(MAKEDOC_CPP) $(top_srcdir)/functions.h | \ 
     141            perl $(srcdir)/gen-map-doc $(srcdir)/manual.xml.tail $(top_srcdir)/OPS* \ 
    141142        ) > manual.xml 
    142143        touch stamp-doc-xml 
  • doc/gen-map-doc

    r4994 r5013  
    33use strict; 
    44 
    5 my (%OPS, %MAP, $map); 
     5my (%OPS, %MAP, %DOC, $map); 
    66 
    7 my $functions_h = shift @ARGV; 
     7my $xml = shift @ARGV; 
    88 
    99open F, "cat @ARGV |" or die "OPS*: $!"; 
     
    1414close F; 
    1515 
    16 open F, $functions_h or die "$functions_h: $!"; 
    17 while (<F>) { 
     16while (<STDIN>) { 
    1817  if (/^struct binding_t Op.*{ \/\* map: (.*) \*\//) { 
    1918    $map = $1; 
     19    $DOC{$map} = ""; 
     20  } 
     21  if ($map and /^\s*\*\*\s*(.*)/) { 
     22    $DOC{$map} .= "$1\n"; 
    2023  } 
    2124  if ($map and /{\s*"(.+)"\s*,\s*(\w+)\s*,\s*(?:"([^"]+)"|(\w+))\s*}/) { 
     
    4144  } 
    4245} 
    43 close F; 
    4446 
    45 while (<STDIN>) { 
     47open XML, $xml or die "$xml: $!"; 
     48while (<XML>) { 
    4649  if (/__print_map\((.*)\)/) { 
    47     die "map $1 undefined" unless $MAP{$1}; 
    48     print $MAP{$1}; 
     50    my $map = $1; 
     51    unless ($MAP{$map}) { 
     52      warn "map $map undefined"; 
     53      next; 
     54    } 
     55    print <<EOT; 
     56<sect2 id="${map}_map"> 
     57<title>$map</title> 
     58$DOC{$map} 
     59<para> 
     60 
     61<table id="${map}_table"> 
     62<title>Default $map function bindings</title> 
     63<tgroup cols="3"> 
     64<thead> 
     65<row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> 
     66</thead> 
     67<tbody> 
     68$MAP{$map} 
     69</tbody> 
     70</tgroup> 
     71</table> 
     72 
     73</para> 
     74 
     75</sect2> 
     76 
     77EOT 
    4978    delete $MAP{$1}; 
    5079  } else { 
     
    5281  } 
    5382} 
     83close XML; 
    5484 
    55 die "unprinted maps: ". join(" ", keys %MAP) if %MAP; 
     85warn "unprinted maps: ". join(" ", keys %MAP) if %MAP; 
  • doc/manual.xml.tail

    r4994 r5013  
    1212</para> 
    1313 
    14 <sect2 id="generic_map"> 
    15 <title>generic</title> 
    16  
    17 <para> 
    18 The <emphasis>generic</emphasis> menu is not a real menu, but specifies common functions 
    19 (such as movement) available in all menus except for <emphasis>pager</emphasis> and 
    20 <emphasis>editor</emphasis>.  Changing settings for this menu will affect the default 
    21 bindings for all menus (except as noted). 
    22 </para> 
    23  
    24 <para> 
    25  
    26 <table id="generic_table"> 
    27 <title>Default generic function bindings</title> 
    28 <tgroup cols="3"> 
    29 <thead> 
    30 <row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> 
    31 </thead> 
    32 <tbody> 
    3314__print_map(generic) 
    34 </tbody> 
    35 </tgroup> 
    36 </table> 
    37  
    38 </para> 
    39  
    40 </sect2> 
    41  
    42 <sect2 id="index_map"> 
    43 <title>index</title> 
    44  
    45 <para> 
    46  
    47 <table id="index_table"> 
    48 <title>Default index menu function bindings</title> 
    49 <tgroup cols="3"> 
    50 <thead> 
    51 <row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> 
    52 </thead> 
    53 <tbody> 
    5415__print_map(index) 
    55 </tbody> 
    56 </tgroup> 
    57 </table> 
    58  
    59 </para> 
    60  
    61 </sect2> 
    62  
    63 <sect2 id="pager_map"> 
    64 <title>pager</title> 
    65  
    66 <para> 
    67  
    68 <table id="pager_table"> 
    69 <title>Default pager menu function bindings</title> 
    70 <tgroup cols="3"> 
    71 <thead> 
    72 <row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> 
    73 </thead> 
    74 <tbody> 
    7516__print_map(pager) 
    76 </tbody> 
    77 </tgroup> 
    78 </table> 
    79  
    80 </para> 
    81  
    82 </sect2> 
    83  
    84 <sect2 id="alias_map"> 
    85 <title>alias</title> 
    86  
    87 <para> 
    88  
    89 <table id="alias_table"> 
    90 <title>Default alias menu function bindings</title> 
    91 <tgroup cols="3"> 
    92 <thead> 
    93 <row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> 
    94 </thead> 
    95 <tbody> 
    9617__print_map(alias) 
    97 </tbody> 
    98 </tgroup> 
    99 </table> 
    100  
    101 </para> 
    102  
    103 </sect2> 
    104  
    105 <sect2 id="query_map"> 
    106 <title>query</title> 
    107  
    108 <para> 
    109  
    110 <table id="query_table"> 
    111 <title>Default query menu function bindings</title> 
    112 <tgroup cols="3"> 
    113 <thead> 
    114 <row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> 
    115 </thead> 
    116 <tbody> 
    11718__print_map(query) 
    118 </tbody> 
    119 </tgroup> 
    120 </table> 
    121  
    122 </para> 
    123  
    124 </sect2> 
    125  
    126 <sect2 id="attach_map"> 
    127 <title>attach</title> 
    128  
    129 <para> 
    130  
    131 <table id="attach_table"> 
    132 <title>Default attach menu function bindings</title> 
    133 <tgroup cols="3"> 
    134 <thead> 
    135 <row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> 
    136 </thead> 
    137 <tbody> 
    13819__print_map(attach) 
    139 </tbody> 
    140 </tgroup> 
    141 </table> 
    142  
    143 </para> 
    144  
    145 </sect2> 
    146  
    147 <sect2 id="compose_map"> 
    148 <title>compose</title> 
    149  
    150 <para> 
    151  
    152 <table id="compose_table"> 
    153 <title>Default compose menu function bindings</title> 
    154 <tgroup cols="3"> 
    155 <thead> 
    156 <row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> 
    157 </thead> 
    158 <tbody> 
    15920__print_map(compose) 
    160 </tbody> 
    161 </tgroup> 
    162 </table> 
    163  
    164 </para> 
    165  
    166 </sect2> 
    167  
    168 <sect2 id="postpone_map"> 
    169 <title>postpone</title> 
    170  
    171 <para> 
    172  
    173 <table id="postpone_table"> 
    174 <title>Default postpone menu function bindings</title> 
    175 <tgroup cols="3"> 
    176 <thead> 
    177 <row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> 
    178 </thead> 
    179 <tbody> 
    18021__print_map(postpone) 
    181 </tbody> 
    182 </tgroup> 
    183 </table> 
    184  
    185 </para> 
    186  
    187 </sect2> 
    188  
    189 <sect2 id="browser_map"> 
    190 <title>browser</title> 
    191  
    192 <para> 
    193  
    194 <table id="browser_table"> 
    195 <title>Default browser menu function bindings</title> 
    196 <tgroup cols="3"> 
    197 <thead> 
    198 <row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> 
    199 </thead> 
    200 <tbody> 
    20122__print_map(browser) 
    202 </tbody> 
    203 </tgroup> 
    204 </table> 
    205  
    206 </para> 
    207  
    208 </sect2> 
    209  
    210 <sect2 id="pgp_map"> 
    211 <title>pgp</title> 
    212  
    213 <para> 
    214  
    215 <table id="pgp_table"> 
    216 <title>Default pgp menu function bindings</title> 
    217 <tgroup cols="3"> 
    218 <thead> 
    219 <row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> 
    220 </thead> 
    221 <tbody> 
    22223__print_map(pgp) 
    223 </tbody> 
    224 </tgroup> 
    225 </table> 
    226  
    227 </para> 
    228  
    229 </sect2> 
    230  
    231 <sect2 id="smime_map"> 
    232 <title>smime</title> 
    233  
    234 <para> 
    235  
    236 <table id="smime_table"> 
    237 <title>Default smime menu function bindings</title> 
    238 <tgroup cols="3"> 
    239 <thead> 
    240 <row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> 
    241 </thead> 
    242 <tbody> 
    24324__print_map(smime) 
    244 </tbody> 
    245 </tgroup> 
    246 </table> 
    247  
    248 </para> 
    249  
    250 </sect2> 
    251  
    252 <sect2 id="mix_map"> 
    253 <title>mix</title> 
    254  
    255 <para> 
    256  
    257 <table id="mix_table"> 
    258 <title>Default mix menu function bindings</title> 
    259 <tgroup cols="3"> 
    260 <thead> 
    261 <row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> 
    262 </thead> 
    263 <tbody> 
    26425__print_map(mix) 
    265 </tbody> 
    266 </tgroup> 
    267 </table> 
    268  
    269 </para> 
    270  
    271 </sect2> 
    272  
    273 <sect2 id="editor_map"> 
    274 <title>editor</title> 
    275  
    276 <para> 
    277  
    278 <table id="editor_table"> 
    279 <title>Default editor function bindings</title> 
    280 <tgroup cols="3"> 
    281 <thead> 
    282 <row><entry>Function</entry><entry>Default key</entry><entry>Description</entry></row> 
    283 </thead> 
    284 <tbody> 
    28526__print_map(editor) 
    286 </tbody> 
    287 </tgroup> 
    288 </table> 
    289  
    290 </para> 
    291  
    292 </sect2> 
    29327 
    29428</sect1>