-
Notifications
You must be signed in to change notification settings - Fork 23
/
md2man
executable file
·67 lines (43 loc) · 1.81 KB
/
md2man
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
#!/usr/bin/env ruby
=begin =======================================================================
# MD2MAN 1 2012-07-05 1.2.1
## NAME
md2man - convert markdown(7) into roff(7)
## SYNOPSIS
`md2man` [*OPTION*]... [*FILE*]
## DESCRIPTION
[md2man] converts markdown(7) input from the given *FILE* into roff(7) using
[Redcarpet] and then prints the result to the standard output stream. If
*FILE* is not given, then the standard input stream is read in its place.
### Document format
md2man extends markdown(7) syntax in the following ways, as provisioned in the
`Md2Man::Document` module and defined in its derivative `Md2Man::Roff` module:
* Paragraphs whose lines are all uniformly indented by two spaces are
considered to be "indented paragraphs". They are unindented accordingly
before emission as `.IP` in the roff(7) output.
* Paragraphs whose subsequent lines (all except the first) are uniformly
indented by two spaces are considered to be a "tagged paragraphs". They
are unindented accordingly before emission as `.TP` in the roff(7) output.
md2man extends markdown(7) semantics in the following ways:
* There can be at most one top-level heading (H1). It is emitted as `.TH`
in the roff(7) output to define the UNIX manual page's header and footer.
### Markdown extensions
The following [Redcarpet] extensions are enabled while processing markdown(7):
* tables
* autolink
* superscript
* strikethrough
* no_intra_emphasis
* fenced_code_blocks
## OPTIONS
`-h`, `--help`
Show this help manual.
## SEE ALSO
markdown(7), roff(7)
[md2man]: https://github.com/sunaku/md2man
[Redcarpet]: https://github.com/tanoku/redcarpet
=end =========================================================================
require 'binman'
BinMan.help
require 'md2man'
puts Md2Man::ENGINE.render(ARGF.read)