📄 texinfo2man.c
字号:
break; case 9: break; } } else { if (in_table && was_at_start_of_input_line && !in_item) putone ('\n'); /* Kludge :/ */ putone (*q); } } else { if (at_start_of_input_line) { if (!strncmp (q, "@end ignore", 11) || !strncmp (q, "@end menu", 9) || !strncmp (q, "@end iftex", 10) || !strncmp (q, "@end tex", 8) || !strncmp (q, "@end direntry", 13)) { --ignore; if (!(q = strchr (q, '\n'))) break; ++line_no; continue; } else if (!strncmp (q, "@ignore\n", 8) || !strncmp (q, "@menu\n", 6) || !strncmp (q, "@iftex\n", 7) || !strncmp (q, "@tex\n", 5) || !strncmp (q, "@direntry\n", 10)) { ++ignore; if (!(q = strchr (q, '\n'))) break; ++line_no; continue; } else if (ignore) continue; else if (!strncmp (q, "@author ", 8)) { printf (".br\n"); q += 7; continue; } else if (!strncmp (q, "@example\n", 9) || !strncmp (q, "@smallexample\n", 14)) { if (!at_start_of_line) putchar ('\n'); printf (".in +5\n"); indentation += 5; printf (".nf\n.na\n"); q = strchr (q, '\n'); ++line_no; continue; } else if (!strncmp (q, "@end example", 12) || !strncmp (q, "@end smallexample", 17)) { if (!at_start_of_line) putchar ('\n'); printf (".in -5\n"); indentation -= 5; printf (".ad\n.fi\n"); q = strchr (q, '\n'); if (!q) break; ++line_no; continue; } else if (!strncmp (q, "@noindent", 9)) { if (indentation) { if (!at_start_of_line) putchar ('\n'); printf (".in -%d\n", indentation); at_start_of_line = at_start_of_line_for_dot = 1; indentation = 0; } q = strchr (q, '\n'); if (!q) break; ++line_no; continue; } else if (!strncmp (q, "@display\n", 9)) { if (!at_start_of_line) putchar ('\n'); printf (".nf\n.na\n"); q += 8; ++line_no; continue; } else if (!strncmp (q, "@end display", 12)) { if (!at_start_of_line) putchar ('\n'); printf (".ad\n.fi\n"); q = strchr (q, '\n'); if (!q) break; ++line_no; continue; } else if (!strncmp (q, "@section ", 9) || !strncmp (q, "@appendix ", 10) || !strncmp (q, "@subsection ", 12) || !strncmp (q, "@subheading ", 12)) { if (!at_start_of_line) putchar ('\n'); printf (".SH \""); at_start_of_line = at_start_of_line_for_dot = 0; in_section = 1; to_upper = 1; if (q[2] == 'e') q += 8; else if (q[2] == 'p') q += 9; else { q += 11; to_upper = 0; } continue; } else if (!strncmp (q, "@table", 6)) { in_table = 1; q = strchr (q, '\n'); ++line_no; continue; } else if (!strncmp (q, "@end table", 10)) { disabled = 0; in_table = 0; q = strchr (q, '\n'); if (!q) break; ++line_no; continue; } else if (!strncmp (q, "@item ", 6) || !strncmp (q, "@itemx ", 7)) { disabled = 0; if (in_table && q[5] == ' ') { if (!at_start_of_line) putchar ('\n'); if (in_table == 1) { in_table = 2; printf (".TP 4\n"); at_start_of_line = at_start_of_line_for_dot = 1; } else { printf (".TP\n"); at_start_of_line = at_start_of_line_for_dot = 1; } } if (in_table && q[5] == 'x') { printf (", "); at_start_of_line = at_start_of_line_for_dot = 0; } in_item = 1; q = strchr (q, ' '); start_bold (); continue; } } else if (ignore) continue; if (!strncmp (q, "@code{", 6) || !strncmp (q, "@env{", 5) || !strncmp (q, "@command{", 9)) { if (!in_section) start_bold (); *++what = 1; if (q[1] == 'e') q += 4; else if (q[3] == 'd') q += 5; else q += 8; } else if (!strncmp (q, "@samp{", 6) || !strncmp (q, "@option{", 8) || !strncmp (q, "@file{", 6)) { putone ('`'); *++what = 7; if (q[1] == 'o') q += 7; else q += 5; } else if (!strncmp (q, "@cite{", 6)) { putone ('"'); *++what = 2; q += 5; } else if (!strncmp (q, "@var{", 5) || !strncmp (q, "@dfn{", 5)) { start_I (); *++what = 3; q += 4; } else if (!strncmp (q, "@copyright{}", 12)) { printf ("(c)"); q += 11; } else if (!strncmp (q, "@value{UPDATED}", 15)) { printf ("%s", value_updated); q += 14; } else if (!strncmp (q, "@value{VERSION}", 15)) { printf ("%s", value_version); q += 14; } else if (!strncmp (q, "@value{EDITION}", 15)) { printf ("%s", value_edition); q += 14; } else if (!strncmp (q, "@refill", 7)) { q += 6; } else if (!strncmp (q, "@footnote{", 10)) { if (!at_start_of_line) putone (' '); putone ('['); *++what = 4; q += 9; } else if (!strncmp (q, "@emph{", 6)) { /* putone('*'); */ start_I (); *++what = 5; q += 5; } else if (!strncmp (q, "@xref{", 6) || !strncmp (q, "@pxref{", 7)) { if (!disabled) { printf ("See "); at_start_of_line = at_start_of_line_for_dot = 0; start_bold (); to_upper = 1; ++no_break; *++what = 6; } if (q[1] == 'p') q += 6; else q += 5; } else if (!strncmp (q, "@w{", 3)) { ++no_break; *++what = 8; q += 2; } else if (!strncmp (q, "@email{", 7)) { *++what = 9; q += 6; } else if (!strncmp (q, "@{", 2)) { putone ('{'); ++q; } else if (!strncmp (q, "@}", 2)) { putone ('}'); ++q; } else if (!strncmp (q, "@*", 2)) { if (!at_start_of_line_for_dot) putchar ('\n'); printf (".br\n"); at_start_of_line = at_start_of_line_for_dot = 1; ++q; } else if (!strncmp (q, "@@", 2)) { putone ('@'); ++q; } else { char *s = strchr (q, ' '); char *a = strchr (q, '{'); if (!s || !a || s < a) { char *q2 = strchr (q, '\n'); if (strncmp (q, "@ifinfo", 7) && strncmp (q, "@end ifinfo", 11) && strncmp (q, "@cindex", 7) && strncmp (q, "@kindex", 7) && strncmp (q, "@refill", 7) && strncmp (q, "@include", 8) && strncmp (q, "@set", 4) && strncmp (q, "@group", 6) && strncmp (q, "@end group", 10) && strncmp (q, "@node", 5) && strncmp (q, "@comment", 8) && strncmp (q, "@c\n", 3) && strncmp (q, "@c ", 3) && strncmp (q, "@need", 5) && strncmp (q, "@dircategory", 12)) { if (a) *a = 0; if (q2) *q2 = 0; fprintf (stderr, "%s: Unknown texinfo command %s\n", where (line_no), q); if (a) *a = '{'; } q = q2; ++line_no; if (!q) break; continue; } } } } break; } } if (i == nr) putone ('@'); } } } return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -