From 3352a8e9bd0f6a0666c5dcb84ccdb5536471d280 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 13 Jun 2017 19:34:40 +0000 Subject: Partial support for the \n[an-margin] number register. Manuals autogenerated from reStructuredText are reckless enough to peek at this non-portable, implementation-dependent, highly groff-specific internal register - for no good reason, because the man(7) language natively provides in a much simpler way what they are trying to emulate here with much fragility. A full implementation would be very hard because it would require access to output-device-specific formatting data at the roff(7) preprocessor stage, which mandoc doesn't support at all. So hardcode a few magic numbers as reStructuredText expects them for terminal output. For other output modes (like HTML), code using this register is utterly broken anyway. --- regress/man/RS/Makefile | 2 +- regress/man/RS/an-margin.in | 24 ++++++++++++++++++++++++ regress/man/RS/an-margin.out_ascii | 17 +++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 regress/man/RS/an-margin.in create mode 100644 regress/man/RS/an-margin.out_ascii (limited to 'regress') diff --git a/regress/man/RS/Makefile b/regress/man/RS/Makefile index 4c62bb30..fda516e0 100644 --- a/regress/man/RS/Makefile +++ b/regress/man/RS/Makefile @@ -1,6 +1,6 @@ # $OpenBSD: Makefile,v 1.11 2015/04/06 13:34:54 schwarze Exp $ -REGRESS_TARGETS = breaking broken empty literal lonelyRE +REGRESS_TARGETS = an-margin breaking broken empty literal lonelyRE REGRESS_TARGETS += nested noRE nowidth REarg width LINT_TARGETS = empty lonelyRE noRE REarg diff --git a/regress/man/RS/an-margin.in b/regress/man/RS/an-margin.in new file mode 100644 index 00000000..b14b2cae --- /dev/null +++ b/regress/man/RS/an-margin.in @@ -0,0 +1,24 @@ +.TH RS-AN-MARGIN 1 "June 13, 2017" OpenBSD +.SH NAME +RS-an-margin \- reStructuredText peeks at an internal register +.SH DESCRIPTION +regular +text +.RS 0.0 +zero +indent +\n[an-margin] +.RS 3.5 +non-zero +indent +\n[an-margin] +.RE +back to +zero +indent +\n[an-margin] +.RE +back to +regular +text +\n[an-margin] diff --git a/regress/man/RS/an-margin.out_ascii b/regress/man/RS/an-margin.out_ascii new file mode 100644 index 00000000..be41d4ec --- /dev/null +++ b/regress/man/RS/an-margin.out_ascii @@ -0,0 +1,17 @@ +RS-AN-MARGIN(1) General Commands Manual RS-AN-MARGIN(1) + + + +NNAAMMEE + RS-an-margin - reStructuredText peeks at an internal register + +DDEESSCCRRIIPPTTIIOONN + regular text + zero indent 168 + non-zero indent 252 + back to zero indent 168 + back to regular text 168 + + + +OpenBSD June 13, 2017 RS-AN-MARGIN(1) -- cgit v1.2.3-56-ge451