Changeset 5462:7e6d98886cce

Show
Ignore:
Timestamp:
2008-07-21 02:42:27 (4 months ago)
Author:
Rocco Rutte <pdmef@…>
Branch:
HEAD
Message:

makedoc: Add ".ie" and ".il" to support itemized lists.

Some settings docs use verbatim screen environments to print
lists while support for real lists will make it look nicer:
for docbook use <itemizedlist/>, \(hy for roff and '-' for text.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • doc/makedoc.c

    r5306 r5462  
    7777#define D_DD            (1 << 8) 
    7878#define D_PA            (1 << 9) 
     79#define D_IL            (1 << 10) 
    7980 
    8081enum 
     
    9495  SP_END_DD, 
    9596  SP_END_DL, 
     97  SP_START_IL, 
     98  SP_END_IL, 
    9699  SP_END_SECT, 
    97100  SP_REFER 
     
    734737 ** - .dd starts a definition in a definition list. 
    735738 ** - .de on a line finishes a definition list. 
     739 ** - .il on a line starts an itemzied list 
     740 ** - .dd starts an item in an itemized list 
     741 ** - .ie on a line finishes an itemized list 
    736742 ** - .ts on a line starts a "tscreen" environment (name taken from SGML). 
    737743 ** - .te on a line finishes this environment. 
     
    851857        case SP_DD: 
    852858        { 
     859          if (docstat & D_IL) 
     860            fputs ("- ", out); 
    853861          Continuation = 0; 
    854862          break; 
     
    858866          Continuation = 0; 
    859867          docstat &= ~D_DL; 
     868          break; 
     869        } 
     870        case SP_START_IL: 
     871        { 
     872          docstat |= D_IL; 
     873          break; 
     874        } 
     875        case SP_END_IL: 
     876        { 
     877          Continuation = 0; 
     878          docstat &= ~D_IL; 
    860879          break; 
    861880        } 
     
    960979        case SP_DD: 
    961980        { 
    962           fputs ("\n", out); 
     981          if (docstat & D_IL) 
     982            fputs (".TP\n\\(hy ", out); 
     983          else 
     984            fputs ("\n", out); 
    963985          break; 
    964986        } 
    965987        case SP_END_DL: 
     988        { 
     989          fputs (".RE\n.PD 1", out); 
     990          docstat &= ~D_DL; 
     991          break; 
     992        } 
     993        case SP_START_IL: 
     994        { 
     995          fputs (".RS\n.PD 0\n", out); 
     996          docstat |= D_IL; 
     997          break; 
     998        } 
     999        case SP_END_IL: 
    9661000        { 
    9671001          fputs (".RE\n.PD 1", out); 
     
    10881122        { 
    10891123          docstat |= D_DD; 
    1090           fputs ("</term>\n<listitem><para>", out); 
     1124          if (docstat & D_DL) 
     1125            fputs("</term>\n", out); 
     1126          fputs ("<listitem><para>", out); 
    10911127          break; 
    10921128        } 
     
    10941130        { 
    10951131          docstat &= ~D_DD; 
    1096           fputs ("</para></listitem></varlistentry>\n", out); 
     1132          fputs ("</para></listitem>", out); 
     1133          if (docstat & D_DL) 
     1134            fputs("</varlistentry>\n", out); 
    10971135          break; 
    10981136        } 
     
    11001138        { 
    11011139          fputs ("</para></listitem></varlistentry></variablelist>\n", out); 
     1140          docstat &= ~(D_DD|D_DL); 
     1141          break; 
     1142        } 
     1143        case SP_START_IL: 
     1144        { 
     1145          fputs ("\n<itemizedlist>\n", out); 
     1146          docstat |= D_IL; 
     1147          break; 
     1148        } 
     1149        case SP_END_IL: 
     1150        { 
     1151          fputs ("</para></listitem></itemizedlist>\n", out); 
    11021152          docstat &= ~(D_DD|D_DL); 
    11031153          break; 
     
    11841234  else if (!strncmp (l, ".de", 3)) 
    11851235    return print_it (SP_END_DL, NULL, out, docstat); 
     1236  else if (!strncmp (l, ".il", 3)) 
     1237    return print_it (SP_START_IL, NULL, out, docstat); 
     1238  else if (!strncmp (l, ".ie", 3)) 
     1239    return print_it (SP_END_IL, NULL, out, docstat); 
    11861240  else if (!strncmp (l, ". ", 2)) 
    11871241    *l = ' '; 
     
    12301284    else if (!strncmp (s, ".dd", 3)) 
    12311285    { 
     1286      if ((docstat & D_IL) && (docstat & D_DD)) 
     1287      { 
     1288        docstat = commit_buff (buff, &d, out, docstat); 
     1289        docstat = print_it (SP_END_DD, NULL, out, docstat); 
     1290      } 
    12321291      docstat = commit_buff (buff, &d, out, docstat); 
    12331292      docstat = print_it (SP_DD, NULL, out, docstat);