version 1.252, 2017/01/19 13:35:02 |
version 1.254, 2017/01/19 15:48:39 |
Line 48 struct htmlmdoc { |
|
Line 48 struct htmlmdoc { |
|
void (*post)(MDOC_ARGS); |
void (*post)(MDOC_ARGS); |
}; |
}; |
|
|
|
static char *make_id(const struct roff_node *); |
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 313 html_mdoc(void *arg, const struct roff_man *mdoc) |
|
Line 314 html_mdoc(void *arg, const struct roff_man *mdoc) |
|
} |
} |
|
|
mdoc_root_pre(&mdoc->meta, mdoc->first->child, h); |
mdoc_root_pre(&mdoc->meta, mdoc->first->child, h); |
|
t = print_otag(h, TAG_DIV, "c", "manual-text"); |
print_mdoc_nodelist(&mdoc->meta, mdoc->first->child, h); |
print_mdoc_nodelist(&mdoc->meta, mdoc->first->child, h); |
|
print_tagq(h, t); |
mdoc_root_post(&mdoc->meta, mdoc->first->child, h); |
mdoc_root_post(&mdoc->meta, mdoc->first->child, h); |
print_tagq(h, NULL); |
print_tagq(h, NULL); |
} |
} |
Line 490 mdoc_root_pre(MDOC_ARGS) |
|
Line 493 mdoc_root_pre(MDOC_ARGS) |
|
return 1; |
return 1; |
} |
} |
|
|
char * |
static char * |
make_id(const struct roff_node *n) |
make_id(const struct roff_node *n) |
{ |
{ |
const struct roff_node *nch; |
const struct roff_node *nch; |
Line 519 mdoc_sh_pre(MDOC_ARGS) |
|
Line 522 mdoc_sh_pre(MDOC_ARGS) |
|
|
|
switch (n->type) { |
switch (n->type) { |
case ROFFT_BLOCK: |
case ROFFT_BLOCK: |
print_otag(h, TAG_DIV, "c", "section"); |
|
return 1; |
return 1; |
case ROFFT_BODY: |
case ROFFT_BODY: |
if (n->sec == SEC_AUTHORS) |
if (n->sec == SEC_AUTHORS) |
Line 530 mdoc_sh_pre(MDOC_ARGS) |
|
Line 532 mdoc_sh_pre(MDOC_ARGS) |
|
} |
} |
|
|
if ((id = make_id(n)) != NULL) { |
if ((id = make_id(n)) != NULL) { |
print_otag(h, TAG_H1, "i", id); |
print_otag(h, TAG_H1, "ci", "Sh", id); |
free(id); |
free(id); |
} else |
} else |
print_otag(h, TAG_H1, ""); |
print_otag(h, TAG_H1, "c", "Sh"); |
|
|
return 1; |
return 1; |
} |
} |
Line 543 mdoc_ss_pre(MDOC_ARGS) |
|
Line 545 mdoc_ss_pre(MDOC_ARGS) |
|
{ |
{ |
char *id; |
char *id; |
|
|
if (n->type == ROFFT_BLOCK) { |
if (n->type != ROFFT_HEAD) |
print_otag(h, TAG_DIV, "c", "subsection"); |
|
return 1; |
return 1; |
} else if (n->type == ROFFT_BODY) |
|
return 1; |
|
|
|
if ((id = make_id(n)) != NULL) { |
if ((id = make_id(n)) != NULL) { |
print_otag(h, TAG_H2, "i", id); |
print_otag(h, TAG_H2, "ci", "Ss", id); |
free(id); |
free(id); |
} else |
} else |
print_otag(h, TAG_H2, ""); |
print_otag(h, TAG_H2, "c", "Ss"); |
|
|
return 1; |
return 1; |
} |
} |
Line 637 mdoc_xr_pre(MDOC_ARGS) |
|
Line 636 mdoc_xr_pre(MDOC_ARGS) |
|
return 0; |
return 0; |
|
|
if (h->base_man) |
if (h->base_man) |
print_otag(h, TAG_A, "chM", "link-man", |
print_otag(h, TAG_A, "chM", "Xr", |
n->child->string, n->child->next == NULL ? |
n->child->string, n->child->next == NULL ? |
NULL : n->child->next->string); |
NULL : n->child->next->string); |
else |
else |
print_otag(h, TAG_A, "c", "link-man"); |
print_otag(h, TAG_A, "c", "Xr"); |
|
|
n = n->child; |
n = n->child; |
print_text(h, n->string); |
print_text(h, n->string); |
Line 864 mdoc_sx_pre(MDOC_ARGS) |
|
Line 863 mdoc_sx_pre(MDOC_ARGS) |
|
{ |
{ |
char *id; |
char *id; |
|
|
print_otag(h, TAG_I, "c", "link-sec"); |
|
if ((id = make_id(n)) != NULL) { |
if ((id = make_id(n)) != NULL) { |
print_otag(h, TAG_A, "chR", "link-sec", id); |
print_otag(h, TAG_A, "chR", "Sx", id); |
free(id); |
free(id); |
} else |
} else |
print_otag(h, TAG_A, "c", "link-sec"); |
print_otag(h, TAG_A, "c", "Sx"); |
|
|
return 1; |
return 1; |
} |
} |