summaryrefslogtreecommitdiffstats
path: root/man_term.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow RS/RE blocks to nest. This requires first the syntax tree toKristaps Dzonsons2011-06-181-17/+20
| | | | | | | | accomodate for the fix, then for the front-ends. -T[x]html accepted the syntax tree natively, but -Tascii had to use relative offsets. It's quite a simple fix. From a TODO by {dcoppa,dsoares}@openbsd.
* 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.
* 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-8/+2
| | | | | | | | | | | | 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).
* Add initial libmdoc and libman top-most machinery for accepting TBLKristaps Dzonsons2011-02-061-0/+2
| | | | | directives. For now this will just ignore them (except for -Ttree, which just notes that an EQN's been accepted).
* Avoid double blank line before a table preceded by .PP.Ingo Schwarze2011-01-251-0/+3
| | | | ok kristaps@
* Fix another regression caused by the reorg of print_man_node() in rev. 1.97:Ingo Schwarze2011-01-231-0/+3
| | | | End-of-sentence spacing got lost for man(7) after plain text lines.
* Refrain from throwing fatal errors forIngo Schwarze2011-01-171-2/+2
| | | | | | | * .br .sp .nf .fi .na with arguments - just skip the arguments * .TH lacking arguments - use empty strings instead like groff * .TH with excessive arguments - skip those Reminded by joerg@, ok kristaps@.
* When processing a blank text line, do not break out of text processingIngo Schwarze2011-01-161-2/+2
| | | | | | into macro processing code. Fixing a regression introduced in 1.95, found because it caused segfaults in my regression suite. OK kristaps@
* Make -man -Tascii not break within literal lines, e.g.,Kristaps Dzonsons2011-01-121-27/+33
| | | | | | | | | | .nf .B hello world .fi Also, clean up the print_man_node() function a little bit. This problem has long since been in the TODO and was recently noted again by Brad Smith. The -T[x]html fix will follow...
* If the first character of free-form text is whitespace, then a newlineKristaps Dzonsons2011-01-121-2/+6
| | | | shall precede outputted text (surprise!).
* Don't let `in' creep past the right margin.Kristaps Dzonsons2011-01-111-0/+5
| | | | From an assertion noted by Brad (at comstyle).
* Multiple man(7) .IP and .TP fixes started during p2k10:Ingo Schwarze2011-01-041-15/+24
| | | | | | | | | | | | | | | | | | | | | Affecting both -Tascii and -Thtml: * The .IP HEAD uses the second argument as the width, not the last one. * Only print the first .IP HEAD argument, not all but the last. Affecting only -Tascii: * The .IP and .TP HEADs must be printed without literal mode, but literal mode must be restored afterwards. * After the .IP and .TP bodies, we only want term_newln(), not term_flushln(), or we would get two blank lines in literal mode. * The .TP HEAD does not use TWOSPACE, just like .IP doesn't either. * In literal mode, clear NOLPAD after each line, or subsequent lines would get no indentation whatsoever. Affecting only -Thtml: * Only print next-line .TP children, instead of all but the first. OK kristaps@ on the -Tascii part; and: "Can you work this into man_html.c, too?"
* For tbl: -man documents print an extra space before `TS' blocks.Kristaps Dzonsons2011-01-031-0/+2
|
* 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 -man support for tables. Like -mdoc, this consists of anKristaps Dzonsons2011-01-011-1/+9
| | | | | | | external-facing function man_addspan() (this required shuffling around the descope routine) and hooks elsewhere. Also fixed mdoc.c's post-validation of tables.
* Remove `i' and `r' macro handlers. These macros, originally part of theKristaps Dzonsons2010-12-081-2/+0
| | | | | | | | me package, aren't recognised by "groff -mandoc" so we don't need to do so either. Discussed on tech@ with schwarze@. While at it, remove references to `b' in man.7. As far as I know, this was never supported anyway.
* Add support for `ft' macro found in groff(7). Based on a patch byKristaps Dzonsons2010-12-061-0/+43
| | | | | schwarze@, but without the -T[x]html handling, which structurally does not work. Also add man.7 documentation (not in original patch).
* My favourite: removing lots of code in favour of smaller, tighter code.Kristaps Dzonsons2010-12-061-79/+49
| | | | | Merge patch by schwarze@ consolidating RB, BR, etc. into one function. man_html.c already does this.
* Header for `PP', `P', and `LP' should never be printed.Kristaps Dzonsons2010-12-061-1/+1
|
* Remove `Sp', `Vb', and `Ve' (as per schwarze@'s changes in OpenBSD),Kristaps Dzonsons2010-12-051-6/+1
| | | | which are now accomodated for the new libroff modifications.
* Allow string lengths to account for escapes. Now all calls to calculateKristaps Dzonsons2010-09-151-0/+4
| | | | | | | | | | | | | | | | | | | | | column width in -Tascii, -Tpdf, and -Tps will account for "more real" string lengths. Example: .Bl -tag -width \s[+123424]foo .It bar baz .El The size escape will be correctly tossed. .Bl -tag -width \(aqbar .It \(aqbar baz .El The \(aq will be correctly handled.
* Collapse `nf', `fi', `Vb', and `Ve' into one function as in man_html.c.VERSION.1.10.5.PREPDFKristaps Dzonsons2010-07-231-18/+17
|
* Added `in' macro support for -man -Tascii. This is not yet supported inKristaps Dzonsons2010-07-221-0/+43
| | | | -Thtml (I'm surprised to note that neither is LITERAL mode).
* Bring `sp', `Sp', and `br' behaviour for -man in line with how -mdoc'sKristaps Dzonsons2010-07-221-15/+10
| | | | | is handled: correctly. This removes superfluous line breaks in many -man manuals.
* Have `nf' and `fi' flush lines. This is necessary or the LITERAL willKristaps Dzonsons2010-07-221-0/+2
| | | | | | be meaningless when invoked within a non-flushing context. This based on a formatting bug report submitted by Jonathon Gray (jsg@) via Christian Weisgerber (naddy@).
* 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.
* Churn-ish check-in getting mdoc_parseln() and man_parseln() to accept aKristaps Dzonsons2010-06-261-0/+1
| | | | const struct regset pointer. No functionality.
* Initial chunks for variable-width fonts. Pushes all width calculationsKristaps Dzonsons2010-06-251-40/+38
| | | | | | | | in mdoc_term.c and man_term.c down into term.c. This is still not implemented in term.c, although stubs for width calculations are in place. From now on, offset, rmargin, and other layout variables are abstract screen widths. They will resolve to the the familiar values for -Tascii but -Tps will eventually use points instead of chars.
* Churn as I finish email address migration kth.se -> bsd.lv.Kristaps Dzonsons2010-06-191-1/+1
|
* Fix a regression that crept in in man_term.c 1.73 and mdoc_term.c 1.144.Ingo Schwarze2010-06-101-2/+2
| | | | | | | | | | | | | | | | When the title line uses special characters, mandoc will segfault. Thus, first set up the character tables, then print the header, as we always did. Found in OpenBSD /usr/src/usr.sbin/bind/bin/check/named-checkconf.8. While here, set p->tabwidth in terminal_man() for symmetry with terminal_mdoc(), as suggested by millert@ (and already committed to OpenBSD earlier). Since 5 is the default, this is not strictly required, but it is certainly clearer and more robust. "looks fine" kristaps@
* Have the standard manpage header and footer print on every page of -TpsKristaps Dzonsons2010-06-091-1/+1
| | | | | | | | | | | | | | | output. This is more tricky than you may think: we can't just call the header function out-of-state (i.e., before a flushln has occured) because we'd clobber our current state. Thus, we call at the beginning and dump the output into an auxiliary buffer. For the record, I don't think there's any other clean way to do this. The only other Way That Works is to copy-aside *all* termp state, zero it, and do the necessary headf/footf. This is just as complex, as memory needs to be alloc'd and free'd per margin. Unfortunately, this prohibits page numbering (the margin is only printed once), so I'll probably end up re-writing this down the line.
* First check-in of PostScript output. This does not change any logicKristaps Dzonsons2010-06-071-8/+14
| | | | | | within term.c, but does add a small shim over putchar() that switches on the output engine. Prints, for this initial version, only monospace and without font decorations. It's a start.
* Allow bad -man dates to flow verbatim into the front-ends. Noted byKristaps Dzonsons2010-05-261-1/+4
| | | | Ulrich Spoerlein.
* Enable the unified error/warning enumeration in mandoc.h that'sKristaps Dzonsons2010-05-171-0/+1
| | | | | | | | | | | 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.
* Add support for .AT. Properly implement .UC. Add regress tests.Joerg Sonnenberger2010-05-171-0/+1
|
* groff uses three vspaces before the footer too.Joerg Sonnenberger2010-05-171-0/+2
|
* Remove `am', `ami', `de', `dei', and `.' from -man, as they're now in the ↵Kristaps Dzonsons2010-05-151-5/+0
| | | | roff preprocessor.
* Pull `ig' out of -man and leave it the roff preparser.Kristaps Dzonsons2010-05-151-1/+0
|
* For .IP groff requires a single space only after the head, adopt.Joerg Sonnenberger2010-05-151-2/+0
|
* Make the output width an option for ascii_alloc and use that to computeJoerg Sonnenberger2010-05-151-2/+6
| | | | the default margin. Hard-code 80 chars/line for now.
* Removed restriction on integer manual sections in -man.Kristaps Dzonsons2010-05-151-1/+1
|
* End-of-sentence spacing for -man -Tascii.Kristaps Dzonsons2010-05-121-0/+3
|
* Back out OpenBSD special case (ok Ingo Schwarze).Kristaps Dzonsons2010-05-101-11/+11
|
* Proper leading spaces for new- and old-groff in -man -Tascii mode.Kristaps Dzonsons2010-05-101-1/+19
|