[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.228 and 1.233

version 1.228, 2015/04/02 22:48:17 version 1.233, 2015/08/30 19:00:14
Line 35 
Line 35 
   
 #define INDENT           5  #define INDENT           5
   
 #define MDOC_ARGS         const struct mdoc_meta *meta, \  #define MDOC_ARGS         const struct roff_meta *meta, \
                           struct roff_node *n, \                            struct roff_node *n, \
                           struct html *h                            struct html *h
   
Line 48  struct htmlmdoc {
Line 48  struct htmlmdoc {
         void            (*post)(MDOC_ARGS);          void            (*post)(MDOC_ARGS);
 };  };
   
 static  void              print_mdoc(MDOC_ARGS);  
 static  void              print_mdoc_head(MDOC_ARGS);  static  void              print_mdoc_head(MDOC_ARGS);
 static  void              print_mdoc_node(MDOC_ARGS);  static  void              print_mdoc_node(MDOC_ARGS);
 static  void              print_mdoc_nodelist(MDOC_ARGS);  static  void              print_mdoc_nodelist(MDOC_ARGS);
Line 264  static const char * const lists[LIST_MAX] = {
Line 263  static const char * const lists[LIST_MAX] = {
 };  };
   
   
 void  
 html_mdoc(void *arg, const struct mdoc *mdoc)  
 {  
   
         print_mdoc(mdoc_meta(mdoc), mdoc_node(mdoc)->child,  
             (struct html *)arg);  
         putchar('\n');  
 }  
   
 /*  /*
  * Calculate the scaling unit passed in a `-width' argument.  This uses   * Calculate the scaling unit passed in a `-width' argument.  This uses
  * either a native scaling unit (e.g., 1i, 2m) or the string length of   * either a native scaling unit (e.g., 1i, 2m) or the string length of
Line 331  synopsis_pre(struct html *h, const struct roff_node *n
Line 321  synopsis_pre(struct html *h, const struct roff_node *n
         }          }
 }  }
   
 static void  void
 print_mdoc(MDOC_ARGS)  html_mdoc(void *arg, const struct roff_man *mdoc)
 {  {
         struct tag      *t, *tt;  
         struct htmlpair  tag;          struct htmlpair  tag;
           struct html     *h;
           struct tag      *t, *tt;
   
         PAIR_CLASS_INIT(&tag, "mandoc");          PAIR_CLASS_INIT(&tag, "mandoc");
           h = (struct html *)arg;
   
         if ( ! (HTML_FRAGMENT & h->oflags)) {          if ( ! (HTML_FRAGMENT & h->oflags)) {
                 print_gen_decls(h);                  print_gen_decls(h);
                 t = print_otag(h, TAG_HTML, 0, NULL);                  t = print_otag(h, TAG_HTML, 0, NULL);
                 tt = print_otag(h, TAG_HEAD, 0, NULL);                  tt = print_otag(h, TAG_HEAD, 0, NULL);
                 print_mdoc_head(meta, n, h);                  print_mdoc_head(&mdoc->meta, mdoc->first->child, h);
                 print_tagq(h, tt);                  print_tagq(h, tt);
                 print_otag(h, TAG_BODY, 0, NULL);                  print_otag(h, TAG_BODY, 0, NULL);
                 print_otag(h, TAG_DIV, 1, &tag);                  print_otag(h, TAG_DIV, 1, &tag);
         } else          } else
                 t = print_otag(h, TAG_DIV, 1, &tag);                  t = print_otag(h, TAG_DIV, 1, &tag);
   
         print_mdoc_nodelist(meta, n, h);          mdoc_root_pre(&mdoc->meta, mdoc->first->child, h);
           print_mdoc_nodelist(&mdoc->meta, mdoc->first->child, h);
           mdoc_root_post(&mdoc->meta, mdoc->first->child, h);
         print_tagq(h, t);          print_tagq(h, t);
           putchar('\n');
 }  }
   
 static void  static void
Line 391  print_mdoc_node(MDOC_ARGS)
Line 386  print_mdoc_node(MDOC_ARGS)
         n->flags &= ~MDOC_ENDED;          n->flags &= ~MDOC_ENDED;
   
         switch (n->type) {          switch (n->type) {
         case ROFFT_ROOT:  
                 child = mdoc_root_pre(meta, n, h);  
                 break;  
         case ROFFT_TEXT:          case ROFFT_TEXT:
                 /* No tables in this mode... */                  /* No tables in this mode... */
                 assert(NULL == h->tblt);                  assert(NULL == h->tblt);
Line 451  print_mdoc_node(MDOC_ARGS)
Line 443  print_mdoc_node(MDOC_ARGS)
         print_stagq(h, t);          print_stagq(h, t);
   
         switch (n->type) {          switch (n->type) {
         case ROFFT_ROOT:  
                 mdoc_root_post(meta, n, h);  
                 break;  
         case ROFFT_EQN:          case ROFFT_EQN:
                 break;                  break;
         default:          default:
Line 1653  mdoc_fo_pre(MDOC_ARGS)
Line 1642  mdoc_fo_pre(MDOC_ARGS)
                 return(1);                  return(1);
         }          }
   
         /* XXX: we drop non-initial arguments as per groff. */          if (n->child == NULL)
                   return(0);
   
         assert(n->child);  
         assert(n->child->string);          assert(n->child->string);
   
         PAIR_CLASS_INIT(&tag, "fname");          PAIR_CLASS_INIT(&tag, "fname");
         t = print_otag(h, TAG_B, 1, &tag);          t = print_otag(h, TAG_B, 1, &tag);
         print_text(h, n->child->string);          print_text(h, n->child->string);

Legend:
Removed from v.1.228  
changed lines
  Added in v.1.233

CVSweb