binman 3.4.1 → 4.0.0

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: d6becc92c0aa066561bb49848c692097ac293ad0
4
- data.tar.gz: ff7adbef6a482c095b42f99a245985022433c29c
3
+ metadata.gz: 1cc5d7a68d2e6551e60382f9b64667e099ce762f
4
+ data.tar.gz: 2a8ecf5be7b27cc58f680c63ef8f90fc96a7088e
5
5
  SHA512:
6
- metadata.gz: 0a309791584f5a2abe6c74ed132a4112b6f62c0b722beca8c3b2a3066207af24e1709a32bd95708ab3104d365231a37ed72507fd9eecc64b62a885312dc3176c
7
- data.tar.gz: fb221b25276afd2bc34fea9bbfe18d793787e8ae1eeb3ca8bf09478f9249d07f1f2aace1224ce1898ce4c0bb35c2f8244e27c848f92034b8eefb9297b0479fd3
6
+ metadata.gz: 8b96360d2329f069691839253409f0d261b72caceaa612762817938b056529a7e26fea03f8f830330ebf867252d7ca718b53cbb435820ab5108ad2422a93d27a
7
+ data.tar.gz: a332414eed9ce3a4f0e5d70ce83c8ca2169063052deff307f1778b42a9ed2923a76a0736d946be6b757f93633c485a474fe3d417acac99eb3f1658009d04de0c
data/README.markdown CHANGED
@@ -4,9 +4,9 @@
4
4
  Simply [document your script in Markdown][md2man-markdown] as a comment at the
5
5
  top of your script and call `binman show` to display it as a UNIX manual page!
6
6
  Or, call `binman help` to display your manual _only_ when your script receives
7
- with `-h` or `--help` command-line options. Or, call `binman load` to extract
7
+ with `-h` or `--help` command-line options. Or, call `binman snip` to extract
8
8
  the manual from your script for your own custom processing, outside of binman.
9
- And that's not all: [see the manual][binman-man] for even more possibilities!
9
+ And that's not all: [see the manual page][binman-man] for more possibilities!
10
10
 
11
11
  * Manuals: <https://sunaku.github.io/binman/man>
12
12
  * Sources: <https://github.com/sunaku/binman>
@@ -29,62 +29,72 @@ And that's not all: [see the manual][binman-man] for even more possibilities!
29
29
 
30
30
  ![Obligatory screen-shot of binman(1) in action!](EXAMPLE.png)
31
31
 
