summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/man_html.c
AgeCommit message (Collapse)Author
2018-08-18implement the GNU man-ext .SY/.YS (synopsis block) macro in man,Ingo Schwarze
used in most manual pages of the groff package
2018-08-17Remove more pointer arithmetic passing via regions outside the arrayIngo Schwarze
that is undefined according to the C standard. Robert Elz <kre at munnari dot oz dot au> pointed out i wasn't quite done yet.
2018-08-16implement the GNU man-ext .TQ macro in man(7),Ingo Schwarze
used for example by groff_diff(7)
2018-07-27garbage collect the unused "#define INDENT"Ingo Schwarze
2018-06-25Ignore author-specified indentation for .RS; it harms responsiveIngo Schwarze
design. Use the existing @media-dependent indent instead. This removes the last style= attribute from man(7) output.
2018-06-25For -man -Thtml, ignore author-specified .HP widths because theyIngo Schwarze
harm responsive design; use @media-dependent defaults instead.
2018-05-25Do not write duplicate id= attributes, they violate HTML syntax.Ingo Schwarze
Append suffixes for disambiguation. Issue first reported by Jakub Klinkovsky <j dot l dot k at gmx dot com> (Arch Linux).
2018-05-08Eliminate the class=It-* attributes.Ingo Schwarze
Cleaner HTML, more idiomatic CSS, and minus 30 lines of C code. Suggested by John Gardner <gardnerjohng at gmail dot com>.
2018-04-24replace my vague and idiosyncratic term "selflink"Ingo Schwarze
with the clearer and more usual "permalink"; suggested by John Gardner <gardnerjohng at gmail dot com>
2018-04-13preserve comments before .Dd and .TH (typically Copyright and license)Ingo Schwarze
in full HTML output, but not with -Ofragment, e.g. in man.cgi(8); suggested by Thomas Klausner <wiz at NetBSD>
2018-04-11preserve comments before .Dd when converting mdoc(7) to man(7)Ingo Schwarze
with mandoc -Tman; suggested by Thomas Klausner <wiz at NetBSD>
2017-06-25Add support for the MT and ME mailto macros, used for example in wg(8).Anthony J. Bentley
feedback and ok schwarze@
2017-06-24Split -Wstyle into -Wstyle and the even lower -Wbase, and addIngo Schwarze
-Wopenbsd and -Wnetbsd to check conventions for the base system of a specific operating system. Mark operating system specific messages with "(OpenBSD)" at the end. Please use just "-Tlint" to check base system manuals (defaulting to -Wall, which is now -Wbase), but prefer "-Tlint -Wstyle" for the manuals of portable software projects you maintain that are not part of OpenBSD base, to avoid bogus recommendations about base system conventions that do not apply. Issue originally reported by semarie@, solution using an idea from tedu@, discussed with jmc@ and jca@.
2017-06-08make the internal a2roffsu() interface more powerful by returningIngo Schwarze
a pointer to the end of the parsed data, making it easier to parse subsequent bytes
2017-05-09Trailing \c suppresses the output line break even ifIngo Schwarze
the next line is a text line starting with whitespace. Quirk found in the sysutils/rancid port.
2017-05-05Move .sp to the roff modules. Enough infrastructure is in placeIngo Schwarze
now that this actually saves code: -70 LOC.
2017-05-05move .ll to the roff modulesIngo Schwarze
2017-05-05Move handling of the roff(7) .ft request from the man(7)Ingo Schwarze
modules to the new roff(7) modules. As a side effect, mdoc(7) now handles .ft, too. Of course, do not use that.
2017-05-04Start roff formatter modules for HTML and termininal output,Ingo Schwarze
used by both the mdoc and man formatters, with the ultimate goal of reducing code duplication between the two macro formatters. Made possible by the parser unification. Add the first formatting function (for the .br request).
2017-05-04Parser reorg:Ingo Schwarze
Generate the first node on the roff level: .br Fix some column numbers in diagnostic messages while here.
2017-04-24Continue parser unification:Ingo Schwarze
* Make enum rofft an internal interface as enum roff_tok in "roff.h". * Represent mdoc and man macros in enum roff_tok. * Make TOKEN_NONE a proper enum value and use it throughout. * Put the prologue macros first in the macro tables. * Unify mdoc_macroname[] and man_macroname[] into roff_name[].
2017-03-17Fix regression in mdoc_html.c 1.150, man_html 1.87:Ingo Schwarze
For .Sh, .Ss, .SH, .SS, only write selflink if an id could be constructed. Crash reported by Raf Czlonka <rczlonka at gmail dot com>, analysis of root cause by natano@
2017-03-15Minimal support for deep linking into man(7) pages.Ingo Schwarze
As the man(7) language does not provide semantic markup, only .SH, .SS, and .UR become anchors for now.
2017-02-05Improve <table> syntax:Ingo Schwarze
The <col> element can only appear inside <colgroup>, so use <colgroup>. The <tbody> element is optional and useless, so don't use it. Even if we would ever need <thead> or <tfoot>, <tbody> would still be optional and useless; besides, we will likely never need <thead> or <tfoot>, simply because our languages don't support such functionality.
2017-01-30Rework fill mode handling for -man -Thtml.Ingo Schwarze
Basically, open <pre> whenever printing text in no-fill mode and it is not already open, and close it whenever printing something that cannot be inside <pre>. This fixes a crash reported by Michael <Stapelberg at debian dot org> in the French Linux chroot(2) manual and also improves rendering for OpenBSD pages like DPMSGetTimeouts(3) and GLwDrawingArea(3). These changes also permitted retiring struct mhtml.
2017-01-29eliminate one useless struct and one level of indirection;Ingo Schwarze
no functional change
2017-01-26Fix -man -Thtml formatting after .nf (which has nothing to doIngo Schwarze
with "literal", by the way, it means "no fill"): * Use <pre> such that whitespace is preserved. * Preserve lines breaks. * For font alternating macros, avoid node recursion which required scary juggling with the fill state. Instead, simply print the text children directly. Missing feature first noticed by kristaps@ in 2011, the again reported by afresh1@ in 2016, and finally reported here: https://github.com/Debian/debiman/issues/21 , which i only found because of Shane Kerr's comment here: https://plus.google.com/110314300533310775053/posts/H1eaw9Yskoc
2017-01-21clean up the remaining class attributesIngo Schwarze
2017-01-20Standardize class attributes for semantic macros.Ingo Schwarze
Correct markup for .Va and iprove markup for .Dv, .Er, .Ev while here.
2017-01-19Clean up CSS rules for sections and paragraphs.Ingo Schwarze
Start using real macro names for CSS classes.
2017-01-19Start cleanup: trim useless HTML comments and <div> elementsIngo Schwarze
on the <html> and <body> levels.
2017-01-19Implement line breaking of the generated HTML code at space charactersIngo Schwarze
in filled text. This does not affect HTML semantics, but makes the HTML code even more humanly readable. While here, - collapse multiple consecutive space characters in filled text - and insert a blank between style entries.
2017-01-18Make HTML output more human readable by overhauling line break logicIngo Schwarze
around tags and by introducing some simple indentation. No change of HTML semantics intended.
2017-01-17Completely delete the buf field of struct html and all the buf*()Ingo Schwarze
interfaces. Such a static buffer was a bad idea in the first place, causing unfixable truncation that was only prevented by triggering an assertion failure. Instead, let the small number of remaining users allocate and free their own, temporary dynamic buffers, or for the case of .Xr and .In, pass the original data to be assembled in print_otag().
2017-01-17Simplify the usage of print_otag() by making it accept a variableIngo Schwarze
number of arguments. Delete struct htmlpair and all the PAIR_*() macros. Delete enum htmlattr, handle that in print_otag() instead. Minus 190 lines of code; no functional change except better ordering of attributes (class before style) in three cases.
2017-01-10unify names of AST node flags; no change of cpp outputIngo Schwarze
2016-01-08Delete the redundant "nchild" member of struct roff_node, replacingIngo Schwarze
most uses by one, a few by two pointer checks, and only one by a tiny loop - not only making data smaller, but code shorter as well. This gets rid of an implicit invariant that confused both static analysis tools and human auditors. No functional change.
2015-10-06modernize style: "return" is not a function; ok cmp(1)Ingo Schwarze
2015-09-26/* NOTREACHED */ after abort() is silly, delete itIngo Schwarze
2015-04-18Delete the wrapper functions mdoc_meta(), man_meta(), mdoc_node(),Ingo Schwarze
man_node() from the mandoc(3) semi-public interface and the internal wrapper functions print_mdoc() and print_man() from the HTML formatters. Minus 60 lines of code, no functional change.
2015-04-18Replace the structs mdoc and man by a unified struct roff_man.Ingo Schwarze
Almost completely mechanical, no functional change. Written on the train from Exeter to London returning from p2k15.
2015-04-02Third step towards parser unification:Ingo Schwarze
Replace struct mdoc_meta and struct man_meta by a unified struct roff_meta. Written of the train from London to Exeter on the way to p2k15.
2015-04-02Second step towards parser unification:Ingo Schwarze
Replace struct mdoc_node and struct man_node by a unified struct roff_node. To be able to use the tok member for both mdoc(7) and man(7) without defining all the macros in roff.h, sacrifice a tiny bit of type safety and make tok an int rather than an enum. Almost mechanical, no functional change. Written on the Eurostar from Bruxelles to London on the way to p2k15.
2015-04-02First step towards parser unification:Ingo Schwarze
Replace enum mdoc_type and enum man_type by a unified enum roff_type. Almost mechanical, no functional change. Written on the ICE train from Frankfurt to Bruxelles on the way to p2k15.
2015-03-03If an eqn(7) starts on a new input line, be sure to output whitespaceIngo Schwarze
in front of it. Issue found by tedu@ in glOrtho(3). There are also cases of excessive whitespace before and after equations. This patch neither fixes them nor makes them worse.
2015-02-10trim trailing white space, no code change;Ingo Schwarze
from Svyatoslav Mishyn <juef at openmailboxd dot org>, Crux Linux
2015-01-30Have pity on the poor stack.Ingo Schwarze
Replace tail recursion by iteration when walking the syntax trees. No functional change.
2015-01-24Strangely, ignoring the roff(7) .na request was implemented in the man(7)Ingo Schwarze
parser. Simplify the code by moving it into the roff(7) parser, also making it work for mdoc(7).
2014-12-23some scaling unit fixes:Ingo Schwarze
- .sp with an invalid argument is .sp 1v, not .sp 0v - in man(1), trailing garbage doesn't make scaling units invalid
2014-12-04fix handling of roff requests having a default scale other than "n",Ingo Schwarze
in particular .sp which uses "v", when the scale is not specified; cures groff-mandoc differences in about a dozen Xenocara manuals