| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
| |
found while syncing to OpenBSD
|
|
|
|
| |
minimum: unseparated terms.
|
|
|
|
|
|
| |
little else. Also remove the check for __STDC_ISO_10646__. It turns
out that very few systems---even those that support it---actually
declare this and it's just causing problems instead of being useful.
|
|
|
|
|
|
|
| |
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().
|
|
|
|
|
|
| |
which only held one entry; finally (as per the first), make "ps" member into a
pointer managed by term_ps.c. This frees up a nice chunk of memory during
run-time and in the binary.
|
|
|
|
| |
indexing into arrays, so this removes lots of casts from size_t to int.
|
|
|
|
|
|
| |
consist of type "int". This will take more work (especially in encode and
friends), but this is a strong start. This commit also consists of some
harmless lint fixes.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(isn't now, but will need to be, used by -T[x]html also). Necessitated
a lot of churn in getting tbl_calc* code out of tbl_term.c and into
out.c, including renaming some structures and so on. The abstraction is
in having a pointer to a wrapper function for calculating string widths.
The char devices use term_strlen and term_len; the others will probably
just use strlen().
While at it, remove some superfluous assertions in the tbl code. This
allows all tbl manuals to clear.
Lastly, set the right-margin to be the maximum margin for each table
span. This allows big, complicated tbl-pages like terminfo to be
displayed. They're ugly, but they work.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
for front-ends to make decisions about widths, not the back-end.
To pull this off, first make each tbl_head contain a unique index value
(0 <= index < total tbl_head elements) and remove the tbl_calc() routine
from the back-end.
Then, when encountering the first tbl_span in the front-end, dynamically
create an array of configurations (termp_tbl) keyed on each tbl_head's
unique index value. Construct the decimals and widths at this time,
then continue parsing as before.
The termp_tbl and indexes are required because we pass a const tbl AST
into the front-end.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
single and multiple-manual mode (e.g., mandoc -Tpdf foo.1 bar.1).
|
|
|
|
|
|
|
|
|
|
| |
It's currently missing the xref table, so you'll get a warning in most
PDF viewers). It also produces lots of redundant output, which will go
away once I get a better handle on the PDF spec. The code doesn't
really touch any existing functionality; it's a bunch of conditionals
atop the -Tps (term_ps.c) implementation. I'm checking it in now to
have it exist and be auditable. It needs clean-up, polish, and general
care (and xref!).
|
|
|
|
| |
ok kristaps@
|
|
|
|
|
| |
Also renamed "psstate" -> "flags" (was wrongly implying some sort of
state machine).
|
|
|
|
| |
termp_ps) to arbitrarily scale font. Tested with 10 (default), 12, 14.
|
| |
|
| |
|
|
|
|
| |
glyph units to make positioning more precise.
|
|
|
|
|
| |
constructs. Push the stupid CPP defines for page boundaries and margins
into proper variables. Give enum termfont a proper TERMFONT__MAX.
|
|
|
|
|
| |
restructured to make a bit more readable. Also removed an unused entry
in the PS engine structure.
|
|
|
|
| |
OK and one stylistic tweak by kristaps@.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
TERMFONT_BOLD (Courier-Bold) and TERMFONT_UNDER (Courier-Oblique). It
doesn't look half bad. This accomplished through tricksy juggling of
the one-char back-buffer.
|
|
|
|
| |
simple state machine. This paves the way for decorated text.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Made low-level engine functions into function pointers.
|
|
|
|
|
| |
terminal_free() in favour of ps_free() and ascii_free(). Moved ps_*()
functions into term_ps.c so that they don't clutter up term.c.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
save the visual cursor position in term_flushln()
and use that to avoid multiple blank lines in nested lists while
still putting subsequent empty list tags each on their own line;
"go ahead" kristaps@
|
|
|
|
|
|
|
|
| |
and outside. In literal context, tab stops are at each eigth column;
outside, they are at each fifth column.
from OpenBSD mdoc_term.c rev. 1.75;
"commit" kristaps@
|
|
|
|
| |
the default margin. Hard-code 80 chars/line for now.
|
|
|
|
| |
output engine with flag.
|
| |
|
|
|
|
| |
between parse sequences.
|
|
|
|
|
|
|
|
|
| |
bold and underline, we use a stack (no cascading, no double-font-mode).
Font modes with \f only affect the current stack point, as documented in
mdoc.7 and man.7. While -mdoc stacks fonts with embedded macros, -man
replaces them (the stack is always size 1). This works for all
invocations in supported systems' manual corpora to date. It doesn't
support groff's insanity with line-scoped \f as documented in mdoc.7.
|
| |
|
|
|
|
| |
syntax for scaling widths: -mdoc assumes no unit means that the value is a string literal while -man instead uses the default vertical/horizontal scale.
|
|
|
|
| |
Terminal scaling backend pushed into term.c.
|
|
|
|
| |
More html work.
|
|
|
|
| |
Put err() functions back into front-ends (no use making it needlessly complex).
|
|
|
|
|
|
| |
increments.
Cleaned up confusing behaviour of p->flags.
|
|
|
|
| |
Improved handling of libman `IP' macro (still needs work).
|
|
|
|
| |
strings and escape characters, respectively.
|
| |
|
| |
|
|
|
|
| |
Pre-testing.
|