summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
AgeCommit message (Collapse)Author
2011-04-25As abbreviations for IEEE Std 1003.1 and its predecessors, use "POSIX.1"Ingo Schwarze
or "POSIX.2", respectively, but not "POSIX". That's closer to Open Group usage, leads to consistency in our own mandoc, and agrees with what both mandoc on other BSDs and groff-1.21 do. ok jmc@; "no objection" millert@; "no concerns" guenther@.
2011-04-24Prevent line breaks right before numbers. Groff does the same.Ingo Schwarze
OK kristaps@.
2011-04-24Closing delimiters only suppress spacing when they follow something.Ingo Schwarze
Fixing a regression introduced in bsd.lv rev. 1.105.
2011-04-24User defined macros may invoke high-level macros.Ingo Schwarze
The latter got lost due to a regression in bsd.lv rev. 1.130.
2011-04-24Merge version 1.11.1:Ingo Schwarze
Again lots of cleanup and maintenance work by kristaps@. - simplify error reporting: less function pointers, more mandoc_[v]msg - main: split document parsing out of main.c into read.c - roff, mdoc, man: improved recognition of control characters - roff: better handling of if/else stack overflows - roff: add some predefined strings for backward compatibility - mdoc, man: empty sections are not errors - mdoc: move delimiter handling to libmdoc - some header restructuring and some minor features and fixes This merge causes two minor regressions that i will fix in separate commits right afterwards.
2011-04-21Merge version 1.10.10:Ingo Schwarze
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
2011-04-05On .de macro lines, after the new macro name, space and tab are equivalent.Ingo Schwarze
Bug reported by Tristan dot LeGuern at gmail dot com in fvwm(1). tweaks and ok kristaps@; earlier version looked good to espie@ as well
2011-03-21This file was forgotten when importing the foundation for eqn(7) support.Ingo Schwarze
Written by kristaps@. Sorry, and thanks to jmc@ for noticing so quickly.
2011-03-20Import the foundation for eqn(7) support.Ingo Schwarze
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.
2011-03-16o diaeresis is 246 (U+00F6)Christian Weisgerber
2011-03-15my $buf = "string"; return $string; is cool in Perl, but not in C;Ingo Schwarze
found by Ulrich Spoerlein <uqs at freebsd> using the clang static analyzer; "ok, but please document the numbers" kristaps@
2011-03-07Do not leak information about the software usedIngo Schwarze
into PostScript and PDF documents behind the user's back. Joerg Sonnenberger pointed out that almost all software creating PostScript and PDF documents does so, even on OpenBSD, but that doesn't make the leakage much better in my book. According to all standards i could find, this information is optional. Issue originally reported by deraadt@; "commit!" kristaps@.
2011-03-07Clean up date handling,Ingo Schwarze
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@
2011-02-10Tbl code maintenance by kristaps@.Ingo Schwarze
- Remember the line-number of a tbl_span, and use it in messages. - Put *_span_alloc() functions right into the *_addspan() ones, since these are the only places they are called from.
2011-02-06Do not break the line between the arguments of .Bsx .Dx .Fx .Nx .Ox .Ux.Ingo Schwarze
Original patch from kristaps@, but i fixed a regression regarding .Bk.
2011-02-06Some pre-handlers produce output, so reorder the code to set upIngo Schwarze
keep flags before they are called. Without this bugfix, .Bk was ineffective in some cases. "looks reasonable" kristaps@
2011-02-06If .Ns is specified on its own line, ignore it, like groff does;Ingo Schwarze
from kristaps@.
2011-01-31When in a <PRE>, don't print out the <BR> before lines that haveIngo Schwarze
leading whitespace; from kristaps@.
2011-01-31Remove unnecessary conditional: term_alloc() cannot return NULL;Ingo Schwarze
from kristaps@.
2011-01-30Make .Bx accept not more than two arguments.Ingo Schwarze
Convert the first character of the second argument to uppercase. Append the second argument with a hyphen. Improves chpass(1), column(1), fstat(1), ... from kristaps@
2011-01-30Like in groff, if .%B is specified, quote .%T; from kristaps@.Ingo Schwarze
2011-01-30Implement the \N'number' (numbered character) roff escape sequence.Ingo Schwarze
Don't use it in new manuals, it is inherently non-portable, but we need it for backward-compatibility with existing manuals, for example in Xenocara driver pages. ok kristaps@ matthieu@ jmc@
2011-01-25Avoid double blank line before a table preceded by .PP.Ingo Schwarze
ok kristaps@
2011-01-25Since tbl_data() can now produce multiple spans, let parsebuf()Ingo Schwarze
generate man(7) or mdoc(7) nodes for all these spans, not only for the last one. Restores the horizontal lines in the cpu(4/hppa) tables. ok kristaps@
2011-01-25Do not skip data after horizontal lines in the layout.Ingo Schwarze
Instead, let one line of input data add two new spans to the tbl tree during one single call of tbl_data(). Note that this causes the horizontal line to get parsed into the tbl tree, but not yet used in the output, which will be fixed next. Avoids data loss in cpu(4/hppa). ok kristaps@
2011-01-25correct horizontal spacing of data cellsIngo Schwarze
correct alignment of centered cells adjust horizontal rule width to the new spacing ok kristaps@
2011-01-25Ignore .ns (no-space mode), .ps (change point size), .ta (tab control)Ingo Schwarze
for now. All of these just cause a bit too much or too little whitespace, but no serious formatting problems.
2011-01-24Skip carriage return before newline, if any.Ingo Schwarze
As pointed out by Joerg Sonnenberger, this is useful because we use mmap(3) and look for '\n' by hand. "check it in" kristaps@
2011-01-23Fix another regression caused by the reorg of print_man_node() in rev. 1.61:Ingo Schwarze
End-of-sentence spacing got lost for man(7) after plain text lines.
2011-01-22Check argument count validation for all in_line() macros.Ingo Schwarze
Most empty in_line() macros are already removed by the parser, so there is no need to check again in mdoc_validate.c. This also downgrades almost all remaining argument count issues from ERROR to WARNING. ok kristaps@
2011-01-20When finding the roff .it request (line trap),Ingo Schwarze
make it clear that you cannot use mandoc to format that page (yet). Triggered by a report from brad@.
2011-01-17Refrain from throwing fatal errors forIngo Schwarze
* .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@.
2011-01-16Merge from bsd.lv, original commit message by kristaps@:Ingo Schwarze
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@.
2011-01-16Some improvements to error handling from kristaps@:Ingo Schwarze
* Make out-of-context .fi invocations not cause an error, but just a warning. * Downgrade -man message about ignored empty paragraph to MANDOC_IGNPAR. * Avoid syntax tree corruption when removing empty block macros. Triggered by some reports from brad@.
2011-01-16In literal context, do not generate output line breaks between macroIngo Schwarze
arguments. This fixes a long-standing bug reported repeatedly, in particular by naddy@ and brad@. Fix by kristaps@, minus one regression caught by my test suite.
2011-01-16If the first character of a free-form text input line is whitespace,Ingo Schwarze
then it will start a new output line; from kristaps@.
2011-01-16Various tbl improvements from kristaps@:Ingo Schwarze
* horizontal lines do not consume layout lines * skip excessive data cells * prepare rendering of spanned cells * support vertical spans
2011-01-12Implement the roff .rm request (remove macro).Ingo Schwarze
Using the new roff_getname() function, this is really simple. Breaks mandoc of the habit of reporting an error in each pod2man(1) preamble. Reminded by a report from brad@.
2011-01-11When (cumulative) indentation requested by .in exceeds the rightIngo Schwarze
margin, do not run into an assert(3)ion. Problem reported by brad@ in gm(1), fix by kristaps@.
2011-01-10Refactoring in preparation for .rm support:Ingo Schwarze
Unify parsing of names given as roff request arguments into a new function roff_getname(), which is rather different from the parsing function for normal arguments, mandoc_getarg(), because names cannot be quoted and cannot contain whitespace or escaped characters. The new function now throws an ERROR when finding escaped characters in a name. "I'm fine with this." kristaps@
2011-01-09Remove an unused variable, and use int for array indices (not size_t);Ingo Schwarze
found by lint(1), fixed by kristaps@, no functional change.
2011-01-09Only .Bd -literal has 8-character tabs,Ingo Schwarze
while .Bd -unfilled has 5-character tabs just like normal text; from kristaps@.
2011-01-09Add and install tbl(7);Ingo Schwarze
written by kristaps@, looked over by jmc@.
2011-01-09Sync tbl handling to bsd.lv release 1.10.9:Ingo Schwarze
* .T} can be followed by a delimiter, then more data. * Do not limit table column widths (improves terminfo(5)). * Let numerical cells respect explicitly specified minimum cell widths. * Let terminal output survive missing data cells. * Parse and ignore arguments in parentheses on layout cell specifications. * Move tbl_calc() into out.c such that it can be used by all frontends. * Give tables an HTML class. * Some cleanup in tbl -Thtml code. All code by kristaps@.
2011-01-09Make sure coding errors cannot make us miss fatal parsing errorsIngo Schwarze
by assert(3)ing valid parser state in the main parsing functions; from kristaps@.
2011-01-04Bring back my fix from -r 1.3 (Oct 15, 2010) after the merge.Ingo Schwarze
Original commit message: For now, parse and ignore minimal column width specifications. First step to get terminfo(5) to build.
2011-01-04Merge kristaps@' cleaner tbl integration, removing mine;Ingo Schwarze
there are still a few bugs, but fixing these will be easier in tree.
2011-01-04Multiple man(7) .IP and .TP fixes started during p2k10:Ingo Schwarze
Affecting both -Tascii and -Thtml: * The .IP HEAD uses the second argument as the width, not the last one. * Only print the first .IP HEAD argument, not all but the last. Affecting only -Tascii: * The .IP and .TP HEADs must be printed without literal mode, but literal mode must be restored afterwards. * After the .IP and .TP bodies, we only want term_newln(), not term_flushln(), or we would get two blank lines in literal mode. * The .TP HEAD does not use TWOSPACE, just like .IP doesn't either. * In literal mode, clear NOLPAD after each line, or subsequent lines would get no indentation whatsoever. Affecting only -Thtml: * Only print next-line .TP children, instead of all but the first. OK kristaps@ on the -Tascii part; and: "Can you work this into man_html.c, too?"
2011-01-03Partial cleanup of argument count validation in mdoc(7):Ingo Schwarze
* Do not segfault on empty .Db, .Rs, .Sm, and .St. * Let check_count() really throw the requested level, not always ERROR. * Downgrade most bad argument counts from ERROR to WARNING. * And some related internal cleanup. Looks fine to kristaps@. Note that the macros using eerr_ge1() still need to be checked at a later time; but as all the others are done, let's use what we already have.
2011-01-03Calling a macro with fewer arguments than it is defined with is OK;Ingo Schwarze
the remaining ones default to the empty string, not to NULL. Regression reported and fix tested by kristaps@.