summaryrefslogtreecommitdiffstats
path: root/mdoc_html.c
Commit message (Collapse)AuthorAgeFilesLines
* Significantly clean up Sh, Ss, SH, and SS handling in -Thtml. Now aKristaps Dzonsons2010-12-171-69/+22
| | | | | | top-level DIV is used with only an H1 or H2 as the section header. This makes manuals much more readable in lynx, less complicated, and relegates left-margin widths to example.style.css.
* Get widths to be propertly represented in -T[x]html.Kristaps Dzonsons2010-12-161-6/+17
|
* Remove `Pp' and `Lp' checks in front-ends to make sure we're notKristaps Dzonsons2010-12-151-5/+0
| | | | | printing as the first or last child of an `Ss' or `Sh': this is now ensured within the validator.
* Use a single P tag for paragraph breaks (which can be configured forKristaps Dzonsons2010-12-151-29/+33
| | | | | | | paragraph breaking in CSS). Use -man's handling of `sp' and `br', which accomodates for scaling widths (-mdoc wasn't).
* Make sure that new list types don't emit whitespace before or after (weKristaps Dzonsons2010-12-151-20/+15
| | | | have to do this manually).
* Clarify purpose of "lit".Kristaps Dzonsons2010-12-151-6/+10
| | | | Make `Dl' and `D1' both use BLOCKQUOTE instead of DIVs.
* Remove stupid outer DIV tag in favour of regular BODY and HTML that canKristaps Dzonsons2010-12-151-6/+0
| | | | | | | | be handled in CSS. Clarified "lit" tag (will be the subject of future clarification). Removed CSS2 note in mandoc.1, which is no longer the case.
* Added list-type style tips.Kristaps Dzonsons2010-12-151-11/+12
|
* In-progress move from -T[x]html using DIVs for its lists to using DL,Kristaps Dzonsons2010-12-151-238/+150
| | | | | OL, and UL. Issue raised by Will Backman, solution proposed by schwarze@.
* Merge schwarze@'s changes allowing nested displays. Tweak the patch byKristaps Dzonsons2010-12-051-0/+4
| | | | | | | making sure output doesn't add a superfluous newline with the nested displays. Also add a COMPATIBILITY note. Rename a macro (DATESIZ) to be in line with OpenBSD (DATESIZE).
* Move `Mt', `Ar', and `Li' handling from mdoc_action.c into mdoc_validate.c.Kristaps Dzonsons2010-11-291-1/+1
| | | | | | | | Clarify that `Mt' gets a default `~' (as per groff 1.20) and document it in mdoc.7. Made `Lk' be removed in mdoc_macro.c if it has no arguments. This fixes segfaults in mdoc_{term,html}.c that nobody's managed to raise yet.
* let .Bsx print just "BSD/OS" like in modern groffIngo Schwarze2010-10-231-1/+1
| | | | from Ulrich Spoerlein <uqs at spoerlein dot net>
* `Sm' no longer produces a linebreak when used in `Bd'.Kristaps Dzonsons2010-10-101-1/+12
|
* * need a space before .No even if it starts with a closing delimiterIngo Schwarze2010-10-011-5/+4
| | | | | | | * slightly simplify .Pf *_IGNDELIM code, and share part of it with .No * do not let opening delimiters fall out of the front of .Ns (from kristaps@) This fixes a few spacing issues in csh(1) and ksh(1). OK kristaps@
* Fix small regression where `Op' had an extra space between the "[" and the SPAN.Kristaps Dzonsons2010-10-011-0/+1
|
* Suppress whitespace following Pp, Lp, sp, and the other newline-emittingKristaps Dzonsons2010-09-271-0/+20
| | | | macros within an unfilled or literal `Bd'.
* Consolidated all -T[x]html punctuation macros into one function.Kristaps Dzonsons2010-09-261-213/+142
|
* A `%T' invoked outside of `Rs' should not produce trailing punctuation.Kristaps Dzonsons2010-09-251-1/+3
| | | | | This from a TODO entry. Also stripped the superfluous NOSPACE, which is handled in term_word() or print_text() anyway.
* Add `Rs' vertical-space in -T[x]html "SEE ALSO" section. RemoveKristaps Dzonsons2010-09-251-6/+3
| | | | | | corresponding TODO entry. Also have the "." after an `Rs' block trigger inter-sentence spacing.
* Churny commit to quiet lint. No functional changes.Kristaps Dzonsons2010-09-041-1/+1
|
* Properly handle -mdoc %A in all outputs. This has two-author entiresKristaps Dzonsons2010-09-041-0/+9
| | | | | | | separated by only "and" while two or more are with ", and" for the last author. Also remove relevant TODO and add regression tests.
* Implement a simple, consistent user interface for error handling.Ingo Schwarze2010-08-201-1/+1
| | | | | | | | | | | | | | | | | 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.
* same as mdoc_term.c rev. 1.180:Ingo Schwarze2010-08-071-4/+4
| | | | | preserve blank lines at the end of .Bd -literal patch from kristaps@, who asked me to commit this
* Fix how `Bd -unfilled' and `Bd -literal' break lines. This unbreaksKristaps Dzonsons2010-07-271-7/+4
| | | | | 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-1/+19
|
* Remove some FIXMEs: `Ms' accepts arbitrary text, so it can't/shouldn'tKristaps Dzonsons2010-07-191-1/+1
| | | | | | 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-0/+5
| | | | `Sh'/`Ss'. Reported by Jason McIntyre.
* correct lots of copyright notices;Ingo Schwarze2010-07-131-1/+1
| | | | ok kristaps@
* Re-constitution of `ds' symbol processing. First, push theKristaps Dzonsons2010-07-071-1/+0
| | | | | | | | | 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-1/+47
|
* Cache column sizes and char pointer into mdoc_bl. Finally get rid ofKristaps Dzonsons2010-07-041-13/+3
| | | | the loops here and there to track down the MDOC_Column arguments.
* Stash `Bf' parameters into struct mdoc_bf.Kristaps Dzonsons2010-07-021-29/+16
|
* Implemented -Thtml bits for handling `Nm' blocks.Kristaps Dzonsons2010-07-021-8/+61
|
* Make struct_bl and struct_bd into pointers. This removes the need to doKristaps Dzonsons2010-07-011-13/+16
| | | | | | | | | | | 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-2/+2
|
* Support for badly nested blocks, written around the time ofIngo Schwarze2010-06-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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-5/+5
| | | | | | | | | 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-0/+1
| | | | const struct regset pointer. No functionality.
* Churn as I finish email address migration kth.se -> bsd.lv.Kristaps Dzonsons2010-06-191-1/+1
|
* Switch on cached -width usage in front-ends.Kristaps Dzonsons2010-06-131-3/+3
|
* Cached `Bl -offset' into mdoc_bl. Removed erroneous "-offset defaultsKristaps Dzonsons2010-06-121-8/+4
| | | | | 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-4/+2
| | | | 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-3/+3
| | | | 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-21/+9
| | | | | | 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-14/+4
| | | | | | | | | | | 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-60/+66
| | | | | | | | | | | | | | | | | | | | | 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-13/+23
|
* Fix following the first: `Ft' is given special treatment if specified beforeKristaps Dzonsons2010-06-041-0/+4
| | | | `Fn'.
* Fixed `Fn' newline behaviour and added some regression tests to thisKristaps Dzonsons2010-06-041-1/+2
| | | | | | | extent. Documented `Fn'. Please note the COMPATIBILITY note regarding historic groff.
* Documented `In' in full.Kristaps Dzonsons2010-06-041-16/+4
| | | | | | 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'.