binman 5.0.1 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.markdown +471 -238
- data/VERSION.markdown +40 -8
- data/bin/binman +17 -71
- data/bin/binman-help +208 -0
- data/bin/binman-html +28 -0
- data/bin/binman-rake +11 -8
- data/bin/binman-roff +28 -0
- data/bin/binman-show +193 -0
- data/bin/binman-text +105 -0
- data/binman.gemspec +4 -4
- data/lib/binman.rb +8 -8
- data/lib/binman/rakefile.rb +2 -2
- data/lib/binman/version.rb +1 -1
- data/man/index.html +3 -3
- data/man/man0/README.html +488 -253
- data/man/man0/VERSION.html +44 -23
- data/man/man1/binman-help.1 +215 -0
- data/man/man1/binman-help.1.html +106 -0
- data/man/man1/binman-html.1 +18 -0
- data/man/man1/binman-html.1.html +12 -0
- data/man/man1/binman-rake.1 +9 -10
- data/man/man1/binman-rake.1.html +8 -8
- data/man/man1/binman-roff.1 +23 -0
- data/man/man1/binman-roff.1.html +12 -0
- data/man/man1/binman-show.1 +219 -0
- data/man/man1/binman-show.1.html +104 -0
- data/man/man1/binman-text.1 +129 -0
- data/man/man1/binman-text.1.html +55 -0
- data/man/man1/binman.1 +22 -111
- data/man/man1/binman.1.html +7 -47
- data/man/man5/md2man.5 +219 -0
- data/man/man5/md2man.5.html +140 -0
- data/man/man5/md2man.5.markdown +190 -0
- data/man/style.css +217 -1
- metadata +28 -7
- data/EXAMPLE.png +0 -0
- data/man/man0/EXAMPLE.png +0 -1
data/VERSION.markdown
CHANGED
@@ -1,3 +1,37 @@
|
|
1
|
+
## Version 5.1.0 (2016-02-28)
|
2
|
+
|
3
|
+
This release splits binman(1) into pieces and improves the documentation.
|
4
|
+
|
5
|
+
### Minor:
|
6
|
+
|
7
|
+
* binman(1) is now deprecated, to be removed in the next major version.
|
8
|
+
Please run the new binman-* programs, listed below, directly instead.
|
9
|
+
|
10
|
+
* Split binman(1) commands into independent programs:
|
11
|
+
|
12
|
+
* binman-help(1) - add help options to your program
|
13
|
+
* binman-html(1) - HTML manpage from header comment
|
14
|
+
* binman-rake(1) - run rake(1) tasks from command line
|
15
|
+
* binman-roff(1) - UNIX manpage from header comment
|
16
|
+
* binman-show(1) - show manpage from header comment
|
17
|
+
* binman-text(1) - extract embedded manpage sources
|
18
|
+
|
19
|
+
* binman-rake(1): allow task names without namespace.
|
20
|
+
|
21
|
+
You can now run `binman-rake man` instead of `binman-rake binman:man`,
|
22
|
+
and similarly `binman-rake web` instead of `binman-rake binman:web`,
|
23
|
+
and similarly `binman-rake mkd` instead of `binman-rake binman:mkd`.
|
24
|
+
|
25
|
+
### Patch:
|
26
|
+
|
27
|
+
* README: an epic revision; add copy of md2man(5).
|
28
|
+
|
29
|
+
* README: add dasht manual pages to examples section.
|
30
|
+
|
31
|
+
* Clarify optionalness of *PATTERN* in `--help` option.
|
32
|
+
|
33
|
+
* Upgrade to md2man version 5.1.
|
34
|
+
|
1
35
|
## Version 5.0.1 (2016-02-13)
|
2
36
|
|
3
37
|
### Major:
|
@@ -19,14 +53,6 @@
|
|
19
53
|
|
20
54
|
## Version 4.2.1 (2016-02-12)
|
21
55
|
|
22
|
-
### Patch:
|
23
|
-
|
24
|
-
* Failure when `binman show` is given input on STDIN.
|
25
|
-
|
26
|
-
binman.rb:51:in `basename': no implicit conversion of IO into String (TypeError)
|
27
|
-
|
28
|
-
## Version 4.2.0 (2016-02-12)
|
29
|
-
|
30
56
|
### Minor:
|
31
57
|
|
32
58
|
* Add `binman:mkd` rake task to extract `man/man1/*.1.markdown` files.
|
@@ -49,6 +75,12 @@
|
|
49
75
|
|
50
76
|
binman.rb:47:in `basename': no implicit conversion of IO into String (TypeError)
|
51
77
|
|
78
|
+
* Failure when `binman show` is given input on STDIN.
|
79
|
+
|
80
|
+
binman.rb:51:in `basename': no implicit conversion of IO into String (TypeError)
|
81
|
+
|
82
|
+
### Patch:
|
83
|
+
|
52
84
|
## Version 4.1.0 (2016-02-10)
|
53
85
|
|
54
86
|
### Minor:
|
data/bin/binman
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
=begin =======================================================================
|
3
3
|
|
4
|
-
# BINMAN 1
|
4
|
+
# BINMAN 1 2016-02-28 5.1.0
|
5
5
|
|
6
6
|
## NAME
|
7
7
|
|
8
|
-
binman -
|
8
|
+
binman - deprecated; use binman-* instead
|
9
9
|
|
10
10
|
## SYNOPSIS
|
11
11
|
|
@@ -13,90 +13,36 @@ binman - man pages for bin scripts
|
|
13
13
|
|
14
14
|
## DESCRIPTION
|
15
15
|
|
16
|
-
|
17
|
-
extract their leading comment headers (defined below), convert them from
|
18
|
-
markdown(7) into roff(7) using [md2man], and display them using man(1).
|
16
|
+
Runs the fellow "`binman`-*COMMAND*" programs listed under "Commands" below.
|
19
17
|
|
20
|
-
|
21
|
-
|
22
|
-
A leading comment header can be one of the following two things:
|
23
|
-
|
24
|
-
1. A contiguous sequence of single-line comments (which begin with `#`
|
25
|
-
and optionally continue with a single space followed by any number of
|
26
|
-
characters until the end of the line) starting at the beginning of the
|
27
|
-
file (after shebang and encoding comments plus optional blank lines) and
|
28
|
-
ending at the first single blank line.
|
29
|
-
|
30
|
-
2. The first embedded document delimited by `=begin` and `=end` lines, which
|
31
|
-
begin with the respective delimiters and optionally continue with a single
|
32
|
-
space followed by any number of characters until the end of the line.
|
33
|
-
|
34
|
-
### Markdown processing divergence
|
35
|
-
|
36
|
-
Although your leading comment headers are written in markdown(7), `binman
|
37
|
-
conv` inherits the following additions to markdown(7) syntax from md2man(5):
|
38
|
-
|
39
|
-
* There can be at most one top-level heading (H1). It is emitted as `.TH`
|
40
|
-
in the roff(7) output to define the UNIX manual page's header and footer.
|
41
|
-
|
42
|
-
* Paragraphs whose lines are all uniformly indented by two spaces are
|
43
|
-
considered to be "indented paragraphs". They are unindented accordingly
|
44
|
-
before emission as `.IP` in the roff(7) output.
|
45
|
-
|
46
|
-
* Paragraphs whose subsequent lines (all except the first) are uniformly
|
47
|
-
indented by two spaces are considered to be a "tagged paragraphs". They
|
48
|
-
are unindented accordingly before emission as `.TP` in the roff(7) output.
|
49
|
-
|
50
|
-
### Markdown processing extensions
|
51
|
-
|
52
|
-
The following [Redcarpet] extensions are enabled while processing markdown(7):
|
53
|
-
|
54
|
-
* tables
|
55
|
-
* autolink
|
56
|
-
* superscript
|
57
|
-
* strikethrough
|
58
|
-
* fenced\_code\_blocks
|
18
|
+
> Note: This program is deprecated for removal in the next major version. To
|
19
|
+
> prepare yourself, please run the fellow binman-* programs directly instead.
|
59
20
|
|
60
21
|
## OPTIONS
|
61
22
|
|
62
23
|
`-h` [*PATTERN*], `--help` [*PATTERN*]
|
63
|
-
Show this help manual and search for *PATTERN* regular expression
|
24
|
+
Show this help manual and optionally search for *PATTERN* regular expression.
|
64
25
|
|
65
26
|
## COMMANDS
|
66
27
|
|
67
|
-
`text`
|
68
|
-
|
28
|
+
`text` ...
|
29
|
+
Runs binman-text(1).
|
69
30
|
|
70
|
-
`roff`
|
71
|
-
|
72
|
-
the given *FILE* or STDIN.
|
31
|
+
`roff` ...
|
32
|
+
Runs binman-roff(1).
|
73
33
|
|
74
|
-
`html`
|
75
|
-
|
76
|
-
the given *FILE* or STDIN.
|
34
|
+
`html` ...
|
35
|
+
Runs binman-html(1).
|
77
36
|
|
78
|
-
`show`
|
79
|
-
|
80
|
-
extracted from the given *FILE* or STDIN. If *PATTERN* is given, search for
|
81
|
-
it within the output displayed by man(1) and jump to first match if found.
|
82
|
-
If man(1) cannot display the roff(1) conversion, fall back to the showing
|
83
|
-
the HTML conversion; if that fails too, display the extracted text as-is.
|
37
|
+
`show` ...
|
38
|
+
Runs binman-show(1).
|
84
39
|
|
85
|
-
`help`
|
86
|
-
|
87
|
-
`--`, optionally followed by a *PATTERN* regular expression that specifies
|
88
|
-
text to search for and, if found, jump to inside the displayed man page,
|
89
|
-
then this program extracts the given *FILE*'s leading comment header,
|
90
|
-
converts it into roff(7), displays it using man(1), and finally exits with
|
91
|
-
status code `0`. Otherwise, this program exits with status code `111`.
|
40
|
+
`help` ...
|
41
|
+
Runs binman-help(1).
|
92
42
|
|
93
43
|
## SEE ALSO
|
94
44
|
|
95
|
-
binman-rake(1)
|
96
|
-
|
97
|
-
[binman]: https://github.com/sunaku/binman
|
98
|
-
[md2man]: https://github.com/sunaku/md2man
|
99
|
-
[Redcarpet]: https://github.com/vmg/redcarpet
|
45
|
+
binman-rake(1)
|
100
46
|
|
101
47
|
=end =========================================================================
|
102
48
|
|
data/bin/binman-help
ADDED
@@ -0,0 +1,208 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# # BINMAN-HELP 1 2016-02-28 5.1.0
|
4
|
+
#
|
5
|
+
# ## NAME
|
6
|
+
#
|
7
|
+
# binman-help - add help options to your program
|
8
|
+
#
|
9
|
+
# ## SYNOPSIS
|
10
|
+
#
|
11
|
+
# `binman-help` *FILE* ... [`-h`|`--help` [*PATTERN*]] ... [`--`] ...
|
12
|
+
#
|
13
|
+
# ## DESCRIPTION
|
14
|
+
#
|
15
|
+
# If the given argument sequence contains `-h` or `--help`, except after `--`,
|
16
|
+
# then this program displays the given *FILE*'s "embedded manpage source",
|
17
|
+
# described in binman-text(1), and then terminates with exit status `0`.
|
18
|
+
# Otherwise, this program terminates with the nonzero exit status `111`.
|
19
|
+
#
|
20
|
+
# ### Examples
|
21
|
+
#
|
22
|
+
# See "Embedded manpage sources" in binman-text(1) for header comment syntax.
|
23
|
+
#
|
24
|
+
# #### From a shell script
|
25
|
+
#
|
26
|
+
# ```sh
|
27
|
+
# #!/usr/bin/sh
|
28
|
+
# # your program's manual page goes here
|
29
|
+
#
|
30
|
+
# binman-help "$0" "$@" && exit
|
31
|
+
# ```
|
32
|
+
#
|
33
|
+
# #### From a Ruby script
|
34
|
+
#
|
35
|
+
# ```ruby
|
36
|
+
# #!/usr/bin/env ruby
|
37
|
+
# # your program's manual page goes here
|
38
|
+
#
|
39
|
+
# require 'binman'
|
40
|
+
# BinMan.help
|
41
|
+
# ```
|
42
|
+
#
|
43
|
+
# You can also specify your program's source file encoding above the manual:
|
44
|
+
#
|
45
|
+
# ```ruby
|
46
|
+
# #!/usr/bin/env ruby
|
47
|
+
# # -*- coding: utf-8 -*-
|
48
|
+
# # your program's manual page goes here
|
49
|
+
# ```
|
50
|
+
#
|
51
|
+
# You can also write the manual as a multi-line Ruby comment:
|
52
|
+
#
|
53
|
+
# ```ruby
|
54
|
+
# #!/usr/bin/env ruby
|
55
|
+
# =begin
|
56
|
+
# your program's manual page goes here
|
57
|
+
# =end
|
58
|
+
# ```
|
59
|
+
#
|
60
|
+
# You can also specify your program's source file encoding above the manual:
|
61
|
+
#
|
62
|
+
# ```ruby
|
63
|
+
# #!/usr/bin/env ruby
|
64
|
+
# # -*- coding: utf-8 -*-
|
65
|
+
# =begin
|
66
|
+
# your program's manual page goes here
|
67
|
+
# =end
|
68
|
+
# ```
|
69
|
+
#
|
70
|
+
# #### From a Perl script
|
71
|
+
#
|
72
|
+
# ```perl
|
73
|
+
# #!/usr/bin/env perl
|
74
|
+
# # your program's manual page goes here
|
75
|
+
#
|
76
|
+
# system('binman-help', __FILE__, @ARGV) == 0 and exit;
|
77
|
+
# ```
|
78
|
+
#
|
79
|
+
# You can also write the manual as a multi-line Ruby comment after `__END__`:
|
80
|
+
#
|
81
|
+
# ```perl
|
82
|
+
# #!/usr/bin/env perl
|
83
|
+
# print "your program's code goes here";
|
84
|
+
# __END__
|
85
|
+
# =begin
|
86
|
+
# your program's manual page goes here
|
87
|
+
# =end
|
88
|
+
# ```
|
89
|
+
#
|
90
|
+
# #### From a Python script
|
91
|
+
#
|
92
|
+
# ```python
|
93
|
+
# #!/usr/bin/env python
|
94
|
+
# # your program's manual page goes here
|
95
|
+
#
|
96
|
+
# import sys, subprocess
|
97
|
+
#
|
98
|
+
# subprocess.call(['binman-help', __file__] + sys.argv) == 0 and sys.exit()
|
99
|
+
# ```
|
100
|
+
#
|
101
|
+
# You can also specify your program's source file encoding above the manual:
|
102
|
+
#
|
103
|
+
# ```python
|
104
|
+
# #!/usr/bin/env python
|
105
|
+
# # -*- coding: utf-8 -*-
|
106
|
+
# # your program's manual page goes here
|
107
|
+
# ```
|
108
|
+
#
|
109
|
+
# You can also write the manual as a multi-line Ruby comment inside a docstring:
|
110
|
+
#
|
111
|
+
# ```python
|
112
|
+
# #!/usr/bin/env python
|
113
|
+
# """
|
114
|
+
# =begin
|
115
|
+
# your program's manual page goes here
|
116
|
+
# =end
|
117
|
+
# """
|
118
|
+
# ```
|
119
|
+
#
|
120
|
+
# You can also specify your program's source file encoding above the manual:
|
121
|
+
#
|
122
|
+
# ```python
|
123
|
+
# #!/usr/bin/env python
|
124
|
+
# # -*- coding: utf-8 -*-
|
125
|
+
# """
|
126
|
+
# =begin
|
127
|
+
# your program's manual page goes here
|
128
|
+
# =end
|
129
|
+
# """
|
130
|
+
# ```
|
131
|
+
#
|
132
|
+
# #### From an AWK script
|
133
|
+
#
|
134
|
+
# The technique for determining current AWK script file name [comes from here](
|
135
|
+
# http://www.mombu.com/programming/programming/t-the-name-of-script-itself-2040784-print.html
|
136
|
+
# ).
|
137
|
+
#
|
138
|
+
# ```awk
|
139
|
+
# #!/usr/bin/awk -f
|
140
|
+
# # your program's manual page goes here
|
141
|
+
#
|
142
|
+
# BEGIN {getline c <"/proc/self/cmdline"; sub(".*-f\0"," ",c); gsub("\0"," ",c);
|
143
|
+
# if(system("binman-help" c) == 0){ exit }}
|
144
|
+
# ```
|
145
|
+
#
|
146
|
+
# #### From a Tcl script
|
147
|
+
#
|
148
|
+
# ```tcl
|
149
|
+
# #!/usr/bin/env tclsh
|
150
|
+
# # your program's manual page goes here
|
151
|
+
#
|
152
|
+
# if {![catch {exec -- >/dev/tty binman-help $argv0 {*}$argv}]} {exit}
|
153
|
+
# ```
|
154
|
+
#
|
155
|
+
# You can also write the manual as a multi-line Ruby comment inside an `if 0`:
|
156
|
+
#
|
157
|
+
# ```tcl
|
158
|
+
# #!/usr/bin/env tclsh
|
159
|
+
# if 0 {
|
160
|
+
# =begin
|
161
|
+
# your program's manual page goes here
|
162
|
+
# =end
|
163
|
+
# }
|
164
|
+
# ```
|
165
|
+
#
|
166
|
+
# #### From a Node.js script
|
167
|
+
#
|
168
|
+
# ```javascript
|
169
|
+
# /*
|
170
|
+
# =begin
|
171
|
+
# your program's manual page goes here
|
172
|
+
# =end
|
173
|
+
# */
|
174
|
+
#
|
175
|
+
# var exec = require('child_process').exec;
|
176
|
+
# exec(['>/dev/tty', 'binman-help', __filename].concat(process.argv).
|
177
|
+
# join(' '), function(error){ if (error === null){ process.exit(); } });
|
178
|
+
# ```
|
179
|
+
#
|
180
|
+
# ## OPTIONS
|
181
|
+
#
|
182
|
+
# `-h` [*PATTERN*], `--help` [*PATTERN*]
|
183
|
+
# Display manpage and optionally search for *PATTERN* regular expression.
|
184
|
+
#
|
185
|
+
# ## EXIT STATUS
|
186
|
+
#
|
187
|
+
# 0
|
188
|
+
# Arguments contained help options so manpage was displayed.
|
189
|
+
#
|
190
|
+
# 111
|
191
|
+
# Arguments lacked help options so manpage was not displayed.
|
192
|
+
#
|
193
|
+
# ## SEE ALSO
|
194
|
+
#
|
195
|
+
# binman-text(1), binman-roff(1), binman-html(1), binman-show(1), binman(1)
|
196
|
+
#
|
197
|
+
|
198
|
+
require 'binman'
|
199
|
+
|
200
|
+
# display requested manpage
|
201
|
+
file, *args = ARGV
|
202
|
+
BinMan.help file, args
|
203
|
+
|
204
|
+
# fallback to this manpage
|
205
|
+
BinMan.help
|
206
|
+
|
207
|
+
# no manpage was displayed
|
208
|
+
exit 111
|
data/bin/binman-html
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
=begin =======================================================================
|
3
|
+
|
4
|
+
# BINMAN-HTML 1 2016-02-28 5.1.0
|
5
|
+
|
6
|
+
## NAME
|
7
|
+
|
8
|
+
binman-html - HTML manpage from header comment
|
9
|
+
|
10
|
+
## SYNOPSIS
|
11
|
+
|
12
|
+
`binman-html` [*OPTION*]... [*FILE*]
|
13
|
+
|
14
|
+
|
15
|
+
## DESCRIPTION
|
16
|
+
|
17
|
+
Extracts the "embedded manpage source", described in binman-text(1), from the
|
18
|
+
given *FILE* or STDIN and transforms it into HTML for use in a web browser.
|
19
|
+
|
20
|
+
## SEE ALSO
|
21
|
+
|
22
|
+
binman-text(1), binman-roff(1), binman(1)
|
23
|
+
|
24
|
+
=end =========================================================================
|
25
|
+
|
26
|
+
require 'binman'
|
27
|
+
BinMan.help
|
28
|
+
puts BinMan.html(ARGF)
|
data/bin/binman-rake
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
=begin =======================================================================
|
3
3
|
|
4
|
-
# BINMAN-RAKE 1
|
4
|
+
# BINMAN-RAKE 1 2016-02-28 5.1.0
|
5
5
|
|
6
6
|
## NAME
|
7
7
|
|
8
|
-
binman-rake - run rake(1) tasks from
|
8
|
+
binman-rake - run rake(1) tasks from command line
|
9
9
|
|
10
10
|
## SYNOPSIS
|
11
11
|
|
@@ -23,20 +23,20 @@ If no *TASK* is specified, then the `binman` task is run by default.
|
|
23
23
|
## TASKS
|
24
24
|
|
25
25
|
`binman`
|
26
|
-
Runs the `binman:man
|
26
|
+
Runs the `binman:mkd`, `binman:man`, and `binman:web` tasks, in that order.
|
27
27
|
|
28
|
-
`binman:mkd`
|
28
|
+
`binman:mkd` or `mkd`
|
29
29
|
Extracts manual page sources embedded in scripts found in your `bin/`
|
30
30
|
directory and saves them as `man/man1/*.1.markdown` files, which can
|
31
31
|
then be rendered as HTML or UNIX manual pages using md2man-rake(1).
|
32
32
|
|
33
|
-
`binman:man`
|
33
|
+
`binman:man` or `man`
|
34
34
|
Builds UNIX manual pages from scripts found in your `bin/` directory.
|
35
35
|
It also runs the `md2man:man` task, provided by md2man-rake(1), which
|
36
36
|
builds UNIX manual pages from `*.markdown`, `*.mkd`, and `*.md` files
|
37
37
|
found in or beneath the `man/` subdirectory in your working directory.
|
38
38
|
|
39
|
-
`binman:web`
|
39
|
+
`binman:web` or `web`
|
40
40
|
Builds HTML manual pages from scripts found in your `bin/` directory.
|
41
41
|
It also runs the `md2man:web` task, provided by md2man-rake(1), which
|
42
42
|
builds HTML manual pages from `*.markdown`, `*.mkd`, and `*.md` files
|
@@ -44,8 +44,8 @@ If no *TASK* is specified, then the `binman` task is run by default.
|
|
44
44
|
|
45
45
|
## OPTIONS
|
46
46
|
|
47
|
-
`-h` [*
|
48
|
-
Show this help manual and search for *
|
47
|
+
`-h` [*PATTERN*], `--help` [*PATTERN*]
|
48
|
+
Show this help manual and optionally search for *PATTERN* regular expression.
|
49
49
|
|
50
50
|
...
|
51
51
|
Anything else is passed to rake(1); run `rake --help` for documentation.
|
@@ -64,5 +64,8 @@ Rake.application.init File.basename(__FILE__)
|
|
64
64
|
|
65
65
|
require 'binman/rakefile'
|
66
66
|
task :default => :binman
|
67
|
+
task :mkd => 'binman:mkd'
|
68
|
+
task :man => 'binman:man'
|
69
|
+
task :web => 'binman:web'
|
67
70
|
|
68
71
|
Rake.application.top_level
|