[BACK]Return to mdoc_html.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/mdoc_html.c between version 1.80 and 1.87

version 1.80, 2010/06/12 11:21:44 version 1.87, 2010/06/27 16:18:13
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>   * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above   * purpose with or without fee is hereby granted, provided that the above
Line 30 
Line 30 
 #include "mandoc.h"  #include "mandoc.h"
 #include "out.h"  #include "out.h"
 #include "html.h"  #include "html.h"
   #include "regs.h"
 #include "mdoc.h"  #include "mdoc.h"
 #include "main.h"  #include "main.h"
   
Line 303  synopsis_pre(struct html *h, const struct mdoc_node *n
Line 304  synopsis_pre(struct html *h, const struct mdoc_node *n
         struct roffsu    su;          struct roffsu    su;
         struct htmlpair  tag;          struct htmlpair  tag;
   
         if (NULL == n->prev || SEC_SYNOPSIS != n->sec)          if (NULL == n->prev || ! (MDOC_SYNPRETTY & n->flags))
                 return;                  return;
   
         SCALE_VS_INIT(&su, 1);          SCALE_VS_INIT(&su, 1);
Line 1035  mdoc_it_pre(MDOC_ARGS)
Line 1036  mdoc_it_pre(MDOC_ARGS)
         if (MDOC_BLOCK != n->type)          if (MDOC_BLOCK != n->type)
                 bl = bl->parent;                  bl = bl->parent;
   
         type = bl->data.list;          SCALE_HS_INIT(&offs, 0);
   
         /* Set default width and offset. */          type = bl->data.Bl.type;
           comp = bl->data.Bl.comp;
   
         SCALE_HS_INIT(&offs, 0);          if (bl->data.Bl.offs)
                   a2offs(bl->data.Bl.offs, &offs);
   
         switch (type) {          switch (type) {
         case (LIST_enum):          case (LIST_enum):
Line 1056  mdoc_it_pre(MDOC_ARGS)
Line 1059  mdoc_it_pre(MDOC_ARGS)
                 break;                  break;
         }          }
   
         /* Get width, offset, and compact arguments. */          if (bl->data.Bl.width)
                   a2width(bl->data.Bl.width, &width);
   
         wp = -1;          wp = -1;
         for (comp = i = 0; bl->args && i < (int)bl->args->argc; i++)          for (i = 0; bl->args && i < (int)bl->args->argc; i++)
                 switch (bl->args->argv[i].arg) {                  switch (bl->args->argv[i].arg) {
                 case (MDOC_Column):                  case (MDOC_Column):
                         wp = i; /* Save for later. */                          wp = i; /* Save for later. */
                         break;                          break;
                 case (MDOC_Width):  
                         a2width(bl->args->argv[i].value[0], &width);  
                         break;  
                 case (MDOC_Offset):  
                         a2offs(bl->args->argv[i].value[0], &offs);  
                         break;  
                 case (MDOC_Compact):  
                         comp = 1;  
                         break;  
                 default:                  default:
                         break;                          break;
                 }                  }
Line 1123  mdoc_bl_pre(MDOC_ARGS)
Line 1118  mdoc_bl_pre(MDOC_ARGS)
                 return(0);                  return(0);
         if (MDOC_BLOCK != n->type)          if (MDOC_BLOCK != n->type)
                 return(1);                  return(1);
         if (LIST_enum != n->data.list)          if (LIST_enum != n->data.Bl.type)
                 return(1);                  return(1);
   
         ord = malloc(sizeof(struct ord));          ord = malloc(sizeof(struct ord));
Line 1147  mdoc_bl_post(MDOC_ARGS)
Line 1142  mdoc_bl_post(MDOC_ARGS)
   
         if (MDOC_BLOCK != n->type)          if (MDOC_BLOCK != n->type)
                 return;                  return;
         if (LIST_enum != n->data.list)          if (LIST_enum != n->data.Bl.type)
                 return;                  return;
   
         ord = h->ords.head;          ord = h->ords.head;
Line 1619  mdoc_fn_pre(MDOC_ARGS)
Line 1614  mdoc_fn_pre(MDOC_ARGS)
          */           */
   
 #if 0  #if 0
         if (SEC_SYNOPSIS == n->sec) {          if (MDOC_SYNPRETTY & n->flags) {
                 nbuf[0] = '\0';                  nbuf[0] = '\0';
                 html_idcat(nbuf, sp, BUFSIZ);                  html_idcat(nbuf, sp, BUFSIZ);
                 PAIR_ID_INIT(&tag[1], nbuf);                  PAIR_ID_INIT(&tag[1], nbuf);
Line 1649  mdoc_fn_pre(MDOC_ARGS)
Line 1644  mdoc_fn_pre(MDOC_ARGS)
   
         for (nn = n->child->next; nn; nn = nn->next) {          for (nn = n->child->next; nn; nn = nn->next) {
                 i = 1;                  i = 1;
                 if (SEC_SYNOPSIS == n->sec)                  if (MDOC_SYNPRETTY & n->flags)
                         i = 2;                          i = 2;
                 t = print_otag(h, TAG_SPAN, i, tag);                  t = print_otag(h, TAG_SPAN, i, tag);
                 print_text(h, nn->string);                  print_text(h, nn->string);
Line 1659  mdoc_fn_pre(MDOC_ARGS)
Line 1654  mdoc_fn_pre(MDOC_ARGS)
         }          }
   
         print_text(h, ")");          print_text(h, ")");
         if (SEC_SYNOPSIS == n->sec)          if (MDOC_SYNPRETTY & n->flags)
                 print_text(h, ";");                  print_text(h, ";");
   
         return(0);          return(0);
Line 1829  mdoc_in_pre(MDOC_ARGS)
Line 1824  mdoc_in_pre(MDOC_ARGS)
         PAIR_CLASS_INIT(&tag[0], "includes");          PAIR_CLASS_INIT(&tag[0], "includes");
         print_otag(h, TAG_SPAN, 1, tag);          print_otag(h, TAG_SPAN, 1, tag);
   
         if (SEC_SYNOPSIS == n->sec && MDOC_LINE & n->flags)          if (MDOC_SYNPRETTY & n->flags && MDOC_LINE & n->flags)
                 print_text(h, "#include");                  print_text(h, "#include");
   
         print_text(h, "<");          print_text(h, "<");

Legend:
Removed from v.1.80  
changed lines
  Added in v.1.87

CVSweb