[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.56 and 1.57

version 1.56, 2010/04/03 14:25:12 version 1.57, 2010/04/05 08:51:56
Line 589  mdoc_sh_pre(MDOC_ARGS)
Line 589  mdoc_sh_pre(MDOC_ARGS)
                         html_idcat(buf, " ", BUFSIZ);                          html_idcat(buf, " ", BUFSIZ);
         }          }
   
         /*  
          * TODO: make sure there are no duplicates, as HTML does not  
          * allow for multiple `id' tags of the same name.  
          */  
   
         PAIR_CLASS_INIT(&tag[0], "sec-head");          PAIR_CLASS_INIT(&tag[0], "sec-head");
         tag[1].key = ATTR_ID;          PAIR_ID_INIT(&tag[1], buf);
         tag[1].val = buf;  
         print_otag(h, TAG_DIV, 2, tag);          print_otag(h, TAG_DIV, 2, tag);
         return(1);          return(1);
 }  }
Line 648  mdoc_ss_pre(MDOC_ARGS)
Line 643  mdoc_ss_pre(MDOC_ARGS)
   
         PAIR_CLASS_INIT(&tag[0], "ssec-head");          PAIR_CLASS_INIT(&tag[0], "ssec-head");
         PAIR_STYLE_INIT(&tag[1], h);          PAIR_STYLE_INIT(&tag[1], h);
         tag[2].key = ATTR_ID;          PAIR_ID_INIT(&tag[2], buf);
         tag[2].val = buf;  
         print_otag(h, TAG_DIV, 3, tag);          print_otag(h, TAG_DIV, 3, tag);
         return(1);          return(1);
 }  }
Line 765  mdoc_xr_pre(MDOC_ARGS)
Line 760  mdoc_xr_pre(MDOC_ARGS)
                 buffmt_man(h, n->child->string,                  buffmt_man(h, n->child->string,
                                 n->child->next ?                                  n->child->next ?
                                 n->child->next->string : NULL);                                  n->child->next->string : NULL);
                 tag[1].key = ATTR_HREF;                  PAIR_HREF_INIT(&tag[1], h->buf);
                 tag[1].val = h->buf;  
                 print_otag(h, TAG_A, 2, tag);                  print_otag(h, TAG_A, 2, tag);
         } else          } else
                 print_otag(h, TAG_A, 1, tag);                  print_otag(h, TAG_A, 1, tag);
Line 1309  mdoc_sx_pre(MDOC_ARGS)
Line 1303  mdoc_sx_pre(MDOC_ARGS)
         const struct mdoc_node  *nn;          const struct mdoc_node  *nn;
         char                     buf[BUFSIZ];          char                     buf[BUFSIZ];
   
         /* FIXME: duplicates? */  
   
         strlcpy(buf, "#", BUFSIZ);          strlcpy(buf, "#", BUFSIZ);
         for (nn = n->child; nn; nn = nn->next) {          for (nn = n->child; nn; nn = nn->next) {
                 html_idcat(buf, nn->string, BUFSIZ);                  html_idcat(buf, nn->string, BUFSIZ);
Line 1319  mdoc_sx_pre(MDOC_ARGS)
Line 1311  mdoc_sx_pre(MDOC_ARGS)
         }          }
   
         PAIR_CLASS_INIT(&tag[0], "link-sec");          PAIR_CLASS_INIT(&tag[0], "link-sec");
         tag[1].key = ATTR_HREF;          PAIR_HREF_INIT(&tag[1], buf);
         tag[1].val = buf;  
   
         print_otag(h, TAG_A, 2, tag);          print_otag(h, TAG_A, 2, tag);
         return(1);          return(1);
Line 1586  mdoc_vt_pre(MDOC_ARGS)
Line 1577  mdoc_vt_pre(MDOC_ARGS)
         struct htmlpair  tag;          struct htmlpair  tag;
         struct roffsu    su;          struct roffsu    su;
   
         if (MDOC_BLOCK == n->type) {          if (SEC_SYNOPSIS == n->sec && MDOC_BLOCK == n->type) {
                 if (n->prev && MDOC_Vt != n->prev->tok) {                  if (n->next && MDOC_Vt != n->next->tok) {
                         SCALE_VS_INIT(&su, 1);                          SCALE_VS_INIT(&su, 1);
                         bufcat_su(h, "margin-top", &su);                          bufcat_su(h, "margin-bottom", &su);
                         PAIR_STYLE_INIT(&tag, h);                          PAIR_STYLE_INIT(&tag, h);
                         print_otag(h, TAG_DIV, 1, &tag);                          print_otag(h, TAG_DIV, 1, &tag);
                 } else                  } else
                         print_otag(h, TAG_DIV, 0, NULL);                          print_otag(h, TAG_DIV, 0, NULL);
   
                 return(1);                  return(1);
         } else if (MDOC_HEAD == n->type)          } else if (MDOC_HEAD == n->type)
                 return(0);                  return(0);
