summaryrefslogtreecommitdiff
path: root/tmac/doc.tmac
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2022-12-18 13:41:44 -0600
committerG. Branden Robinson <g.branden.robinson@gmail.com>2022-12-18 19:07:34 -0600
commitd0ae281616da88d55134d877fdc3735df5cde8dc (patch)
tree66a194cc3c1c42fbad7331055a82592c62418c82 /tmac/doc.tmac
parent7fd9e589d86b6916a254a03cc359db6281c7aaf0 (diff)
downloadgroff-git-d0ae281616da88d55134d877fdc3735df5cde8dc.tar.gz
[mdoc]: Support `FT` register.
* tmac/doc.tmac (initialization): Add logic supporting `FT` register just as our man(7) implementation does. * tmac/mdoc/doc-common (doc-set-up-titles): Plant footer trap in validated user-requested location. * tmac/groff_mdoc.7.man (Options): Document it. * NEWS: Update item. Fixes part of <https://savannah.gnu.org/bugs/?63046>.
Diffstat (limited to 'tmac/doc.tmac')
-rw-r--r--tmac/doc.tmac38
1 files changed, 38 insertions, 0 deletions
diff --git a/tmac/doc.tmac b/tmac/doc.tmac
index 4edc408f6..587cef1ee 100644
--- a/tmac/doc.tmac
+++ b/tmac/doc.tmac
@@ -117,6 +117,44 @@
. nr D 0
. \}
.
+.\" footer distance
+.\"
+.\" Unlike most of these parameters, we do not set a default for FT; the
+.\" doc-set-up-titles macro places page location traps only if not
+.\" continuously rendering.
+.if r FT \{\
+. \" Validate it. Continuous rendering ignores FT. Measuring a footer
+. \" distance from the page top isn't done. A footer distance of over
+. \" half the page length is unlikely. A footer distance of less than
+. \" one line height is too.
+. ie \n[cR] \
+. ds doc-msg footer distance when continuously rendering\"
+. el \{\
+. nr doc-tmp 1v
+. ds doc-help " (1v=\n[doc-tmp]u)\"
+. ie (\n[FT] : (\n[FT] = 0)) \
+. ds doc-msg non-negative footer distance: \n[FT]u\*[doc-help]\"
+. el \{\
+. ie (-(\n[FT]) > (\n[.p] / 2)) \{\
+. ds doc-msg implausibly large footer distance:\"
+. as doc-msg " \n[FT]u\*[doc-help]\"
+. \}
+. el \
+. if (-(\n[FT]) < 1v) \{\
+. ds doc-msg implausibly small footer distance:\"
+. as doc-msg " \n[FT]u\*[doc-help]\"
+. \}
+. rm doc-help
+. rr doc-tmp
+. \}
+. \}
+. if d doc-msg \{\
+. tm mdoc: ignoring \*[doc-msg]
+. rr FT
+. rm doc-msg
+. \}
+.\}
+.
.\" TODO: Implement HF string.
.
.\" \n[HY] is recognized for groff_man(7) compatibility, particuarly via