summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
AgeCommit message (Collapse)Author
2012-07-29Disable hyphenation and, for nroff, disable justification which isTodd C. Miller
consistent with how mdoc behaves (and produces more readable manuals). OK schwarze@
2012-07-29The '-' before the flags needs to be quoted to prevent nroffTodd C. Miller
from putting a line break between the '-' and the flag character. OK schwarze@
2012-07-29Use "\\ " not "\\~" as the non-breaking space as historic nroffTodd C. Miller
doesn't support the latter. OK schwarze@
2012-07-29Implement .PD for -Tascii.Ingo Schwarze
Reminded about the missing feature by millert@. This reduces mandoc/groff differences in base by 25%. ok millert@
2012-07-18Drop empty .IP such that is does not cause additional vertical spacing.Ingo Schwarze
Issue first reported by naddy@ in rsync(1).
2012-07-18Drop .sp and .br right after .SH and .SS.Ingo Schwarze
Fixes vertical spacing after "OPTIONS" in gcc(1). Issue first reported by naddy@ in rsync(1).
2012-07-18Let a trailing .Ns macro take effectIngo Schwarze
even on an input line containing a partial implicit macro. Fixes horizontal spacing in vi(1), ddb(4), and ppp(8).
2012-07-18Fix handling of paragraph macros inside lists:Ingo Schwarze
* When they are trailing the last item, move them outside the list. * When they are trailing any other none-compact item, drop them. Improves formatting of 40 pages, e.g. grep(1), ksh(1), netstat(1), ath(4), bsd.port.mk(5), pf.conf(5), mount(8), crypto(9).
2012-07-18The mdoc(7) \*(Ba predefined string actually forces roman font;Ingo Schwarze
that's stupid because it may break enclosing font changes, but let's do the same for groff bug compatibility. --> Never use \*(Ba, use just plain "|"! <-- Also, predefined strings are already expanded by the roff(7) parser, so the mdoc(7) parser has to look for the expanded string. Formatting improvements in ksh(1), less(1), atan2(3), hostapd.conf(5), snmpd.conf(5), and mknod(8).
2012-07-16Always fix the man(7) subsection header (.SS) indent to 3n,Ingo Schwarze
do not let it depend on the default indent provided by -Oindent. By default, this doesn't change anything because 7 / 2 = 3; in -Omdoc mode, it makes man(7) output the same as mdoc(7) output.
2012-07-16Release polishing: finally fix the perl(1) SYNOPSIS.Ingo Schwarze
In flush-left mode of both man(7) and mdoc(7), when an output line is broken at the position of a literal tab, the tab indents the following line. Reminded by deraadt@ in Pest, Ujlipotvaros, Csanady utza.
2012-07-16Two fixes regarding -Tman .sp:Ingo Schwarze
* Keep height argument on the same line (it got printed to the output). * For .El .sp, avoid the weird .sp -1v .PP .sp output sequence.
2012-07-16Several -mdoc parser improvements related to vertical spacing:Ingo Schwarze
* So far, .Pp and .Lp were removed before paragraph type blocks. * Now also remove .br before paragraph type blocks. * Treat .Lp as a paragraph like .Pp, so remove .Pp, .Lp, .br before it. * Do not treat .sp as a paragraph, don't remove anything before it. * After .Sh, .Ss, .Pp, and .Lp, remove .Pp, .Lp, .sp, .br, and blank lines. * After .sp and .br, remove .br.
2012-07-14Translate blank input lines to .sp just like in mdoc(7),Ingo Schwarze
and ignore .sp after .PP. This fixes vertical spacing for blank lines after .PP and for .sp after .PP.
2012-07-14In -Tman .Bl -compact, skip the blank line only before the first itemIngo Schwarze
of the first list in a section, not before every item of the first list.
2012-07-13Adjust -Tman SYNOPSIS .Nm indentation using .HP; requested by millert@.Ingo Schwarze
There are still lots of ugly line breaks, to be fixed later.
2012-07-13If the tag in .Bl -tag .It would leave exactly one blank before theIngo Schwarze
body of the item, mdoc(7) breaks the line, whereas the .TP used to translate this to man(7) does not. Thus, insert an explicit roff(7) line break in this place. To be able to correctly count the characters, do not pass font escapes an the like through print_word().
2012-07-13In -man -Tascii, support .sp with negative argument.Ingo Schwarze
In -mdoc -Tman, improve the framework to control vertical spacing. Use both to support .Bl -compact (surprisingly hard to get right).
2012-07-12The post_nm() validation function crashed when the first .Nm child nodeIngo Schwarze
was a non-text node. Fix this by rewriting post_nm() to always set the meta name to UNKNOWN when the name is missing or unusable. While here, make MANDOCERR_NONAME an ERROR, as it usually renders the page content unintelligible. Bug reported by Maxim <Belooussov at gmail dot com>, thanks.
2012-07-12Do not crash in -Tman on:Ingo Schwarze
* .Fn with exactly one argument * .Bl -hang without a -width Now all 3776 base manuals build without crashing.
2012-07-11Polish -Tman .Rs support.Ingo Schwarze
All mdoc(7) macros are now supported by -Tman.
2012-07-11fix position and formatting of %UIngo Schwarze
2012-07-11Basic implementation of -Tman .Bl -column using tbl(7).Ingo Schwarze
In the end, this turned out to be surprisingly simple; of course, getting identical output will be quite hard, so there is no way to quickly set up unit tests.
2012-07-10basic implementation of -Tman .Bl -tagIngo Schwarze
while here, do some minor outflags cleanup
2012-07-10multiple fixes to -Tascii .HP rendering:Ingo Schwarze
* do not add an excessive blank line before the block * in literal mode, start a new line after the tag getting this to work requires some general (print_man_node) fixes: * in literal mode, break the output line at the end of each input line, not just after those input lines ending in text * but don't break it when there was no output on the line * and adjust the margins after the .HP tag these general fixes require an adjustment to -Tascii .TP rendering: * set up NOBREAK mode before the body, not after the head finally, based on all this, implement -Tman .Bl -hang in terms of .HP
2012-07-10Remove a hack that was intended for groff-1.15 bug compatibility:Ingo Schwarze
When the width of a tag in .Bl -hang was exactly one character shorter than the maximum length that would fit, the following text would have a negative hang of one character (i.e., hang to the left). That bug is no longer present in groff-1.21, so relax mandoc, too.
2012-07-10* implement -Tman .Bl -item -inset -diag -ohang -dash -hyphen -enum .ItIngo Schwarze
* fix -Tman .Bl -bullet .It * adjust the -Tascii .Bl -bullet -dash -hyphen .It default and minimum width to new groff standards, it changed from 4n (in groff 1.15) to 2n (in groff 1.21) * same for -Tascii -enum, it changed from 5n to 2n * use -hang formatting for -Tascii -enum -width 2n * for -Tascii -enum, the default is -width 3n
2012-07-09fix -Tascii .Fd line breakingIngo Schwarze
and implement -Tman .Fd
2012-07-09implement -Tman .Eo and .EcIngo Schwarze
2012-07-09Implement -Tman .Bf.Ingo Schwarze
To get the spacing right, * avoid man(7) code line breaks at places where no spacing is allowed * allow spacing right after .Sm on * allow spacing after empty .Fl at the end of an input line
2012-07-09fix -Tman font handling for:Ingo Schwarze
.Ad .Ar .Cd .Cm .Dv .Em .Er .Ev .Fa .Fl .Fn .Fo .Ft .Ic .In .Lk .Li .Ms .Mt .Nm .Pa .Sx .Sy .Tn .Va .Vt
2012-07-09implement -Tman .No and .MtIngo Schwarze
2012-07-08fix .Lk for -Tascii and implement it for -TmanIngo Schwarze
2012-07-08fix vertical spacing for -Tman SYNOPSIS .Fn .Fo .Ft .In .Nm .Va .VtIngo Schwarze
2012-07-08implement -Tman .AnIngo Schwarze
also reset -[no]split mode at .Sh AUTHORS in -Tascii
2012-07-08Add flags to insert a .sp or .br request before the next output,Ingo Schwarze
shortening some frequent idioms and preparing for better vertical spacing in the SYNOPSIS; no functional change intended.
2012-07-08Instead of adding one integer variable for each global boolean output flagIngo Schwarze
and passing around a structure containing them into each and every function, just use a single static bitfield. In preparation for adding more output flags to support more features.
2012-07-08implement -Tman .VaIngo Schwarze
and fix -Tman .Vt for the non-SYNOPSIS case
2012-07-08ouch, in the SYNOPSIS, .Vt is a block,Ingo Schwarze
so avoid printing pointless goo in -Tman
2012-07-08implement -Tman .VtIngo Schwarze
2012-07-08Basic implementation of -Tman .Fo and .Fa;Ingo Schwarze
again, some blank lines still missing from the output. While here, remove the trailing semicolon from .Fn when outside .Sh SYNOPSIS.
2012-07-07rudimentary support for -Tman .Ft and .Fn;Ingo Schwarze
some blank lines are still missing from the output
2012-07-07basic support for -Tman .InIngo Schwarze
2012-07-07Support the .cc request; code by kristaps@, tests by me.Ingo Schwarze
Needed for sqlite3(1) as reported by espie@.
2012-07-07Fix an assert() raised by `RS' when following `TP' without a tag.Ingo Schwarze
The reason was that `RS' wasn't BSCOPE'd, so the next-line (BLINE) scope opened by `TP' would still be in the macro HEAD. This was from joerg@'s archive of failures. Fix by kristaps@, bsd.lv rev. 1.74.
2012-07-07after .Lb in library section, break the line in the final outputIngo Schwarze
2012-07-07implement -Tman .BkIngo Schwarze
2012-07-07implement -Tman .SmIngo Schwarze
2012-07-07implement -Tman .Bd -offset and -compactIngo Schwarze
2012-07-07minor -mdoc -Tman fixesIngo Schwarze
* right after .Ns, avoid breaking the line in man code * after .Fl without arguments, do not insert a blank into man code * before each .Nm in .Sh SYNOPSIS, insert a .br into man code * skip .Pp arguments, don't copy them to man code