Repository navigation
Expand file tree
/
Copy pathREADME.1
More file actions
139 lines (93 loc) · 2.13 KB
/
Copy pathREADME.1
File metadata and controls
139 lines (93 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
.TH md2roff
\fBmd2roff\fP converts Markdown to roff source (ms or man formats)\. This is useful
for converting Markdown files to printable PDFs or generating a manpage from
a Markdown file\.
.SH Prerequisites
.TP
A lex\.
.SH Building
.RS
.ft CR
.nf
.eo
make
sudo make install
.ec
.fi
.ft R
.RE
.SH Usage
The wrapper program, \fBmd2roff\fP, must take either \fB-ms\fP or \fB-man\fP as an argument\.
Arguments for \fBmd2ms\fP and \fBmd2man\fP may be added as well\. Input and output files
are \fBstdin\fP and \fBstdout\fP by default\.
.RS
.ft CR
.nf
.eo
md2roff [-ms|-man] [-t title] [-o outputfile] [args...] [inputfile]
.ec
.fi
.ft R
.RE
Note: \fBmd2roff\fP must be installed for the wrapper to work\.
.SH Options
.SH md2ms
.RS
.ft CR
.nf
.eo
md2ms [-bnT] [-t title] [-a author] [-o outputfile] [inputfile]
.ec
.fi
.ft R
.RE
.TP
\fB-b\fP: Disable page break between the title page and contents\.
.TP
\fB-n\fP: Disable display of the current date\.
.TP
\fB-T\fP: Use the first heading (\fB#\fP) as the document title\.
.TP
\fB-t title\fP: Set the document title\.
.TP
\fB-a author\fP: Set the document author\.
.TP
\fB-o outputfile\fP: Set the output file\.
.SH md2man
.RS
.ft CR
.nf
.eo
md2man [-t title] [-o outputfile] [inputfile]
.ec
.fi
.ft R
.RE
.TP
\fB-t title\fP: Add custom title header (\fB.TH\fP)
.TP
\fB-o outputfile\fP: Set the output file\.
.SH Examples
.TP
See examples/README.pdf for a PDF version of this README generated by \fBmd2roff\fP\.
.TP
See examples/README.1 for a manpage version of this README generated by \fBmd2roff\fP\.
.RS
.ft CR
.nf
.eo
# Convert to postscript
md2roff -ms -t "My File" mymarkdown.md | groff -ms -Tps >myps.ps
# Convert to PDF
md2roff -ms -t "My File" mymarkdown.md | groff -ms -Tpdf >mypdf.pdf
# Convert to manpage
md2roff -man -t 'MYMANPAGE 1 "May 2025" "mymanpage" "User Commands"' mymarkdown.md >mymanpage.1
.ec
.fi
.ft R
.RE
.SH Bugs
If you find a bug, submit an issue, PR, or email me with a description and/or patch\.
.SH License
Copyright (c) 2019-2025 Ben O'Neill <ben@oneill\.sh>\. This work is released under the
terms of the MIT License\. See LICENSE for the license terms\.