md2man 5.0.1 → 5.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2bdb1fbb6e383e4152958f6bbb6a39c4297d69b5
4
- data.tar.gz: 2363a55a81bb82af94e94c16818999d4259b26bf
3
+ metadata.gz: fed108c801a748ce17e7b401494b90ff77b3a18a
4
+ data.tar.gz: 7bb491d3120e92aa877f537683634d5ef53b350b
5
5
  SHA512:
6
- metadata.gz: 71dd39157e1c68f8e69730d3dbe231c6f3ab3f8f38e4436cc777a99112584280e117e6964fa24f9d8ec7665f2e45475f9ff5311c6c2f4e4e44f6f82628914f69
7
- data.tar.gz: bb0e2fe13cfdb086950dccf58b4c05700b4fd890f08d5567db11a707379b6992d1069c2b72dc2467e93051b7b99721a65df9d9406e215fe07e01b4cf8ad1c74c
6
+ metadata.gz: dd28d0dfad989ae8ac9d476f7a8a24ab61d08b90fa1efca4dea2f38ee111dccbd5341d25ab586335206f7156944521d1e8057501a569922e10eebad6ef898cbb
7
+ data.tar.gz: 6507bcc13ae9c1ff181423648c15867884e85e99a34c8d22be52f31f055287afbbead53413688a3e5d2ed146cb787f3729621d3172a4b32b21653e33e00eebfb
@@ -9,7 +9,7 @@ foo - frobnicate the bar library
9
9
  SYNOPSIS
10
10
  --------
11
11
 
12
- `foo` [`-bar`] [`-c` *config-file* ] *file* ...
12
+ `foo` [`-bar`] [`-c` *config-file*] *file* ...
13
13
 
14
14
  DESCRIPTION
15
15
  -----------
@@ -1,16 +1,15 @@
1
+ * Code: <https://github.com/sunaku/md2man>
2
+ * Docs: <https://sunaku.github.io/md2man/man>
3
+ * Bugs: <https://github.com/sunaku/md2man/issues>
4
+
1
5
  # md2man - markdown to manpage
2
6
 
3
7
  md2man is a Ruby library and a set of command-line programs that convert
4
8
  [Markdown] into UNIX manual pages (both [roff] and HTML) using [Redcarpet].
5
9
 
6
- * Manuals: <https://sunaku.github.io/md2man/man>
7
- * Sources: <https://github.com/sunaku/md2man>
8
- * Support: <https://github.com/sunaku/md2man/issues>
9
- * Package: <https://rubygems.org/gems/md2man>
10
-
11
10
  ## Features
12
11
 
13
- * Formats tagged and indented paragraphs (see "document format" below).
12
+ * Formats indented, tagged, and normal paragraphs: described in md2man(5).
14
13
 
15
14
  * Translates all HTML4 and XHTML1 entities into native [roff] equivalents.
16
15
 
@@ -18,24 +17,46 @@ md2man is a Ruby library and a set of command-line programs that convert
18
17
 
19
18
  * Usable from the command line as a filter in a UNIX command pipeline.
20
19
 
21
- ### Demonstration
20
+ ### Examples
22
21
 
23
- Try converting [this example Markdown file][example] into a UNIX manual page:
22
+ Try converting
23
+ [this example Markdown file][example]
24
+ into
25
+ [a UNIX manual page][example-roff]:
24
26
 
25
27
  ```sh
26
28
  md2man-roff EXAMPLE.markdown > EXAMPLE.1
29
+ ```
30
+
31
+ You can view [the resulting UNIX manual page][example-roff] in your man(1)
32
+ viewer:
33
+
34
+ ```sh
27
35
  man -l EXAMPLE.1
28
36
  ```
29
37
 
