md2man 1.4.0 → 1.4.1
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/HISTORY.markdown +28 -0
- data/LICENSE +3 -3
- data/README.markdown +53 -7
- data/bin/md2man +1 -1
- data/bin/md2man-html +1 -1
- data/lib/md2man/rakefile.rb +4 -2
- data/lib/md2man/version.rb +1 -1
- data/man/man1/md2man-html.1 +1 -1
- data/man/man1/md2man.1 +1 -1
- data/md2man.gemspec +1 -0
- metadata +5 -8
data/HISTORY.markdown
CHANGED
@@ -1,3 +1,31 @@
|
|
1
|
+
## Version 1.4.1 (2013-02-23)
|
2
|
+
|
3
|
+
Patch:
|
4
|
+
|
5
|
+
* rakefile: arbitrary directory structure under man/
|
6
|
+
|
7
|
+
https://github.com/sunaku/md2man/pull/3#issuecomment-9429077
|
8
|
+
|
9
|
+
Thanks to Postmodern for raising this issue.
|
10
|
+
|
11
|
+
* hook into 'build' task only if using Bundler tasks
|
12
|
+
|
13
|
+
https://github.com/sunaku/md2man/pull/7#issuecomment-9467621
|
14
|
+
|
15
|
+
Thanks to Postmodern for raising this issue.
|
16
|
+
|
17
|
+
* GH-8: Redcarpet requires Ruby 1.9 and so must we
|
18
|
+
|
19
|
+
https://github.com/sunaku/md2man/issues/8#issuecomment-9509240
|
20
|
+
|
21
|
+
Thanks to Postmodern for raising this issue.
|
22
|
+
|
23
|
+
Other:
|
24
|
+
|
25
|
+
* README: add md2man-html(1) and Md2Man::HTML usage
|
26
|
+
|
27
|
+
* LICENSE: use GitHub profile URLs instead of e-mail
|
28
|
+
|
1
29
|
## Version 1.4.0 (2012-10-14)
|
2
30
|
|
3
31
|
Minor:
|
data/LICENSE
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
(the ISC license)
|
2
2
|
|
3
|
-
Copyright 2011 Suraj N. Kurapati <
|
4
|
-
Thanks to 2011 Vicent Marti <
|
5
|
-
Thanks to 2012 Postmodern <
|
3
|
+
Copyright 2011 Suraj N. Kurapati <https://github.com/sunaku>
|
4
|
+
Thanks to 2011 Vicent Marti <https://github.com/vmg>
|
5
|
+
Thanks to 2012 Postmodern <https://github.com/postmodern>
|
6
6
|
|
7
7
|
Permission to use, copy, modify, and/or distribute this software for any
|
8
8
|
purpose with or without fee is hereby granted, provided that the above
|
data/README.markdown
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# md2man - markdown to manpage
|
2
2
|
|
3
3
|
md2man is a Ruby library and command-line program that converts [Markdown]
|
4
|
-
documents into UNIX manual pages (
|
4
|
+
documents into UNIX manual pages (both [roff] and HTML) using [Redcarpet].
|
5
5
|
|
6
6
|
## Features
|
7
7
|
|
8
8
|
* Formats tagged and indented paragraphs (see "document format" below).
|
9
9
|
|
10
|
-
* Translates all HTML4 and XHTML1 entities into native
|
10
|
+
* Translates all HTML4 and XHTML1 entities into native [roff] equivalents.
|
11
11
|
|
12
12
|
* Supports markdown extensions such as [PHP Markdown Extra tables][tables].
|
13
13
|
|
@@ -47,7 +47,7 @@ It issues a warning when it encounters these instead. Patches are welcome!
|
|
47
47
|
bundle exec md2man --help # run it directly
|
48
48
|
bundle exec rake -T # packaging tasks
|
49
49
|
|
50
|
-
## Usage
|
50
|
+
## Usage (for [roff] output)
|
51
51
|
|
52
52
|
### At the command line
|
53
53
|
|
@@ -58,11 +58,13 @@ It issues a warning when it encounters these instead. Patches are welcome!
|
|
58
58
|
Use the default renderer:
|
59
59
|
|
60
60
|
require 'md2man'
|
61
|
+
|
61
62
|
your_roff_output = Md2Man::ENGINE.render(your_markdown_input)
|
62
63
|
|
63
64
|
Build your own renderer:
|
64
65
|
|
65
66
|
require 'md2man'
|
67
|
+
|
66
68
|
engine = Redcarpet::Markdown.new(Md2Man::Engine, your_options_hash)
|
67
69
|
your_roff_output = engine.render(your_markdown_input)
|
68
70
|
|
@@ -89,6 +91,50 @@ Mix-in your own renderer:
|
|
89
91
|
engine = Redcarpet::Markdown.new(YourManpageRenderer, your_options_hash)
|
90
92
|
your_roff_output = engine.render(your_markdown_input)
|
91
93
|
|
94
|
+
## Usage (for HTML output)
|
95
|
+
|
96
|
+
### At the command line
|
97
|
+
|
98
|
+
md2man-html --help
|
99
|
+
|
100
|
+
### Inside a Ruby script
|
101
|
+
|
102
|
+
Use the default renderer:
|
103
|
+
|
104
|
+
require 'md2man/html/engine'
|
105
|
+
|
106
|
+
your_html_output = Md2Man::HTML::ENGINE.render(your_markdown_input)
|
107
|
+
|
108
|
+
Build your own renderer:
|
109
|
+
|
110
|
+
require 'md2man/html/engine'
|
111
|
+
|
112
|
+
engine = Redcarpet::Markdown.new(Md2Man::HTML::Engine, your_options_hash)
|
113
|
+
your_html_output = engine.render(your_markdown_input)
|
114
|
+
|
115
|
+
Define your own renderer:
|
116
|
+
|
117
|
+
require 'md2man/html/engine'
|
118
|
+
|
119
|
+
class YourManpageRenderer < Md2Man::HTML::Engine
|
120
|
+
# ... your stuff here ...
|
121
|
+
end
|
122
|
+
|
123
|
+
engine = Redcarpet::Markdown.new(YourManpageRenderer, your_options_hash)
|
124
|
+
your_html_output = engine.render(your_markdown_input)
|
125
|
+
|
126
|
+
Mix-in your own renderer:
|
127
|
+
|
128
|
+
require 'md2man/html'
|
129
|
+
|
130
|
+
class YourManpageRenderer < Redcarpet::Render::Base
|
131
|
+
include Md2Man::HTML
|
132
|
+
# ... your stuff here ...
|
133
|
+
end
|
134
|
+
|
135
|
+
engine = Redcarpet::Markdown.new(YourManpageRenderer, your_options_hash)
|
136
|
+
your_html_output = engine.render(your_markdown_input)
|
137
|
+
|
92
138
|
### Document format
|
93
139
|
|
94
140
|
md2man extends [Markdown] syntax in the following ways, as provisioned in the
|
@@ -96,11 +142,11 @@ md2man extends [Markdown] syntax in the following ways, as provisioned in the
|
|
96
142
|
|
97
143
|
* Paragraphs whose lines are all uniformly indented by two spaces are
|
98
144
|
considered to be "indented paragraphs". They are unindented accordingly
|
99
|
-
before emission as `.IP` in the [
|
145
|
+
before emission as `.IP` in the [roff] output.
|
100
146
|
|
101
147
|
* Paragraphs whose subsequent lines (all except the first) are uniformly
|
102
148
|
indented by two spaces are considered to be a "tagged paragraphs". They
|
103
|
-
are unindented accordingly before emission as `.TP` in the [
|
149
|
+
are unindented accordingly before emission as `.TP` in the [roff] output.
|
104
150
|
|
105
151
|
md2man extends [Markdown] semantics in the following ways:
|
106
152
|
|
@@ -121,7 +167,7 @@ Add the following line to your Rakefile:
|
|
121
167
|
|
122
168
|
You now have a `rake md2man` task that builds manual pages from Markdown files
|
123
169
|
(with ".markdown", ".mkd", or ".md" extension) inside `man/man*/` directories.
|
124
|
-
There are also sub-tasks to build
|
170
|
+
There are also sub-tasks to build manual pages individually as [roff] or HTML.
|
125
171
|
|
126
172
|
If you're using Bundler, this task also hooks into Bundler's gem packaging
|
127
173
|
tasks and ensures that your manual pages are built for packaging into a gem:
|
@@ -133,7 +179,7 @@ tasks and ensures that your manual pages are built for packaging into a gem:
|
|
133
179
|
|
134
180
|
Released under the ISC license. See the LICENSE file for details.
|
135
181
|
|
136
|
-
[
|
182
|
+
[roff]: http://troff.org
|
137
183
|
[Markdown]: http://daringfireball.net/projects/markdown/
|
138
184
|
[Redcarpet]: https://github.com/vmg/redcarpet
|
139
185
|
[example]: https://raw.github.com/sunaku/md2man/master/EXAMPLE.markdown
|
data/bin/md2man
CHANGED
data/bin/md2man-html
CHANGED
data/lib/md2man/rakefile.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
require 'rake'
|
2
2
|
|
3
3
|
# build man pages before building ruby gem using bundler
|
4
|
-
|
4
|
+
if defined? Bundler::GemHelper
|
5
|
+
%w[build install release].each {|t| task t => :md2man }
|
6
|
+
end
|
5
7
|
|
6
8
|
#-----------------------------------------------------------------------------
|
7
9
|
desc 'Build manual pages from Markdown files in man/.'
|
8
10
|
task :md2man => ['md2man:man', 'md2man:web']
|
9
11
|
#-----------------------------------------------------------------------------
|
10
12
|
|
11
|
-
mkds = FileList['man
|
13
|
+
mkds = FileList['man/**/*.{markdown,mkd,md}']
|
12
14
|
mans = mkds.pathmap('%X')
|
13
15
|
webs = mans.pathmap('%p.html')
|
14
16
|
|
data/lib/md2man/version.rb
CHANGED
data/man/man1/md2man-html.1
CHANGED
data/man/man1/md2man.1
CHANGED
data/md2man.gemspec
CHANGED
@@ -16,6 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
17
|
s.require_paths = ['lib']
|
18
18
|
|
19
|
+
s.required_ruby_version = '>= 1.9.1'
|
19
20
|
s.add_runtime_dependency 'binman', '~> 3.0'
|
20
21
|
s.add_runtime_dependency 'redcarpet', '~> 2.1'
|
21
22
|
s.add_development_dependency 'minitest', '~> 4.0'
|
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: 1.4.
|
4
|
+
version: 1.4.1
|
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:
|
12
|
+
date: 2013-02-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: binman
|
@@ -77,7 +77,7 @@ dependencies:
|
|
77
77
|
version: 0.9.2.2
|
78
78
|
description: Converts markdown documents into UNIX manual pages.
|
79
79
|
email:
|
80
|
-
-
|
80
|
+
- https://github.com/sunaku
|
81
81
|
executables:
|
82
82
|
- md2man
|
83
83
|
- md2man-html
|
@@ -119,10 +119,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
119
119
|
requirements:
|
120
120
|
- - ! '>='
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version:
|
123
|
-
segments:
|
124
|
-
- 0
|
125
|
-
hash: -1838080913948275679
|
122
|
+
version: 1.9.1
|
126
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
124
|
none: false
|
128
125
|
requirements:
|
@@ -131,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
128
|
version: '0'
|
132
129
|
segments:
|
133
130
|
- 0
|
134
|
-
hash:
|
131
|
+
hash: 2835073792924155153
|
135
132
|
requirements: []
|
136
133
|
rubyforge_project:
|
137
134
|
rubygems_version: 1.8.23
|