summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* add DESCRIPTION and .Ss to the toc; suggested by espie@schwarze2018-10-021-7/+23
|
* enable the equivalent of -O toc in man.cgi(8)schwarze2018-10-021-2/+3
|
* Add an option -T html -O toc to add a brief table of contents nearschwarze2018-10-027-13/+55
| | | | | the top of HTML pages containing at least two non-standard sections. Suggested by Adam Kalisz and discussed with kristaps@ during EuroBSDCon 2018.
* Support a second argument to -O man,schwarze2018-10-024-10/+31
| | | | | | selecting the format according to local existence of the file. Suggested by kristaps@ during EuroBSDCon 2018. Written on the train Frankfurt-Karlsruhe returning from EuroBSDCon.
* Render the eqn(7) "sqrt" function as U+221A in UTF-8 output.schwarze2018-10-021-2/+2
| | | | | | This also agrees with what groff does. Suggested by an attendee of EuroBSDCon 2018 in Bucuresti. Written on the plane Bucuresti-Frankfurt returning from EuroBSDCon.
* Add missing URI encoding when writing HTTP redirects,schwarze2018-10-011-5/+33
| | | | | | fixing a bug reported by <jungleboogie0 at gmail dot com> on bugs@. While here, fully validate the arch name such that we do not have to URI encode that one.
* Reduce excessive right padding in tagged list heads.schwarze2018-08-271-2/+2
| | | | | | The 1.2em was an approximate equivalent of the 2n traditionally used for terminal display, but it is much too wide for HTML rendering. Issue reported by mikeb@.
* Support nesting of elements with next-line scope.schwarze2018-08-264-60/+65
| | | | For example, ksh93(1) needs this for .B\n.SM.
* Rudimentary implementation of the roff(7) .char (output glyphschwarze2018-08-254-6/+94
| | | | | | | | | definition) request, used for example by groff_hdtbl(7). This simplistic implementation may interact incorrectly with the .tr (input character translation) request. But come on, you are not only using .char *and* .tr, but you do so with respect to the same character in the same manual page?
* If man(7) next-line scope is open and the line ends with \c,schwarze2018-08-251-18/+31
| | | | the scope remains open. Needed for example for groff_man(7).
* Rudimentary implementation of the roff(7) .while request.schwarze2018-08-244-193/+293
| | | | | | | | | | | Needed for example by groff_hdtbl(7). There are two limitations: It does not support nested .while requests yet, and each .while loop must start and end in the same scope. The roff_parseln() return codes are now more flexible and allow OR'ing options.
* The upcoming .while request will have to re-execute roff(7) linesschwarze2018-08-238-112/+80
| | | | | | | parsed earlier, so they will have to be saved for reuse - but the read.c preparser does not know yet whether a line contains a .while request before passing it to the roff parser. To cope with that, save all parsed lines for now. Even shortens the code by 20 lines.
* Implement the roff(7) .shift and .return requests,schwarze2018-08-235-188/+263
| | | | | | | | | | | | | | for example used by groff_hdtbl(7) and groff_mom(7). Also correctly interpolate arguments during nested macro execution even after .shift and .return, implemented using a stack of argument arrays. Note that only read.c, but not roff.c can detect the end of a macro execution, and the existence of .shift implies that arguments cannot be interpolated up front, so unfortunately, this includes a partial revert of roff.c rev. 1.209, moving argument interpolation back into the function roff_res().
* Implement the \\$@ escape sequence (insert all macro arguments,schwarze2018-08-211-5/+19
| | | | | | | | | | | | quoted) in addition to the already supported \\$* (similar, but unquoted). Then use \\$@ to improve the implementation of the .als request (macro alias). Needed by groff_hdtbl(7). Gosh, it feels like the manual pages of the groff package are exercising every bloody roff(7) feature under the sun. In the manual page source code itself, not merely in the implementation of the used macro packages, that is.
* Improve the ASCII rendering of \(Po (Pound Sterling)schwarze2018-08-212-8/+8
| | | | | and of the playing card suits to match groff, using feedback from Ralph Corderoy <ralph at inputplus dot co dot uk>.
* Fix some issues found looking at groff_char(7):schwarze2018-08-211-2/+5
| | | | | | * Add two missing characters, \('Y and \('y. * The Weierstrass p is not capital, see http://unicode.org/notes/tn27/. * Add a groff-compatible ASCII transliteration for U+02DC: "~".
* \f[] means \fP, not \fRschwarze2018-08-201-5/+8
|
* Expand \n(.$ (the number of macro arguments) right in roff_userdef(),schwarze2018-08-201-8/+35
| | | | | | | | before even reparsing the expanded macro. That is the least dirty way to fix the bug that \(.$ remained set after execution of the user-defined macro ended. Any other way to fix it would probably require changes to read.c, which really shouldn't be bothered with such roff(7) internals.
* Add the \) special character, a variant of \& so arcane that ischwarze2018-08-191-1/+2
| | | | | intentionally leave it undocumented. Abused for example in the groff(7) manual page.
* Do alignment of non-numeric strings in numeric cells the same wayschwarze2018-08-192-60/+103
| | | | | | as groff, and also honour the explicit alignment indicator "\&". This required an almost complete rewrite of both the measurement function and the formatter function for numeric cells.
* do not print horizontal lines inside vertical spansschwarze2018-08-191-7/+21
|
* Mostly complete implementation of the 'c' (character available)schwarze2018-08-191-5/+44
| | | | | | | | | | | roff conditional, except that the .char request still isn't supported and that behaviour differs from groff in many edge cases. But at least valid character names and numbers are now distinguished from invalid ones. This also fixes the bug that parsing of the 'c' conditional was incomplete, which resulted in leaking the tested character to the input parser at the beginning of the body when the condition was inverted.
* Bugfix: When a line ends with '\ \"', don't strip the trailing spaceschwarze2018-08-181-2/+3
| | | | because that turned it into a bogus line continuation.
* support the highly surprising escape sequence \# (line continuationschwarze2018-08-181-2/+9
| | | | with comment); used for example by gropdf(1)
* paragraphs can contain .MT and .UR blocksschwarze2018-08-181-2/+3
|
* If a tbl(7) column contains both text cells and numeric cells,schwarze2018-08-182-6/+12
| | | | horizontally align the numbers in the same way as groff does.
* .RE causes a line break even if .RS is not openschwarze2018-08-181-1/+7
|
* .SY causes a one-column indentation even without any argumentschwarze2018-08-181-2/+2
|
* Do not allocate a column for decimal points if all numbers are integers.schwarze2018-08-182-14/+10
|
* Unsurprisingly, zero-width non-breaking spaces have... width 0.schwarze2018-08-181-3/+2
|
* end of sentence detection after .ME and .UE, useful for some GNU manualsschwarze2018-08-181-1/+3
|
* The .nf/.fi (fill mode) requests never have text childrenschwarze2018-08-181-3/+3
| | | | and in particular do not reset font mode.
* Two consecutive .SY blocks only get a blank line in betweenschwarze2018-08-182-4/+12
| | | | if the first one is explicitly closed with .YS.
* prevent line breaks in the middle of .OPschwarze2018-08-181-2/+3
|
* implement the GNU man-ext .SY/.YS (synopsis block) macro in man,schwarze2018-08-186-8/+102
| | | | used in most manual pages of the groff package
* Remove more pointer arithmetic passing via regions outside the arrayschwarze2018-08-1716-151/+177
| | | | | 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.
* implement the GNU man-ext .TQ macro in man(7),schwarze2018-08-166-20/+27
| | | | used for example by groff_diff(7)
* Do not calculate a pointer to a memory location before the beginning ofschwarze2018-08-162-8/+6
| | | | | | a static array. Christos Zoulas, Robert Elz, and Andreas Gustafsson point out that is undefined behaviour by the C standard even if we never access the pointer.
* Implement the \*(.T predefined string (interpolate device name)schwarze2018-08-166-8/+60
| | | | | by allowing the preprocessor to pass it through to the formatters. Used for example by the groff_char(7) manual page.
* fix incomplete variable renaming in previous;schwarze2018-08-151-2/+2
| | | | found by Thomas Klausner <wiz at NetBSD> via a compiler warning
* support tail arguments on the .ME and .UE macros,schwarze2018-08-143-19/+30
| | | | used for example in the ditroff(7) manual of the groff package
* handle the non-portable GNU-style \[charNN], \[charNNN] characterschwarze2018-08-101-4/+22
| | | | escape sequences, used for example in the groff_char(7) manual page
* The groff man-ext macros define fonts CB, CI, and CR,schwarze2018-08-102-7/+14
| | | | | and some groff manual pages actually use them in .ft requests. It's easy enough to handle these .ft requests in mandoc, too.
* Implement the roff(7) .nop (no operation) request.schwarze2018-08-101-2/+12
| | | | | Examples of manual pages (ab)using it include groff(7), chem(1), groff_mom(7), and groff_hdtbl(7).
* If somebody asks "man 3 chmod",schwarze2018-08-091-3/+9
| | | | | | don't respond with the lie: "No entry for chmod in the manual." Instead, say "No entry for chmod in section 3 of the manual." Came up after a question from kn@; OK kn@.
* Fix an off-by-one string read access that could happen if an emptyschwarze2018-08-011-3/+2
| | | | | string argument preceded a string argument beginning with "--". Found by Leah Neukirchen <leah at vuxu dot org> with -Wpointer-compare.
* After rewriting the parse buffer from scratch, we also have to resetschwarze2018-08-011-1/+4
| | | | | | the parse point to the beginning of the new buffer or we risk out of bounds accesses. Bug found by Leah Neukirchen <leah at vuxu dot org> with valgrind on Void Linux.
* Avoid a read access one byte beyond the end of an allocated stringschwarze2018-08-011-2/+2
| | | | | which occurred in situations like ".Fl a Cm --"; found by Leah Neukirchen <leah at vuxu dot org> with valgrind on Void Linux.
* Issue a STYLE message when normalizing the date format in .Dd/.TH.schwarze2018-07-284-8/+23
| | | | | | | | Leah Neukirchen pointed out that mdoclint(1) used to warn about a leading zero before the day number, so we know that both NetBSD and Void Linux want the message. It does no harm on OpenBSD because Mdocdate always does the right thing anyway. jmc@ agrees that it makes sense in contexts not using Mdocdate.
* garbage collect the unused "#define INDENT"schwarze2018-07-272-6/+2
|