30
- ![Obligatory screenshot of md2man(1) in action!](EXAMPLE.png)
38
+ ![screenshot](https://github.com/sunaku/md2man/raw/gh-pages/EXAMPLE.png)
31
39
 
32
- Also try converting [that example Markdown file][example] into a web page:
40
+ Next, try converting
41
+ [the same example file][example]
42
+ into
43
+ [a HTML web page][example-html]:
33
44
 
34
45
  ```sh
35
46
  md2man-html EXAMPLE.markdown > EXAMPLE.html
36
- open EXAMPLE.html
37
47
  ```
38
48
 
49
+ You can view [the resulting HTML manual page][example-html] in your web
50
+ browser:
51
+
52
+ ```sh
53
+ firefox EXAMPLE.html
54
+ ```
55
+
56
+ [example]: https://raw.github.com/sunaku/md2man/master/EXAMPLE.markdown
57
+ [example-roff]: https://github.com/sunaku/md2man/raw/gh-pages/man/man0/EXAMPLE
58
+ [example-html]: https://sunaku.github.io/md2man/man/man0/EXAMPLE.html
59
+
39
60
  ## Installation
40
61
 
41
62
  ```sh
@@ -212,5 +233,4 @@ Released under the ISC license. See the LICENSE file for details.
212
233
  [roff]: http://troff.org
213
234
  [Markdown]: http://daringfireball.net/projects/markdown/
214
235
  [Redcarpet]: https://github.com/vmg/redcarpet
215
- [example]: https://raw.github.com/sunaku/md2man/master/EXAMPLE.markdown
216
236
  [tables]: http://michelf.com/projects/php-markdown/extra/#table
@@ -1,3 +1,51 @@
1
+ ## Version 5.0.3 (2016-02-21)
2
+
3
+ This release fixes a crash, fixes roff bugs, improves CSS styling for HTML
4
+ output, and adds a complete manual page example in md2man(5) documentation.
5
+
6
+ ### Patch:
7
+
8
+ * Fix crash upon encountering a sole space ` ` or tab ` ` in a codespan.
9
+
10
+ * md2man-rake(1): fix sorting of manual pages in `man/index.html` listing.
11
+ Previously, the manual page with longest filename ended up at the top.
12
+
13
+ * md2man-html(1): emit extraneous top-level heading components that come
14
+ after the known list of "title section date source manual" components.
15
+ Previously, such extraneous components were omitted from the output.
16
+
17
+ * md2man-html(1): &quot; escaping broke shellwords splitting of .TH heading.
18
+
19
+ * md2man-html(1): css: hide title, section, manual in top-level heading.
20
+
21
+ * md2man-html(1): css: center top-level heading; float source right.
22
+
23
+ * md2man-roff(1): don't chomp off the newline at end of output.
24
+
25
+ * md2man-roff(1): newline before links broke tagged paragraphs.
26
+
27
+ * md2man-roff(1): don't squeeze newlines inside code blocks.
28
+
29
+ ### Other:
30
+
31
+ * md2man(5): revise paragraph definitions and add complete manpage example.
32
+
33
+ * Document optional regexp argument to `-h` and `--help` in all executables.
34
+
35
+ * README: "document format" was moved into md2man(5).
36
+
37
+ * README: shorten and move project links to the top.
38
+
39
+ * README: add link to pre-rendered example HTML file.
40
+
41
+ * md2man-roff(1): we don't emit `.UM` and `.UE` directives anymore.
42
+
43
+ * md2man-roff(1): add tests for postprocess document lstrip().
44
+
45
+ * README: rename "Demonstration" section to "Examples".
46
+
47
+ * README: move EXAMPLE.png screenshot into gh-pages branch.
48
+
1
49
  ## Version 5.0.1 (2016-02-13)
2
50
 
3
51
  ### Major:
@@ -5,7 +53,7 @@
5
53
  * `md2man-html` now puts permalinks _after_ heading text to avoid unsightly
6
54
  gaps at the beginning of each heading in text-mode browsers like w3m(1).
7
55
 
8
- * Upgrade to binman version 5.0.0, which is also a major version bump.
56
+ * Upgrade to binman version 5.x.x, which is also a major version bump.
9
57
 
10
58
  ### Other:
11
59
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  =begin =======================================================================
3
3
 
4
- # MD2MAN-HTML 1 2016-02-13 5.0.1
4
+ # MD2MAN-HTML 1 2016-02-21 5.0.3
5
5
 
6
6
  ## NAME
7
7
 
@@ -62,8 +62,8 @@ For example, the `printf(3)` cross reference would be emitted as this HTML:
62
62
 
63
63
  ## OPTIONS
64
64
 
65
- `-h`, `--help`
66
- Show this help manual.
65
+ `-h` [*PATTERN*], `--help` [*PATTERN*]
66
+ Show this help manual and search for *PATTERN* regular expression therein.
67
67
 
68
68
  ## SEE ALSO
69
69
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  =begin =======================================================================
3
3
 
4
- # MD2MAN-RAKE 1 2016-02-13 5.0.1
4
+ # MD2MAN-RAKE 1 2016-02-21 5.0.3
5
5
 
6
6
  ## NAME
7
7
 
@@ -35,8 +35,8 @@ If no *TASK* is specified, then the `md2man` task is run by default.
35
35
 
36
36
  ## OPTIONS
37
37
 
38
- `-h`, `--help`
39
- Show this help manual.
38
+ `-h` [*PATTERN*], `--help` [*PATTERN*]
39
+ Show this help manual and search for *PATTERN* regular expression therein.
40
40
 
41
41
  Run `rake --help` to see more options.
42
42
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  =begin =======================================================================
3
3
 
4
- # MD2MAN-ROFF 1 2016-02-13 5.0.1
4
+ # MD2MAN-ROFF 1 2016-02-21 5.0.3
5
5
 
6
6
  ## NAME
7
7
 
@@ -31,8 +31,8 @@ It issues a warning when it encounters these instead. Patches are welcome!
31
31
 
32
32
  ## OPTIONS
33
33
 
34
- `-h`, `--help`
35
- Show this help manual.
34
+ `-h` [*PATTERN*], `--help` [*PATTERN*]
35
+ Show this help manual and search for *PATTERN* regular expression therein.
36
36
 
37
37
  ## SEE ALSO
38
38
 
@@ -66,7 +66,7 @@ module Md2Man::Document
66
66
  #---------------------------------------------------------------------------
67
67
 
68
68
  def codespan code
69
- decode_references code, true
69
+ decode_references (code || ' '), true
70
70
  end
71
71
 
72
72
  def reference input_match, output_match
@@ -39,8 +39,9 @@ module Md2Man::HTML
39
39
  def header text, level, _=nil
40
40
  if level == 1 and not @h1_seen
41
41
  @h1_seen = true
42
- text = HEADER_PARTS.zip(Shellwords.split(text)).map do |part, value|
43
- %{<span class="md2man-#{part}">#{value}</span>} if value
42
+ text = CGI.unescape_html(text) # unescape &quot; for Shellwords.split()
43
+ text = Shellwords.split(text).zip(HEADER_PARTS).map do |value, part|
44
+ part ? %{<span class="md2man-#{part}">#{value}</span>} : value
44
45
  end.compact.join(' ')
45
46
  end
46
47
 
@@ -71,7 +71,10 @@ directory 'man'
71
71
 
72
72
  file 'man/index.html' => ['man'] + webs do |t|
73
73
  buffer = ['<div class="container-fluid">']
74
- webs.sort.group_by {|web| web.pathmap('%d').sub('man/', '') }.each do |subdir, dir_webs|
74
+ webs.
75
+ sort_by {|web| web.ext.ext }. # drop .?.html extensions for proper sorting
76
+ group_by {|web| web.pathmap('%d').sub('man/', '') }.
77
+ each do |subdir, dir_webs|
75
78
  buffer << %{<h2 id="#{subdir}">#{subdir}</h2>}
76
79
  dir_webs.each do |web|
77
80
  name = parse_manpage_name.call(web)
@@ -29,9 +29,16 @@
29
29
  margin-top: -5em;
30
30
  font-weight: normal;
31
31
  font-size: smaller;
32
- text-align: right;
32
+ text-align: center;
33
33
  }
34
34
 
35
+ h1:first-child > span.md2man-source {
36
+ float: right;
37
+ }
38
+
39
+ h1:first-child > span.md2man-title,
40
+ h1:first-child > span.md2man-section,
41
+ h1:first-child > span.md2man-manual,
35
42
  h1:first-child > a.md2man-permalink {
36
43
  display: none;
37
44
  }
@@ -16,13 +16,14 @@ module Md2Man::Roff
16
16
  end
17
17
 
18
18
  def postprocess document
19
- super.strip.
19
+ super.
20
20
 
21
- # ensure that spaces after URLs appear properly
22
- gsub(/(^\.[UM]E) \s/, "\\1\n").
21
+ # strip newlines from the beginning, before the very first roff directive
22
+ lstrip.
23
23
 
24
- # squeeze blank lines to prevent double-spaced output
25
- gsub(/^\n/, '')
24
+ # squeeze newlines between roff directives to prevent double-spaced output
25
+ # and also at the end of the document, after the very last roff directive
26
+ gsub(/(\n){2,}(?=\.|\z)/, '\1')
26
27
  end
27
28
 
28
29
  #---------------------------------------------------------------------------
@@ -168,7 +169,7 @@ module Md2Man::Roff
168
169
  end
169
170
 
170
171
  def link link, title, content
171
- content +
172
+ content + ' ' +
172
173
  if link =~ /^mailto:/
173
174
  autolink $', :email
174
175
  else
@@ -177,7 +178,7 @@ module Md2Man::Roff
177
178
  end
178
179
 
179
180
  def autolink link, link_type
180
- "\n\\[la]#{link.chomp}\\[ra]"
181
+ "\\[la]#{link.chomp}\\[ra]"
181
182
  end
182
183
 
183
184
  def image link, title, alt_text
@@ -1,3 +1,3 @@
1
1
  module Md2Man
2
- VERSION = "5.0.1"
2
+ VERSION = "5.0.3"
3
3
  end
@@ -2,10 +2,10 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
- <meta name="generator" content="md2man 5.0.0 https://github.com/sunaku/md2man" />
5
+ <meta name="generator" content="md2man 5.0.3 https://github.com/sunaku/md2man" />
6
6
  <title>man/index</title>
7
7
  <link rel="stylesheet" href="style.css"/>
8
8
  <!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
9
9
  </head>
10
- <body><div class="container-fluid"><h2 id="man0">man0</h2><dl class="dl-horizontal"><dt><a href="man0/README.html">README</a></dt><dd></dd></dl><dl class="dl-horizontal"><dt><a href="man0/VERSION.html">VERSION</a></dt><dd></dd></dl><h2 id="man1">man1</h2><dl class="dl-horizontal"><dt><a href="man1/md2man-html.1.html">md2man-html(1)</a></dt><dd>convert md2man(5) flavored markdown(7) into HTML</dd></dl><dl class="dl-horizontal"><dt><a href="man1/md2man-rake.1.html">md2man-rake(1)</a></dt><dd>run rake(1) tasks from md2man(1)</dd></dl><dl class="dl-horizontal"><dt><a href="man1/md2man-roff.1.html">md2man-roff(1)</a></dt><dd>convert md2man(5) flavored markdown(7) into roff(7)</dd></dl><h2 id="man5">man5</h2><dl class="dl-horizontal"><dt><a href="man5/md2man.5.html">md2man(5)</a></dt><dd>manual page flavoring for the markdown(7) file format</dd></dl></div></body>
10
+ <body><div class="container-fluid"><h2 id="man0">man0</h2><dl class="dl-horizontal"><dt><a href="man0/EXAMPLE.html">EXAMPLE</a></dt><dd>frobnicate the bar library</dd></dl><dl class="dl-horizontal"><dt><a href="man0/README.html">README</a></dt><dd></dd></dl><dl class="dl-horizontal"><dt><a href="man0/VERSION.html">VERSION</a></dt><dd></dd></dl><h2 id="man1">man1</h2><dl class="dl-horizontal"><dt><a href="man1/md2man-html.1.html">md2man-html(1)</a></dt><dd>convert md2man(5) flavored markdown(7) into HTML</dd></dl><dl class="dl-horizontal"><dt><a href="man1/md2man-rake.1.html">md2man-rake(1)</a></dt><dd>run rake(1) tasks from md2man(1)</dd></dl><dl class="dl-horizontal"><dt><a href="man1/md2man-roff.1.html">md2man-roff(1)</a></dt><dd>convert md2man(5) flavored markdown(7) into roff(7)</dd></dl><h2 id="man5">man5</h2><dl class="dl-horizontal"><dt><a href="man5/md2man.5.html">md2man(5)</a></dt><dd>UNIX manual page flavoring for the markdown(7) file format</dd></dl></div></body>
11
11
  </html>
@@ -0,0 +1,20 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="generator" content="md2man 5.0.3 https://github.com/sunaku/md2man" />
6
+ <title>EXAMPLE &mdash; frobnicate the bar library</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#man0">man0</a>/EXAMPLE</span></div></div><div class="container-fluid"><h1 id="foo-1-march-1995-linux-user-manuals"><span class="md2man-title">FOO</span> <span class="md2man-section">1</span> <span class="md2man-date">MARCH 1995</span> <span class="md2man-source">Linux</span> <span class="md2man-manual">User Manuals</span><a name="foo-1-march-1995-linux-user-manuals" href="#foo-1-march-1995-linux-user-manuals" class="md2man-permalink" title="permalink"></a></h1><h2 id="name">NAME<a name="name" href="#name" class="md2man-permalink" title="permalink"></a></h2><p>foo - frobnicate the bar library</p><h2 id="synopsis">SYNOPSIS<a name="synopsis" href="#synopsis" class="md2man-permalink" title="permalink"></a></h2><p><code>foo</code> [<code>-bar</code>] [<code>-c</code> <em>config-file</em>] <em>file</em> ...</p><h2 id="description">DESCRIPTION<a name="description" href="#description" class="md2man-permalink" title="permalink"></a></h2><p><code>foo</code> frobnicates the bar library by tweaking internal symbol tables. By
11
+ default it parses all baz segments and rearranges them in reverse order by
12
+ time for the <a class="md2man-reference">xyzzy(1)</a> linker to find them. The symdef entry is then compressed
13
+ using the WBG (Whiz-Bang-Gizmo) algorithm. All files are processed in the
14
+ order specified.</p><h2 id="options">OPTIONS<a name="options" href="#options" class="md2man-permalink" title="permalink"></a></h2><dl><dt><code>-b</code></dt><dd>Do not write &quot;busy&quot; to stdout while processing.</dd></dl><dl><dt><code>-c</code> <em>config-file</em></dt><dd>Use the alternate system wide <em>config-file</em> instead of <em>/etc/foo.conf</em>. This
15
+ overrides any <code>FOOCONF</code> environment variable.</dd></dl><dl><dt><code>-a</code></dt><dd>In addition to the baz segments, also parse the blurfl headers.</dd></dl><dl><dt><code>-r</code></dt><dd>Recursive mode. Operates as fast as lightning at the expense of a megabyte
16
+ of virtual memory.</dd></dl><h2 id="files">FILES<a name="files" href="#files" class="md2man-permalink" title="permalink"></a></h2><dl><dt><em>/etc/foo.conf</em></dt><dd>The system wide configuration file. See <a class="md2man-reference">foo(5)</a> for further details.</dd></dl><dl><dt><em>~/.foorc</em></dt><dd>Per user configuration file. See <a class="md2man-reference">foo(5)</a> for further details.</dd></dl><h2 id="environment">ENVIRONMENT<a name="environment" href="#environment" class="md2man-permalink" title="permalink"></a></h2><dl><dt><code>FOOCONF</code></dt><dd>If non-null the full pathname for an alternate system wide <em>/etc/foo.conf</em>.
17
+ Overridden by the <code>-c</code> option.</dd></dl><h2 id="diagnostics">DIAGNOSTICS<a name="diagnostics" href="#diagnostics" class="md2man-permalink" title="permalink"></a></h2><p>The following diagnostics may be issued on stderr:</p><dl><dt><strong>Bad magic number.</strong></dt><dd>The input file does not look like an archive file.</dd></dl><dl><dt><strong>Old style baz segments.</strong></dt><dd><code>foo</code> can only handle new style baz segments. COBOL object libraries are not
18
+ supported in this version.</dd></dl><h2 id="bugs">BUGS<a name="bugs" href="#bugs" class="md2man-permalink" title="permalink"></a></h2><p>The command name should have been chosen more carefully to reflect its
19
+ purpose.</p><h2 id="author">AUTHOR<a name="author" href="#author" class="md2man-permalink" title="permalink"></a></h2><p>Jens Schweikhardt <a href="mailto:howto@schweikhardt.net">howto@schweikhardt.net</a></p><h2 id="see-also">SEE ALSO<a name="see-also" href="#see-also" class="md2man-permalink" title="permalink"></a></h2><p><a class="md2man-reference">bar(1)</a>, <a class="md2man-reference">foo(5)</a>, <a class="md2man-reference">xyzzy(1)</a>, <a href="http://www.schweikhardt.net/man_page_howto.html">Linux Man Page Howto</a></p></div></body>
20
+ </html>
@@ -0,0 +1 @@
1
+ ../../EXAMPLE.markdown
@@ -2,31 +2,39 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
- <meta name="generator" content="md2man 5.0.0 https://github.com/sunaku/md2man" />
5
+ <meta name="generator" content="md2man 5.0.3 https://github.com/sunaku/md2man" />
6
6
  <title>README</title>
7
7
  <link rel="stylesheet" href="../style.css"/>
8
8
  <!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
9
9
  </head>
10
- <body><div class="navbar"><div class="navbar-inner"><span class="brand"><a href="../index.html#man0">man0</a>/README</span></div></div><div class="container-fluid"><h1 id="md2man-markdown-to-manpage"><span class="md2man-title">md2man</span> <span class="md2man-section">-</span> <span class="md2man-date">markdown</span> <span class="md2man-source">to</span> <span class="md2man-manual">manpage</span><a name="md2man-markdown-to-manpage" href="#md2man-markdown-to-manpage" class="md2man-permalink" title="permalink"></a></h1><p>md2man is a Ruby library and a set of command-line programs that convert
11
- <a href="http://daringfireball.net/projects/markdown/">Markdown</a> into UNIX manual pages (both <a href="http://troff.org">roff</a> and HTML) using <a href="https://github.com/vmg/redcarpet">Redcarpet</a>.</p>
12
- <ul>
13
- <li>Manuals: <a href="https://sunaku.github.io/md2man/man">https://sunaku.github.io/md2man/man</a></li>
14
- <li>Sources: <a href="https://github.com/sunaku/md2man">https://github.com/sunaku/md2man</a></li>
15
- <li>Support: <a href="https://github.com/sunaku/md2man/issues">https://github.com/sunaku/md2man/issues</a></li>
16
- <li>Package: <a href="https://rubygems.org/gems/md2man">https://rubygems.org/gems/md2man</a></li>
10
+ <body><div class="navbar"><div class="navbar-inner"><span class="brand"><a href="../index.html#man0">man0</a>/README</span></div></div><div class="container-fluid"><ul>
11
+ <li>Code: <a href="https://github.com/sunaku/md2man">https://github.com/sunaku/md2man</a></li>
12
+ <li>Docs: <a href="https://sunaku.github.io/md2man/man">https://sunaku.github.io/md2man/man</a></li>
13
+ <li>Bugs: <a href="https://github.com/sunaku/md2man/issues">https://github.com/sunaku/md2man/issues</a></li>
17
14
  </ul>
18
- <h2 id="features">Features<a name="features" href="#features" class="md2man-permalink" title="permalink"></a></h2>
15
+ <h1 id="md2man-markdown-to-manpage"><span class="md2man-title">md2man</span> <span class="md2man-section">-</span> <span class="md2man-date">markdown</span> <span class="md2man-source">to</span> <span class="md2man-manual">manpage</span><a name="md2man-markdown-to-manpage" href="#md2man-markdown-to-manpage" class="md2man-permalink" title="permalink"></a></h1><p>md2man is a Ruby library and a set of command-line programs that convert
16
+ <a href="http://daringfireball.net/projects/markdown/">Markdown</a> into UNIX manual pages (both <a href="http://troff.org">roff</a> and HTML) using <a href="https://github.com/vmg/redcarpet">Redcarpet</a>.</p><h2 id="features">Features<a name="features" href="#features" class="md2man-permalink" title="permalink"></a></h2>
19
17
  <ul>
20
- <li><p>Formats tagged and indented paragraphs (see &quot;document format&quot; below).</p></li>
18
+ <li><p>Formats indented, tagged, and normal paragraphs: described in <a class="md2man-reference" href="../man5/md2man.5.html">md2man(5)</a>.</p></li>
21
19
  <li><p>Translates all HTML4 and XHTML1 entities into native <a href="http://troff.org">roff</a> equivalents.</p></li>
22
20
  <li><p>Supports markdown extensions such as <a href="http://michelf.com/projects/php-markdown/extra/#table">PHP Markdown Extra tables</a>.</p></li>
23
21
  <li><p>Usable from the command line as a filter in a UNIX command pipeline.</p></li>
24
22
  </ul>
25
- <h3 id="demonstration">Demonstration<a name="demonstration" href="#demonstration" class="md2man-permalink" title="permalink"></a></h3><p>Try converting <a href="https://raw.github.com/sunaku/md2man/master/EXAMPLE.markdown">this example Markdown file</a> into a UNIX manual page:</p><pre><code>md2man-roff EXAMPLE.markdown &gt; EXAMPLE.1
26
- man -l EXAMPLE.1
23
+ <h3 id="examples">Examples<a name="examples" href="#examples" class="md2man-permalink" title="permalink"></a></h3><p>Try converting
24
+ <a href="https://raw.github.com/sunaku/md2man/master/EXAMPLE.markdown">this example Markdown file</a>
25
+ into
26
+ <a href="https://github.com/sunaku/md2man/raw/gh-pages/man/man0/EXAMPLE">a UNIX manual page</a>:</p><pre><code>md2man-roff EXAMPLE.markdown &gt; EXAMPLE.1
27
+ </code></pre>
28
+ <p>You can view <a href="https://github.com/sunaku/md2man/raw/gh-pages/man/man0/EXAMPLE">the resulting UNIX manual page</a> in your <a class="md2man-reference">man(1)</a>
29
+ viewer:</p><pre><code>man -l EXAMPLE.1
30
+ </code></pre>
31
+ <p><img src="https://github.com/sunaku/md2man/raw/gh-pages/EXAMPLE.png" alt="screenshot"></p><p>Next, try converting
32
+ <a href="https://raw.github.com/sunaku/md2man/master/EXAMPLE.markdown">the same example file</a>
33
+ into
34
+ <a href="https://sunaku.github.io/md2man/man/man0/EXAMPLE.html">a HTML web page</a>:</p><pre><code>md2man-html EXAMPLE.markdown &gt; EXAMPLE.html
27
35
  </code></pre>
28
- <p><img src="EXAMPLE.png" alt="Obligatory screenshot of md2man(1) in action!"></p><p>Also try converting <a href="https://raw.github.com/sunaku/md2man/master/EXAMPLE.markdown">that example Markdown file</a> into a web page:</p><pre><code>md2man-html EXAMPLE.markdown &gt; EXAMPLE.html
29
- open EXAMPLE.html
36
+ <p>You can view <a href="https://sunaku.github.io/md2man/man/man0/EXAMPLE.html">the resulting HTML manual page</a> in your web
37
+ browser:</p><pre><code>firefox EXAMPLE.html
30
38
  </code></pre>
31
39
  <h2 id="installation">Installation<a name="installation" href="#installation" class="md2man-permalink" title="permalink"></a></h2><pre><code>gem install md2man
32
40
  </code></pre>
@@ -2,22 +2,50 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
- <meta name="generator" content="md2man 5.0.0 https://github.com/sunaku/md2man" />
5
+ <meta name="generator" content="md2man 5.0.3 https://github.com/sunaku/md2man" />
6
6
  <title>VERSION</title>
7
7
  <link rel="stylesheet" href="../style.css"/>
8
8
  <!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
9
9
  </head>
10
- <body><div class="navbar"><div class="navbar-inner"><span class="brand"><a href="../index.html#man0">man0</a>/VERSION</span></div></div><div class="container-fluid"><h2 id="version-5-0-1-2016-02-13">Version 5.0.1 (2016-02-13)<a name="version-5-0-1-2016-02-13" href="#version-5-0-1-2016-02-13" class="md2man-permalink" title="permalink"></a></h2><h3 id="major">Major:<a name="major" href="#major" class="md2man-permalink" title="permalink"></a></h3>
10
+ <body><div class="navbar"><div class="navbar-inner"><span class="brand"><a href="../index.html#man0">man0</a>/VERSION</span></div></div><div class="container-fluid"><h2 id="version-5-0-3-2016-02-21">Version 5.0.3 (2016-02-21)<a name="version-5-0-3-2016-02-21" href="#version-5-0-3-2016-02-21" class="md2man-permalink" title="permalink"></a></h2><p>This release fixes a crash, fixes roff bugs, improves CSS styling for HTML
11
+ output, and adds a complete manual page example in <a class="md2man-reference" href="../man5/md2man.5.html">md2man(5)</a> documentation.</p><h3 id="patch">Patch:<a name="patch" href="#patch" class="md2man-permalink" title="permalink"></a></h3>
12
+ <ul>
13
+ <li><p>Fix crash upon encountering a sole space <code> </code> or tab <code> </code> in a codespan.</p></li>
14
+ <li><p><a class="md2man-reference" href="../man1/md2man-rake.1.html">md2man-rake(1)</a>: fix sorting of manual pages in <code>man/index.html</code> listing.
15
+ Previously, the manual page with longest filename ended up at the top.</p></li>
16
+ <li><p><a class="md2man-reference" href="../man1/md2man-html.1.html">md2man-html(1)</a>: emit extraneous top-level heading components that come
17
+ after the known list of &quot;title section date source manual&quot; components.
18
+ Previously, such extraneous components were omitted from the output.</p></li>
19
+ <li><p><a class="md2man-reference" href="../man1/md2man-html.1.html">md2man-html(1)</a>: &quot; escaping broke shellwords splitting of .TH heading.</p></li>
20
+ <li><p><a class="md2man-reference" href="../man1/md2man-html.1.html">md2man-html(1)</a>: css: hide title, section, manual in top-level heading.</p></li>
21
+ <li><p><a class="md2man-reference" href="../man1/md2man-html.1.html">md2man-html(1)</a>: css: center top-level heading; float source right.</p></li>
22
+ <li><p><a class="md2man-reference" href="../man1/md2man-roff.1.html">md2man-roff(1)</a>: don&#39;t chomp off the newline at end of output.</p></li>
23
+ <li><p><a class="md2man-reference" href="../man1/md2man-roff.1.html">md2man-roff(1)</a>: newline before links broke tagged paragraphs.</p></li>
24
+ <li><p><a class="md2man-reference" href="../man1/md2man-roff.1.html">md2man-roff(1)</a>: don&#39;t squeeze newlines inside code blocks.</p></li>
25
+ </ul>
26
+ <h3 id="other">Other:<a name="other" href="#other" class="md2man-permalink" title="permalink"></a></h3>
27
+ <ul>
28
+ <li><p><a class="md2man-reference" href="../man5/md2man.5.html">md2man(5)</a>: revise paragraph definitions and add complete manpage example.</p></li>
29
+ <li><p>Document optional regexp argument to <code>-h</code> and <code>--help</code> in all executables.</p></li>
30
+ <li><p>README: &quot;document format&quot; was moved into <a class="md2man-reference" href="../man5/md2man.5.html">md2man(5)</a>.</p></li>
31
+ <li><p>README: shorten and move project links to the top.</p></li>
32
+ <li><p>README: add link to pre-rendered example HTML file.</p></li>
33
+ <li><p><a class="md2man-reference" href="../man1/md2man-roff.1.html">md2man-roff(1)</a>: we don&#39;t emit <code>.UM</code> and <code>.UE</code> directives anymore.</p></li>
34
+ <li><p><a class="md2man-reference" href="../man1/md2man-roff.1.html">md2man-roff(1)</a>: add tests for postprocess document lstrip().</p></li>
35
+ <li><p>README: rename &quot;Demonstration&quot; section to &quot;Examples&quot;.</p></li>
36
+ <li><p>README: move EXAMPLE.png screenshot into gh-pages branch.</p></li>
37
+ </ul>
38
+ <h2 id="version-5-0-1-2016-02-13">Version 5.0.1 (2016-02-13)<a name="version-5-0-1-2016-02-13" href="#version-5-0-1-2016-02-13" class="md2man-permalink" title="permalink"></a></h2><h3 id="major">Major:<a name="major" href="#major" class="md2man-permalink" title="permalink"></a></h3>
11
39
  <ul>
12
40
  <li><p><code>md2man-html</code> now puts permalinks <em>after</em> heading text to avoid unsightly
13
41
  gaps at the beginning of each heading in text-mode browsers like <a class="md2man-reference">w3m(1)</a>.</p></li>
14
- <li><p>Upgrade to binman version 5.0.0, which is also a major version bump.</p></li>
42
+ <li><p>Upgrade to binman version 5.x.x, which is also a major version bump.</p></li>
15
43
  </ul>
16
- <h3 id="other">Other:<a name="other" href="#other" class="md2man-permalink" title="permalink"></a></h3>
44
+ <h3 id="other-1">Other:<a name="other-1" href="#other-1" class="md2man-permalink" title="permalink"></a></h3>
17
45
  <ul>
18
46
  <li>README: use fenced code blocks to get syntax highlighting on GitHub.</li>
19
47
  </ul>
20
- <h2 id="version-4-0-1-2016-02-10">Version 4.0.1 (2016-02-10)<a name="version-4-0-1-2016-02-10" href="#version-4-0-1-2016-02-10" class="md2man-permalink" title="permalink"></a></h2><h3 id="other-1">Other:<a name="other-1" href="#other-1" class="md2man-permalink" title="permalink"></a></h3>
48
+ <h2 id="version-4-0-1-2016-02-10">Version 4.0.1 (2016-02-10)<a name="version-4-0-1-2016-02-10" href="#version-4-0-1-2016-02-10" class="md2man-permalink" title="permalink"></a></h2><h3 id="other-2">Other:<a name="other-2" href="#other-2" class="md2man-permalink" title="permalink"></a></h3>
21
49
  <ul>
22
50
  <li><p>Make all permalinks appear in the same size.</p></li>
23
51
  <li><p>Change permalink symbols from hearts to stars.</p></li>
@@ -35,11 +63,11 @@ call <code>super()</code> therein to trigger these methods&#39; original impleme
35
63
  <li><code>Md2Man::Document#codespan(code)</code></li>
36
64
  </ul></li>
37
65
  </ul>
38
- <h2 id="version-3-0-2-2014-10-26">Version 3.0.2 (2014-10-26)<a name="version-3-0-2-2014-10-26" href="#version-3-0-2-2014-10-26" class="md2man-permalink" title="permalink"></a></h2><h3 id="patch">Patch:<a name="patch" href="#patch" class="md2man-permalink" title="permalink"></a></h3>
66
+ <h2 id="version-3-0-2-2014-10-26">Version 3.0.2 (2014-10-26)<a name="version-3-0-2-2014-10-26" href="#version-3-0-2-2014-10-26" class="md2man-permalink" title="permalink"></a></h2><h3 id="patch-1">Patch:<a name="patch-1" href="#patch-1" class="md2man-permalink" title="permalink"></a></h3>
39
67
  <ul>
40
68
  <li>Update bootstrap 2.3.2 CDN URL; previous one died.</li>
41
69
  </ul>
42
- <h2 id="version-3-0-1-2014-07-16">Version 3.0.1 (2014-07-16)<a name="version-3-0-1-2014-07-16" href="#version-3-0-1-2014-07-16" class="md2man-permalink" title="permalink"></a></h2><p>This release restores Mac OS X support and fixes a permalink generation bug.</p><h3 id="patch-1">Patch:<a name="patch-1" href="#patch-1" class="md2man-permalink" title="permalink"></a></h3>
70
+ <h2 id="version-3-0-1-2014-07-16">Version 3.0.1 (2014-07-16)<a name="version-3-0-1-2014-07-16" href="#version-3-0-1-2014-07-16" class="md2man-permalink" title="permalink"></a></h2><p>This release restores Mac OS X support and fixes a permalink generation bug.</p><h3 id="patch-2">Patch:<a name="patch-2" href="#patch-2" class="md2man-permalink" title="permalink"></a></h3>
43
71
  <ul>
44
72
  <li><p>GH-13: <a class="md2man-reference">man(1)</a> on Mac OS X could not display URLs.</p><p>The version of groff on Mac OS X is too old: it lacks the an-ext.tmac
45
73
  macro package that defines styles for email addresses and general URLs.</p><pre><code>$ groff --version
@@ -61,13 +89,13 @@ have for jumping to specific locations in your HTML manuals after upgrading.</p>
61
89
  <li><p>Make permalink anchors unique by appending a count in <a class="md2man-reference" href="../man1/md2man-html.1.html">md2man-html(1)</a>.</p></li>
62
90
  <li><p>Rename <code>md2man-xref</code> CSS class to <code>md2man-reference</code> in <a class="md2man-reference" href="../man1/md2man-html.1.html">md2man-html(1)</a>.</p></li>
63
91
  </ul>
64
- <h2 id="version-2-1-1-2014-06-21">Version 2.1.1 (2014-06-21)<a name="version-2-1-1-2014-06-21" href="#version-2-1-1-2014-06-21" class="md2man-permalink" title="permalink"></a></h2><h3 id="patch-2">Patch:<a name="patch-2" href="#patch-2" class="md2man-permalink" title="permalink"></a></h3>
92
+ <h2 id="version-2-1-1-2014-06-21">Version 2.1.1 (2014-06-21)<a name="version-2-1-1-2014-06-21" href="#version-2-1-1-2014-06-21" class="md2man-permalink" title="permalink"></a></h2><h3 id="patch-3">Patch:<a name="patch-3" href="#patch-3" class="md2man-permalink" title="permalink"></a></h3>
65
93
  <ul>
66
94
  <li><p>Bootstrap CSS failed to load for HTML manuals served under HTTPS.
67
95
  See <a href="https://github.com/sunaku/readably/pull/3">https://github.com/sunaku/readably/pull/3</a> for the details.</p></li>
68
96
  <li><p>Drop redundant nil check in <code>Md2Man::Roff::Engine.escape()</code>.</p></li>
69
97
  </ul>
70
- <h3 id="other-2">Other:<a name="other-2" href="#other-2" class="md2man-permalink" title="permalink"></a></h3>
98
+ <h3 id="other-3">Other:<a name="other-3" href="#other-3" class="md2man-permalink" title="permalink"></a></h3>
71
99
  <ul>
72
100
  <li><p>GitHub now supports relative links from the README.</p></li>
73
101
  <li><p>README: add links to package, manuals, and GitHub.</p></li>
@@ -86,11 +114,11 @@ top-level heading in HTML <code>&lt;span&gt;</code> elements with stylable CSS c
86
114
  </code></pre>
87
115
  <p>Thanks to Nick Fagerlund for requesting this feature in <a href="https://github.com/sunaku/md2man/issues/15">GH-15</a>.</p></li>
88
116
  </ul>
89
- <h3 id="other-3">Other:<a name="other-3" href="#other-3" class="md2man-permalink" title="permalink"></a></h3>
117
+ <h3 id="other-4">Other:<a name="other-4" href="#other-4" class="md2man-permalink" title="permalink"></a></h3>
90
118
  <ul>
91
119
  <li><p><a class="md2man-reference" href="../man5/md2man.5.html">md2man(5)</a> now documents the special <code>.TH</code> format of top-level headings.</p><p>Thanks to Nick Fagerlund for requesting this documentation in <a href="https://github.com/sunaku/md2man/issues/15">GH-15</a>.</p></li>
92
120
  </ul>
93
- <h2 id="version-2-0-4-2014-04-26">Version 2.0.4 (2014-04-26)<a name="version-2-0-4-2014-04-26" href="#version-2-0-4-2014-04-26" class="md2man-permalink" title="permalink"></a></h2><h3 id="patch-3">Patch:<a name="patch-3" href="#patch-3" class="md2man-permalink" title="permalink"></a></h3>
121
+ <h2 id="version-2-0-4-2014-04-26">Version 2.0.4 (2014-04-26)<a name="version-2-0-4-2014-04-26" href="#version-2-0-4-2014-04-26" class="md2man-permalink" title="permalink"></a></h2><h3 id="patch-4">Patch:<a name="patch-4" href="#patch-4" class="md2man-permalink" title="permalink"></a></h3>
94
122
  <ul>
95
123
  <li><p>GH-16: Redcarpet 3.1 added a third parameter to its <code>header()</code> method.
96
124
  This raised an ArgumentError on &quot;wrong number of arguments (3 for 2)&quot;.</p><p>Thanks to zimbatm for contributing this patch.</p></li>
@@ -98,7 +126,7 @@ This raised an ArgumentError on &quot;wrong number of arguments (3 for 2)&quot;.
98
126
  This fixes a bug where lines beginning with periods or single quotes
99
127
  did not appear when <a class="md2man-reference" href="../man1/md2man-roff.1.html">md2man-roff(1)</a> output was rendered using <a class="md2man-reference">man(1)</a>.</p><p>Thanks to zimbatm for reporting this bug and suggesting how to fix it.</p></li>
100
128
  </ul>
101
- <h2 id="version-2-0-3-2014-01-16">Version 2.0.3 (2014-01-16)<a name="version-2-0-3-2014-01-16" href="#version-2-0-3-2014-01-16" class="md2man-permalink" title="permalink"></a></h2><h3 id="patch-4">Patch:<a name="patch-4" href="#patch-4" class="md2man-permalink" title="permalink"></a></h3>
129
+ <h2 id="version-2-0-3-2014-01-16">Version 2.0.3 (2014-01-16)<a name="version-2-0-3-2014-01-16" href="#version-2-0-3-2014-01-16" class="md2man-permalink" title="permalink"></a></h2><h3 id="patch-5">Patch:<a name="patch-5" href="#patch-5" class="md2man-permalink" title="permalink"></a></h3>
102
130
  <ul>
103
131
  <li><p>Use CSS3 <code>-ch</code> suffix for accurate 80-character width in HTML output.</p><p><a href="http://www.w3.org/TR/css3-values/#font-relative-lengths">http://www.w3.org/TR/css3-values/#font-relative-lengths</a></p></li>
104
132
  </ul>