summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man_html.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* clean up the remaining class attributesschwarze2017-01-211-4/+4
|
* Standardize class attributes for semantic macros.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.schwarze2017-01-191-13/+9
| | | | Start using real macro names for CSS classes.
* Start cleanup: trim useless HTML comments and <div> elementsschwarze2017-01-191-10/+8
| | | | on the <html> and <body> levels.
* Implement line breaking of the generated HTML code at space charactersschwarze2017-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 logicschwarze2017-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*()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 variableschwarze2017-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 outputschwarze2017-01-101-4/+4
|
* Delete the redundant "nchild" member of struct roff_node, replacingschwarze2016-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 function; ok cmp(1)schwarze2015-10-061-31/+31
|
* /* NOTREACHED */ after abort() is silly, delete itschwarze2015-09-261-2/+1
|
* Delete the wrapper functions mdoc_meta(), man_meta(), mdoc_node(),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.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: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: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: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 whitespaceschwarze2015-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;schwarze2015-02-101-2/+2
| | | | from Svyatoslav Mishyn <juef at openmailboxd dot org>, Crux Linux
* Have pity on the poor stack.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)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: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",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).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:schwarze2014-12-011-3/+2
| | | | | | * add missing forward declarations * remove needless header inclusions * some style unification
* Add some missing OpenBSD RCS markersschwarze2014-11-281-1/+1
| | | | and a few missing <sys/types.h> inclusions; no code change.
* Switch HTML output to polyglot HTML5; have only one single -Thml mode.schwarze2014-10-071-37/+24
| | | | | | | | Replace hard-coded widths and alignments with a minimal embedded stylesheet. Do not use <p> because it cannot appear inside block macros. Remove the "summary" attribute because it is not HTML5. Written by kristaps@ some months ago, finished during EuroBSDCon.
* Clarity with respect to floating point handling:schwarze2014-08-081-2/+2
| | | | | | Write double constants as double rather than integer literals. Remove useless explicit (double) cast done at one place and nowhere else. No functional change.
* Audit strlcpy(3)/strlcat(3) usage.schwarze2014-04-231-7/+3
| | | | | | | | | | | | | * Repair three instances of silent truncation, use asprintf(3). * Change two instances of strlen(3)+malloc(3)+strlcpy(3)+strlcat(3)+... to use asprintf(3) instead to make them less error prone. * Cast the return value of four instances where the destination buffer is known to be large enough to (void). * Completely remove three useless instances of strlcpy(3)/strlcat(3). * Mark two places in -Thtml with XXX that can cause information loss and crashes but are not easy to fix, requiring design changes of some internal interfaces. * The file mandocdb.c remains to be audited.
* fix unchecked snprintf(3) in page header printing:schwarze2014-04-201-3/+6
| | | | | the length of the title is unknown, and speed doesn't matter here, so use asprintf/free rather than a static buffer
* KNF: case (FOO): -> case FOO, remove /* LINTED */ and /* ARGSUSED */,schwarze2014-04-201-48/+23
| | | | | remove trailing whitespace and blanks before tabs, improve some indenting; no functional change
* Implement the roff(7) .ll (line length) request.schwarze2014-03-301-1/+2
| | | | | Found by naddy@ in the textproc/enchant(1) port. Of course, do not use this in new manuals.
* To find out whether .TP head arguments are same-line or next-line arguments,schwarze2014-03-081-6/+11
| | | | | | | | use the MAN_LINE flag instead of the man_node line member. This is required such that user-defined macros wrapping .TP work correctly. Issue found by Havard Eidnes in Tcl_NewStringObj(3), reported via the NetBSD bug tracking system and Thomas Klausner <wiz at NetBSD>.
* Implement the .UR/.UE block (uniform resource identifier) introduced in theschwarze2013-10-171-2/+30
| | | | | | | | man-ext macros by Eric S. Raymond, enabled by default in groff_man(7). Usual disclaimer: You don't write new man(7) code, so you are not going to use these, either. Improves e.g. the bzr(1) and etherape(1) manuals. Thanks to naddy@ for bringing these to my attention.
* Cleanup naming of local variables to make the code easier on the eye:schwarze2012-11-171-28/+28
| | | | | | | | Settle for "struct man *man", "struct mdoc *mdoc", "struct meta *meta" and avoid the confusing "*m" which was sometimes this, sometimes that. No functional change. ok kristaps@ some time ago
* Minimal implementation of .EX and .EE for GNU compatibility.schwarze2012-06-021-2/+4
| | | | | Do not use this, it is not portable and only defined in esr's man-ext. For example, sox(1) wants these macros.
* Support .OP, one of the extended man macros; from kristaps@.schwarze2012-02-261-11/+42
| | | | Do not use this GNU extension, we take it for compatibility only.
* When a man document contains nothing at all except one or more invalidschwarze2011-12-041-1/+6
| | | | | | macros, do not die on an assertion, but show correct error messages. Assertions of meta data validity suggested by joerg@. ok joerg@
* Always print <table> column widths in -T[x]html;schwarze2011-10-091-36/+18
| | | | | if desired, they can be overridden in the CSS file. Suggested by kristaps@, and i always like to simplify code.
* Sync to version 1.12.0; all code by kristaps@:schwarze2011-10-091-18/+17
| | | | | | | | Implement .Rv in -Tman. Let -man -Tman work a bit like cat(1). Add the -Ofragment option to -T[x]html. Minor fixes in -T[x]html. Lots of apropos(1) and -Tman code cleanup.
* sync to version 1.11.7 from kristaps@schwarze2011-09-181-2/+1
| | | | | | | | main new feature: support the roff(7) .tr request plus various bugfixes and some refactoring regressions are so minor that it's better to get this in and fix them in the tree
* sync to version 1.11.5:schwarze2011-09-181-5/+2
| | | | | | | | adding an implementation of the eqn(7) language by kristaps@ So far, only .EQ/.EN blocks are handled, in-line equations are not, and rendering is not yet very pretty, but the parser is fairly complete.
* clean up .HP, .IP, .TP, .nf, and \c handling in -T[x]html;schwarze2011-07-081-95/+33
| | | | from kristaps@
* Sync to bsd.lv (all coded by kristaps@):schwarze2011-07-051-8/+34
| | | | | | | | | | - mdoc(7): fix an assertion if the first line after .Bd -column starts with a blank, and some simplifications in mdoc_argv.c - man(7): literal mode ends at .SH and .SS (bug reported by naddy@) - allow .RS/.RE blocks to nest (bug reported by dcoppa@ and gsoares@) - improve vertical spacing of man(7) blocks - roff(7): clear user-defined strings when starting a new file - correct ID tags in -T[x]html
* Merge release 1.11.3, almost all code by kristaps@:schwarze2011-05-291-12/+22
| | | | | | | | | * Unicode output support (no Unicode input yet, though). * Refactoring: completely handle predefined strings in roff.c. - New function mandoc_escape() replaces a2roffdeco() and mandoc_special(). - Start using mandoc_getarg() in mdoc_argv.c. - Clean up parsing of delimiters in mdoc(7). * And many minor fixes and lots of cleanup.
* Merge version 1.10.10:schwarze2011-04-211-2/+7
| | | | | | | | | | lots of cleanup and maintenance work by kristaps@. - move some main.c globals into struct curparse - move mandoc_*alloc to mandoc.h such that all code can use them - make mandoc_isdelim available to formatting frontends - dissolve mdoc_strings.c, move the code where it is used - make all error reporting functions void, their return values were useless - and various minor cleanups and fixes
* Import the foundation for eqn(7) support.schwarze2011-03-201-1/+4
| | | | | | | | Written by kristaps@. For now, i'm adding one line to each of the four frontends to just pass the input text through to the output, not yet interpreting any of then eqn keywords.
* Clean up date handling,schwarze2011-03-071-8/+2
| | | | | | | | | | | | as a first step to get rid of the frequent petty warnings in this area: - always store dates as strings, not as seconds since the Epoch - for input, try the three most common formats everywhere - for unrecognized format, just pass the date though verbatim - when there is no date at all, still use the current date Originally triggered by a one-line patch from Tim van der Molen, <tbvdm at xs4all dot nl>, which is included here. Feedback and OK on manual parts from jmc@. "please check this in" kristaps@
* Refrain from throwing fatal errors forschwarze2011-01-171-3/+3
| | | | | | | * .br .sp .nf .fi .na with arguments - just skip the arguments * .TH lacking arguments - use empty strings instead like groff * .TH with excessive arguments - skip those Reminded by Joerg Sonnenberger, ok kristaps@.
* Merge from bsd.lv, original commit message by kristaps@:schwarze2011-01-161-3/+17
| | | | | | | | | | Change how -Thtml behaves with tables: use multiple rows, with widths set by COL, until an external macro is encountered. At this point in time, close out the table and process the macro. When the first table row is again re-encountered, re-start the table. This requires a bit of tracking added to "struct html", but the change is very small and follows the logic of meta-fonts. This all follows a bug-report by joerg@.