32
- Here are some working examples of Ruby bin scripts to help you get started:
33
-
34
- * tork(1):
35
- [Ruby source](https://raw.github.com/sunaku/tork/master/bin/tork) &rarr;
36
- [HTML result](https://sunaku.github.io/tork/man/man1/tork.1.html) +
37
- [roff result](https://sunaku.github.io/tork/man/man1/tork.1)
38
- * tork-runner(1):
39
- [Ruby source](https://raw.github.com/sunaku/tork/master/bin/tork-runner) &rarr;
40
- [HTML result](https://sunaku.github.io/tork/man/man1/tork-runner.1.html) +
41
- [roff result](https://sunaku.github.io/tork/man/man1/tork-runner.1)
42
- * tork-herald(1):
43
- [Ruby source](https://raw.github.com/sunaku/tork/master/bin/tork-herald) &rarr;
44
- [HTML result](https://sunaku.github.io/tork/man/man1/tork-herald.1.html) +
45
- [roff result](https://sunaku.github.io/tork/man/man1/tork-herald.1)
46
- * tork-driver(1):
47
- [Ruby source](https://raw.github.com/sunaku/tork/master/bin/tork-driver) &rarr;
48
- [HTML result](https://sunaku.github.io/tork/man/man1/tork-driver.1.html) +
49
- [roff result](https://sunaku.github.io/tork/man/man1/tork-driver.1)
50
- * tork-engine(1):
51
- [Ruby source](https://raw.github.com/sunaku/tork/master/bin/tork-engine) &rarr;
52
- [HTML result](https://sunaku.github.io/tork/man/man1/tork-engine.1.html) +
53
- [roff result](https://sunaku.github.io/tork/man/man1/tork-engine.1)
54
- * tork-master(1):
55
- [Ruby source](https://raw.github.com/sunaku/tork/master/bin/tork-master) &rarr;
56
- [HTML result](https://sunaku.github.io/tork/man/man1/tork-master.1.html) +
57
- [roff result](https://sunaku.github.io/tork/man/man1/tork-master.1)
58
- * tork-remote(1):
59
- [Ruby source](https://raw.github.com/sunaku/tork/master/bin/tork-remote) &rarr;
60
- [HTML result](https://sunaku.github.io/tork/man/man1/tork-remote.1.html) +
61
- [roff result](https://sunaku.github.io/tork/man/man1/tork-remote.1)
62
- * tork-notify(1):
63
- [Ruby source](https://raw.github.com/sunaku/tork/master/bin/tork-notify) &rarr;
64
- [HTML result](https://sunaku.github.io/tork/man/man1/tork-notify.1.html) +
65
- [roff result](https://sunaku.github.io/tork/man/man1/tork-notify.1)
66
- * md2man-roff(1):
67
- [Ruby source](https://raw.github.com/sunaku/md2man/master/bin/md2man-roff) &rarr;
68
- [HTML result](https://sunaku.github.io/md2man/man/man1/md2man-roff.1.html) +
69
- [roff result](https://sunaku.github.io/md2man/man/man1/md2man-roff.1)
70
- * md2man-html(1):
71
- [Ruby source](https://raw.github.com/sunaku/md2man/master/bin/md2man-html) &rarr;
72
- [HTML result](https://sunaku.github.io/md2man/man/man1/md2man-html.1.html) +
73
- [roff result](https://sunaku.github.io/md2man/man/man1/md2man-html.1)
74
- * md2man-rake(1):
75
- [Ruby source](https://raw.github.com/sunaku/md2man/master/bin/md2man-rake) &rarr;
76
- [HTML result](https://sunaku.github.io/md2man/man/man1/md2man-rake.1.html) +
77
- [roff result](https://sunaku.github.io/md2man/man/man1/md2man-rake.1)
78
- * binman(1):
79
- [Ruby source](https://raw.github.com/sunaku/binman/master/bin/binman) &rarr;
80
- [HTML result](https://sunaku.github.io/binman/man/man1/binman.1.html) +
81
- [roff result](https://sunaku.github.io/binman/man/man1/binman.1)
82
- * binman-rake(1):
83
- [Ruby source](https://raw.github.com/sunaku/binman/master/bin/binman-rake) &rarr;
84
- [HTML result](https://sunaku.github.io/binman/man/man1/binman-rake.1.html) +
85
- [roff result](https://sunaku.github.io/binman/man/man1/binman-rake.1)
86
-
87
- For examples in other scripting languages, see the "Usage" section below!
32
+ #### What can binman(1) do?
33
+
34
+ Here are some real examples of processed bin scripts to help you get started:
35
+
36
+ * [bin/tork](https://raw.github.com/sunaku/tork/master/bin/tork) &rArr;
37
+ [tork.1.markdown](https://sunaku.github.io/tork/man/man1/tork.1.markdown) &rArr;
38
+ [tork.1](https://sunaku.github.io/tork/man/man1/tork.1) +
39
+ [tork.1.html](https://sunaku.github.io/tork/man/man1/tork.1.html)
40
+ * [bin/tork-runner](https://raw.github.com/sunaku/tork/master/bin/tork-runner) &rArr;
41
+ [tork-runner.1.markdown](https://sunaku.github.io/tork/man/man1/tork-runner.1.markdown) &rArr;
42
+ [tork-runner.1](https://sunaku.github.io/tork/man/man1/tork-runner.1) +
43
+ [tork-runner.1.html](https://sunaku.github.io/tork/man/man1/tork-runner.1.html)
44
+ * [bin/tork-herald](https://raw.github.com/sunaku/tork/master/bin/tork-herald) &rArr;
45
+ [tork-herald.1.markdown](https://sunaku.github.io/tork/man/man1/tork-herald.1.markdown) &rArr;
46
+ [tork-herald.1](https://sunaku.github.io/tork/man/man1/tork-herald.1) +
47
+ [tork-herald.1.html](https://sunaku.github.io/tork/man/man1/tork-herald.1.html)
48
+ * [bin/tork-driver](https://raw.github.com/sunaku/tork/master/bin/tork-driver) &rArr;
49
+ [tork-driver.1.markdown](https://sunaku.github.io/tork/man/man1/tork-driver.1.markdown) &rArr;
50
+ [tork-driver.1](https://sunaku.github.io/tork/man/man1/tork-driver.1) +
51
+ [tork-driver.1.html](https://sunaku.github.io/tork/man/man1/tork-driver.1.html)
52
+ * [bin/tork-engine](https://raw.github.com/sunaku/tork/master/bin/tork-engine) &rArr;
53
+ [tork-engine.1.markdown](https://sunaku.github.io/tork/man/man1/tork-engine.1.markdown) &rArr;
54
+ [tork-engine.1](https://sunaku.github.io/tork/man/man1/tork-engine.1) +
55
+ [tork-engine.1.html](https://sunaku.github.io/tork/man/man1/tork-engine.1.html)
56
+ * [bin/tork-master](https://raw.github.com/sunaku/tork/master/bin/tork-master) &rArr;
57
+ [tork-master.1.markdown](https://sunaku.github.io/tork/man/man1/tork-master.1.markdown) &rArr;
58
+ [tork-master.1](https://sunaku.github.io/tork/man/man1/tork-master.1) +
59
+ [tork-master.1.html](https://sunaku.github.io/tork/man/man1/tork-master.1.html)
60
+ * [bin/tork-remote](https://raw.github.com/sunaku/tork/master/bin/tork-remote) &rArr;
61
+ [tork-remote.1.markdown](https://sunaku.github.io/tork/man/man1/tork-remote.1.markdown) &rArr;
62
+ [tork-remote.1](https://sunaku.github.io/tork/man/man1/tork-remote.1) +
63
+ [tork-remote.1.html](https://sunaku.github.io/tork/man/man1/tork-remote.1.html)
64
+ * [bin/tork-notify](https://raw.github.com/sunaku/tork/master/bin/tork-notify) &rArr;
65
+ [tork-notify.1.markdown](https://sunaku.github.io/tork/man/man1/tork-notify.1.markdown) &rArr;
66
+ [tork-notify.1](https://sunaku.github.io/tork/man/man1/tork-notify.1) +
67
+ [tork-notify.1.html](https://sunaku.github.io/tork/man/man1/tork-notify.1.html)
68
+ * [bin/md2man-roff](https://raw.github.com/sunaku/md2man/master/bin/md2man-roff) &rArr;
69
+ [md2man-roff.1.markdown](https://sunaku.github.io/md2man/man/man1/md2man-roff.1.markdown) &rArr;
70
+ [md2man-roff.1](https://sunaku.github.io/md2man/man/man1/md2man-roff.1) +
71
+ [md2man-roff.1.html](https://sunaku.github.io/md2man/man/man1/md2man-roff.1.html)
72
+ * [bin/md2man-html](https://raw.github.com/sunaku/md2man/master/bin/md2man-html) &rArr;
73
+ [md2man-html.1.markdown](https://sunaku.github.io/md2man/man/man1/md2man-html.1.markdown) &rArr;
74
+ [md2man-html.1](https://sunaku.github.io/md2man/man/man1/md2man-html.1) +
75
+ [md2man-html.1.html](https://sunaku.github.io/md2man/man/man1/md2man-html.1.html)
76
+ * [bin/md2man-rake](https://raw.github.com/sunaku/md2man/master/bin/md2man-rake) &rArr;
77
+ [md2man-rake.1.markdown](https://sunaku.github.io/md2man/man/man1/md2man-rake.1.markdown) &rArr;
78
+ [md2man-rake.1](https://sunaku.github.io/md2man/man/man1/md2man-rake.1) +
79
+ [md2man-rake.1.html](https://sunaku.github.io/md2man/man/man1/md2man-rake.1.html)
80
+ * [bin/binman](https://raw.github.com/sunaku/binman/master/bin/binman) &rArr;
81
+ [binman.1.markdown](https://sunaku.github.io/binman/man/man1/binman.1.markdown) &rArr;
82
+ [binman.1](https://sunaku.github.io/binman/man/man1/binman.1) +
83
+ [binman.1.html](https://sunaku.github.io/binman/man/man1/binman.1.html)
84
+ * [bin/binman-rake](https://raw.github.com/sunaku/binman/master/bin/binman-rake) &rArr;
85
+ [binman-rake.1.markdown](https://sunaku.github.io/binman/man/man1/binman-rake.1.markdown) &rArr;
86
+ [binman-rake.1](https://sunaku.github.io/binman/man/man1/binman-rake.1) +
87
+ [binman-rake.1.html](https://sunaku.github.io/binman/man/man1/binman-rake.1.html)
88
+
89
+ For examples in even more scripting languages, see the "Usage" section below!
90
+
91
+ #### What can binman-rake(1) do?
92
+
93
+ Here are some examples of HTML manual _sets_ produced by binman-rake(1):
94
+
95
+ * https://sunaku.github.io/tork/man
96
+ * https://sunaku.github.io/binman/man
97
+ * https://sunaku.github.io/md2man/man
88
98
 
89
99
  ## Installation
90
100
 
@@ -97,7 +107,7 @@ gem install binman
97
107
  If you also want to build your own manual pages:
98
108
 
99
109
  ```sh
100
- gem install md2man -v '~> 3.0'
110
+ gem install md2man -v '~> 4.0'
101
111
  ```
102
112
 
103
113
  ### Prerequisites
@@ -332,7 +342,7 @@ Add this snippet to your gemspec file:
332
342
  ```ruby
333
343
  s.files += Dir['man/man?/*.?'] # UNIX man pages
334
344
  s.files += Dir['man/**/*.{html,css,js}'] # HTML man pages
335
- s.add_development_dependency 'md2man', '~> 3.0'
345
+ s.add_development_dependency 'md2man', '~> 4.0'
336
346
  ```
337
347
 
338
348
  Add the following line to your Rakefile:
data/VERSION.markdown CHANGED
@@ -1,3 +1,16 @@
1
+ ## Version 4.0.0 (2014-10-26)
2
+
3
+ ### Major:
4
+
5
+ * binman(1): Rename the `load` command to `snip` and remove `conv`.
6
+
7
+ * The `binman conv` command has been removed; use `md2man-roff` instead.
8
+
9
+ * We no longer require a specific md2man version at runtime; any will do.
10
+
11
+ * Upgrade to md2man 4.0, which no longer expands cross references in code
12
+ spans and code blocks. Your manuals might be rendered differently now.
13
+
1
14
  ## Version 3.4.1 (2014-07-01)
2
15
 
3
16
  This release fixes the help options' REGEXP argument under non-Debian systems.
data/bin/binman CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  =begin =======================================================================
3
3
 
4
- # BINMAN 1 2014-07-01 3.4.1
4
+ # BINMAN 1 2014-10-26 4.0.0
5
5
 
6
6
  ## NAME
7
7
 
@@ -64,6 +64,18 @@ The following [Redcarpet] extensions are enabled while processing markdown(7):
64
64
 
65
65
  ## COMMANDS
66
66
 
67
+ `snip` [*FILE*]
68
+ Print the leading comment header extracted from the given *FILE* or STDIN.
69
+
70
+ `dump` [*FILE*]
71
+ Print the roff(7) conversion of the leading comment header extracted from
72
+ the given *FILE* or STDIN.
73
+
74
+ `show` [*FILE*] [*PATTERN*]
75
+ Use man(1) to display the roff(7) conversion of the leading comment header
76
+ extracted from the given *FILE* or STDIN. If *PATTERN* is given, search for
77
+ it within the output displayed by man(1) and jump to first match if found.
78
+
67
79
  `help` *FILE* ... [`-h`|`--help` [*PATTERN*]] ... [`--`] ...
68
80
  If the given argument sequence contains `-h` or `--help`, except after
69
81
  `--`, optionally followed by a *PATTERN* regular expression that specifies
@@ -72,22 +84,6 @@ The following [Redcarpet] extensions are enabled while processing markdown(7):
72
84
  converts it into roff(7), displays it using man(1), and finally exits with
73
85
  status code `0`. Otherwise, this program exits with status code `111`.
74
86
 
75
- `show` [*FILE*] [*PATTERN*]
76
- Use man(1) to display the roff(7) conversion of the leading comment header
77
- extracted from the given *FILE* or STDIN. If *PATTERN* is given, search for
78
- it within the output displayed by man(1) and jump to first match if found.
79
-
80
- `load` [*FILE*]
81
- Print the leading comment header extracted from the given *FILE* or STDIN.
82
-
83
- `dump` [*FILE*]
84
- Print the roff(7) conversion of the leading comment header extracted from
85
- the given *FILE* or STDIN.
86
-
87
- `conv` [*FILE*]
88
- Print the roff(7) conversion of the markdown(7) document read from the given
89
- *FILE* or STDIN.
90
-
91
87
  ## SEE ALSO
92
88
 
93
89
  binman-rake(1), man(1), roff(7), markdown(7)
@@ -111,7 +107,7 @@ else
111
107
  case command
112
108
  when 'show'
113
109
  BinMan.send(command, source)
114
- when 'load', 'dump', 'conv'
110
+ when 'snip', 'dump'
115
111
  puts BinMan.send(command, source)
116
112
  else
117
113
  warn 'binman: invalid command; try --help'
data/bin/binman-rake CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  =begin =======================================================================
3
3
 
4
- # BINMAN-RAKE 1 2014-07-01 3.4.1
4
+ # BINMAN-RAKE 1 2014-10-26 4.0.0
5
5
 
6
6
  ## NAME
7
7
 
data/binman.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
 
19
19
  s.files += Dir['man/man?/*.?'] # UNIX man pages
20
20
  s.files += Dir['man/**/*.{html,css,js}'] # HTML man pages
21
- s.add_development_dependency 'md2man', '~> 3.0'
21
+ s.add_development_dependency 'md2man', '~> 4.0'
22
22
 
23
23
  s.add_dependency 'opener', '>= 0.1.0', '< 1'
24
24
  s.add_development_dependency 'rake', '~> 10.1'
data/lib/binman.rb CHANGED
@@ -15,7 +15,7 @@ module BinMan
15
15
  #
16
16
  # Comment markers and shebang/encoding comments are omitted from result.
17
17
  #
18
- def load source=nil
18
+ def snip source=nil
19
19
  header = read(source)
20
20
 
21
21
  # strip shebang and encoding comments
@@ -30,22 +30,16 @@ module BinMan
30
30
  end.strip
31
31
  end
32
32
 
33
- # Converts given markdown(7) source into roff(7).
34
- def conv source=nil
35
- require_md2man
36
- require 'md2man/roff/engine'
37
- Md2Man::Roff::ENGINE.render(read(source))
38
- end
39
-
40
33
  # Extracts leading comment header content from given
41
34
  # source and returns the roff(7) conversion thereof.
42
35
  def dump source=nil
43
- conv load(source)
36
+ conv snip(source)
44
37
  end
45
38
 
46
39
  # Shows leading comment header from given source as UNIX man page and
47
40
  # optionally jumps to first match of query regular expression if given.
48
41
  # If not possible, falls back to showing leading comment header as-is.
42
+ # Tries to display a pre-rendered UNIX man page under ./man/ if possible.
49
43
  def show source=nil, query=nil
50
44
  # try showing existing man page files for given source
51
45
  if file = find(source) and File.exist? file
@@ -69,7 +63,7 @@ module BinMan
69
63
  end
70
64
 
71
65
  # fall back to showing leading comment header as-is
72
- header = load(source)
66
+ header = snip(source)
73
67
 
74
68
  begin
75
69
  roff = conv(header)
@@ -98,15 +92,6 @@ module BinMan
98
92
  end
99
93
  end
100
94
 
101
- # Requires that the correct version of Md2Man is available on this system.
102
- def require_md2man
103
- require 'rubygems' unless respond_to? :gem
104
- gem 'md2man', '~> 3.0' if respond_to? :gem
105
- require 'md2man/version'
106
- rescue LoadError
107
- raise 'Run `gem install md2man --version "~> 3.0"` to use BinMan::conv().'
108
- end
109
-
110
95
  private
111
96
 
112
97
  # Launches man(1) with the given arguments and then tries to search for the
@@ -122,6 +107,14 @@ private
122
107
  end or system 'man', *argv
123
108
  end
124
109
 
110
+ # Converts given markdown(7) source into roff(7).
111
+ def conv source=nil
112
+ require 'md2man/roff/engine'
113
+ Md2Man::Roff::ENGINE.render(read(source))
114
+ rescue LoadError
115
+ raise 'Run `gem install md2man` to use BinMan::dump() or BinMan::show().'
116
+ end
117
+
125
118
  # Returns contents of given source I/O, file name, or string.
126
119
  def read source=nil
127
120
  if source.respond_to? :read
@@ -17,7 +17,7 @@ mkds = bins.pathmap("#{dir}/%n.1.markdown")
17
17
 
18
18
  bins.zip(mkds).each do |src, dst|
19
19
  file dst => [dir, src] do
20
- output = BinMan.load(src)
20
+ output = BinMan.snip(src)
21
21
  File.open(dst, 'w') {|f| f << output }
22
22
  end
23
23
  end
@@ -26,7 +26,6 @@ end
26
26
  desc 'Build UNIX manual pages for bin/ scripts.'
27
27
  task 'binman:man' => mkds do
28
28
  #-----------------------------------------------------------------------------
29
- BinMan.require_md2man
30
29
  load 'md2man/rakefile.rb'
31
30
  Rake::Task['md2man:man'].invoke
32
31
  end
@@ -35,7 +34,6 @@ end
35
34
  desc 'Build HTML manual pages for bin/ scripts.'
36
35
  task 'binman:web' => mkds do
37
36
  #-----------------------------------------------------------------------------
38
- BinMan.require_md2man
39
37
  load 'md2man/rakefile.rb'
40
38
  Rake::Task['md2man:web'].invoke
41
39
  end
@@ -1,3 +1,3 @@
1
1
  module BinMan
2
- VERSION = "3.4.1"
2
+ VERSION = "4.0.0"
3
3
  end
data/man/index.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
- <meta name="generator" content="md2man 3.0.0 https://github.com/sunaku/md2man" />
5
+ <meta name="generator" content="md2man 4.0.0 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]-->
data/man/man0/README.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
- <meta name="generator" content="md2man 3.0.0 https://github.com/sunaku/md2man" />
5
+ <meta name="generator" content="md2man 4.0.0 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]-->
@@ -11,9 +11,9 @@
11
11
  Simply <a href="https://sunaku.github.io/md2man/man/man5/md2man.5.html">document your script in Markdown</a> as a comment at the
12
12
  top of your script and call <code>binman show</code> to display it as a UNIX manual page!
13
13
  Or, call <code>binman help</code> to display your manual <em>only</em> when your script receives
14
- with <code>-h</code> or <code>--help</code> command-line options. Or, call <code>binman load</code> to extract
14
+ with <code>-h</code> or <code>--help</code> command-line options. Or, call <code>binman snip</code> to extract
15
15
  the manual from your script for your own custom processing, outside of binman.
16
- And that&#39;s not all: <a href="https://sunaku.github.io/binman/man/man1/binman.1.html">see the manual</a> for even more possibilities!</p>
16
+ And that&#39;s not all: <a href="https://sunaku.github.io/binman/man/man1/binman.1.html">see the manual page</a> for more possibilities!</p>
17
17
  <ul>
18
18
  <li>Manuals: <a href="https://sunaku.github.io/binman/man">https://sunaku.github.io/binman/man</a></li>
19
19
  <li>Sources: <a href="https://github.com/sunaku/binman">https://github.com/sunaku/binman</a></li>
@@ -29,83 +29,84 @@ Perl, Python, Node.js, Tcl, AWK, UNIX shell, and more!</p></li>
29
29
  <li><p>Individual extraction, conversion, and display commands.</p></li>
30
30
  <li><p>Implemented in roughly 150 lines of pure Ruby code! :-)</p></li>
31
31
  </ul>
32
- <h3 id="demonstration"><a name="demonstration" href="#demonstration" class="md2man-permalink" title="permalink"></a>Demonstration</h3><p><img src="EXAMPLE.png" alt="Obligatory screen-shot of binman(1) in action!"></p><p>Here are some working examples of Ruby bin scripts to help you get started:</p>
32
+ <h3 id="demonstration"><a name="demonstration" href="#demonstration" class="md2man-permalink" title="permalink"></a>Demonstration</h3><p><img src="EXAMPLE.png" alt="Obligatory screen-shot of binman(1) in action!"></p><h4 id="what-can-binman-1-do"><a name="what-can-binman-1-do" href="#what-can-binman-1-do" class="md2man-permalink" title="permalink"></a>What can <a class="md2man-reference" href="../man1/binman.1.html">binman(1)</a> do?</h4><p>Here are some real examples of processed bin scripts to help you get started:</p>
33
33
  <ul>
34
- <li><a class="md2man-reference">tork(1)</a>:
35
- <a href="https://raw.github.com/sunaku/tork/master/bin/tork">Ruby source</a> &rarr;
36
- <a href="https://sunaku.github.io/tork/man/man1/tork.1.html">HTML result</a> +
37
- <a href="https://sunaku.github.io/tork/man/man1/tork.1">roff result</a></li>
38
- <li><a class="md2man-reference">tork-runner(1)</a>:
39
- <a href="https://raw.github.com/sunaku/tork/master/bin/tork-runner">Ruby source</a> &rarr;
40
- <a href="https://sunaku.github.io/tork/man/man1/tork-runner.1.html">HTML result</a> +
41
- <a href="https://sunaku.github.io/tork/man/man1/tork-runner.1">roff result</a></li>
42
- <li><a class="md2man-reference">tork-herald(1)</a>:
43
- <a href="https://raw.github.com/sunaku/tork/master/bin/tork-herald">Ruby source</a> &rarr;
44
- <a href="https://sunaku.github.io/tork/man/man1/tork-herald.1.html">HTML result</a> +
45
- <a href="https://sunaku.github.io/tork/man/man1/tork-herald.1">roff result</a></li>
46
- <li><a class="md2man-reference">tork-driver(1)</a>:
47
- <a href="https://raw.github.com/sunaku/tork/master/bin/tork-driver">Ruby source</a> &rarr;
48
- <a href="https://sunaku.github.io/tork/man/man1/tork-driver.1.html">HTML result</a> +
49
- <a href="https://sunaku.github.io/tork/man/man1/tork-driver.1">roff result</a></li>
50
- <li><a class="md2man-reference">tork-engine(1)</a>:
51
- <a href="https://raw.github.com/sunaku/tork/master/bin/tork-engine">Ruby source</a> &rarr;
52
- <a href="https://sunaku.github.io/tork/man/man1/tork-engine.1.html">HTML result</a> +
53
- <a href="https://sunaku.github.io/tork/man/man1/tork-engine.1">roff result</a></li>
54
- <li><a class="md2man-reference">tork-master(1)</a>:
55
- <a href="https://raw.github.com/sunaku/tork/master/bin/tork-master">Ruby source</a> &rarr;
56
- <a href="https://sunaku.github.io/tork/man/man1/tork-master.1.html">HTML result</a> +
57
- <a href="https://sunaku.github.io/tork/man/man1/tork-master.1">roff result</a></li>
58
- <li><a class="md2man-reference">tork-remote(1)</a>:
59
- <a href="https://raw.github.com/sunaku/tork/master/bin/tork-remote">Ruby source</a> &rarr;
60
- <a href="https://sunaku.github.io/tork/man/man1/tork-remote.1.html">HTML result</a> +
61
- <a href="https://sunaku.github.io/tork/man/man1/tork-remote.1">roff result</a></li>
62
- <li><a class="md2man-reference">tork-notify(1)</a>:
63
- <a href="https://raw.github.com/sunaku/tork/master/bin/tork-notify">Ruby source</a> &rarr;
64
- <a href="https://sunaku.github.io/tork/man/man1/tork-notify.1.html">HTML result</a> +
65
- <a href="https://sunaku.github.io/tork/man/man1/tork-notify.1">roff result</a></li>
66
- <li><a class="md2man-reference">md2man-roff(1)</a>:
67
- <a href="https://raw.github.com/sunaku/md2man/master/bin/md2man-roff">Ruby source</a> &rarr;
68
- <a href="https://sunaku.github.io/md2man/man/man1/md2man-roff.1.html">HTML result</a> +
69
- <a href="https://sunaku.github.io/md2man/man/man1/md2man-roff.1">roff result</a></li>
70
- <li><a class="md2man-reference">md2man-html(1)</a>:
71
- <a href="https://raw.github.com/sunaku/md2man/master/bin/md2man-html">Ruby source</a> &rarr;
72
- <a href="https://sunaku.github.io/md2man/man/man1/md2man-html.1.html">HTML result</a> +
73
- <a href="https://sunaku.github.io/md2man/man/man1/md2man-html.1">roff result</a></li>
74
- <li><a class="md2man-reference">md2man-rake(1)</a>:
75
- <a href="https://raw.github.com/sunaku/md2man/master/bin/md2man-rake">Ruby source</a> &rarr;
76
- <a href="https://sunaku.github.io/md2man/man/man1/md2man-rake.1.html">HTML result</a> +
77
- <a href="https://sunaku.github.io/md2man/man/man1/md2man-rake.1">roff result</a></li>
78
- <li><a class="md2man-reference" href="../man1/binman.1.html">binman(1)</a>:
79
- <a href="https://raw.github.com/sunaku/binman/master/bin/binman">Ruby source</a> &rarr;
80
- <a href="https://sunaku.github.io/binman/man/man1/binman.1.html">HTML result</a> +
81
- <a href="https://sunaku.github.io/binman/man/man1/binman.1">roff result</a></li>
82
- <li><a class="md2man-reference" href="../man1/binman-rake.1.html">binman-rake(1)</a>:
83
- <a href="https://raw.github.com/sunaku/binman/master/bin/binman-rake">Ruby source</a> &rarr;
84
- <a href="https://sunaku.github.io/binman/man/man1/binman-rake.1.html">HTML result</a> +
85
- <a href="https://sunaku.github.io/binman/man/man1/binman-rake.1">roff result</a></li>
34
+ <li><a href="https://raw.github.com/sunaku/tork/master/bin/tork">bin/tork</a> &rArr;
35
+ <a href="https://sunaku.github.io/tork/man/man1/tork.1.markdown">tork.1.markdown</a> &rArr;
36
+ <a href="https://sunaku.github.io/tork/man/man1/tork.1">tork.1</a> +
37
+ <a href="https://sunaku.github.io/tork/man/man1/tork.1.html">tork.1.html</a></li>
38
+ <li><a href="https://raw.github.com/sunaku/tork/master/bin/tork-runner">bin/tork-runner</a> &rArr;
39
+ <a href="https://sunaku.github.io/tork/man/man1/tork-runner.1.markdown">tork-runner.1.markdown</a> &rArr;
40
+ <a href="https://sunaku.github.io/tork/man/man1/tork-runner.1">tork-runner.1</a> +
41
+ <a href="https://sunaku.github.io/tork/man/man1/tork-runner.1.html">tork-runner.1.html</a></li>
42
+ <li><a href="https://raw.github.com/sunaku/tork/master/bin/tork-herald">bin/tork-herald</a> &rArr;
43
+ <a href="https://sunaku.github.io/tork/man/man1/tork-herald.1.markdown">tork-herald.1.markdown</a> &rArr;
44
+ <a href="https://sunaku.github.io/tork/man/man1/tork-herald.1">tork-herald.1</a> +
45
+ <a href="https://sunaku.github.io/tork/man/man1/tork-herald.1.html">tork-herald.1.html</a></li>
46
+ <li><a href="https://raw.github.com/sunaku/tork/master/bin/tork-driver">bin/tork-driver</a> &rArr;
47
+ <a href="https://sunaku.github.io/tork/man/man1/tork-driver.1.markdown">tork-driver.1.markdown</a> &rArr;
48
+ <a href="https://sunaku.github.io/tork/man/man1/tork-driver.1">tork-driver.1</a> +
49
+ <a href="https://sunaku.github.io/tork/man/man1/tork-driver.1.html">tork-driver.1.html</a></li>
50
+ <li><a href="https://raw.github.com/sunaku/tork/master/bin/tork-engine">bin/tork-engine</a> &rArr;
51
+ <a href="https://sunaku.github.io/tork/man/man1/tork-engine.1.markdown">tork-engine.1.markdown</a> &rArr;
52
+ <a href="https://sunaku.github.io/tork/man/man1/tork-engine.1">tork-engine.1</a> +
53
+ <a href="https://sunaku.github.io/tork/man/man1/tork-engine.1.html">tork-engine.1.html</a></li>
54
+ <li><a href="https://raw.github.com/sunaku/tork/master/bin/tork-master">bin/tork-master</a> &rArr;
55
+ <a href="https://sunaku.github.io/tork/man/man1/tork-master.1.markdown">tork-master.1.markdown</a> &rArr;
56
+ <a href="https://sunaku.github.io/tork/man/man1/tork-master.1">tork-master.1</a> +
57
+ <a href="https://sunaku.github.io/tork/man/man1/tork-master.1.html">tork-master.1.html</a></li>
58
+ <li><a href="https://raw.github.com/sunaku/tork/master/bin/tork-remote">bin/tork-remote</a> &rArr;
59
+ <a href="https://sunaku.github.io/tork/man/man1/tork-remote.1.markdown">tork-remote.1.markdown</a> &rArr;
60
+ <a href="https://sunaku.github.io/tork/man/man1/tork-remote.1">tork-remote.1</a> +
61
+ <a href="https://sunaku.github.io/tork/man/man1/tork-remote.1.html">tork-remote.1.html</a></li>
62
+ <li><a href="https://raw.github.com/sunaku/tork/master/bin/tork-notify">bin/tork-notify</a> &rArr;
63
+ <a href="https://sunaku.github.io/tork/man/man1/tork-notify.1.markdown">tork-notify.1.markdown</a> &rArr;
64
+ <a href="https://sunaku.github.io/tork/man/man1/tork-notify.1">tork-notify.1</a> +
65
+ <a href="https://sunaku.github.io/tork/man/man1/tork-notify.1.html">tork-notify.1.html</a></li>
66
+ <li><a href="https://raw.github.com/sunaku/md2man/master/bin/md2man-roff">bin/md2man-roff</a> &rArr;
67
+ <a href="https://sunaku.github.io/md2man/man/man1/md2man-roff.1.markdown">md2man-roff.1.markdown</a> &rArr;
68
+ <a href="https://sunaku.github.io/md2man/man/man1/md2man-roff.1">md2man-roff.1</a> +
69
+ <a href="https://sunaku.github.io/md2man/man/man1/md2man-roff.1.html">md2man-roff.1.html</a></li>
70
+ <li><a href="https://raw.github.com/sunaku/md2man/master/bin/md2man-html">bin/md2man-html</a> &rArr;
71
+ <a href="https://sunaku.github.io/md2man/man/man1/md2man-html.1.markdown">md2man-html.1.markdown</a> &rArr;
72
+ <a href="https://sunaku.github.io/md2man/man/man1/md2man-html.1">md2man-html.1</a> +
73
+ <a href="https://sunaku.github.io/md2man/man/man1/md2man-html.1.html">md2man-html.1.html</a></li>
74
+ <li><a href="https://raw.github.com/sunaku/md2man/master/bin/md2man-rake">bin/md2man-rake</a> &rArr;
75
+ <a href="https://sunaku.github.io/md2man/man/man1/md2man-rake.1.markdown">md2man-rake.1.markdown</a> &rArr;
76
+ <a href="https://sunaku.github.io/md2man/man/man1/md2man-rake.1">md2man-rake.1</a> +
77
+ <a href="https://sunaku.github.io/md2man/man/man1/md2man-rake.1.html">md2man-rake.1.html</a></li>
78
+ <li><a href="https://raw.github.com/sunaku/binman/master/bin/binman">bin/binman</a> &rArr;
79
+ <a href="https://sunaku.github.io/binman/man/man1/binman.1.markdown">binman.1.markdown</a> &rArr;
80
+ <a href="https://sunaku.github.io/binman/man/man1/binman.1">binman.1</a> +
81
+ <a href="https://sunaku.github.io/binman/man/man1/binman.1.html">binman.1.html</a></li>
82
+ <li><a href="https://raw.github.com/sunaku/binman/master/bin/binman-rake">bin/binman-rake</a> &rArr;
83
+ <a href="https://sunaku.github.io/binman/man/man1/binman-rake.1.markdown">binman-rake.1.markdown</a> &rArr;
84
+ <a href="https://sunaku.github.io/binman/man/man1/binman-rake.1">binman-rake.1</a> +
85
+ <a href="https://sunaku.github.io/binman/man/man1/binman-rake.1.html">binman-rake.1.html</a></li>
86
86
  </ul>
87
- <p>For examples in other scripting languages, see the &quot;Usage&quot; section below!</p><h2 id="installation"><a name="installation" href="#installation" class="md2man-permalink" title="permalink"></a>Installation</h2><p>If you only want to view pre-built manual pages:</p>
88
- <pre><code class="sh">gem install binman
87
+ <p>For examples in even more scripting languages, see the &quot;Usage&quot; section below!</p><h4 id="what-can-binman-rake-1-do"><a name="what-can-binman-rake-1-do" href="#what-can-binman-rake-1-do" class="md2man-permalink" title="permalink"></a>What can <a class="md2man-reference" href="../man1/binman-rake.1.html">binman-rake(1)</a> do?</h4><p>Here are some examples of HTML manual <em>sets</em> produced by <a class="md2man-reference" href="../man1/binman-rake.1.html">binman-rake(1)</a>:</p>
88
+ <ul>
89
+ <li><a href="https://sunaku.github.io/tork/man">https://sunaku.github.io/tork/man</a></li>
90
+ <li><a href="https://sunaku.github.io/binman/man">https://sunaku.github.io/binman/man</a></li>
91
+ <li><a href="https://sunaku.github.io/md2man/man">https://sunaku.github.io/md2man/man</a></li>
92
+ </ul>
93
+ <h2 id="installation"><a name="installation" href="#installation" class="md2man-permalink" title="permalink"></a>Installation</h2><p>If you only want to view pre-built manual pages:</p><pre><code>gem install binman
89
94
  </code></pre>
90
- <p>If you also want to build your own manual pages:</p>
91
- <pre><code class="sh">gem install md2man -v &#39;~&gt; 3.0&#39;
95
+ <p>If you also want to build your own manual pages:</p><pre><code>gem install md2man -v &#39;~&gt; 4.0&#39;
92
96
  </code></pre>
93
97
  <h3 id="prerequisites"><a name="prerequisites" href="#prerequisites" class="md2man-permalink" title="permalink"></a>Prerequisites</h3>
94
98
  <ul>
95
99
  <li>Ruby 1.8.7 or 1.9.2 or newer.</li>
96
100
  </ul>
97
- <h3 id="development"><a name="development" href="#development" class="md2man-permalink" title="permalink"></a>Development</h3>
98
- <pre><code class="sh">git clone git://github.com/sunaku/binman
101
+ <h3 id="development"><a name="development" href="#development" class="md2man-permalink" title="permalink"></a>Development</h3><pre><code>git clone git://github.com/sunaku/binman
99
102
  cd binman
100
103
  bundle install
101
104
  bundle exec binman --help # run it directly
102
105
  bundle exec rake --tasks # packaging tasks
103
106
  </code></pre>
104
- <h2 id="usage"><a name="usage" href="#usage" class="md2man-permalink" title="permalink"></a>Usage</h2><h3 id="at-the-command-line"><a name="at-the-command-line" href="#at-the-command-line" class="md2man-permalink" title="permalink"></a>At the command line</h3><p>See <a class="md2man-reference" href="../man1/binman.1.html">binman(1)</a> manual:</p>
105
- <pre><code class="sh">binman --help
107
+ <h2 id="usage"><a name="usage" href="#usage" class="md2man-permalink" title="permalink"></a>Usage</h2><h3 id="at-the-command-line"><a name="at-the-command-line" href="#at-the-command-line" class="md2man-permalink" title="permalink"></a>At the command line</h3><p>See <a class="md2man-reference" href="../man1/binman.1.html">binman(1)</a> manual:</p><pre><code>binman --help
106
108
  </code></pre>
107
- <h3 id="inside-a-ruby-script"><a name="inside-a-ruby-script" href="#inside-a-ruby-script" class="md2man-permalink" title="permalink"></a>Inside a Ruby script</h3>
108
- <pre><code class="ruby">#!/usr/bin/env ruby
109
+ <h3 id="inside-a-ruby-script"><a name="inside-a-ruby-script" href="#inside-a-ruby-script" class="md2man-permalink" title="permalink"></a>Inside a Ruby script</h3><pre><code>#!/usr/bin/env ruby
109
110
  # your program&#39;s manual page goes here
110
111
 
111
112
  require &#39;binman&#39;
@@ -116,26 +117,22 @@ BinMan.help
116
117
  # OPTION 2: show manual unconditionally
117
118
  BinMan.show
118
119
  </code></pre>
119
- <p>You can also specify your program&#39;s source file encoding above the manual:</p>
120
- <pre><code class="ruby">#!/usr/bin/env ruby
120
+ <p>You can also specify your program&#39;s source file encoding above the manual:</p><pre><code>#!/usr/bin/env ruby
121
121
  # -*- coding: utf-8 -*-
122
122
  # your program&#39;s manual page goes here
123
123
  </code></pre>
124
- <p>You can also write the manual as a multi-line Ruby comment:</p>
125
- <pre><code class="ruby">#!/usr/bin/env ruby
124
+ <p>You can also write the manual as a multi-line Ruby comment:</p><pre><code>#!/usr/bin/env ruby
126
125
  =begin
127
126
  your program&#39;s manual page goes here
128
127
  =end
129
128
  </code></pre>
130
- <p>You can also specify your program&#39;s source file encoding above the manual:</p>
131
- <pre><code class="ruby">#!/usr/bin/env ruby
129
+ <p>You can also specify your program&#39;s source file encoding above the manual:</p><pre><code>#!/usr/bin/env ruby
132
130
  # -*- coding: utf-8 -*-
133
131
  =begin
134
132
  your program&#39;s manual page goes here
135
133
  =end
136
134
  </code></pre>
137
- <p>See the <a href="http://rubydoc.info/gems/binman/frames">API documentation</a> for even more possibilities!</p><h3 id="inside-a-shell-script"><a name="inside-a-shell-script" href="#inside-a-shell-script" class="md2man-permalink" title="permalink"></a>Inside a shell script</h3>
138
- <pre><code class="ruby">#!/usr/bin/sh
135
+ <p>See the <a href="http://rubydoc.info/gems/binman/frames">API documentation</a> for even more possibilities!</p><h3 id="inside-a-shell-script"><a name="inside-a-shell-script" href="#inside-a-shell-script" class="md2man-permalink" title="permalink"></a>Inside a shell script</h3><pre><code>#!/usr/bin/sh
139
136
  # your program&#39;s manual page goes here
140
137
 
141
138
  # OPTION 1: show manual and exit if ARGV has -h or --help except after --
@@ -144,8 +141,7 @@ binman help &quot;$0&quot; &quot;$@&quot; &amp;&amp; exit
144
141
  # OPTION 2: show manual unconditionally
145
142
  binman show &quot;$0&quot;
146
143
  </code></pre>
147
- <h3 id="inside-a-perl-script"><a name="inside-a-perl-script" href="#inside-a-perl-script" class="md2man-permalink" title="permalink"></a>Inside a Perl script</h3>
148
- <pre><code class="perl">#!/usr/bin/env perl
144
+ <h3 id="inside-a-perl-script"><a name="inside-a-perl-script" href="#inside-a-perl-script" class="md2man-permalink" title="permalink"></a>Inside a Perl script</h3><pre><code>#!/usr/bin/env perl
149
145
  # your program&#39;s manual page goes here
150
146
 
151
147
  # OPTION 1: show manual and exit if ARGV has -h or --help except after --
@@ -154,16 +150,14 @@ system(&#39;binman&#39;, &#39;help&#39;, __FILE__, @ARGV) == 0 and exit;
154
150
  # OPTION 2: show manual unconditionally
155
151
  system(&#39;binman&#39;, &#39;show&#39;, __FILE__);
156
152
  </code></pre>
157
- <p>You can also write the manual as a multi-line Ruby comment after <code>__END__</code>:</p>
158
- <pre><code class="perl">#!/usr/bin/env perl
153
+ <p>You can also write the manual as a multi-line Ruby comment after <code>__END__</code>:</p><pre><code>#!/usr/bin/env perl
159
154
  print &quot;your program&#39;s code goes here&quot;;
160
155
  __END__
161
156
  =begin
162
157
  your program&#39;s manual page goes here
163
158
  =end
164
159
  </code></pre>
165
- <h3 id="inside-a-python-script"><a name="inside-a-python-script" href="#inside-a-python-script" class="md2man-permalink" title="permalink"></a>Inside a Python script</h3>
166
- <pre><code class="python">#!/usr/bin/env python
160
+ <h3 id="inside-a-python-script"><a name="inside-a-python-script" href="#inside-a-python-script" class="md2man-permalink" title="permalink"></a>Inside a Python script</h3><pre><code>#!/usr/bin/env python
167
161
  # your program&#39;s manual page goes here
168
162
 
169
163
  import sys, subprocess
@@ -174,21 +168,18 @@ subprocess.call([&#39;binman&#39;, &#39;help&#39;, __file__] + sys.argv) == 0 an
174
168
  # OPTION 2: show manual unconditionally
175
169
  subprocess.call([&#39;binman&#39;, &#39;show&#39;, __file__])
176
170
  </code></pre>
177
- <p>You can also specify your program&#39;s source file encoding above the manual:</p>
178
- <pre><code class="python">#!/usr/bin/env python
171
+ <p>You can also specify your program&#39;s source file encoding above the manual:</p><pre><code>#!/usr/bin/env python
179
172
  # -*- coding: utf-8 -*-
180
173
  # your program&#39;s manual page goes here
181
174
  </code></pre>
182
- <p>You can also write the manual as a multi-line Ruby comment inside a docstring:</p>
183
- <pre><code class="python">#!/usr/bin/env python
175
+ <p>You can also write the manual as a multi-line Ruby comment inside a docstring:</p><pre><code>#!/usr/bin/env python
184
176
  &quot;&quot;&quot;
185
177
  =begin
186
178
  your program&#39;s manual page goes here
187
179
  =end
188
180
  &quot;&quot;&quot;
189
181
  </code></pre>
190
- <p>You can also specify your program&#39;s source file encoding above the manual:</p>
191
- <pre><code class="python">#!/usr/bin/env python
182
+ <p>You can also specify your program&#39;s source file encoding above the manual:</p><pre><code>#!/usr/bin/env python
192
183
  # -*- coding: utf-8 -*-
193
184
  &quot;&quot;&quot;
194
185
  =begin
@@ -196,8 +187,7 @@ your program&#39;s manual page goes here
196
187
  =end
197
188
  &quot;&quot;&quot;
198
189
  </code></pre>
199
- <h3 id="inside-an-awk-script"><a name="inside-an-awk-script" href="#inside-an-awk-script" class="md2man-permalink" title="permalink"></a>Inside an AWK script</h3><p>The technique for determining current AWK script file name <a href="http://www.mombu.com/programming/programming/t-the-name-of-script-itself-2040784-print.html">comes from here</a>.</p>
200
- <pre><code class="awk">#!/usr/bin/awk -f
190
+ <h3 id="inside-an-awk-script"><a name="inside-an-awk-script" href="#inside-an-awk-script" class="md2man-permalink" title="permalink"></a>Inside an AWK script</h3><p>The technique for determining current AWK script file name <a href="http://www.mombu.com/programming/programming/t-the-name-of-script-itself-2040784-print.html">comes from here</a>.</p><pre><code>#!/usr/bin/awk -f
201
191
  # your program&#39;s manual page goes here
202
192
 
203
193
  # OPTION 1: show manual and exit if ARGV has -h or --help except after --
@@ -208,8 +198,7 @@ BEGIN {getline c &lt;&quot;/proc/self/cmdline&quot;; sub(&quot;.*-f\0&quot;,&quo
208
198
  BEGIN {getline c &lt;&quot;/proc/self/cmdline&quot;; sub(&quot;.*-f\0&quot;,&quot; &quot;,c); sub(&quot;\0.*&quot;,&quot;&quot;,c);
209
199
  system(&quot;binman show&quot; c)}
210
200
  </code></pre>
211
- <h3 id="inside-a-tcl-script"><a name="inside-a-tcl-script" href="#inside-a-tcl-script" class="md2man-permalink" title="permalink"></a>Inside a Tcl script</h3>
212
- <pre><code class="tcl">#!/usr/bin/env tclsh
201
+ <h3 id="inside-a-tcl-script"><a name="inside-a-tcl-script" href="#inside-a-tcl-script" class="md2man-permalink" title="permalink"></a>Inside a Tcl script</h3><pre><code>#!/usr/bin/env tclsh
213
202
  # your program&#39;s manual page goes here
214
203
 
215
204
  # OPTION 1: show manual and exit if ARGV has -h or --help except after --
@@ -218,16 +207,14 @@ if {![catch {exec -- &gt;/dev/tty binman help $argv0 {*}$argv}]} {exit}
218
207
  # OPTION 2: show manual unconditionally
219
208
  exec &gt;/dev/tty binman show $argv0
220
209
  </code></pre>
221
- <p>You can also write the manual as a multi-line Ruby comment inside an <code>if 0</code>:</p>
222
- <pre><code class="tcl">#!/usr/bin/env tclsh
210
+ <p>You can also write the manual as a multi-line Ruby comment inside an <code>if 0</code>:</p><pre><code>#!/usr/bin/env tclsh
223
211
  if 0 {
224
212
  =begin
225
213
  your program&#39;s manual page goes here
226
214
  =end
227
215
  }
228
216
  </code></pre>
229
- <h3 id="inside-a-node-js-script"><a name="inside-a-node-js-script" href="#inside-a-node-js-script" class="md2man-permalink" title="permalink"></a>Inside a Node.js script</h3>
230
- <pre><code class="javascript">/*
217
+ <h3 id="inside-a-node-js-script"><a name="inside-a-node-js-script" href="#inside-a-node-js-script" class="md2man-permalink" title="permalink"></a>Inside a Node.js script</h3><pre><code>/*
231
218
  =begin
232
219
  your program&#39;s manual page goes here
233
220
  =end
@@ -237,28 +224,24 @@ var exec = require(&#39;child_process&#39;).exec;
237
224
 
238
225
  // OPTION 1: show manual and exit if ARGV has -h or --help except after --
239
226
  exec([&#39;&gt;/dev/tty&#39;, &#39;binman&#39;, &#39;help&#39;, __filename].concat(process.argv).
240
- join(&#39; &#39;), <a class="md2man-reference">function(error)</a>{ if (error === null){ process.exit(); } });
227
+ join(&#39; &#39;), function(error){ if (error === null){ process.exit(); } });
241
228
 
242
229
  // OPTION 2: show manual unconditionally
243
230
  exec([&#39;&gt;/dev/tty&#39;, &#39;binman&#39;, &#39;show&#39;, __filename].join(&#39; &#39;));
244
231
  </code></pre>
245
- <h2 id="packaging"><a name="packaging" href="#packaging" class="md2man-permalink" title="permalink"></a>Packaging</h2><h3 id="building-man-pages"><a name="building-man-pages" href="#building-man-pages" class="md2man-permalink" title="permalink"></a>Building man pages</h3><h4 id="at-the-command-line-1"><a name="at-the-command-line-1" href="#at-the-command-line-1" class="md2man-permalink" title="permalink"></a>At the command line</h4><p>See <a class="md2man-reference" href="../man1/binman-rake.1.html">binman-rake(1)</a> manual:</p>
246
- <pre><code class="sh">binman-rake --help
232
+ <h2 id="packaging"><a name="packaging" href="#packaging" class="md2man-permalink" title="permalink"></a>Packaging</h2><h3 id="building-man-pages"><a name="building-man-pages" href="#building-man-pages" class="md2man-permalink" title="permalink"></a>Building man pages</h3><h4 id="at-the-command-line-1"><a name="at-the-command-line-1" href="#at-the-command-line-1" class="md2man-permalink" title="permalink"></a>At the command line</h4><p>See <a class="md2man-reference" href="../man1/binman-rake.1.html">binman-rake(1)</a> manual:</p><pre><code>binman-rake --help
247
233
  </code></pre>
248
- <h4 id="inside-a-ruby-script-1"><a name="inside-a-ruby-script-1" href="#inside-a-ruby-script-1" class="md2man-permalink" title="permalink"></a>Inside a Ruby script</h4><p>Add this snippet to your gemspec file:</p>
249
- <pre><code class="ruby">s.files += Dir[&#39;man/man?/*.?&#39;] # UNIX man pages
234
+ <h4 id="inside-a-ruby-script-1"><a name="inside-a-ruby-script-1" href="#inside-a-ruby-script-1" class="md2man-permalink" title="permalink"></a>Inside a Ruby script</h4><p>Add this snippet to your gemspec file:</p><pre><code>s.files += Dir[&#39;man/man?/*.?&#39;] # UNIX man pages
250
235
  s.files += Dir[&#39;man/**/*.{html,css,js}&#39;] # HTML man pages
251
- s.add_development_dependency &#39;md2man&#39;, &#39;~&gt; 3.0&#39;
236
+ s.add_development_dependency &#39;md2man&#39;, &#39;~&gt; 4.0&#39;
252
237
  </code></pre>
253
- <p>Add the following line to your Rakefile:</p>
254
- <pre><code class="ruby">require &#39;binman/rakefile&#39;
238
+ <p>Add the following line to your Rakefile:</p><pre><code>require &#39;binman/rakefile&#39;
255
239
  </code></pre>
256
240
  <p>You now have a <code>rake binman</code> task that pre-builds UNIX manual page files for
257
241
  your <code>bin/</code> scripts into a <code>man/</code> directory so that your end-users do not need
258
242
  <a href="https://github.com/sunaku/md2man">md2man</a> installed in order to view the manual pages you&#39;ve embedded therein!
259
243
  There are also sub-tasks to build manual pages individually as <a href="http://troff.org">roff</a> or HTML.</p><p>If you&#39;re using Bundler, this task also hooks into its gem packaging tasks and
260
- ensures that your UNIX manual pages are pre-built and packaged into your gem:</p>
261
- <pre><code class="shell">bundle exec rake build
244
+ ensures that your UNIX manual pages are pre-built and packaged into your gem:</p><pre><code>bundle exec rake build
262
245
  gem spec pkg/*.gem | fgrep man/man
263
246
  </code></pre>
264
247
  <h2 id="license"><a name="license" href="#license" class="md2man-permalink" title="permalink"></a>License</h2><p>Released under the ISC license. See the LICENSE file for details.</p></div></body>