Comments (7)
Debian bug #1043256 has even more context.
from lowdown.
Hi faidon. This is a tricky one... can you keep an eye on these commits and see if they work for you?
pandoc uses an .ie
clause in the header and uses a custom V
font, which doesn't play well with mandoc. My solution is to use B
(bold font) for -tman and C
(constant-width) for -tms by default. The user can override this with --nroff-code-font, which I've not yet finalised upon or documented. (Later commits wihle I ruminate.)
This, I think, sets some useful defaults while letting the user override the output, playing reasonably well with groff and mandoc.
from lowdown.
Thomas Dickey recently merged changes from me to his ncurses man pages that look like this.
.ie n .ds CW R
.el \{
.ie \n(.g .ds CW CR
.el .ds CW CW
.\}
.ft \*(CW
This defines a roff string named "CW". Translated to English, this means...
- If formatting for a terminal (that is, "in nroff mode"), define the string as "R" (the roman style--always available).
- Otherwise, we are formatting for a typesetter.
- If the formatter claims groff compatibility, use the font name "CR" ("Courier roman").
- Otherwise, use the font name "CW" ("constant-width", from Unix System III troff and later).
- There has not been such a thing as BSD troff since before Networking Release/2 (1991), before the CSRG disbanded. (When there was, it was descended from Seventh Edition Unix (1979) troff--in other words, before Kernighan's changes for device independence, and it too did not support the "CW" font name.) In Net/2, BSD adopted groff.
This should cover all the bases.
- Any version of groff will do the right thing.
- mandoc will do the right thing because it always claims to be in nroff mode, and it understands the
ds
,ft
,ie
, andel
requests, and string interpolation escape sequence syntax, well enough to cope. - AT&T troff, nowadays seen only in Documenter's Workbench (DWB) 3.3 troff (which I think only roff developers like me ever use) and proprietary Unices like Solaris and HP-UX (and sometimes not even those due to adoption of groff, as in Solaris 11) will do the right thing because that troff doesn't define the
.g
register, (by convention) claiming groff compatibility. The font name "CW" may not work on all AT&T troff output devices, but all of the ones supported by DWB 3.3 troff do support one, and the program issues a diagnostic if a font is unavailable. - Heirloom Doctools troff will emulate either groff or AT&T troff, as configured by the user.
The only aspect of this solution that I (and, I would guess, mandoc maintainer @ischwarze) don't like is the resort to conditional requests and string definitions, because as a general rule, employment of formatter requests in man pages makes them less portable. But there's really no way around this if one wants portability for this specific problem--the referenced pandoc issue explains why--without giving up the use of monospaced fonts altogether when typesetting man(7) pages, which people are generally not willing to do.
groff man(7)'s macros EX
and EE
are an alternative--if one is willing to embrace a Ninth Edition Unix (1986) extension--but are not fully suitable if one wants to use a monospaced font in a tbl(1) table, or "inline" amid proportional type. Details available on request.
from lowdown.
pandoc uses an
.ie
clause in the header and uses a customV
font, which doesn't play well with mandoc.
pandoc doesn't do this anymore.
from lowdown.
If pandoc's going to make a stand on using CR
, I'll do the same as a default. However, I'll keep the option available for people to override (e.g., with bold for terminals).
from lowdown.
If the new support looks good to you, please close out this issue. Thanks!
from lowdown.
LGTM! @g-branden-robinson may have more thoughts as the expert, but I'll stay optimistic and close the issue.
from lowdown.
Related Issues (20)
- Suggestion for superscript HOT 2
- typographical quotes not always replaced HOT 2
- Support for Pandoc's metadata block HOT 1
- Question: Accept gemini as an input format ? HOT 1
- Bug with pipe_tables HOT 1
- bsd.lv website down HOT 2
- ABI & SONAME bumps HOT 6
- [Bug] Metadata shown (shouldn't) with: -tterm -stterm -stms as main text HOT 4
- lacks `uninstall` and `uninstall_libs` targets HOT 2
- Using <div> with inline HTML causes incorrect parsing HOT 4
- [Feature request] Add option to control or disable indentation of paragraphs in terminal output HOT 2
- Build failure with MinGW HOT 3
- Directly construsting the AST HOT 2
- Render back to markdown
- -tlatex seems to need xfrac package for PDF if source includes fractions HOT 1
- 1.1.0 refuses to build from not detecting strtonum
- Weirdness with whitespace before code blocks
- Manual and actual lowdown disagree on `term-all-metadata` flag
- Gemini output prints smart punctuation characters as "รข" (hex codepoint e2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lowdown.