| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
parsed earlier, so they will have to be saved for reuse - but the
read.c preparser does not know yet whether a line contains a .while
request before passing it to the roff parser. To cope with that,
save all parsed lines for now. Even shortens the code by 20 lines.
|
|
|
|
|
|
|
|
| |
* Make enum rofft an internal interface as enum roff_tok in "roff.h".
* Represent mdoc and man macros in enum roff_tok.
* Make TOKEN_NONE a proper enum value and use it throughout.
* Put the prologue macros first in the macro tables.
* Unify mdoc_macroname[] and man_macroname[] into roff_name[].
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because these work slightly differently on different systems,
they are becoming a maintenance burden in the portable version,
so delete them.
Besides, one of the chief design goals of the mandoc toolbox is to
make sure that nothing related to documentation requires C++.
Consequently, linking mandoc against any kind of C++ program would
defeat the purpose and is not supported.
I don't understand why kristaps@ added them in the first place.
|
| |
|
|
|
|
|
|
|
|
| |
No functional change except that for mdoc(7), it now skips leading
escape sequences just like it already did for man(7).
Escape sequences rarely occur in mdoc(7) code and if they do,
skipping them is an improvement in this context.
Minus 30 lines of code.
|
|
|
|
|
|
| |
man_node() from the mandoc(3) semi-public interface and the internal
wrapper functions print_mdoc() and print_man() from the HTML formatters.
Minus 60 lines of code, no functional change.
|
|
|
|
|
| |
Almost completely mechanical, no functional change.
Written on the train from Exeter to London returning from p2k15.
|
|
|
|
|
| |
Replace struct mdoc_meta and struct man_meta by a unified struct roff_meta.
Written of the train from London to Exeter on the way to p2k15.
|
|
|
|
|
|
|
|
|
| |
Replace struct mdoc_node and struct man_node by a unified struct roff_node.
To be able to use the tok member for both mdoc(7) and man(7) without
defining all the macros in roff.h, sacrifice a tiny bit of type safety
and make tok an int rather than an enum.
Almost mechanical, no functional change.
Written on the Eurostar from Bruxelles to London on the way to p2k15.
|
|
|
|
|
|
| |
Replace enum mdoc_type and enum man_type by a unified enum roff_type.
Almost mechanical, no functional change.
Written on the ICE train from Frankfurt to Bruxelles on the way to p2k15.
|
|
|
|
|
| |
parser. Simplify the code by moving it into the roff(7) parser, also
making it work for mdoc(7).
|
|
|
|
|
|
|
| |
because negative indents can get truncated, in which case we no longer
know how to restore the original indent at the end of the block.
This also solves another case of effectively infinite output found
by jsg@ with afl, triggered by very large negative indents.
|
| |
|
|
|
|
| |
and some cleanup; no functional change, minus 70 lines.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
when they are meaningful, to avoid confusing stuff like this:
$ mandoc /dev/null
mandoc: /dev/null:0:1: FATAL: not a manual
Instead, just say:
mandoc: /dev/null: FATAL: not a manual
Another example this applies to is documents having a prologue,
but lacking a body. Do not throw a FATAL error for these; instead,
issue a WARNING and show the empty document, in the man(7) case with
the same amount of blank lines as groff does. Also downgrade mdoc(7)
documents having content before the first .Sh from FATAL to WARNING.
|
|
|
|
|
| |
Found by naddy@ in the textproc/enchant(1) port.
Of course, do not use this in new manuals.
|
|
|
|
|
|
| |
entries for .Nd in mandocdb(8), instead use the macro content
recursively. This improves indexing of more than 200 manuals
in Xenocara, i.e. more than 15%, in particular GL and some Xkb.
|
|
|
|
|
|
|
|
| |
man-ext macros by Eric S. Raymond, enabled by default in groff_man(7).
Usual disclaimer: You don't write new man(7) code, so you are not going
to use these, either.
Improves e.g. the bzr(1) and etherape(1) manuals.
Thanks to naddy@ for bringing these to my attention.
|
|
|
|
|
| |
Do not use this, it is not portable and only defined in esr's man-ext.
For example, sox(1) wants these macros.
|
|
|
|
| |
some man(7) changes to accomodate for the an-ext compatibility.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
replaced by file) input. This replaces earlier behaviour of doing
nothing, which I found unexpected (mandoc should always output).
This requires a buffer in read.c that saves the input lines before being
parsed, with a special hook if `so' is invoked. This buffer is just
flushed to output if -mman is the input.
While mucking around doing this, I also alpha-ordered the mandoc.h
functions.
Ok schwarze@, with no screaming when the polished patch was published.
|
|
|
|
| |
used for `RE'.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
stuff into libmandoc.h, including old mdoc.h/man.h/roff.h functions now
used by read.c. The motivation behind this is to tighten the
relationship between the underlying compilers while keeping parse data
hidden from general callers (e.g., main.c).
While here, also move register values from mandoc.h into libmandoc.h as
noted by schwarze@. See above for explanation.
|
|
|
|
|
|
|
|
|
| |
libroff, etc., etc.) route into mandoc_msg() and mandoc_vmsg(), for the
time being in libmandoc.h. This requires struct mparse to be passed
into the allocation routines instead of mandocmsg and a void pointer.
Then, move some of the functionality of the old mmsg() into read.c's
mparse_mmsg() (check against wlevel and setting of file_status) and use
main.c's mmsg() as simply a printing tool.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
| |
statements in the post-handler for EQN in -mdoc and -man.
|
|
|
|
|
| |
directives. For now this will just ignore them (except for -Ttree,
which just notes that an EQN's been accepted).
|
|
|
|
| |
shall precede outputted text (surprise!).
|
|
|
|
|
|
|
| |
external-facing function man_addspan() (this required shuffling around
the descope routine) and hooks elsewhere.
Also fixed mdoc.c's post-validation of tables.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
schwarze@, but without the -T[x]html handling, which structurally does
not work. Also add man.7 documentation (not in original patch).
|
|
|
|
| |
which are now accomodated for the new libroff modifications.
|
|
|
|
| |
While I'm add it, properly document all structures in these files.
|
|
|
|
|
| |
slow process of logically splitting formatting frontend and parser backend
without pollution.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
I checked that substantial changes were committed
to these files during these years.
|
|
|
|
| |
-Thtml (I'm surprised to note that neither is LITERAL mode).
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
functionality and UGLY works quite well thanks to schwarze@'s careful
attention.
This also backs out function-prototype changes for struct regset,
instead stuffing a pointer to the regset directly into struct
mdoc/man/roff.
|
|
|
|
| |
const struct regset pointer. No functionality.
|
| |
|
|
|
|
| |
Ulrich Spoerlein.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
Allow roff_parseln() to manipulate the line buffer offset. This is used
in situations like `.ie n .TH FOO 1' or `.ie n .ie n', where the line
buffer offset is recalculated then the roff parser re-run.
Fix mdoc_parseln() and man_parseln() to accept the initial line offset.
WARNING: backed-out ALL roff macros whilst accomodating for how roff
handles multi-line conditionals (in short, re-running the parser).
|
|
|
|
| |
roff preprocessor.
|
| |
|
| |
|