summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man_validate.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Minimal glue to integrate tbl into the mandoc man(7) parser and formatter.schwarze2010-10-151-1/+3
| | | | | | The output dosn't look nice yet, escape handling is still missing, but will follow soon. "move forward aggressively :-)" deraadt@
* Implement a simple, consistent user interface for error handling.schwarze2010-08-201-7/+3
| | | | | | | | | | | | | | | | | We now have sufficient practical experience to know what we want, so this is intended to be final: - provide -Wlevel (warning, error or fatal) to select what you care about - provide -Wstop to stop after parsing a file with warnings you care about - provide consistent exit status codes for those warnings you care about - fully document what warnings, errors and fatal errors mean - remove all other cruft from the user interface, less is more: - remove all -f knobs along with the whole -f option - remove the old -Werror because calling warnings "fatal" is silly - always finish parsing each file, unless fatal errors prevent that This commit also includes a couple of related simplifications behind the scenes regarding error handling. Feedback and OK kristaps@; Joerg Sonnenberger (NetBSD) and Sascha Wildner (DragonFly BSD) agree with the general direction.
* Sync to bsd.lv; in particular, pull in lots of bug fixes.schwarze2010-07-251-21/+33
| | | | | | | | | | | | | | | | | | | | | new features: * support the .in macro in man(7) * support minimal PDF output * support .Sm in mdoc(7) HTML output * support .Vb and .nf in man(7) HTML output * complete the mdoc(7) manual bug fixes: * do not let mdoc(7) .Pp produce a newline before/after .Sh; reported by jmc@ * avoid double blank lines related to man(7) .sp and .br * let man(7) .nf and .fi flush the line; reported by jsg@ and naddy@ * let "\ " produce a non-breaking space; reported by deraadt@ * discard \m colour escape sequences; reported by J.C. Roberts * map undefined 1-character-escapes to the literal character itself maintenance: * express mdoc(7) arguments in terms of an enum for additional type-safety * simplify mandoc_special() and a2roffdeco() * use strcspn in term_word() in place of a manual loop * minor optimisations in the -Tps and -Thtml formatting frontends
* merge release 1.10.2schwarze2010-06-261-5/+5
| | | | | | | | | | | | * bug fixes: - interaction of ASCII_HYPH with special chars (found by Ulrich Spoerlein) - handling of roff conditionals (found by Ulrich Spoerlein) - .Bd -offset will no more default to 6n * maintenance: - more caching of .Bd and .Bl arguments for efficiency - deconstify man(7) validation routines - add FreeBSD library names (provided by Ulrich Spoerlein) * start PostScript font-switching
* When a word does not fully fit onto the output line, but it containsschwarze2010-05-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | at least one hyphen, we already had support for breaking the line a the last fitting hyphen. This patch improves this functionality by only breaking at hyphens in free-form text, and by not breaking at hyphens * at the beginning or end of a word or * immediately preceded or followed by another hyphen or * escaped by a preceding backslash. Before this patch, differences in break-at-hyphen support were one of the major sources of noise in automatic comparisons to mdoc(7) groff output. Now, the remaining differences are hard to find among the noise coming from other sources. Where there are still differences, what we do seems to be better than what groff does, see e.g. the chio(1) exchange and position commands for one of the now rare examples. idea and coding by kristaps@ Besides, this was the last substantial code difference left between bsd.lv and openbsd.org. We are now in full sync.
* Unified error and warning message system for all of mandoc,schwarze2010-05-231-30/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | featuring three message levels, as agreed during the mandoc hackathon: * FATAL parser failure, cannot produce any output from this input file: eventually, we hope to convert most of these to ERRORs. * ERROR, meaning mandoc cannot cope fully with the input syntax and will probably lose information or produce structurally garbled output; it will try to produce output anyway but exit non-zero at the end, which is eventually intended to make the ports infrastructure happy. * WARNING, meaning you should clean up the input file, but output is probably mostly OK, so this will not cause error-exit at the end. This commit is mostly just converting the old system to the new one; before the classification will become really reliable, we must check all messages. In particular, * set up a new central message string table in main.c * drop the old message string tables from man.c and mdoc.c * get rid of the piece-meal merr enums in libman and libmdoc * reduce number of error/warning functions from 16 to 6 (still a lot...) While here, handle a few problems more gracefully: * allow .Rv and .Ex to work without a prior .Nm * allow .An to ignore extra arguments * allow undeclared columns in .Bl -column Written by kristaps@.
* implement .AT and .UC; from Joerg Sonnenbergerschwarze2010-05-231-1/+2
|
* Support nested roff instructions:schwarze2010-05-201-4/+1
| | | | | | | | | | | | | | | | | | | * allow roff_parseln() to be re-run * allow roff_parseln() to manipulate the line buffer offset * support the offset in the man and mdoc libraries * adapt .if, .ie, .el, .ig, .am* and .de* support * interpret some instructions even in conditional-negative context Coded by kristaps during the last day of the mandoc hackathon. To avoid regressions in the OpenBSD tree, commit this together with some small local additions: * detect roff block end "\}" even on macro lines * actually implement the ".if n" conditional * ignore .ds, .rm and .tr in libroff Also back my old .if/.ie/.el-handling out of libman, reverting: man.h 1.15 man.c 1.25 man_macro.c 1.15 man_validate.c 1.19 man_action.c 1.15 man_term.c 1.28 man_html.c 1.9.
* In theory, Kristaps never intended to write a roff parser,schwarze2010-05-161-26/+1
| | | | | | | | | | | | | | | | | | but in practice, most real legacy man(7)uals are using so much low level roff that we can't really get away without at least partially handling some roff instructions. As doing this in man(7) only has become messy and as even some mdoc(7) pages need it, start a minimal partial roff preprocessor. As a first step, move handling of .am[i], .de[i] and .ig there. Do not use the roff preprocessor for new manuals! Now that we have three main parser libraries - roff, man and mdoc - each one having its own error handling is becoming messy, too. Thus, start unifying message handling in one central place, introducing a new generic function mmsg(). coded by kristaps@
* removed restriction on integer manual sections in -man;schwarze2010-05-151-2/+2
| | | | by kristaps@
* Remove the command line option -fno-ign-chars.schwarze2010-05-131-4/+2
| | | | | | | | | This option was not useful, you never want mandoc to die just because there is an invalid character in the input file, neither in production nor when linting: a warning is sufficient. This was particularly annoying because it was part of -fstrict and could not be switched off. "less is more" kristaps@
* Implement roff conditional instructions .if .ie .el, in man(7) only for now;schwarze2010-04-251-1/+4
| | | | fixing OpenBSD::PackageName(3p) and friends for espie@.
* Merge the good parts of 1.9.23,schwarze2010-04-071-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* When we have no title in man(7), just use "unknown". No need to bail.schwarze2010-04-031-3/+6
| | | | ok deraadt@
* merge 1.9.20, keeping local patchesschwarze2010-04-021-2/+2
| | | | | | | | * 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)
* merge 1.9.19, keeping local patchesschwarze2010-03-291-3/+22
| | | | | | | * 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
* merge 1.9.17, keeping local patchesschwarze2010-03-261-2/+28
| | | | | | | * 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
* Accept the non-standard macros .Sp (similar to .sp)schwarze2010-03-021-3/+6
| | | | | | | 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.
* The groff_man(7) manual says "the first line of text following" .TP isschwarze2010-02-261-4/+4
| | | | | | | | | 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.
* sync to 1.9.11: adapt printing of dates to groff conventions,schwarze2009-10-271-1/+2
| | | | | NetBSD portability fixes and some minor bugfixes and feature enhancements; also checked that my hyphenation code still works on top of this
* sync to 1.9.9, featuring:schwarze2009-10-211-35/+4
| | | | | | | * -Thtml output mode * roff scaling units * and some minor fixes for full changelogs, see http://bsd.lv/cgi-bin/cvsweb.cgi/
* sync to 1.9.2: Add .UC libman macro for compatibility, has no effect.schwarze2009-09-181-1/+2
| | | | | Correct .UC and .DT to not print their arguments. Document that .UC and .DT should not be used.
* another large chunk of -man updates,schwarze2009-08-221-24/+27
| | | | | among others regarding .DT, .HP, .RS, .RE, .SH, .SS, and scoping, now in sync vith release 1.9.1
* Kristaps@ significantly overhauled libman.schwarze2009-08-221-59/+162
| | | | | | | I'm committing this in one large chunk because in contrast to -mdoc, -man is mostly untested in OpenBSD anyway, so any fallout can be fixed in-tree. Among others, improved support for .IP, .HP, and .TP. Now in sync with release 1.9.0.
* sync to 1.8.4: support .sp in -manschwarze2009-08-221-5/+40
|
* sync to 1.7.21: unified escape sequence validation for mdoc and manschwarze2009-07-081-3/+18
| | | | | checking is still incomplete, but a bit better, in particular for man now in sync with 1.7.22: the only 1.7.22 diff was already in
* sync to 1.7.20: root and text validation for -manschwarze2009-06-231-16/+37
|
* sync to 1.7.19: improved comment handlingschwarze2009-06-181-3/+2
|
* sync to 1.7.16: comments, whitespace and spelling fixes; no functional changeschwarze2009-06-141-13/+11
|
* Initial check-in of mandoc for formatting manuals. ok deraadt@kristaps2009-04-061-0/+137