aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_html.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix how `Bd -unfilled' and `Bd -literal' break lines. This unbreaksKristaps Dzonsons2010-07-271-8/+5
| | | | | displays to work as old groff shows them; however, new groff still does some fancy shit.
* Add support for `Sm' in -T[x]html -mdoc.Kristaps Dzonsons2010-07-231-2/+20
|
* Remove some FIXMEs: `Ms' accepts arbitrary text, so it can't/shouldn'tKristaps Dzonsons2010-07-191-2/+2
| | | | | | be converted into a symbol. The `Pp' issue has also been fixed.
* Fix spurrious newline emitted by `Pp' when specified before or afterKristaps Dzonsons2010-07-191-1/+6
| | | | `Sh'/`Ss'. Reported by Jason McIntyre.
* correct lots of copyright notices;Ingo Schwarze2010-07-131-2/+2
| | | | ok kristaps@
* Re-constitution of `ds' symbol processing. First, push theKristaps Dzonsons2010-07-071-2/+1
| | | | | | | | | roff_getstr() family of functions into roff.c with the "first_string" directly in struct roff. Second, pre-process each line for reserved words in libroff, splicing and re-running a line if it has one (this allows defined symbols to be macros). Remove term.c's invocation of the roff_getstrn() function. Removed function documentation in roff.3 and added roff.7 `ds' documentation.
* Give -T[x]html `Bk -words' capability.Kristaps Dzonsons2010-07-061-2/+48
|
* Cache column sizes and char pointer into mdoc_bl. Finally get rid ofKristaps Dzonsons2010-07-041-14/+4
| | | | the loops here and there to track down the MDOC_Column arguments.
* Stash `Bf' parameters into struct mdoc_bf.Kristaps Dzonsons2010-07-021-30/+17
|
* Implemented -Thtml bits for handling `Nm' blocks.Kristaps Dzonsons2010-07-021-9/+62
|
* Make struct_bl and struct_bd into pointers. This removes the need to doKristaps Dzonsons2010-07-011-14/+17
| | | | | | | | | | | copying on internals after modification. Even more importantly, if an ENDBODY token is provided, it would have been impossible for post-change copying of the data to take place in the BLOCK. This allows it to happen by dint of pointers. Also did some bikeshedding in mdoc_term.c: checking against enum type and explicitly casting to the "post" function to void. This is for my own readability.
* More reality-checks for the p->end type.Kristaps Dzonsons2010-07-011-3/+3
|
* Support for badly nested blocks, written around the time ofIngo Schwarze2010-06-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | the Rostock mandoc hackathon and tested and polished since, supporting constructs like: .Ao Bo Ac Bc (exp breaking exp) .Aq Bo eol Bc (imp breaking exp) .Ao Bq Ac eol (exp breaking imp) .Ao Bo So Bc Ac Sc (double break, inner before outer) .Ao Bo So Ac Bc Sc (double break, outer before inner) .Ao Bo Ac So Bc Sc (broken breaker) .Ao Bo So Bc Do Ac Sc Dc (broken double breaker) There are still two known issues which are tricky: 1) Breaking two identical explicit blocks (Ao Bo Bo Ac or Aq Bo Bo eol) fails outright, triggering a bogus syntax error. 2) Breaking a block by two identical explicit blocks (Ao Ao Bo Ac Ac Bc or Ao Ao Bq Ac Ac eol) still has a minor rendering error left: "<ao1 <ao2 [bo ac2> ac1> bc]>" should not have the final ">". We can fix these later in the tree, let's not grow this diff too large. "get it in" kristaps@
* Following clue-stick applied by schwarze@, back out const-ness of regsetKristaps Dzonsons2010-06-271-6/+6
| | | | | | | | | passed in to libmdoc and libman. Fix mdoc.3 and man.3 EXAMPLE sections to include regset. Add MDOC_SYNPRETTY flag cueing front-end to nicely format certain values as if SEC_SYNOPSIS were the current section.
* Churn-ish check-in getting mdoc_parseln() and man_parseln() to accept aKristaps Dzonsons2010-06-261-1/+2
| | | | const struct regset pointer. No functionality.
* Churn as I finish email address migration kth.se -> bsd.lv.Kristaps Dzonsons2010-06-191-2/+2
|
* Switch on cached -width usage in front-ends.Kristaps Dzonsons2010-06-131-4/+4
|
* Cached `Bl -offset' into mdoc_bl. Removed erroneous "-offset defaultsKristaps Dzonsons2010-06-121-9/+5
| | | | | to 6n if no value is specified" and added regression tests for `Bl' testing against the empty -offset argument.
* Moved `Bl -compact' into cached data. This allowed the removal ofKristaps Dzonsons2010-06-121-5/+3
| | | | scanning the argv list in print_bvspace(), and thus the parent pointer.
* `Bl' is now using a struct instead of a single enum mdoc_list for itsKristaps Dzonsons2010-06-121-4/+4
| | | | cached values. You can probably guess where this is going.
* Cache all of `Bd's resolved arguments into mdoc_bd, which is stashed inKristaps Dzonsons2010-06-121-22/+10
| | | | | | the "data" union in mdoc_node. Allows me to remove some ugly loops in the front-end and duplicate tests in mdoc_action.c. Add a regression test to make sure we're not doing anything bad (more to come).
* Added enum mdoc_disp (similar to enum mdoc_list). Display types are nowKristaps Dzonsons2010-06-121-15/+5
| | | | | | | | | | | only calculated once in mdoc_validate.c. Noted that `Bd -file xxx' is not supported: it now raises a fatal warning. This is noted in mdoc.7. Empty `Bd' now defaults to LIST_ragged, which is not quite what groff does, but close enough (gross just throws away the `Bd' and gets upset when it encounters an `Ed').
* Normalise SYNOPSIS behaviour after I gave up on following groff'sKristaps Dzonsons2010-06-071-61/+67
| | | | | | | | | | | | | | | | | | | | | inconsistent behaviour. In short: Some macros are displayed differently in the SYNOPSIS section, particularly Nm, Cd, Fd, Fn, Fo, In, Vt, and Ft. All of these macros are output on their own line. If two such dissimilar macros are pair-wise invoked (except for Ft before Fo or Fn), they are separated by a vertical space, unless in the case of Fo, Fn, and Ft, which are always separated by vertical space. Behaviour ok Jason McIntyre, ingo@. Fallout will be treated case-by-case. I had to clear out some regressions that were testing against groff's stranger behaviours: these will now break, as we don't care about such invocations. Also removed the newline for `Cd' invocation in a non-SYNOPSIS context.
* Fixed -Tascii and -Thtml rendering of `Ft' and `Fo'.Kristaps Dzonsons2010-06-061-14/+24
|
* Fix following the first: `Ft' is given special treatment if specified beforeKristaps Dzonsons2010-06-041-1/+5
| | | | `Fn'.
* Fixed `Fn' newline behaviour and added some regression tests to thisKristaps Dzonsons2010-06-041-2/+3
| | | | | | | extent. Documented `Fn'. Please note the COMPATIBILITY note regarding historic groff.
* Documented `In' in full.Kristaps Dzonsons2010-06-041-17/+5
| | | | | | Fixed `In' to behave properly: it wasn't properly breaking lines, formatting, or really anything else. Noted COMPATIBILITY with OpenBSD's groff, which pukes all over `In'.
* Fixed `Fd' to format in the right way. Found when confused by what theKristaps Dzonsons2010-06-041-13/+12
| | | | | hell `Fd' is supposed to do anyway (answer: it's a historical macro and we shouldn't be doing anything with it anyway).
* Consolidated list processing to a single loop in mdoc_validate.c. ThisKristaps Dzonsons2010-06-031-6/+5
| | | | | | | | | | relieves having to repeat running over the argument list in mdoc_action.c and mdoc_validate.c. Default to LIST_item for type-less lists (groff technically doesn't do this: it just ignores the `It' lines altogether). Make MANDOC_LISTTYPE be a recoverable error.
* Remove enum mdocargerr from phrase() (unused).Kristaps Dzonsons2010-05-311-1/+2
| | | | | | | | | | | | | | Add `Ta' macro, which is basically a NULL case everywhere but in mdoc_macro.c, where it closes out an existing `It' body scope and opens a new one, then continues parsing as in phrase() (TODO: merge these two?). Fix where scope-breaking was silently just dying instead of printing an error. Fix where trailing `Ta' or tab weren't creating a new MDOC_BODY context. We now support arbitrarily complex `It' contents for `Bl -column'.
* Migrate `Bl -column' phrases to be MDOC_BODY instead of MDOC_HEAD. ThisKristaps Dzonsons2010-05-301-23/+20
| | | | | | | | | | will make it easy for re-entrant parsing of `Ta' macros to fit in with standard closure rules. Added some more regressions for `Bl -column'. Note that one should fail, as documented in the TODO file. Recorded change of AST BNF in mdoc.3.
* Moved printing of empty word [back] into mdoc_action.c so that it's notKristaps Dzonsons2010-05-291-3/+1
| | | | mirrored across front-ends.
* Commit of patch floated on discuss@ a few days ago: if an in_line scopeKristaps Dzonsons2010-05-291-1/+3
| | | | | | | | | | has not been opened and closing punctuation is encountered AND the macro is marked as accepting no-content (or `Li'), then open an empty scope. Added regression tests for `Fl' and `Li' testing this behaviour. Also, squeeze hyph0.in tests into the last characters of each line so that groff doesn't hyphenate and break the test.
* Fix segfault in mixing old enum types for -Thtml -mdoc.Kristaps Dzonsons2010-05-241-3/+3
|
* Increase performance by stashing the list type in struct mdoc_node.Kristaps Dzonsons2010-05-171-80/+35
| | | | | | | This will eventually be used so that mdoc_macro can known whether to dump list line arguments into the body (`Bl -column' overflowing). Remove a2list() and arg_listtype() because of this.
* Enable the unified error/warning enumeration in mandoc.h that'sKristaps Dzonsons2010-05-171-3/+7
| | | | | | | | | | | stringified in main.c. Allow `An' to handle an argument and child (with a warning). Allow `Rv' and `Ex' to work without a prior `Nm' as groff does (with a warning). Allow inconsistent column syntax to only raise a warning.
* Documented ie/el.Kristaps Dzonsons2010-05-171-3/+4
| | | | | Installing roff.7 and added it to index.sgml. Small fix for `D1' and `Bd' in -Thtml.
* LIBRARY can also occur in section 9.Kristaps Dzonsons2010-05-151-3/+3
| | | | | | All manual sections (unknown, 3p, 3f, etc.) correctly handled by -mdoc. Useful warning printed if unknown manual section. Checking for manual sections (e.g., LIBRARY) checks only first character, so 3p, 3f, etc. are free.
* Fixed bug in -Thtml -mdoc where `Lb' would line-break in LIBRARY section.Kristaps Dzonsons2010-05-131-7/+8
| | | | | Fixed assumption that parse-point == 1 equates to beginning of line (false if whitespace separates macro and control character). Fixed line-break for non-first-macro in several SYNOPSIS macros.
* Fixed %T: it now correctly underlines, instead of quoting (noted by Jason ↵Kristaps Dzonsons2010-04-081-11/+3
| | | | McIntyre and posted on Ingo Schwarze' mandoc-todo list).
* Bug in printing of reserved words with form \*[xxx] fixed (found by Joerg ↵Kristaps Dzonsons2010-04-071-1/+2
| | | | Sonnenberger).
* Let `Bl' accept arguments on the head line with a warning (these are ignored ↵Kristaps Dzonsons2010-04-061-1/+3
| | | | in the front-end device) (noted by Theo de Raadt).
* `Fl' now correctly suppresses the trailing space if followed by macros on ↵Kristaps Dzonsons2010-04-061-3/+3
| | | | the same line.
* Fix in `Mt' mailto from a patch by Tim van der Molen.Kristaps Dzonsons2010-04-051-37/+42
| | | | | Fixed PAIR_xxx_INIT macros -- this are to be unified. Have `Vt', `Fn', `Ft', and `Fo' print whitespace afterward, instead of before.
* Merged patch by Ingo Schwarze allowing `Xr' to pass through with no ↵Kristaps Dzonsons2010-04-031-1/+4
| | | | arguments (emits warning of course).
* Integrate Ingo Schwarze's patch for mdoc_iscdelim() (tri-state for opening ↵Kristaps Dzonsons2010-03-291-2/+2
| | | | | | | | | | | and closing macro punctuation). Modify blk_part_exp() to correctly handle leading punctuation before HEAD. Significantly clean up and document blk_part_exp(). Modify blk_part_imp() for to correctly handle leading punctuation before HEAD. Significantly clean up and document blk_part_imp(). Integrate Ingo Schwarze's patch for args() (using new mdoc_iscdelim() format). Documented bad `Ec' handling for later work in mdoc_term.c/mdoc_html.c.
* Fix in handling Vt in SYNOPSIS with trailing punctuation. Spotted by Joerg ↵Kristaps Dzonsons2010-01-301-3/+6
| | | | Sonnenberger.
* Fixed Makefile for `make lint' dep. on config.hKristaps Dzonsons2010-01-291-2/+2
| | | | Added -Txhtml for XHTML output (minimal increase to programme logic). Because groff has it and it bothers me that we don't.
* Big check-in of compatibility layer. This should work on most major ↵Kristaps Dzonsons2010-01-011-7/+9
| | | | architectures. Thanks to Joerg Sonnenberger.
* Documented `Fl' in mdoc.7.Kristaps Dzonsons2010-01-011-17/+5
| | | | Backed out stipulation that `Fl ""' is ignored: this is not the case in !OpenBSD groffs.