summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Full .nr nS support, unbreaking the kernel manuals.schwarze2010-06-271-3/+6
| | | | | | | | | Kristaps coded this from scratch after reading my .nr patch; it is simpler and more powerful. Registers live in struct regset in regs.h, struct man and struct mdoc contain pointers to it. The nS register is cleared when parsing .Sh. Frontends respect the MDOC_SYNPRETTY flag set in mdoc node_alloc.
* Merge bsd.lv release 1.10.0,schwarze2010-06-061-1/+3
| | | | | | | | | | | | | | | | which is mostly the post-hackathon release, bringing in the OpenBSD changes to bsd.lv, but which also has a few additional minor fixes: * .Lb is an in-line macro, not in_line_eoln * .Bt, .Ud now warn when discarding arguments * allow bad -man dates to flow verbatim into the front-ends - so far all reported by Ulrich Spoerlein * .Ar, .Fl and .Li starting with closing punctuation emit an empty element * empty .Li macros print nothing, but may cause spacing * proper EOS handling for .Bt, .Ex, .Rv, and .Ud. * cleanup: collapse posts_xr into posts_wtext (which is the same) * efficiency: very simple table lookup for roff.c
* Unified error and warning message system for all of mandoc,schwarze2010-05-231-85/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+2
|
* Support nested roff instructions:schwarze2010-05-201-42/+30
| | | | | | | | | | | | | | | | | | | * 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-9/+3
| | | | | | | | | | | | | | | | | | 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/+3
| | | | by kristaps@
* Integrate kristaps@' end-of-sentence (EOS) frameworkschwarze2010-05-141-1/+12
| | | | | | | | | | | | | which is simpler and more powerful than mine, and remove mine. * man(7) now has EOS handling, too * put EOS detection into its own function in libmandoc * use node and termp flags to communicate the EOS condition * no more EOS pseudo-macro * no more non-printable EOS marker character on the formatter level This slightly breaks EOS detection after trailing punctuation in mdoc(7) macros, but that will be restored soon.
* merge 1.9.24, keeping local patches; some changes:schwarze2010-05-141-55/+32
| | | | | | | | | * preserve multiple consecutive space characters in input * do not restrict .Cd and .Rv to certain sections (requested by Joerg) * do not run lookup() on quoted words * enum return types for mdoc_args and mdoc_argv * fix auto-closing of LINK tag in -Txhtml (from Daniel Friesel) * various lint and manual fixes
* handle text lines beginning with \." as comments, like groff does,schwarze2010-05-081-1/+7
| | | | | even though this is not correct comment syntax (so warn, too) reported by Claus Assmann on misc@, fix by kristaps@
* Implement roff conditional instructions .if .ie .el, in man(7) only for now;schwarze2010-04-251-5/+22
| | | | fixing OpenBSD::PackageName(3p) and friends for espie@.
* merge 1.9.20, keeping local patchesschwarze2010-04-021-10/+17
| | | | | | | | * 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-7/+13
| | | | | | | * 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-40/+67
| | | | | | | * 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
* merge 1.9.16, keeping local patchesschwarze2010-03-251-18/+70
| | | | | | | 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.
* Accept the non-standard macros .Sp (similar to .sp)schwarze2010-03-021-2/+3
| | | | | | | 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-2/+3
| | | | | | | | | 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 release 1.9.15:schwarze2010-02-181-6/+33
| | | | | | | | | * 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
* sync to 1.9.13: minor fixes:schwarze2009-12-231-4/+4
| | | | | | | | | | | | | | | | | | correctness/functionality: - bugfix: properly ignore lines with only a dot in -man - bugfix: .Bl -ohang doesn't allow -width, warn about this - improve date string handling by new function mandoc_a2time - some HTML improvements - significant documentation additions in man.7 and mdoc.7 portability: - replace __dead by __attribute__((noreturn)) - bugfix: correct .Dx rendering - some more library names for NetBSD simplicity: - replace hand-rolled putchar(3)-loops by fwrite(3) - replace single-character printf(3) by putchar(3)
* sync to 1.9.12, mostly portability and refactoring:schwarze2009-12-221-40/+15
| | | | | | | | | | | | | | | | | | | correctness/functionality: - bugfix: do not die when overstep hits the right margin - new option: -fign-escape - and various HTML features portability: - replace bzero(3) by memset(3), which is ANSI C - replace err(3)/warn(3) by perror(3)/exit(3), which is ANSI C - iuse argv[0] instead of __progname - add time.h to various files for FreeBSD compilation simplicity: - do not allocate header/footer data dynamically in *_term.c - provide and use malloc frontends that error out on failure for full changelogs, see http://bsd.lv/cgi-bin/cvsweb.cgi/
* sync to 1.9.11: adapt printing of dates to groff conventions,schwarze2009-10-271-8/+16
| | | | | 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.6: u_char lives in <sys/types.h>schwarze2009-10-191-1/+3
| | | | | noticed by uqs at spoerlein dot net on FreeBSD, where <stdlib.h> does not include <sys/types.h>
* sync to 1.9.5: lookup hashes are now static tablesschwarze2009-09-211-10/+4
| | | | shortening the code, and, according to kristaps@, speeding it up
* sync to 1.9.2: Add .UC libman macro for compatibility, has no effect.schwarze2009-09-181-2/+2
| | | | | Correct .UC and .DT to not print their arguments. Document that .UC and .DT should not be used.
* sync to 1.9.2: non-printable characters in macro names are errors;schwarze2009-09-181-1/+7
| | | | from joerg at netbsd dot org
* another large chunk of -man updates,schwarze2009-08-221-25/+118
| | | | | 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-48/+115
| | | | | | | 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-2/+3
|
* sync to 1.7.23: unify the various "enum merr" into libman.h and libmdoc.h,schwarze2009-07-121-36/+16
| | | | | use it as a new argument to mdoc_err(), the same way as for for man_err(), and use string tables instead of switch statements to select error messages
* sync to 1.7.21: provide WESCAPE and MAN_IGN_ESCAPE,schwarze2009-07-071-1/+4
| | | | to be used soon in man_validate.c
* sync to 1.7.20: root and text validation for -manschwarze2009-06-231-1/+6
|
* sync to 1.7.20: error reporting functions for -manschwarze2009-06-231-1/+44
|
* sync to 1.7.19: improved comment handlingschwarze2009-06-181-7/+3
|
* sync to 1.7.16: comments, whitespace and spelling fixes; no functional changeschwarze2009-06-141-14/+12
|
* Initial check-in of mandoc for formatting manuals. ok deraadt@kristaps2009-04-061-0/+440