summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
AgeCommit message (Collapse)Author
2010-05-10Switch to using COMPILER_VERSION instead of USE_GCC3, allows for more flexibleDale Rahn
complier picking, eg supporting gcc2, gcc3, and gcc4. based on diff by Marco, with fixes from espie@. ok espie@ general mumbling of approval of others.
2010-05-08sync to bsd.lv mdoc_term.c 1.117, mdoc_html.c 1.61:Ingo Schwarze
fixed %T: it now correctly underlines, instead of quoting; noted by jmc@, fixed by kristaps@
2010-05-08merge bsd.lv rev 1.123:Ingo Schwarze
sync mdoc.c's static function names with man.c
2010-05-08handle text lines beginning with \." as comments, like groff does,Ingo Schwarze
even though this is not correct comment syntax (so warn, too) reported by Claus Assmann on misc@, fix by kristaps@
2010-05-08sync to bsd.lv rev 1.12:Ingo Schwarze
add some standards found in NetBSD's manuals
2010-05-04end-of-sentence markers at the end of .Fn argument listsIngo Schwarze
ruin indentation of the next line in the SYNOPSIS section; bug found by jacekm@ in err(3)
2010-04-27Fix a subtle bug noticed by naddy@ in pftop(8), thanks!Ingo Schwarze
When converting blank lines to .Pp outside literal context, it could happen that the following node ended up as a child of the .Pp element, but it must always be a sibling.
2010-04-25Implement roff conditional instructions .if .ie .el, in man(7) only for now;Ingo Schwarze
fixing OpenBSD::PackageName(3p) and friends for espie@.
2010-04-23Handle literal tab characters both in literal context (.Bd -literal)Ingo Schwarze
and outside. In literal context, tab stops are at each eigth column; outside, they are at each fifth column. Use tabwidth = 5 as the default and temporarily switch to 8 in termp_bd_pre(). This requires to move the term_flushln() of the final line of a display from termp_bd_post() to termp_bd_pre(); the former still needs term_newln() to handle the final lines of non-literal displays. Handling inside term_flushln() is tricky because a tab collapses with inter-word spacing, but not with another tab. Missing feature reported independently by jmc@ and deraadt@.
2010-04-22Fix a segfault reported by nicm@, introduced in rev. 1.38.Ingo Schwarze
When finding a blank line, trying to parse it is a bad idea. Instead, after adding .Pp to the AST, just return from parsetext().
2010-04-13Fix rendering of multiple successive .It macros without intervening text;Ingo Schwarze
another problem reported by jmc@. The physical output line may contain output from more than one buffer. Thus, to decide whether a line break is needed, it's insufficient to only look at the number of bytes in the current output buffer. Keep track of the number of characters already written, too.
2010-04-13zap all the (rather useless) dot lines; ok kristapsJason McIntyre
2010-04-13- sort everythingJason McIntyre
- prefer Cm to Ar for stuff like -Tascii - fix wonky ellipsis - standard $ prompt - update usage() kristaps has these diffs rolled in already ok schwarze kristaps
2010-04-12Partial revert of term.c rev. 1.23Ingo Schwarze
because jmc@ noticed that it broke blank lines in literal displays. The original idea was to suppress stray blank lines. But we don't want to suppress *all* blank lines, instead just those caused by nested lists. So do the check whether there was any output on this line, i.e. whether or not to break the line, at the right place, which is after processing the .It body.
2010-04-08first pass at cleaning this page up:Jason McIntyre
- add openbsd rcsid - new sentence, new line - > -> \*(Gt ok schwarze diff sent to kristaps; this commit includes a tweak from kristaps to keep the page up to date
2010-04-07Merge the good parts of 1.9.23,Ingo Schwarze
avoid the bad parts of 1.9.23, and keep local patches. Input in general: * Basic handling of roff-style font escapes \f, \F. * Quoted punctuation does not count as punctuation. mdoc(7) parser: * Make .Pf callable; noted by Claus Assmann. * Let .Bd and .Bl ignore unknown arguments; noted by deraadt@. * Do not warn when .Er is used outside certain sections. * Replace mdoc_node_free[list] by mdoc_node_delete. * Replace #define by enum for rew*() return values. man(7) parser: * When .TH is missing, use default section and date. Output in general: * Curly braces do not count as punctuation. * No space after .Fl w/o args when a macro follows on the same line. HTML output: * Unify PAIR_*_INIT macros, introduce new PAIR_ID_INIT(). * Print whitespace after, not before .Vt .Fn .Ft .Fo. Checked that all manuals in base still build.
2010-04-04When the prologue lacks required information, do not error out,Ingo Schwarze
but warn, set up some default values, and prod on. Unbreaking the ports build for textproc/sgmlformat; reported by naddy@, thanks.
2010-04-04Make sure we never stay in SEC_NONE when passing by .Sh.Ingo Schwarze
Fixing the x11/scrotwm build. Problem reported by naddy@, thanks.
2010-04-04Adding the pod2man(1) special characters to mandoc_char(7) was a bad idea.Ingo Schwarze
The mandoc_char(7) manual is supposed to document standard characters for man(7) and mdoc(7), and these are not standard in any sense. So move the documentation to an implementation-specific manual. noticed by kristaps@ and merged in 1.9.22 ok jmc@ who also noticed that \*(TH broke the nroff -Tps build
2010-04-04Better write 'href="mailto:' instead of 'style="mailto:'.Ingo Schwarze
Diff from Tim van der Molen <tbvdm at xs4all dot nl>, thanks! ok kristaps@
2010-04-03no need to die from .Xr without arguments, we can just ignore itIngo Schwarze
ok deraadt@
2010-04-03When we have no title in man(7), just use "unknown". No need to bail.Ingo Schwarze
ok deraadt@
2010-04-03When two conflicting list types are specified for the same list,Ingo Schwarze
use the first, discard the second, and warn. No need to bail out. ok deraadt@
2010-04-03* outside literal context in mdoc(7), handle blank lines like .PpIngo Schwarze
* a missing NAME section in mdoc(7) need not be fatal ok deraadt@
2010-04-02merge 1.9.22, keeping local patchesIngo Schwarze
* convert mdoc tokens from #define to enum * fix a segfault with .Xo/.Xc in explicit blocks * Thorn is \*(Th, not \*(TH; noticed by Joerg Sonnenberger
2010-04-02Temporarily disable the handling of leading punctuation.Ingo Schwarze
We must investigate the fallout before enabling this.
2010-04-02merge 1.9.20, keeping local patchesIngo Schwarze
* prevent roff instructions in man(7) from clobbering scopes and line modes (noted by Sascha Wildner) * handle leading punctuation in mdoc(7) blocks and line macros (looks good in principle, but is causing some fallout in OpenBSD, so i will disable it locally for now with the next commit)
2010-03-29merge 1.9.19, keeping local patchesIngo Schwarze
* scoping fixes for roff instructions * accept apostroph in place of dot as a macro control character * accept tabs between the control character and the macro name * check that man(7) .TH titles use capital letters
2010-03-26merge 1.9.17, keeping local patchesIngo Schwarze
* much improved pod2man support and low-level roff robustness * have -Tlint imply -Wall and -fstrict * use fewer macros and more enum in libman * and various bug fixes
2010-03-25merge 1.9.16, keeping local patchesIngo Schwarze
This is mostly cleanup by kristaps@ after my rather hackish patch to tolerate the non-text macros .na, .sp, .br in next-line scope; plus some nesting issues fixed by him, all in man(7). This survived a full cd /usr/src; make man.
2010-03-25fix a stupid out-of-bounds read access introduced in the previousIngo Schwarze
revision, in the code searching for the end of a sentence
2010-03-22Only try to break the line at an existing hyphenIngo Schwarze
when there actually IS a hyphen. Fixing an endless loop that broke the xenocara build.
2010-03-20When the length of a single words exceeds the maximum acceptable lineIngo Schwarze
length, rather ignore the right margin than entering an endless loop. Found the hard way in /usr/xenocara/app/fvwm/modules/FvwmM4/FvwmM4.1.
2010-03-06When the last field on an output line is empty, break the lineIngo Schwarze
if and only if something was printed on that line. This avoids double line breaks after nested lists while still breaking lines after items with empty body.
2010-03-05At the end of lines, split words at existing hyphens:Ingo Schwarze
Making pages look better and helping comparisons with groff output. Note that proper hyphenation is postponed for now because it doesn't really help the switch.
2010-03-02In man(7), do not crash on very long title lines,Ingo Schwarze
and do not emulate groff's habit of printing garbage either, but just print the wanted information even though the format must be sacrificed because it won't fit.
2010-03-02For -man -Tascii, limit the width of normal text to 65 characters,Ingo Schwarze
and effectively unlimit the width of literal displays. Following this traditional behaviour allows for automatic output comparisons.
2010-03-02Accept the non-standard macros .Sp (similar to .sp)Ingo Schwarze
and .Vb/.Ve (similar to .nf/.fi) in man(7) mode. These are not intended to be used manually, but they allow us to properly render man(7) code autogenerated by pod2man(1), making Perl and OpenSSL happy in our tree.
2010-03-02Proper inter-sentence spacing for mdoc(7).Ingo Schwarze
When a text line or a non-block macro line in the source code ends in any of ".!?", consider that an end of sentence (EOS). This makes Jason's rule "new sentence, new line" even more important. Let the parser detect the EOS and insert a token into the AST. Let the -Tascii frontend render the EOS token as a double space before the next word.
2010-03-02Distinguish opening and closing delimiters, and close out blockIngo Schwarze
macros after closing delimiters only, not after opening ones. Besides, neither roff nor old nor new groff consider braces { } as delimiters. This fixes some frequent misrenderings by mandoc, for example ".Ql (" being rendered as "`'(" instead of "`('".
2010-02-26Old news: there is an experimental "loongson" port.Ingo Schwarze
This commit corresponds to what jmc@ did in share/tmac/mdoc/doc-common and share/man/man7/mdoc.samples.7 on January 24.
2010-02-26The groff_man(7) manual says "the first line of text following" .TP isIngo Schwarze
used as a label, not "the first line following", so allow (some kinds of) intervening macros - some people actually put macros in between. On the other hand, when there is no text line before the next block macro, that is, when the .TP block ends without any text line, then something *is* broken, so still error out in that case.
2010-02-26Support .It .Xo.Ingo Schwarze
The trick is to not switch from the .It header to the body at EOL, but, in case an explicit block macro follows, at the end of the block.
2010-02-18sync to release 1.9.15:Ingo Schwarze
* corrected .Vt handling (spotted by Joerg Sonnenberger) * corrected .Xr argument handling (based on my patch) * removed \\ escape sequence (because it is for low-level roff only) * warn about trailing whitespace (suggested by jmc@) * -Txhtml support * and some general cleanup and doc improvements
2010-01-03This is not intended to document just the mandoc(1) program, but ratherIngo Schwarze
man(7) and mdoc(7) special characters and predefined strings in general; just as mandoc(1) is not intending to implement new languages, but provide standard formatting for man(7) and mdoc(7) files, whatever "standard" may mean in this context (sigh). So move this to the right place. noticed by deraadt@
2010-01-03Install mandoc_char(7), a comprehensive overview of mandoc(1) specialIngo Schwarze
characters and predefined strings. In kristaps@'s words: "Note that mandoc_char(7) is a superset of the latest groff_char(7) (which defines most special characters), groff(7) (more special characters, mostly formatting), and mdoc_samples(7) (predefined strings and other nits). Thus, some of the characters that mandoc(1) accepts are not accepted by the groff in OpenBSD base." This is useful because you now have everything in one place, and in a form authoritative for mandoc(1). At least as long as we still have groff(1) in base, we must keep groff_char(7) as well, of course. "sure" jmc@
2010-01-02complete the sync to 1.9.15-pre2: mostly minor fixesIngo Schwarze
* bugfix: do not restore TERMP flags when leaving lists, just reset them * and a few HTML fixes * clarity: return width from a2width, not width+2, and adapt to it * manual: document .Bl and .Fl * portability: no need to escape '%' in macro names
2010-01-01When a .Fl macro without an argument is followed by text,Ingo Schwarze
we need a space in between; patch by kristaps@, rev. 1.103 and 1.104; fixes regress/usr.bin/mandoc/mdoc/Fl/noarg.in.
2010-01-01.Bl may have .Sm as a child.Ingo Schwarze
The comment in the source code and OK by kristaps@; merged upstream in rev. 1.55.
2010-01-01Fix .Bl -column horizontal spacing to agree with groff.Ingo Schwarze
My original patch nicely improved by and OK kristaps@; merged upstream as rev. 1.105, 1.106.