summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/libmdoc.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Full .nr nS support, unbreaking the kernel manuals.schwarze2010-06-271-10/+16
| | | | | | | | | 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 version 1.10.1 (to be released soon).schwarze2010-06-061-3/+3
| | | | | | | | | | | | | | | | | | | | The main step forward is that this now has *much* better .Bl -column support, now supporting many manuals that previously errored out without producing any output. Other fixes include: * do not die from multiple list types, use the first and warn * in .Bl without a type, default to -item * various tweaks to .Dt * fix .In, .Fd, .Ft, .Fn and .Fo formatting * some documentation fixes and additions * and fix a couple of bugs reported by Ulrich Spoerlein: * better support for roff block-end "\}" without a preceding dot * .In must not break the line outside SYNOPSIS * spelling in some error messages While merging, fix one regression in .In spacing that needs to go to bsd.lv, too.
* Increase performance by saving the list type in struct mdoc_node.schwarze2010-05-241-2/+2
| | | | | | | | | | | This will eventually be used so that mdoc_macro can know whether to dump list line arguments into the body (`Bl -column' overflowing). Remove a2list() and arg_listtype() because of this. From kristaps@. While merging, fix a regression in mdoc_term.c, print_bvspace(): The bsd.lv version of this broke vertical spacing in .Bl -column.
* Unified error and warning message system for all of mandoc,schwarze2010-05-231-71/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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@.
* allow non-numeric manual sections in -mdoc;schwarze2010-05-151-2/+2
| | | | | while here, allow LIBRARY in section 9; by kristaps@
* various improvements regarding errors and warnings Joerg Sonnenberger:schwarze2010-05-151-2/+1
| | | | | | | | | | | | * If the last -column .Bl isn't specified, it is auto-sized. * An invalid .St argument should be a warning, not an error. Just put the argument into the output. * An invalid .At argument should be a warning, not an error. Just print the argument, like new groff does. * Remove warnings concerning manual section (like 1, 6, 8). It was only used for .Ex and not really useful. * Remove warnings concerning page section (like SYNOPSIS). These were only used for .Fd and .Lb and not really useful.
* proper handling of quoted tab-separated column listsschwarze2010-05-151-4/+6
| | | | by kristaps@
* Distinguish OPEN, MIDDLE and CLOSE delimiters (using an enum).schwarze2010-05-151-3/+10
| | | | | | | | | | Only OPEN are drawn before the beginning of a macro; this is new, before this, MIDDLE ('|') were drawn in front, too. Only CLOSE are pushed after the end of a macro (as before). ok kristaps@ This allows us to finally enable handling of leading punctuation without regressions.
* Merge 1.9.25, keeping local patches;schwarze2010-05-141-6/+8
| | | | | | | | | | | | | | this does not merge kristaps' end-of-sentences handling yet, i will check that separately. This one includes: * handle \*(Ba as a delimiter * introduce ARGS_PEND for .Bl -column .It end-of-line special casing * section ordering: expect EXIT STATUS at the right place * line break fixes in SYNOPSIS * allow literal contexts to have arbitrary line lengths * the input file column number can not be used to identify the beginning of a line because white space is allowed after the initial '.' * proper leading spaces in -man -Tascii mode * do not let Lb break lines in -mdoc -Thtml LIBRARY
* merge 1.9.24, keeping local patches; some changes:schwarze2010-05-141-16/+23
| | | | | | | | | * 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/+2
| | | | | even though this is not correct comment syntax (so warn, too) reported by Claus Assmann on misc@, fix by kristaps@
* Merge the good parts of 1.9.23,schwarze2010-04-071-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 two conflicting list types are specified for the same list,schwarze2010-04-031-1/+2
| | | | | | use the first, discard the second, and warn. No need to bail out. ok deraadt@
* merge 1.9.22, keeping local patchesschwarze2010-04-021-11/+11
| | | | | | * 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
* sync to 1.9.12, mostly portability and refactoring:schwarze2009-12-221-2/+1
| | | | | | | | | | | | | | | | | | | 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.9, featuring:schwarze2009-10-211-1/+2
| | | | | | | * -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.6: multiple improvements to references (.Rs)schwarze2009-10-191-1/+2
| | | | | | | * validate and order .Rs child nodes * underline book title (.%B) and issuer (.%I) * enclose title of article (.%T) in quotes * avoid calling mdoc_verr directly, use a proper error code instead
* sync to 1.9.5: lookup hashes are now static tablesschwarze2009-09-211-5/+3
| | | | shortening the code, and, according to kristaps@, speeding it up
* sync to 1.9.1: correctly flag delimiter whitespaceschwarze2009-08-221-3/+5
|
* sync to 1.9.1: set mdoc_next flags in mdoc_*_alloc routines, where they belongschwarze2009-08-221-2/+2
|
* sync to 1.9.0: polishing the core code of mdoc macro handlingschwarze2009-08-221-4/+1
| | | | | | | | | | 1) If a macro is not parsed, do not parse it. Of course, without parsing it, we cannot produce "macro-like parameter" warnings, but these were useless anyway. 2) If a macro is not callable, do not print a useless warning when it occurs as a parameter, just display the raw characters. 3) Below .Bl -column, check whether macros are callable. 4) Like groff, allow whitespace after the initial dot on macro lines.
* sync to 1.8.1: rewrite quoted literal handling correctly,schwarze2009-07-261-2/+3
| | | | | rewrite TABSEP handling in a simpler way, and retire ECOLEMPTY, ARGS_QUOTED and ARGS_ARGVLIKE
* sync to 1.8.1: removed excessively verbose EARGVPARM warningschwarze2009-07-261-2/+1
|
* sync to 1.8.0: move mdoc_a2att, mdoc_a2st, and mdoc_a2lib to libmdocschwarze2009-07-181-1/+5
|
* sync to 1.7.24: mdoc_nwarn/mdoc_nerr got mixed up;schwarze2009-07-131-3/+3
| | | | fix from joerg at netbsd via kristaps@
* sync to 1.7.23: pass warning code to mdoc_pwarn() instead of warning messageschwarze2009-07-121-4/+5
| | | | | | define additional warning macro mdoc_nwarn() remove obsolete warning functions mdoc_warn(), pwarn(), vwarn(), nwarn() remove various now unused "enum mdoc_warn" and "enum mwarn"
* sync to 1.7.23: pass error code to mdoc_perr() instead of error stringschwarze2009-07-121-2/+3
| | | | | and use the so improved mdoc_nerr() at many places; get rid of now unused static functions perr()
* sync to 1.7.23: pass error code to mdoc_nerr() instead of error stringschwarze2009-07-121-7/+3
| | | | and use the so improved mdoc_nerr() at many places
* sync to 1.7.23: unify the various "enum merr" into libman.h and libmdoc.h,schwarze2009-07-121-2/+60
| | | | | 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.23: third step to get rid of enum mdoc_warn:schwarze2009-07-121-3/+2
| | | | mdoc_verr is not using enum mdoc_warn, so use it at a few more places
* sync to 1.7.23: second step to get rid of enum mdoc_warn:schwarze2009-07-121-3/+4
| | | | remove type from mdoc_vwarn arguments, and use this function where apropriate
* sync to 1.7.19: more elegant section handlingschwarze2009-06-191-3/+4
|
* complete sync to 1.7.17: garbage collect unused functionsschwarze2009-06-181-7/+5
| | | | mdoc_msg, mdoc_pmsg, mdoc_vmsg, and mdoc_nwarn
* bring back miod@'s "real functions" patch (rev. 1.2)schwarze2009-06-151-33/+12
| | | | | which was erroneously backed out in rev. 1.4, sorry; ok kristaps@
* sync to 1.7.16:schwarze2009-06-151-16/+33
| | | | | reduce code duplication in warning and error reporting functions while here, garbage collect three unused function prototypes
* sync to 1.7.16: comments, whitespace and spelling fixes; no functional changeschwarze2009-06-141-13/+11
|
* Replace variadic macros with real functions, so that this compiles onmiod2009-04-151-33/+12
| | | | | platforms still using gcc 2. ok deraadt@
* Initial check-in of mandoc for formatting manuals. ok deraadt@kristaps2009-04-061-0/+157