version 1.280, 2014/08/21 12:57:17 |
version 1.281, 2014/09/03 05:22:45 |
Line 252 static const struct termact termacts[MDOC_MAX] = { |
|
Line 252 static const struct termact termacts[MDOC_MAX] = { |
|
void |
void |
terminal_mdoc(void *arg, const struct mdoc *mdoc) |
terminal_mdoc(void *arg, const struct mdoc *mdoc) |
{ |
{ |
const struct mdoc_node *n; |
|
const struct mdoc_meta *meta; |
const struct mdoc_meta *meta; |
|
struct mdoc_node *n; |
struct termp *p; |
struct termp *p; |
|
|
p = (struct termp *)arg; |
p = (struct termp *)arg; |
|
|
if (0 == p->defindent) |
|
p->defindent = 5; |
|
|
|
p->overstep = 0; |
p->overstep = 0; |
p->maxrmargin = p->defrmargin; |
p->rmargin = p->maxrmargin = p->defrmargin; |
p->tabwidth = term_len(p, 5); |
p->tabwidth = term_len(p, 5); |
|
|
if (NULL == p->symtab) |
if (NULL == p->symtab) |
p->symtab = mchars_alloc(); |
p->symtab = mchars_alloc(); |
|
|
n = mdoc_node(mdoc); |
n = mdoc_node(mdoc)->child; |
meta = mdoc_meta(mdoc); |
meta = mdoc_meta(mdoc); |
|
|
term_begin(p, print_mdoc_head, print_mdoc_foot, meta); |
if (p->synopsisonly) { |
|
while (n != NULL) { |
if (n->child) { |
if (n->tok == MDOC_Sh && n->sec == SEC_SYNOPSIS) { |
if (MDOC_Sh != n->child->tok) |
if (n->child->next->child != NULL) |
term_vspace(p); |
print_mdoc_nodelist(p, NULL, |
print_mdoc_nodelist(p, NULL, meta, n->child); |
meta, n->child->next->child); |
|
term_newln(p); |
|
break; |
|
} |
|
n = n->next; |
|
} |
|
} else { |
|
if (p->defindent == 0) |
|
p->defindent = 5; |
|
term_begin(p, print_mdoc_head, print_mdoc_foot, meta); |
|
if (n != NULL) { |
|
if (n->tok != MDOC_Sh) |
|
term_vspace(p); |
|
print_mdoc_nodelist(p, NULL, meta, n); |
|
} |
|
term_end(p); |
} |
} |
|
|
term_end(p); |
|
} |
} |
|
|
static void |
static void |
Line 462 print_mdoc_head(struct termp *p, const void *arg) |
|
Line 472 print_mdoc_head(struct termp *p, const void *arg) |
|
* string depending on the manual volume. If not specified, it |
* string depending on the manual volume. If not specified, it |
* switches on the manual section. |
* switches on the manual section. |
*/ |
*/ |
|
|
p->offset = 0; |
|
p->rmargin = p->maxrmargin; |
|
|
|
assert(meta->vol); |
assert(meta->vol); |
if (NULL == meta->arch) |
if (NULL == meta->arch) |