summaryrefslogtreecommitdiffstats
path: root/mdoc_term.c
Commit message (Collapse)AuthorAgeFilesLines
* Let .Do .Dq .Ql .So .Sq generate the correct roff(7) character escapeIngo Schwarze2013-06-021-4/+4
| | | | | | | sequences such that output modes like -Tutf8 have a chance to select nice glyphs. This doesn't change anything for -Tascii, and, for now, it doesn't affect -Tps and -Tpdf either. OK matthew@ bentley@; like the idea tedu@; no opinion jmc@.
* Simplify condition, avoid duplicate code; no functional change.Ingo Schwarze2013-05-291-6/+2
|
* In SYNOPSIS mode, .Ek doesn't end a keep.Ingo Schwarze2013-05-291-1/+1
| | | | Found and fixed on the plane to the OpenBSD t2k13 hackathon in Toronto.
* Should termp_xx_pre() ever get called for a macro it cannot handle,Ingo Schwarze2013-05-181-1/+2
| | | | | | | | use abort(3), just like in the three other comparable cases in this file, instead of ignoring the problem and causing a null pointer access. Cosmetical issue reported by Ulrich Spoerlein <uqs@spoerlein.net> found by Coverity Scan CID 976115. No functional change.
* Cleanup naming of local variables to make the code easier on the eye:Ingo Schwarze2012-11-171-36/+37
| | | | | | | | Settle for "struct man *man", "struct mdoc *mdoc", "struct meta *meta" and avoid the confusing "*m" which was sometimes this, sometimes that. No functional change. ok kristaps@ some time ago
* Improve formatting of badly nested font blocks.Ingo Schwarze2012-11-161-6/+6
| | | | | | | | | | | | | | | | | The basic idea is to already pop the font at the end marker instead of allowing it to linger until the final end of the block. This requires a few preliminaries: * For each block, save a pointer to the previous font to be used in case the block breaks another and gets extended. * That requires making node information writable during rendering. * Now fonts may get popped in the wrong order; hence, after the stack has already been rewound further by some block that began earlier, ignore popping a font that was put on the stack later. * To be able to exploit all this for font blocks, tie processing to their body, not their block, which is more logical anyway. Triggered by florian@ reporting vaguely similar issues with list blocks.
* fix position and formatting of %U;Ingo Schwarze2012-07-111-1/+1
| | | | OpenBSD rev. 1.104 and 1.145, respectively
* * implement -Tman .Bl -item -inset -diag -ohang -dash -hyphen -enum .ItIngo Schwarze2012-07-101-7/+11
| | | | | | | | | | * fix -Tman .Bl -bullet .It * adjust the -Tascii .Bl -bullet -dash -hyphen .It default and minimum width to new groff standards, it changed from 4n (in groff 1.15) to 2n (in groff 1.21) * same for -Tascii -enum, it changed from 5n to 2n * use -hang formatting for -Tascii -enum -width 2n * for -Tascii -enum, the default is -width 3n
* fix -Tascii .Fd line breakingIngo Schwarze2012-07-091-15/+13
| | | | | and implement -Tman .Fd OpenBSD rev. 1.27 and 1.143, respectively
* fix .Lk for -Tascii and implement it for -TmanIngo Schwarze2012-07-081-16/+15
| | | | OpenBSD rev. 1.22 and 1.142, respectively
* implement -Tman .AnIngo Schwarze2012-07-081-0/+2
| | | | | also reset -[no]split mode at .Sh AUTHORS in -Tascii OpenBSD rev. 1.20 and 1.141, respectively
* Make the default left text margin configurable from the command line,Ingo Schwarze2011-11-131-8/+8
| | | | | | | just like the default right margin already is. This may be useful for people with expensive screen real estate. Besides, it helps automated man(7) to mdoc(7) output comparisons to validate -Tman output. ok kristaps@ on an earlier version
* Correct .Eo spacing:Ingo Schwarze2011-11-031-1/+5
| | | | | no space between the delimiters and the enclosed text. The mdoc_html.c part was added by kristaps; ok kristaps@.
* Remove a bunch of useless assignments,Ingo Schwarze2011-10-161-0/+2
| | | | | | | and assert that print_bvspace cannot be called on NULL pointers. No change in behaviour, none of these were bugs, but the code becomes easier to understand. Based on a clang report posted by joerg@; ok kristaps@.
* Sync print_mdoc_head to print_man_head;Ingo Schwarze2011-09-201-15/+22
| | | | | | this was forgotten after man_term.c rev. 1.25 on March 2, 2010. The benefit is a sane page header line when .Dt is very long. Reminded by Thomas Klausner <wiz at NetBSD>, thanks.
* Remove the terminal frontend flag TERMP_NOLPAD.Ingo Schwarze2011-09-191-23/+8
| | | | | | | | | | | | | | | | | In columnated contexts (.Bl -column, .Bl -tag, .IP, .TP, .HP etc.), do not pad after writing a column. Instead, always pad before writing content. In itself, this change avoids: - writing trailing whitespace in some situations - with .fi/.nf in .HP, breaking lines that were already padded It allows several bugfixes included in this patch: - Do not count backspace as a character with positive width. - Set up proper indentation when encountering .fi/.nf in .HP. - Adjust the .HP indentation width to what groff does. - Never unlimit the right margin unless in the final column. ok kristaps@
* Add character output (-Tpdf, -Tps, -Tascii) for equations. This is theKristaps Dzonsons2011-07-221-1/+1
| | | | minimum: unseparated terms.
* Flip eqn into using parsed nodes. I've temporarily disabled printingKristaps Dzonsons2011-07-211-1/+1
| | | | | | | 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-1/+2
| | | | | | 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-8/+1
| | | | | | | 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-1/+1
|
* Remove enum mcharst, which hasn't been used in quite some time.Kristaps Dzonsons2011-04-301-1/+1
|
* Move "chars" interface out of out.h and into mandoc.h. This doesn'tKristaps Dzonsons2011-04-291-1/+1
| | | | | | | | | | 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-6/+13
|
* Clean up superfluous variables in `Xr' handling in -Tascii.Kristaps Dzonsons2011-04-041-9/+9
|
* Fully fix the `Rv' and `Ex' handlers for -T[x]html and -Tascii. ThisKristaps Dzonsons2011-04-041-12/+15
| | | | 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-10/+15
|
* Move mandoc_isdelim() back into libmdoc.h. This fixes an unreportedKristaps Dzonsons2011-03-221-5/+27
| | | | | | | | | 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-1/+0
| | | | | 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-9/+5
| | | | | | | | | | | | 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-0/+1
| | | | 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-1/+3
| | | | | 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-20/+25
| | | | | | 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-0/+4
| | | | | 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-1/+2
| | | | | 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-2/+6
| | | | This removes a TODO raised by schwarze@.
* Push capitalisation of `Bx' second argument into validator, where it belongs.Kristaps Dzonsons2011-01-251-7/+2
|
* Properly uppercase the first-letter of the `Bx' second argument.Kristaps Dzonsons2011-01-251-2/+7
|
* Have `Bx' accept two arguments, not just one, and join these argumentsKristaps Dzonsons2011-01-251-6/+20
| | | | with "xxBSD-yy"
* If %B is specified, quote %T. Noted by schwarze@ in the TODO.Kristaps Dzonsons2011-01-251-2/+2
|
* If the first character of free-form text is whitespace, then a newlineKristaps Dzonsons2011-01-121-0/+2
| | | | shall precede outputted text (surprise!).
* Make -literal displays only have 8-character displays. From aKristaps Dzonsons2011-01-061-1/+3
| | | | 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-0/+1
| | | | | | 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-7/+22
| | | | | | 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-4/+4
| | | | the fancy double-quote.
* Implement schwarze@'s much more elegant version of my %T/%J fix.Kristaps Dzonsons2010-12-251-3/+3
|
* Specifying both %T and %J in an `Rs' block causes the title to be quotedKristaps Dzonsons2010-12-251-3/+42
| | | | | 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-24/+24
| | | | | | | | 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-29/+24
| | | | | | | 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-1/+2
| | | | | | .Bk without arguments defaults to -words. .Bk with invalid arguments (including -lines) has no effect. ok kristaps@