aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_html.c
Commit message (Collapse)AuthorAgeFilesLines
* garbage collect the unused "#define INDENT"Ingo Schwarze2018-07-271-3/+1
|
* Ignore author-specified indentation for .RS; it harms responsiveIngo Schwarze2018-06-251-21/+3
| | | | | design. Use the existing @media-dependent indent instead. This removes the last style= attribute from man(7) output.
* For -man -Thtml, ignore author-specified .HP widths because theyIngo Schwarze2018-06-251-16/+5
| | | | harm responsive design; use @media-dependent defaults instead.
* Do not write duplicate id= attributes, they violate HTML syntax.Ingo Schwarze2018-05-251-5/+3
| | | | | Append suffixes for disambiguation. Issue first reported by Jakub Klinkovsky <j dot l dot k at gmx dot com> (Arch Linux).
* Eliminate the class=It-* attributes.Ingo Schwarze2018-05-081-3/+3
| | | | | Cleaner HTML, more idiomatic CSS, and minus 30 lines of C code. Suggested by John Gardner <gardnerjohng at gmail dot com>.
* replace my vague and idiosyncratic term "selflink"Ingo Schwarze2018-04-241-3/+3
| | | | | with the clearer and more usual "permalink"; suggested by John Gardner <gardnerjohng at gmail dot com>
* preserve comments before .Dd and .TH (typically Copyright and license)Ingo Schwarze2018-04-131-14/+21
| | | | | in full HTML output, but not with -Ofragment, e.g. in man.cgi(8); suggested by Thomas Klausner <wiz at NetBSD>
* preserve comments before .Dd when converting mdoc(7) to man(7)Ingo Schwarze2018-04-111-1/+3
| | | | with mandoc -Tman; suggested by Thomas Klausner <wiz at NetBSD>
* add support for the MT and ME mailto macros, used for example in wg(8);Ingo Schwarze2017-06-251-2/+11
| | | | patch from bentley@
* Split -Wstyle into -Wstyle and the even lower -Wbase, and addIngo Schwarze2017-06-241-1/+2
| | | | | | | | | | | | | | | -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@.
* make the internal a2roffsu() interface more powerful by returningIngo Schwarze2017-06-081-6/+2
| | | | | a pointer to the end of the parsed data, making it easier to parse subsequent bytes
* Trailing \c suppresses the output line break even ifIngo Schwarze2017-05-091-2/+3
| | | | | the next line is a text line starting with whitespace. Quirk found in the sysutils/rancid port.
* Move .sp to the roff modules. Enough infrastructure is in placeIngo Schwarze2017-05-051-22/+2
| | | | now that this actually saves code: -70 LOC.
* move .ll to the roff modulesIngo Schwarze2017-05-051-2/+1
|
* Move handling of the roff(7) .ft request from the man(7)Ingo Schwarze2017-05-051-2/+1
| | | | | modules to the new roff(7) modules. As a side effect, mdoc(7) now handles .ft, too. Of course, do not use that.
* Start roff formatter modules for HTML and termininal output,Ingo Schwarze2017-05-041-18/+8
| | | | | | | 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).
* Parser reorg:Ingo Schwarze2017-05-041-2/+13
| | | | | Generate the first node on the roff level: .br Fix some column numbers in diagnostic messages while here.
* Continue parser unification:Ingo Schwarze2017-04-241-3/+4
| | | | | | | | * 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[].
* Fix regression in mdoc_html.c 1.275, man_html 1.134:Ingo Schwarze2017-03-171-3/+5
| | | | | | 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@
* Minimal support for deep linking into man(7) pages.Ingo Schwarze2017-03-151-6/+18
| | | | | As the man(7) language does not provide semantic markup, only .SH, .SS, and .UR become anchors for now.
* Improve <table> syntax:Ingo Schwarze2017-02-051-2/+1
| | | | | | | | 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.
* Rework fill mode handling for -man -Thtml.Ingo Schwarze2017-01-301-69/+134
| | | | | | | | | | | | 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.
* eliminate one useless struct and one level of indirection;Ingo Schwarze2017-01-291-3/+3
| | | | no functional change
* Fix -man -Thtml formatting after .nf (which has nothing to doIngo Schwarze2017-01-261-58/+47
| | | | | | | | | | | | | | | | 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
* clean up the remaining class attributesIngo Schwarze2017-01-211-4/+4
|
* Standardize class attributes for semantic macros.Ingo Schwarze2017-01-201-3/+3
| | | | Correct markup for .Va and iprove markup for .Dv, .Er, .Ev while here.
* Clean up CSS rules for sections and paragraphs.Ingo Schwarze2017-01-191-13/+9
| | | | Start using real macro names for CSS classes.
* Start cleanup: trim useless HTML comments, <div> elements,Ingo Schwarze2017-01-191-10/+8
| | | | and CSS rules on the <html> and <body> levels.
* Implement line breaking of the generated HTML code at space charactersIngo Schwarze2017-01-191-3/+1
| | | | | | | | | 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.
* Make HTML output more human readable by overhauling line break logicIngo Schwarze2017-01-181-2/+1
| | | | | around tags and by introducing some simple indentation. No change of HTML semantics intended.
* Completely delete the buf field of struct html and all the buf*()Ingo Schwarze2017-01-171-6/+5
| | | | | | | | | 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().
* Simplify the usage of print_otag() by making it accept a variableIngo Schwarze2017-01-171-92/+47
| | | | | | | | | | 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.
* unify names of AST node flags; no change of cpp outputIngo Schwarze2017-01-101-4/+4
|
* Delete the redundant "nchild" member of struct roff_node, replacingIngo Schwarze2016-01-081-3/+3
| | | | | | | | 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.
* modernize style: "return" is not a functionIngo Schwarze2015-10-061-31/+31
|
* /* NOTREACHED */ after abort() is silly, delete itIngo Schwarze2015-09-261-2/+1
|
* Delete the wrapper functions mdoc_meta(), man_meta(), mdoc_node(),Ingo Schwarze2015-04-181-14/+8
| | | | | | 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.
* Replace the structs mdoc and man by a unified struct roff_man.Ingo Schwarze2015-04-181-2/+2
| | | | | Almost completely mechanical, no functional change. Written on the train from Exeter to London returning from p2k15.
* Third step towards parser unification:Ingo Schwarze2015-04-021-4/+4
| | | | | 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.
* Second step towards parser unification:Ingo Schwarze2015-04-021-9/+9
| | | | | | | | | 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.
* First step towards parser unification:Ingo Schwarze2015-04-021-27/+28
| | | | | | 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.
* If an eqn(7) starts on a new input line, be sure to output whitespaceIngo Schwarze2015-03-031-1/+3
| | | | | | | 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.
* trim trailing white space, no code change;Ingo Schwarze2015-02-101-2/+2
| | | | from Svyatoslav Mishyn <juef at openmailboxd dot org>, Crux Linux
* Have pity on the poor stack.Ingo Schwarze2015-01-301-5/+6
| | | | | Replace tail recursion by iteration when walking the syntax trees. No functional change.
* Strangely, ignoring the roff(7) .na request was implemented in the man(7)Ingo Schwarze2015-01-241-2/+1
| | | | | parser. Simplify the code by moving it into the roff(7) parser, also making it work for mdoc(7).
* some scaling unit fixes:Ingo Schwarze2014-12-231-2/+2
| | | | | - .sp with an invalid argument is .sp 1v, not .sp 0v - in man(1), trailing garbage doesn't make scaling units invalid
* fix handling of roff requests having a default scale other than "n",Ingo Schwarze2014-12-041-2/+2
| | | | | in particular .sp which uses "v", when the scale is not specified; cures groff-mandoc differences in about a dozen Xenocara manuals
* Fix the implementation and documentation of \c (continue text input line).Ingo Schwarze2014-12-021-11/+4
| | | | | In particular, make it work in no-fill mode, too. Reminded by Carsten dot Kunze at arcor dot de (Heirloom roff).
* header cleanup:Ingo Schwarze2014-12-011-3/+2
| | | | | | * add missing forward declarations * remove needless header inclusions * some style unification
* Don't pretend we have a separate XHTML and HTML mode any more.Kristaps Dzonsons2014-09-271-2/+2
|