md2man 1.6.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +24 -43
- data/VERSION.markdown +36 -0
- data/bin/md2man-html +11 -14
- data/bin/md2man-rake +2 -2
- data/bin/md2man-roff +49 -0
- data/lib/md2man/document.rb +12 -41
- data/lib/md2man/html/engine.rb +2 -4
- data/lib/md2man/html.rb +9 -15
- data/lib/md2man/rakefile/style.css +9 -9
- data/lib/md2man/rakefile.rb +4 -6
- data/lib/md2man/{engine.rb → roff/engine.rb} +5 -4
- data/lib/md2man/roff.rb +6 -8
- data/lib/md2man/version.rb +1 -1
- data/lib/md2man.rb +0 -1
- data/man/index.html +2 -2
- data/man/man0/README.html +76 -61
- data/man/man0/README.markdown +24 -43
- data/man/man0/VERSION.html +41 -9
- data/man/man0/VERSION.markdown +36 -0
- data/man/man1/md2man-html.1 +19 -18
- data/man/man1/md2man-html.1.html +10 -7
- data/man/man1/md2man-rake.1 +4 -3
- data/man/man1/md2man-rake.1.html +7 -5
- data/man/man1/md2man-roff.1 +53 -0
- data/man/man1/md2man-roff.1.html +21 -0
- data/man/man5/md2man.5 +116 -0
- data/man/man5/md2man.5.html +64 -0
- data/man/man5/md2man.5.markdown +91 -0
- data/man/style.css +9 -9
- data/test/md2man/html_test.rb +31 -7
- data/test/md2man/roff_test.rb +46 -7
- metadata +11 -8
- data/bin/md2man +0 -67
- data/man/man1/md2man.1 +0 -84
- data/man/man1/md2man.1.html +0 -37
@@ -0,0 +1,53 @@
|
|
1
|
+
.TH MD2MAN\-ROFF 1 2013\-05\-05 2.0.0
|
2
|
+
.SH NAME
|
3
|
+
.PP
|
4
|
+
md2man\-roff \- convert
|
5
|
+
.BR md2man (5)
|
6
|
+
flavored
|
7
|
+
.BR markdown (7)
|
8
|
+
into
|
9
|
+
.BR roff (7)
|
10
|
+
.SH SYNOPSIS
|
11
|
+
.PP
|
12
|
+
\fB\fCmd2man-roff\fR [\fIOPTION\fP]... [\fIFILE\fP]
|
13
|
+
.SH DESCRIPTION
|
14
|
+
.PP
|
15
|
+
This program converts
|
16
|
+
.BR md2man (5)
|
17
|
+
flavored
|
18
|
+
.BR markdown (7)
|
19
|
+
input from the given
|
20
|
+
\fIFILE\fP into
|
21
|
+
.BR roff (7)
|
22
|
+
and then prints the result to the standard output stream.
|
23
|
+
If \fIFILE\fP is not given, then the standard input stream is read in its place.
|
24
|
+
.SS Limitations
|
25
|
+
.PP
|
26
|
+
This program does not convert the following Redcarpet
|
27
|
+
.UR https://github.com/vmg/redcarpet
|
28
|
+
.UE
|
29
|
+
nodes into
|
30
|
+
.BR roff (7):
|
31
|
+
.RS
|
32
|
+
.IP \(bu 2
|
33
|
+
\fB\fCblock_html\fR
|
34
|
+
.IP \(bu 2
|
35
|
+
\fB\fCstrikethrough\fR
|
36
|
+
.IP \(bu 2
|
37
|
+
\fB\fCsuperscript\fR
|
38
|
+
.IP \(bu 2
|
39
|
+
\fB\fCimage\fR
|
40
|
+
.IP \(bu 2
|
41
|
+
\fB\fCraw_html\fR
|
42
|
+
.RE
|
43
|
+
.PP
|
44
|
+
It issues a warning when it encounters these instead. Patches are welcome!
|
45
|
+
.SH OPTIONS
|
46
|
+
.TP
|
47
|
+
\fB\fC-h\fR, \fB\fC--help\fR
|
48
|
+
Show this help manual.
|
49
|
+
.SH SEE ALSO
|
50
|
+
.PP
|
51
|
+
.BR md2man-html (1),
|
52
|
+
.BR md2man-rake (1),
|
53
|
+
.BR md2man (5)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8" />
|
5
|
+
<meta name="generator" content="md2man 2.0.0 https://github.com/sunaku/md2man" />
|
6
|
+
<title>md2man-roff(1) — convert md2man(5) flavored markdown(7) into roff(7)</title>
|
7
|
+
<link rel="stylesheet" href="../style.css"/>
|
8
|
+
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
9
|
+
</head>
|
10
|
+
<body><div class="navbar"><div class="navbar-inner"><span class="brand"><a href="../index.html#man1">man1</a>/md2man-roff.1</span></div></div><div class="container-fluid"><h1 id="MD2MAN-ROFF-1-2013-05-05-2-0-0">MD2MAN-ROFF 1 2013-05-05 2.0.0</h1><h2 id="NAME">NAME</h2><p>md2man-roff - convert <a class="md2man-xref" href="../man5/md2man.5.html">md2man(5)</a> flavored <a class="md2man-xref">markdown(7)</a> into <a class="md2man-xref">roff(7)</a></p><h2 id="SYNOPSIS">SYNOPSIS</h2><p><code>md2man-roff</code> [<em>OPTION</em>]... [<em>FILE</em>]</p><h2 id="DESCRIPTION">DESCRIPTION</h2><p>This program converts <a class="md2man-xref" href="../man5/md2man.5.html">md2man(5)</a> flavored <a class="md2man-xref">markdown(7)</a> input from the given
|
11
|
+
<em>FILE</em> into <a class="md2man-xref">roff(7)</a> and then prints the result to the standard output stream.
|
12
|
+
If <em>FILE</em> is not given, then the standard input stream is read in its place.</p><h3 id="Limitations">Limitations</h3><p>This program does not convert the following <a href="https://github.com/vmg/redcarpet">Redcarpet</a> nodes into <a class="md2man-xref">roff(7)</a>:</p>
|
13
|
+
<ul>
|
14
|
+
<li><code>block_html</code></li>
|
15
|
+
<li><code>strikethrough</code></li>
|
16
|
+
<li><code>superscript</code></li>
|
17
|
+
<li><code>image</code></li>
|
18
|
+
<li><code>raw_html</code></li>
|
19
|
+
</ul>
|
20
|
+
<p>It issues a warning when it encounters these instead. Patches are welcome!</p><h2 id="OPTIONS">OPTIONS</h2><dl><dt><code>-h</code>, <code>--help</code></dt><dd>Show this help manual.</dd></dl><h2 id="SEE-ALSO">SEE ALSO</h2><p><a class="md2man-xref" href="../man1/md2man-html.1.html">md2man-html(1)</a>, <a class="md2man-xref" href="../man1/md2man-rake.1.html">md2man-rake(1)</a>, <a class="md2man-xref" href="../man5/md2man.5.html">md2man(5)</a></p></div></body>
|
21
|
+
</html>
|
data/man/man5/md2man.5
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
.TH MD2MAN 5 2013\-05\-05 2.0.0
|
2
|
+
.SH NAME
|
3
|
+
.PP
|
4
|
+
md2man \- manual page flavoring for the
|
5
|
+
.BR markdown (7)
|
6
|
+
file format
|
7
|
+
.SH DESCRIPTION
|
8
|
+
.PP
|
9
|
+
md2man
|
10
|
+
.UR https://github.com/sunaku/md2man
|
11
|
+
.UE
|
12
|
+
makes the
|
13
|
+
.BR markdown (7)
|
14
|
+
file format friendly for writing UNIX manual
|
15
|
+
pages by extending its syntax, semantics, and assumed processing extensions.
|
16
|
+
.SS Syntax
|
17
|
+
.PP
|
18
|
+
md2man extends
|
19
|
+
.BR markdown (7)
|
20
|
+
syntax by defining three kinds of paragraphs.
|
21
|
+
.PP
|
22
|
+
.RS
|
23
|
+
.nf
|
24
|
+
This is a
|
25
|
+
normal
|
26
|
+
paragraph.
|
27
|
+
This is a
|
28
|
+
tagged
|
29
|
+
paragraph.
|
30
|
+
This is an
|
31
|
+
indented
|
32
|
+
paragraph.
|
33
|
+
This
|
34
|
+
is another
|
35
|
+
normal
|
36
|
+
paragraph.
|
37
|
+
.fi
|
38
|
+
.RE
|
39
|
+
.SS Normal paragraphs
|
40
|
+
.PP
|
41
|
+
Paragraphs whose lines are all indented by exactly zero or one additional
|
42
|
+
spaces are considered to be "normal paragraphs". For example:
|
43
|
+
.PP
|
44
|
+
.RS
|
45
|
+
.nf
|
46
|
+
This is a
|
47
|
+
normal
|
48
|
+
paragraph.
|
49
|
+
This
|
50
|
+
is another
|
51
|
+
normal
|
52
|
+
paragraph.
|
53
|
+
.fi
|
54
|
+
.RE
|
55
|
+
.SS Tagged paragraphs
|
56
|
+
.PP
|
57
|
+
Paragraphs whose first line is indented by less than two additional spaces and
|
58
|
+
whose subsequent lines are uniformly indented by exactly two additional spaces
|
59
|
+
are considered to be "tagged paragraphs". For example:
|
60
|
+
.PP
|
61
|
+
.RS
|
62
|
+
.nf
|
63
|
+
This is a
|
64
|
+
tagged
|
65
|
+
paragraph.
|
66
|
+
.fi
|
67
|
+
.RE
|
68
|
+
.SS Indented paragraphs
|
69
|
+
.PP
|
70
|
+
Paragraphs whose lines are all uniformly indented by exactly two additional
|
71
|
+
spaces are considered to be "indented paragraphs". For example:
|
72
|
+
.PP
|
73
|
+
.RS
|
74
|
+
.nf
|
75
|
+
This is an
|
76
|
+
indented
|
77
|
+
paragraph.
|
78
|
+
.fi
|
79
|
+
.RE
|
80
|
+
.SS Semantics
|
81
|
+
.PP
|
82
|
+
md2man extends
|
83
|
+
.BR markdown (7)
|
84
|
+
semantics by treating top\-level headings specially.
|
85
|
+
.SS Top\-level headings
|
86
|
+
.PP
|
87
|
+
The first top\-level heading (H1) found in the input is considered to be the
|
88
|
+
\fB\fC.TH\fR directive in
|
89
|
+
.BR roff (7),
|
90
|
+
which defines the UNIX manual page's header and
|
91
|
+
footer. Any subsequent top\-level headings are treated as second\-level (H2).
|
92
|
+
.SS Extensions
|
93
|
+
.PP
|
94
|
+
md2man enables the following Redcarpet
|
95
|
+
.UR https://github.com/vmg/redcarpet
|
96
|
+
.UE
|
97
|
+
extensions while reading
|
98
|
+
.BR markdown (7):
|
99
|
+
.RS
|
100
|
+
.IP \(bu 2
|
101
|
+
tables
|
102
|
+
.IP \(bu 2
|
103
|
+
autolink
|
104
|
+
.IP \(bu 2
|
105
|
+
superscript
|
106
|
+
.IP \(bu 2
|
107
|
+
strikethrough
|
108
|
+
.IP \(bu 2
|
109
|
+
fenced_code_blocks
|
110
|
+
.RE
|
111
|
+
.SH SEE ALSO
|
112
|
+
.PP
|
113
|
+
.BR markdown (7),
|
114
|
+
.BR md2man-roff (1),
|
115
|
+
.BR md2man-html (1),
|
116
|
+
.BR md2man-rake (1)
|
@@ -0,0 +1,64 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8" />
|
5
|
+
<meta name="generator" content="md2man 2.0.0 https://github.com/sunaku/md2man" />
|
6
|
+
<title>md2man(5) — manual page flavoring for the markdown(7) file format</title>
|
7
|
+
<link rel="stylesheet" href="../style.css"/>
|
8
|
+
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
9
|
+
</head>
|
10
|
+
<body><div class="navbar"><div class="navbar-inner"><span class="brand"><a href="../index.html#man5">man5</a>/md2man.5</span></div></div><div class="container-fluid"><h1 id="MD2MAN-5-2013-05-05-2-0-0">MD2MAN 5 2013-05-05 2.0.0</h1><h2 id="NAME">NAME</h2><p>md2man - manual page flavoring for the <a class="md2man-xref">markdown(7)</a> file format</p><h2 id="DESCRIPTION">DESCRIPTION</h2><p><a href="https://github.com/sunaku/md2man">md2man</a> makes the <a class="md2man-xref">markdown(7)</a> file format friendly for writing UNIX manual
|
11
|
+
pages by extending its syntax, semantics, and assumed processing extensions.</p><h3 id="Syntax">Syntax</h3><p>md2man extends <a class="md2man-xref">markdown(7)</a> syntax by defining three kinds of paragraphs.</p>
|
12
|
+
<pre><code>This is a
|
13
|
+
normal
|
14
|
+
paragraph.
|
15
|
+
|
16
|
+
This is a
|
17
|
+
tagged
|
18
|
+
paragraph.
|
19
|
+
|
20
|
+
This is an
|
21
|
+
indented
|
22
|
+
paragraph.
|
23
|
+
|
24
|
+
This
|
25
|
+
is another
|
26
|
+
normal
|
27
|
+
paragraph.
|
28
|
+
</code></pre>
|
29
|
+
<h4 id="Normal-paragraphs">Normal paragraphs</h4><p>Paragraphs whose lines are all indented by exactly zero or one additional
|
30
|
+
spaces are considered to be "normal paragraphs". For example:</p>
|
31
|
+
<pre><code>This is a
|
32
|
+
normal
|
33
|
+
paragraph.
|
34
|
+
|
35
|
+
This
|
36
|
+
is another
|
37
|
+
normal
|
38
|
+
paragraph.
|
39
|
+
</code></pre>
|
40
|
+
<h4 id="Tagged-paragraphs">Tagged paragraphs</h4><p>Paragraphs whose first line is indented by less than two additional spaces and
|
41
|
+
whose subsequent lines are uniformly indented by exactly two additional spaces
|
42
|
+
are considered to be "tagged paragraphs". For example:</p>
|
43
|
+
<pre><code>This is a
|
44
|
+
tagged
|
45
|
+
paragraph.
|
46
|
+
</code></pre>
|
47
|
+
<h4 id="Indented-paragraphs">Indented paragraphs</h4><p>Paragraphs whose lines are all uniformly indented by exactly two additional
|
48
|
+
spaces are considered to be "indented paragraphs". For example:</p>
|
49
|
+
<pre><code> This is an
|
50
|
+
indented
|
51
|
+
paragraph.
|
52
|
+
</code></pre>
|
53
|
+
<h3 id="Semantics">Semantics</h3><p>md2man extends <a class="md2man-xref">markdown(7)</a> semantics by treating top-level headings specially.</p><h4 id="Top-level-headings">Top-level headings</h4><p>The first top-level heading (H1) found in the input is considered to be the
|
54
|
+
<code>.TH</code> directive in <a class="md2man-xref">roff(7)</a>, which defines the UNIX manual page's header and
|
55
|
+
footer. Any subsequent top-level headings are treated as second-level (H2).</p><h3 id="Extensions">Extensions</h3><p>md2man enables the following <a href="https://github.com/vmg/redcarpet">Redcarpet</a> extensions while reading <a class="md2man-xref">markdown(7)</a>:</p>
|
56
|
+
<ul>
|
57
|
+
<li>tables</li>
|
58
|
+
<li>autolink</li>
|
59
|
+
<li>superscript</li>
|
60
|
+
<li>strikethrough</li>
|
61
|
+
<li>fenced_code_blocks</li>
|
62
|
+
</ul>
|
63
|
+
<h2 id="SEE-ALSO">SEE ALSO</h2><p><a class="md2man-xref">markdown(7)</a>, <a class="md2man-xref" href="../man1/md2man-roff.1.html">md2man-roff(1)</a>, <a class="md2man-xref" href="../man1/md2man-html.1.html">md2man-html(1)</a>, <a class="md2man-xref" href="../man1/md2man-rake.1.html">md2man-rake(1)</a></p></div></body>
|
64
|
+
</html>
|
@@ -0,0 +1,91 @@
|
|
1
|
+
# MD2MAN 5 2013-05-05 2.0.0
|
2
|
+
|
3
|
+
## NAME
|
4
|
+
|
5
|
+
md2man - manual page flavoring for the markdown(7) file format
|
6
|
+
|
7
|
+
## DESCRIPTION
|
8
|
+
|
9
|
+
[md2man] makes the markdown(7) file format friendly for writing UNIX manual
|
10
|
+
pages by extending its syntax, semantics, and assumed processing extensions.
|
11
|
+
|
12
|
+
### Syntax
|
13
|
+
|
14
|
+
md2man extends markdown(7) syntax by defining three kinds of paragraphs.
|
15
|
+
|
16
|
+
This is a
|
17
|
+
normal
|
18
|
+
paragraph.
|
19
|
+
|
20
|
+
This is a
|
21
|
+
tagged
|
22
|
+
paragraph.
|
23
|
+
|
24
|
+
This is an
|
25
|
+
indented
|
26
|
+
paragraph.
|
27
|
+
|
28
|
+
This
|
29
|
+
is another
|
30
|
+
normal
|
31
|
+
paragraph.
|
32
|
+
|
33
|
+
#### Normal paragraphs
|
34
|
+
|
35
|
+
Paragraphs whose lines are all indented by exactly zero or one additional
|
36
|
+
spaces are considered to be "normal paragraphs". For example:
|
37
|
+
|
38
|
+
This is a
|
39
|
+
normal
|
40
|
+
paragraph.
|
41
|
+
|
42
|
+
This
|
43
|
+
is another
|
44
|
+
normal
|
45
|
+
paragraph.
|
46
|
+
|
47
|
+
#### Tagged paragraphs
|
48
|
+
|
49
|
+
Paragraphs whose first line is indented by less than two additional spaces and
|
50
|
+
whose subsequent lines are uniformly indented by exactly two additional spaces
|
51
|
+
are considered to be "tagged paragraphs". For example:
|
52
|
+
|
53
|
+
This is a
|
54
|
+
tagged
|
55
|
+
paragraph.
|
56
|
+
|
57
|
+
#### Indented paragraphs
|
58
|
+
|
59
|
+
Paragraphs whose lines are all uniformly indented by exactly two additional
|
60
|
+
spaces are considered to be "indented paragraphs". For example:
|
61
|
+
|
62
|
+
This is an
|
63
|
+
indented
|
64
|
+
paragraph.
|
65
|
+
|
66
|
+
### Semantics
|
67
|
+
|
68
|
+
md2man extends markdown(7) semantics by treating top-level headings specially.
|
69
|
+
|
70
|
+
#### Top-level headings
|
71
|
+
|
72
|
+
The first top-level heading (H1) found in the input is considered to be the
|
73
|
+
`.TH` directive in roff(7), which defines the UNIX manual page's header and
|
74
|
+
footer. Any subsequent top-level headings are treated as second-level (H2).
|
75
|
+
|
76
|
+
### Extensions
|
77
|
+
|
78
|
+
md2man enables the following [Redcarpet] extensions while reading markdown(7):
|
79
|
+
|
80
|
+
* tables
|
81
|
+
* autolink
|
82
|
+
* superscript
|
83
|
+
* strikethrough
|
84
|
+
* fenced\_code\_blocks
|
85
|
+
|
86
|
+
## SEE ALSO
|
87
|
+
|
88
|
+
markdown(7), md2man-roff(1), md2man-html(1), md2man-rake(1)
|
89
|
+
|
90
|
+
[md2man]: https://github.com/sunaku/md2man
|
91
|
+
[Redcarpet]: https://github.com/vmg/redcarpet
|
data/man/style.css
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
@import url('http://twitter.github.com/bootstrap/assets/css/bootstrap.css');
|
2
2
|
|
3
3
|
@media all {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
h1,
|
5
|
+
h2,
|
6
|
+
h3,
|
7
|
+
h4,
|
8
|
+
h5,
|
9
|
+
h6 {
|
10
10
|
margin-top: 1em;
|
11
11
|
}
|
12
12
|
|
13
13
|
/* deactivate external manual page cross-references */
|
14
|
-
a.
|
14
|
+
a.md2man-xref:not([href]) {
|
15
15
|
color: inherit;
|
16
16
|
text-decoration: none;
|
17
17
|
}
|
@@ -25,7 +25,7 @@
|
|
25
25
|
margin: auto;
|
26
26
|
}
|
27
27
|
|
28
|
-
|
28
|
+
h1:first-child {
|
29
29
|
margin-top: -5em;
|
30
30
|
font-weight: normal;
|
31
31
|
font-size: smaller;
|
@@ -34,7 +34,7 @@
|
|
34
34
|
}
|
35
35
|
|
36
36
|
@media print {
|
37
|
-
.navbar {
|
37
|
+
.navbar:first-child {
|
38
38
|
display: none;
|
39
39
|
}
|
40
40
|
|
data/test/md2man/html_test.rb
CHANGED
@@ -51,11 +51,24 @@ describe 'html engine' do
|
|
51
51
|
OUTPUT
|
52
52
|
end
|
53
53
|
|
54
|
+
it 'does not break surrounding Markdown while processing references' do
|
55
|
+
@markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
|
56
|
+
|For example, the `printf(3)` cross reference would be emitted as this HTML:
|
57
|
+
|
|
58
|
+
| <a class="md2man-xref" href="../man3/printf.3.html">printf(3)</a>
|
59
|
+
INPUT
|
60
|
+
|<p>For example, the <code><a class="md2man-xref" href="../man3/printf.3.html">printf(3)</a></code> cross reference would be emitted as this HTML:</p>
|
61
|
+
|<pre><code><a class="md2man-xref" href="../man3/printf.3.html"><a class="md2man-xref" href="../man3/printf.3.html">printf(3)</a></a>
|
62
|
+
|</code></pre>
|
63
|
+
|
|
64
|
+
OUTPUT
|
65
|
+
end
|
66
|
+
|
54
67
|
it 'renders references to other man pages as hyperlinks in middle of line' do
|
55
68
|
@markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
|
56
69
|
|convert them from markdown(7) into roff(7), using
|
57
70
|
INPUT
|
58
|
-
|<p>convert them from <a class="
|
71
|
+
|<p>convert them from <a class="md2man-xref" href="../man7/markdown.7.html">markdown(7)</a> into <a class="md2man-xref" href="../man7/roff.7.html">roff(7)</a>, using</p>
|
59
72
|
OUTPUT
|
60
73
|
end
|
61
74
|
|
@@ -63,28 +76,38 @@ describe 'html engine' do
|
|
63
76
|
@markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
|
64
77
|
|markdown(1) into roff(2)
|
65
78
|
INPUT
|
66
|
-
|<p><a class="
|
79
|
+
|<p><a class="md2man-xref" href="../man1/markdown.1.html">markdown(1)</a> into <a class="md2man-xref" href="../man2/roff.2.html">roff(2)</a></p>
|
67
80
|
OUTPUT
|
68
81
|
end
|
69
82
|
|
70
|
-
it '
|
83
|
+
it 'renders references inside code blocks' do
|
71
84
|
@markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
|
72
85
|
| this is a code block
|
73
86
|
| containing markdown(7),
|
74
87
|
| roff(7), and much more!
|
75
88
|
INPUT
|
76
89
|
|<pre><code>this is a code block
|
77
|
-
|containing markdown(7)
|
78
|
-
|
90
|
+
|containing <a class=\"md2man-xref\" href=\"../man7/markdown.7.html\">markdown(7)</a>,
|
91
|
+
|<a class=\"md2man-xref\" href=\"../man7/roff.7.html\">roff(7)</a>, and much more!
|
79
92
|
|</code></pre>
|
93
|
+
|
|
80
94
|
OUTPUT
|
81
95
|
end
|
82
96
|
|
83
|
-
it '
|
97
|
+
it 'renders references inside code spans' do
|
84
98
|
@markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
|
85
99
|
|this is a code span `containing markdown(7), roff(7), and` much more!
|
86
100
|
INPUT
|
87
|
-
|<p>this is a code span <code>containing markdown(7)
|
101
|
+
|<p>this is a code span <code>containing <a class="md2man-xref" href="../man7/markdown.7.html">markdown(7)</a>, <a class="md2man-xref" href="../man7/roff.7.html">roff(7)</a>, and</code> much more!</p>
|
102
|
+
OUTPUT
|
103
|
+
end
|
104
|
+
|
105
|
+
it 'does not render references inside image descriptions' do
|
106
|
+
@markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
|
107
|
+
|
|
109
|
+
INPUT
|
110
|
+
|<p><img src="https://raw.github.com/sunaku/md2man/master/EXAMPLE.png" alt="Obligatory screenshot of md2man-roff(1) in action!"></p>
|
88
111
|
OUTPUT
|
89
112
|
end
|
90
113
|
|
@@ -106,6 +129,7 @@ describe 'html engine' do
|
|
106
129
|
| \\__/\\____/_/ /_/|_\\
|
107
130
|
| >>>------>
|
108
131
|
|</code></pre>
|
132
|
+
|
|
109
133
|
OUTPUT
|
110
134
|
end
|
111
135
|
|
data/test/md2man/roff_test.rb
CHANGED
@@ -7,11 +7,11 @@
|
|
7
7
|
# man 7 groff
|
8
8
|
|
9
9
|
require 'test_helper'
|
10
|
-
require 'md2man/engine'
|
10
|
+
require 'md2man/roff/engine'
|
11
11
|
|
12
12
|
describe 'roff engine' do
|
13
13
|
before do
|
14
|
-
@markdown = Md2Man::ENGINE
|
14
|
+
@markdown = Md2Man::Roff::ENGINE
|
15
15
|
end
|
16
16
|
|
17
17
|
SPACE = 0x20.chr
|
@@ -679,6 +679,26 @@ describe 'roff engine' do
|
|
679
679
|
OUTPUT
|
680
680
|
end
|
681
681
|
|
682
|
+
it 'does not break surrounding Markdown while processing references' do
|
683
|
+
@markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
|
684
|
+
|For example, the `printf(3)` cross reference would be emitted as this HTML:
|
685
|
+
|
|
686
|
+
| <a class="md2man-xref" href="../man3/printf.3.html">printf(3)</a>
|
687
|
+
INPUT
|
688
|
+
|.PP
|
689
|
+
|For example, the \\fB\\fC
|
690
|
+
|.BR printf (3)\\fR#{SPACE}
|
691
|
+
|cross reference would be emitted as this HTML:
|
692
|
+
|.PP
|
693
|
+
|.RS
|
694
|
+
|.nf
|
695
|
+
|<a class="md2man-xref" href="../man3/printf.3.html">
|
696
|
+
|.BR printf (3)</a>
|
697
|
+
|.fi
|
698
|
+
|.RE
|
699
|
+
OUTPUT
|
700
|
+
end
|
701
|
+
|
682
702
|
it 'renders references to other man pages as hyperlinks' do
|
683
703
|
@markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
|
684
704
|
|convert them from markdown(7) into roff(7), using
|
@@ -692,7 +712,7 @@ describe 'roff engine' do
|
|
692
712
|
OUTPUT
|
693
713
|
end
|
694
714
|
|
695
|
-
it '
|
715
|
+
it 'renders references inside code blocks' do
|
696
716
|
@markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
|
697
717
|
| this is a code block
|
698
718
|
| containing markdown(7),
|
@@ -702,19 +722,38 @@ describe 'roff engine' do
|
|
702
722
|
|.RS
|
703
723
|
|.nf
|
704
724
|
|this is a code block
|
705
|
-
|containing
|
706
|
-
|
725
|
+
|containing#{SPACE}
|
726
|
+
|.BR markdown (7),
|
727
|
+
|.BR roff (7),#{SPACE}
|
728
|
+
|and much more!
|
707
729
|
|.fi
|
708
730
|
|.RE
|
709
731
|
OUTPUT
|
710
732
|
end
|
711
733
|
|
712
|
-
it '
|
734
|
+
it 'renders references inside code spans' do
|
713
735
|
@markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
|
714
736
|
|this is a code span `containing markdown(7), roff(7), and` much more!
|
715
737
|
INPUT
|
716
738
|
|.PP
|
717
|
-
|this is a code span \\fB\\fCcontaining
|
739
|
+
|this is a code span \\fB\\fCcontaining#{SPACE}
|
740
|
+
|.BR markdown (7),#{SPACE}
|
741
|
+
|.BR roff (7),#{SPACE}
|
742
|
+
|and\\fR much more!
|
743
|
+
OUTPUT
|
744
|
+
end
|
745
|
+
|
746
|
+
it 'renders references inside image descriptions' do
|
747
|
+
@markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
|
748
|
+
|
|
750
|
+
INPUT
|
751
|
+
|.PP
|
752
|
+
|[Obligatory screenshot of#{SPACE}
|
753
|
+
|.BR md2man-roff (1)#{SPACE}
|
754
|
+
|in action!](
|
755
|
+
|.UR https://raw.github.com/sunaku/md2man/master/EXAMPLE.png
|
756
|
+
|.UE )
|
718
757
|
OUTPUT
|
719
758
|
end
|
720
759
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: md2man
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: binman
|
@@ -79,9 +79,9 @@ description: Converts markdown documents into UNIX manual pages.
|
|
79
79
|
email:
|
80
80
|
- https://github.com/sunaku
|
81
81
|
executables:
|
82
|
-
- md2man
|
83
82
|
- md2man-html
|
84
83
|
- md2man-rake
|
84
|
+
- md2man-roff
|
85
85
|
extensions: []
|
86
86
|
extra_rdoc_files: []
|
87
87
|
files:
|
@@ -93,33 +93,36 @@ files:
|
|
93
93
|
- README.markdown
|
94
94
|
- Rakefile
|
95
95
|
- VERSION.markdown
|
96
|
-
- bin/md2man
|
97
96
|
- bin/md2man-html
|
98
97
|
- bin/md2man-rake
|
98
|
+
- bin/md2man-roff
|
99
99
|
- lib/md2man.rb
|
100
100
|
- lib/md2man/document.rb
|
101
|
-
- lib/md2man/engine.rb
|
102
101
|
- lib/md2man/html.rb
|
103
102
|
- lib/md2man/html/engine.rb
|
104
103
|
- lib/md2man/rakefile.rb
|
105
104
|
- lib/md2man/rakefile/style.css
|
106
105
|
- lib/md2man/roff.rb
|
106
|
+
- lib/md2man/roff/engine.rb
|
107
107
|
- lib/md2man/version.rb
|
108
108
|
- man/man0/README.markdown
|
109
109
|
- man/man0/VERSION.markdown
|
110
|
+
- man/man5/md2man.5.markdown
|
110
111
|
- md2man.gemspec
|
111
112
|
- test/md2man/html_test.rb
|
112
113
|
- test/md2man/roff_test.rb
|
113
114
|
- test/test_helper.rb
|
115
|
+
- man/man5/md2man.5
|
116
|
+
- man/man1/md2man-roff.1
|
114
117
|
- man/man1/md2man-html.1
|
115
|
-
- man/man1/md2man.1
|
116
118
|
- man/man1/md2man-rake.1
|
117
119
|
- man/index.html
|
118
120
|
- man/man0/VERSION.html
|
119
121
|
- man/man0/README.html
|
122
|
+
- man/man5/md2man.5.html
|
120
123
|
- man/man1/md2man-rake.1.html
|
124
|
+
- man/man1/md2man-roff.1.html
|
121
125
|
- man/man1/md2man-html.1.html
|
122
|
-
- man/man1/md2man.1.html
|
123
126
|
- man/style.css
|
124
127
|
homepage: http://github.com/sunaku/md2man
|
125
128
|
licenses: []
|
@@ -141,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
144
|
version: '0'
|
142
145
|
segments:
|
143
146
|
- 0
|
144
|
-
hash:
|
147
|
+
hash: 878508335261676240
|
145
148
|
requirements: []
|
146
149
|
rubyforge_project:
|
147
150
|
rubygems_version: 1.8.25
|