aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.c
Commit message (Collapse)AuthorAgeFilesLines
* Add character output (-Tpdf, -Tps, -Tascii) for equations. This is theKristaps Dzonsons2011-07-221-2/+2
| | | | minimum: unseparated terms.
* Flip eqn into using parsed nodes. I've temporarily disabled printingKristaps Dzonsons2011-07-211-2/+2
| | | | | | | these in the front-ends except for -Ttree, which will display the parsed tree. While here, fix that quoted strings aren't scanned for replacement parts.
* First fix how `sp 1' doesn't imply `1v' (it now does) and that 1Kristaps Dzonsons2011-06-291-2/+3
| | | | | | followed by non-digits, e.g. `1g', really means `1'. Next, fix some spacing issues where `sp' was invoked in -man after sections or subsections. Make sure this behaviour is mirrored in -Thtml.
* Add mode for -Tlocale. This mode, with this commit, behaves exactlyKristaps Dzonsons2011-05-171-9/+2
| | | | | | | like -Tascii. While adding this, inline term_alloc() (was a one-liner), remove some switches around the terminal encoding for the symbol table (unnecessary), and split out ascii_alloc() into ascii_init(), which is also called from locale_init().
* Rename mchars_init() -> mchars_alloc() for consistency.Kristaps Dzonsons2011-04-301-2/+2
|
* Remove enum mcharst, which hasn't been used in quite some time.Kristaps Dzonsons2011-04-301-2/+2
|
* Move "chars" interface out of out.h and into mandoc.h. This doesn'tKristaps Dzonsons2011-04-291-2/+2
| | | | | | | | | | change any code but for renaming functions and types to be consistent with other mandoc.h stuff. The reason for moving into libmandoc is that the rendering of special characters is part of mandoc itself---not an external part. From mandoc(1)'s perspective, this changes nothing, but for other utilities, it's important to have these part of libmandoc. Note this isn't documented [yet] in mandoc.3 because there are some parts I'd like to change around beforehand.
* Last low-hanging removal of superfluous variable assignments.Kristaps Dzonsons2011-04-041-7/+14
|
* Clean up superfluous variables in `Xr' handling in -Tascii.Kristaps Dzonsons2011-04-041-10/+10
|
* Fully fix the `Rv' and `Ex' handlers for -T[x]html and -Tascii. ThisKristaps Dzonsons2011-04-041-13/+16
| | | | includes an unreported bug where `Ex' wasn't properly adding a newline.
* Clean up -Tascii in the same way as -T[x]html regarding `Rv' arguments.Kristaps Dzonsons2011-04-041-11/+16
|
* Move mandoc_isdelim() back into libmdoc.h. This fixes an unreportedKristaps Dzonsons2011-03-221-6/+28
| | | | | | | | | error where (1) -man pages were punctuating delimiters (e.g., `.B a ;') and where (2) standalone punctuation in -mdoc or -man (e.g., ";" on its own line) would also be punctuated. This introduces a small amount of complexity of mdoc_{html,term}.c must manage their own spacing with running print_word() or print_text(). The check for delimiting now happens in mdoc_macro.c's dword().
* Step 4: merge chars.h into out.h. The functions in this file areKristaps Dzonsons2011-03-221-2/+1
| | | | | necessary to all [real] front-ends, so stop pretending it's special. While here, add some documentation to the variable types.
* Clean up date handling,Ingo Schwarze2011-03-071-10/+6
| | | | | | | | | | | | as a first step to get rid of the frequent petty warnings in this area: - always store dates as strings, not as seconds since the Epoch - for input, try the three most common formats everywhere - for unrecognized format, just pass the date though verbatim - when there is no date at all, still use the current date Originally triggered by a one-line patch from Tim van der Molen, <tbvdm at xs4all dot nl>, which is included here. Feedback and OK on manual parts from jmc@. "please check this in" kristaps@
* EQN blocks are now printed in all modes. This is simply a printing ofKristaps Dzonsons2011-02-091-1/+2
| | | | the concatenated string (in -T[x]html, it gets a SPAN, too).
* Fix a regression caused by mdoc_term.c 1.214 / mdoc_html.c 1.148:Ingo Schwarze2011-02-061-2/+4
| | | | | Inside .Bk or inside the SYNOPSIS, Unix variant macros cleared the keep flag.
* Some pre-handlers produce output, so reorder the code to set upIngo Schwarze2011-02-061-21/+26
| | | | | | keep flags before they are called. Without this bugfix, .Bk was ineffective in some cases. "looks reasonable" kristaps@
* Add initial libmdoc and libman top-most machinery for accepting TBLKristaps Dzonsons2011-02-061-1/+5
| | | | | directives. For now this will just ignore them (except for -Ttree, which just notes that an EQN's been accepted).
* If `Ns' is specified on its own line, it should be ignored. This isKristaps Dzonsons2011-02-021-2/+3
| | | | | shitty groff behaviour. Do the same, but raise a warning to this effect. This from a TODO noted by schwarze@.
* Arguments to `Bsx' and friends are separated by a non-breaking space.Kristaps Dzonsons2011-01-251-3/+7
| | | | This removes a TODO raised by schwarze@.
* Push capitalisation of `Bx' second argument into validator, where it belongs.Kristaps Dzonsons2011-01-251-8/+3
|
* Properly uppercase the first-letter of the `Bx' second argument.Kristaps Dzonsons2011-01-251-3/+8
|
* Have `Bx' accept two arguments, not just one, and join these argumentsKristaps Dzonsons2011-01-251-7/+21
| | | | with "xxBSD-yy"
* If %B is specified, quote %T. Noted by schwarze@ in the TODO.Kristaps Dzonsons2011-01-251-3/+3
|
* If the first character of free-form text is whitespace, then a newlineKristaps Dzonsons2011-01-121-1/+3
| | | | shall precede outputted text (surprise!).
* Make -literal displays only have 8-character displays. From aKristaps Dzonsons2011-01-061-2/+4
| | | | low-hanging TODO added by schwarze@ on 15/08/10.
* Turn on -Tascii tbl printing. The output still has some issues---I'mKristaps Dzonsons2011-01-021-1/+2
| | | | | | not sure whether it's in the header calculation or term.c squashing spaces or whatever, but let's get this in for general testing as soon as possible.
* Add table processing structures to -mdoc. This consists of anKristaps Dzonsons2011-01-011-8/+23
| | | | | | external-facing function mdoc_addspan(), then various bits to prohibit printing and scanning (this requires some if's to be converted into switch's).
* As pointed out by schwarze@, %T/%J renders with a normal double-quote, notKristaps Dzonsons2010-12-251-5/+5
| | | | the fancy double-quote.
* Implement schwarze@'s much more elegant version of my %T/%J fix.Kristaps Dzonsons2010-12-251-4/+4
|
* Specifying both %T and %J in an `Rs' block causes the title to be quotedKristaps Dzonsons2010-12-251-4/+43
| | | | | instead of underlined. This only happens in -Tascii, as -T[x]html both underlines and italicises.
* As per schwarze@'s suggestions, roll back the refcount structure inKristaps Dzonsons2010-12-241-25/+25
| | | | | | | | favour of a simpler shim for normalised data in the node allocation and free routines. This removes the need to bump and copy references within validator handlers, removes a pointer redirect, and also kills the refcount structure itself. Data is assumed to "live" either in a MDOC_BLOCK or MDOC_ELEM and is copied accordingly.
* Implement reference-counted version of original union mdoc_data. ThisKristaps Dzonsons2010-12-221-30/+25
| | | | | | | simplifies clean-up and allows for more types without extra hassle. Also made in-line literal types in -T[x]html use CODE instead of SPAN to match how literal blocks use PRE.
* Handle .Bk the same way as groff 1.20.1:Ingo Schwarze2010-12-191-2/+3
| | | | | | .Bk without arguments defaults to -words. .Bk with invalid arguments (including -lines) has no effect. ok kristaps@
* Migrate `An' to use a pointer in its data, like everybody else. This isKristaps Dzonsons2010-12-161-3/+3
| | | | | the first step to having a simpler ref-counted system for "data" associated with a node.
* Remove `Pp' and `Lp' checks in front-ends to make sure we're notKristaps Dzonsons2010-12-151-6/+1
| | | | | printing as the first or last child of an `Ss' or `Sh': this is now ensured within the validator.
* Make SYNOPSIS sections and code having .nr nS enabledIngo Schwarze2010-12-111-2/+15
| | | | | | | | | behave as if the whole code were wrapped in .Bk/.Ek, i.e. keeping input lines together on output lines. This is compatible with new groff behaviour and deviates from historical groff. Tweaked version of a patch sent by kristaps@ on July 16, 2010. ok kristaps@ jmc@ sobrado@ millert@
* Merge schwarze@'s changes allowing nested displays. Tweak the patch byKristaps Dzonsons2010-12-051-1/+5
| | | | | | | 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-2/+2
| | | | | | | | 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-2/+2
| | | | from Ulrich Spoerlein <uqs at spoerlein dot net>
* `Sm' no longer produces a linebreak when used in `Bd'.Kristaps Dzonsons2010-10-101-1/+3
|
* * need a space before .No even if it starts with a closing delimiterIngo Schwarze2010-10-011-6/+5
| | | | | | | * 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@
* Merge from OpenBSD right after 1.10.6; now back to full sync.Ingo Schwarze2010-09-271-2/+1
| | | | | | | | | | * mdoc.c: blank lines outside literal mode are more similar to .sp than .Pp * backslashes do not terminate macros; partial revert of mdoc.c 1.164; the intention of that commit is fully achieved in roff.c * mdoc_term.c: no need to list the same prototype twice * mdoc_validate.c: drop .Pp before .sp just like .Pp before .Pp * fix off-by-one found by jsg@ with parfait, OpenBSD term_ps.c 1.12 ok kristaps@
* Suppress whitespace following Pp, Lp, sp, and the other newline-emittingKristaps Dzonsons2010-09-271-1/+21
| | | | macros within an unfilled or literal `Bd'.
* Linted function arguments.Kristaps Dzonsons2010-09-261-1/+3
|
* Big clean-up consolidating all punctuation opening/closing functions intoKristaps Dzonsons2010-09-261-226/+118
| | | | | | | | | a single one. This makes code auditing easier and cuts down on bytesize. I also removed some NOSPACE clauses that were handled implicitly by the punctuation itself, e.g., a NOSPACE prior to printing ')', which in term.c has its leading whitespace automatically suppressed.
* A `%T' invoked outside of `Rs' should not produce trailing punctuation.Kristaps Dzonsons2010-09-251-2/+4
| | | | | 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-2/+6
| | | | | | corresponding TODO entry. Also have the "." after an `Rs' block trigger inter-sentence spacing.
* When the HEAD of an .Nm block in the SYNOPSIS might be widerIngo Schwarze2010-09-231-7/+13
| | | | | | | | | | | than the column containing it, the TERMP_HANG flag is required, but avoid the flag when we know that the HEAD is shorter, because in that case, the flag might ruin the alignment. Problem originally reported by jmc@, who also spotted a regression in an earlier version of this patch. "feel free to commit" kristaps@
* Properly handle -mdoc %A in all outputs. This has two-author entiresKristaps Dzonsons2010-09-041-2/+26
| | | | | | | separated by only "and" while two or more are with ", and" for the last author. Also remove relevant TODO and add regression tests.