Line 1610  static int
Line 1601  static int
 mdoc_ft_pre(MDOC_ARGS)  mdoc_ft_pre(MDOC_ARGS)
 {  {
         struct htmlpair  tag;          struct htmlpair  tag;
         struct roffsu    su;  
   
         if (SEC_SYNOPSIS == n->sec) {          if (SEC_SYNOPSIS == n->sec)
                 if (n->prev && MDOC_Fo == n->prev->tok) {                  print_otag(h, TAG_DIV, 0, NULL);
                         SCALE_VS_INIT(&su, 1);  
                         bufcat_su(h, "margin-top", &su);  
                         PAIR_STYLE_INIT(&tag, h);  
                         print_otag(h, TAG_DIV, 1, &tag);  
                 } else  
                         print_otag(h, TAG_DIV, 0, NULL);  
         }  
   
         PAIR_CLASS_INIT(&tag, "ftype");          PAIR_CLASS_INIT(&tag, "ftype");
         print_otag(h, TAG_SPAN, 1, &tag);          print_otag(h, TAG_SPAN, 1, &tag);
Line 1674  mdoc_fn_pre(MDOC_ARGS)
Line 1657  mdoc_fn_pre(MDOC_ARGS)
         }          }
   
         PAIR_CLASS_INIT(&tag[0], "fname");          PAIR_CLASS_INIT(&tag[0], "fname");
   
           /*
            * FIXME: only refer to IDs that we know exist.
            */
   
   #if 0
           if (SEC_SYNOPSIS == n->sec) {
                   nbuf[0] = '\0';
                   html_idcat(nbuf, sp, BUFSIZ);
                   PAIR_ID_INIT(&tag[1], nbuf);
           } else {
                   strlcpy(nbuf, "#", BUFSIZ);
                   html_idcat(nbuf, sp, BUFSIZ);
                   PAIR_HREF_INIT(&tag[1], nbuf);
           }
   #endif
   
         t = print_otag(h, TAG_SPAN, 1, tag);          t = print_otag(h, TAG_SPAN, 1, tag);
   
         if (sp) {          if (sp) {
                 (void)strlcpy(nbuf, sp, BUFSIZ);                  strlcpy(nbuf, sp, BUFSIZ);
                 print_text(h, nbuf);                  print_text(h, nbuf);
         }          }
   
Line 1778  mdoc_lk_pre(MDOC_ARGS)
Line 1778  mdoc_lk_pre(MDOC_ARGS)
         nn = n->child;          nn = n->child;
   
         PAIR_CLASS_INIT(&tag[0], "link-ext");          PAIR_CLASS_INIT(&tag[0], "link-ext");
         tag[1].key = ATTR_HREF;          PAIR_HREF_INIT(&tag[1], nn->string);
         tag[1].val = nn->string;  
         print_otag(h, TAG_A, 2, tag);          print_otag(h, TAG_A, 2, tag);
   
         if (NULL == nn->next)          if (NULL == nn->next)
Line 1806  mdoc_mt_pre(MDOC_ARGS)
Line 1805  mdoc_mt_pre(MDOC_ARGS)
                 bufinit(h);                  bufinit(h);
                 bufcat(h, "mailto:");                  bufcat(h, "mailto:");
                 bufcat(h, nn->string);                  bufcat(h, nn->string);
                 PAIR_STYLE_INIT(&tag[1], h);                  PAIR_HREF_INIT(&tag[1], h->buf);
                 t = print_otag(h, TAG_A, 2, tag);                  t = print_otag(h, TAG_A, 2, tag);
                 print_text(h, nn->string);                  print_text(h, nn->string);
                 print_tagq(h, t);                  print_tagq(h, t);
Line 1821  static int
Line 1820  static int
 mdoc_fo_pre(MDOC_ARGS)  mdoc_fo_pre(MDOC_ARGS)
 {  {
         struct htmlpair tag;          struct htmlpair tag;
           struct roffsu   su;
   
         if (MDOC_BODY == n->type) {          if (MDOC_BODY == n->type) {
                 h->flags |= HTML_NOSPACE;                  h->flags |= HTML_NOSPACE;
                 print_text(h, "(");                  print_text(h, "(");
                 h->flags |= HTML_NOSPACE;                  h->flags |= HTML_NOSPACE;
                 return(1);                  return(1);
         } else if (MDOC_BLOCK == n->type)          } else if (MDOC_BLOCK == n->type && n->next) {
                   SCALE_VS_INIT(&su, 1);
                   bufcat_su(h, "margin-bottom", &su);
                   PAIR_STYLE_INIT(&tag, h);
                   print_otag(h, TAG_DIV, 1, &tag);
                 return(1);                  return(1);
           }
   
         PAIR_CLASS_INIT(&tag, "fname");          PAIR_CLASS_INIT(&tag, "fname");
         print_otag(h, TAG_SPAN, 1, &tag);          print_otag(h, TAG_SPAN, 1, &tag);
Line 1888  mdoc_in_pre(MDOC_ARGS)
Line 1893  mdoc_in_pre(MDOC_ARGS)
                 bufinit(h);                  bufinit(h);
                 if (h->base_includes) {                  if (h->base_includes) {
                         buffmt_includes(h, nn->string);                          buffmt_includes(h, nn->string);
                         tag[i].key = ATTR_HREF;                          PAIR_HREF_INIT(&tag[i], h->buf);
                         tag[i++].val = h->buf;                          i++;
                 }                  }
                 t = print_otag(h, TAG_A, i, tag);                  t = print_otag(h, TAG_A, i, tag);
                 print_mdoc_node(m, nn, h);                  print_mdoc_node(m, nn, h);

Legend:
Removed from v.1.56  
changed lines
  Added in v.1.57

CVSweb