CVS log for mandoc/tag.h

[BACK] Up to [cvsweb.bsd.lv] / mandoc

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.14 / (download) - annotate - [select for diffs], Sat Apr 18 20:40:10 2020 UTC (9 months, 1 week ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (unified)

When a .Tg is attached to a paragraph, attach the permalink
to the first word, or the first few words if they are short.

Revision 1.13 / (download) - annotate - [select for diffs], Tue Apr 7 22:56:02 2020 UTC (9 months, 2 weeks ago) by schwarze
Branch: MAIN
Changes since 1.12: +2 -1 lines
Diff to previous 1.12 (unified)

Separate the place to put the <a href> permalink (now marked
with NODE_HREF) from the target element of the link (still marked
with NODE_ID).  In many cases, use this to move the target to the
beginning of the paragraph, such that readers don't get dropped
into the middle of a sentence.

Revision 1.12 / (download) - annotate - [select for diffs], Thu Apr 2 22:12:55 2020 UTC (9 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.11: +2 -12 lines
Diff to previous 1.11 (unified)

When the last file formatted yielded no tags, the tags file got
deleted before starting the pager, even when earlier input files
had written to it; thanks to weerd@ for reporting that bug.

Since we now generate tags for section headers, we almost always
generate at least some.  Consequently, while fixing the above bug,
simplify the code by never deleting the tags file before the pager
exits, not even in the rare case that the file happens to be empty.
Hence, this patch is -75 +63 LOC even though it fixes two bugs.

While deleting the output files belongs after exit from the pager,
closing them should be done before it is started.  Collect the
related code, which was scattered in various places, to where
it belongs, in a dedicated function in the term_tag.c module.
As a side benefit, never fclose(2) stdout, only dup2(2) to it.

Similarly, when the -O tag argument wasn't found in the last file
formatted, there was a complaint about "no such tag" even when the
argument did occur in earlier files.  Fix that by looking for a
matching tag after every formatted file rather than just once at
the very end.  Given that command line arguments aren't properties
of the file(s) being formatted, that check is a job for the main
program, not for the formatters, so while fixing the check, move
it from term_tag.c to main.c.

Revision 1.11 / (download) - annotate - [select for diffs], Fri Mar 13 15:32:29 2020 UTC (10 months, 1 week ago) by schwarze
Branch: MAIN
Changes since 1.10: +15 -14 lines
Diff to previous 1.10 (unified)

Split tagging into a validation part including prioritization
in tag.{h,c} and {mdoc,man}_validate.c
and into a formatting part including command line argument checking
in term_tag.{h,c}, html.c, and {mdoc|man}_{term|html}.c.

Immediate functional benefits include:
* Improved prioritization of automatic tags for .Em and .Sy.
* Avoiding bogus automatic tags when .Em, .Fn, or .Sy are explicitly tagged.
* Explicit tagging of .Er and .Fl now works in HTML output.
* Automatic tagging of .IP and .TP now works in HTML output.
But mainly, this patch provides clean earth to build further improvements on.

Technical changes:
* Main program: Write a tag file for ASCII and UTF-8 output only.
* All formatters: There is no more need to delay writing the tags.
* mdoc(7)+man(7) formatters: No more need for elaborate syntax tree inspection.
* HTML formatter: If available, use the "string" attribute as the tag.
* HTML formatter: New function to write permalinks, to reduce code duplication.

Style cleanup in the vicinity while here:
* mdoc(7) terminal formatter: To set up bold font for children,
defer to termp_bold_pre() rather than calling term_fontpush() manually.
* mdoc(7) terminal formatter: Garbage collect some duplicate functions.
* mdoc(7) HTML formatter: Unify <code> handling, delete redundant functions.
* Where possible, use switch statements rather than if cascades.
* Get rid of some more Yoda notation.

The necessity for such changes was first discussed with kn@, but i didn't
bother him with a request to review the resulting -673/+782 line patch.

Revision 1.10 / (download) - annotate - [select for diffs], Mon Jan 20 10:37:15 2020 UTC (12 months ago) by schwarze
Branch: MAIN
Changes since 1.9: +13 -2 lines
Diff to previous 1.9 (unified)

Make the code more readable by introducing
symbolic constants for tagging priorities.
This review also made me find a minor bug: do not upgrade
TAG_FALLBACK to TAG_WEAK when there is trailing whitespace.

Revision 1.9 / (download) - annotate - [select for diffs], Sat Jul 27 13:40:57 2019 UTC (17 months, 4 weeks ago) by schwarze
Branch: MAIN
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (unified)

Move two more output state variables into the new struct outstate.
Also, move setting of tag_files.tagname into tag_init().
No functional change.

Revision 1.8 / (download) - annotate - [select for diffs], Thu Nov 22 11:30:23 2018 UTC (2 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_5
Changes since 1.7: +2 -1 lines
Diff to previous 1.7 (unified)

In -T locale (the default), -T ascii, and -T utf8 mode, provide a new
output option -O tag[=term] to move right to the definition of "term" when
opening the manual page in a pager, effectively porting the -T html
fragment name feature - https://man.openbsd.org/ksh#ulimit - to the
terminal.  Try:

$ man -O tag uvm_sysctl
$ man -O tag=ulimit ksh
$ man -O tag 3 compress

Feature development triggered by a question from kn@.  Klemens also
tested, provided feedback that resulted in improvements, and provided
an OK.

Revision 1.7 / (download) - annotate - [select for diffs], Fri Nov 20 21:59:54 2015 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_4, VERSION_1_14_3, VERSION_1_14_2, VERSION_1_14_1, VERSION_1_13_4, VERSION_1_13
Changes since 1.6: +3 -1 lines
Diff to previous 1.6 (unified)

Fix multiple issues regarding process group and signal mask handling
found by tb@ and millert@; parts of the code, in particular in tag.c,
by millert@; OK millert@.

Revision 1.6 / (download) - annotate - [select for diffs], Sat Nov 7 14:01:16 2015 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.5: +1 -4 lines
Diff to previous 1.5 (unified)

In private header files, __BEGIN_DECLS and __END_DECLS are pointless.
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.

Revision 1.5 / (download) - annotate - [select for diffs], Tue Jul 28 18:38:55 2015 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.4: +9 -2 lines
Diff to previous 1.4 (unified)

Remove the hack of scrolling forward and backward with +G1G that
many (jmc@, millert@, espie@, deraadt@) considered revolting.
Instead, when using a pager, since we are using a temporary file
for tags anyway, use another temporary file for the formatted
page(s), as suggested by millert@ and similar to what the traditional
BSD man(1) did, except that we use only one single temporary output
file rather than one for each formatted manual page, such that
searching (both with / and :t) works across all the displayed files.

Revision 1.4 / (download) - annotate - [select for diffs], Sat Jul 25 14:28:59 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.3: +2 -3 lines
Diff to previous 1.3 (unified)

Simplify and make tag_put() more efficient by integrating tag_get()
into it and by only handling NUL-terminated strings.
Minus 25 lines of code, no functional change.

Revision 1.3 / (download) - annotate - [select for diffs], Sat Jul 25 14:02:06 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.2: +3 -3 lines
Diff to previous 1.2 (unified)

basic support for tag priorities; written at YYC

Revision 1.2 / (download) - annotate - [select for diffs], Tue Jul 21 03:26:22 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.1: +2 -3 lines
Diff to previous 1.1 (unified)

When creation of the temporary tags file fails, call the pager
without the -T option, because otherwise the pager won't even start.
Fixing a bug reported by jca@.

While here, shorten the code by two lines
and delete one internal interface function.

Revision 1.1 / (download) - annotate - [select for diffs], Fri Jul 17 22:38:29 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN

Initial, still somewhat experimental implementation to leverage
less(1) -T and :t ctags(1)-like functionality to jump to the
definitions of various terms inside manual pages.
To be polished in the tree, so bear with me and report issues.

Technically, if less(1) is used as a pager, information is collected
by the mdoc(7) terminal formatter, first stored using the ohash
library, then ultimately written to a temporary file which is passed
to less via -T.  No change intended for other output formatters or
when running without a pager.

Based on an idea from Kristaps using feedback from many, in particular
phessler@ nicm@ millert@ halex@ doug@ kspillner@ deraadt@.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb