man/man0/README.html in binman-3.3.3 vs man/man0/README.html in binman-3.4.0
- old
+ new
@@ -7,47 +7,47 @@
<link rel="stylesheet" href="../style.css"/>
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<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="binman-man-pages-for"><a name="binman-man-pages-for" href="#binman-man-pages-for" class="md2man-permalink" title="permalink"></a><span class="md2man-title">binman</span> <span class="md2man-section">-</span> <span class="md2man-date">man</span> <span class="md2man-source">pages</span> <span class="md2man-manual">for</span></h1><p><a href="https://github.com/sunaku/binman">binman</a> produces UNIX manual pages for executable scripts using <a href="https://github.com/sunaku/md2man">md2man</a>.</p>
<ul>
-<li>Package: <a href="https://rubygems.org/gems/binman">https://rubygems.org/gems/binman</a></li>
-<li>Manuals: <a href="https://sunaku.github.io/binman">https://sunaku.github.io/binman</a></li>
+<li>Manuals: <a href="https://sunaku.github.io/binman/man">https://sunaku.github.io/binman/man</a></li>
<li>Sources: <a href="https://github.com/sunaku/binman">https://github.com/sunaku/binman</a></li>
<li>Support: <a href="https://github.com/sunaku/binman/issues">https://github.com/sunaku/binman/issues</a></li>
+<li>Package: <a href="https://rubygems.org/gems/binman">https://rubygems.org/gems/binman</a></li>
</ul>
<h2 id="features"><a name="features" href="#features" class="md2man-permalink" title="permalink"></a>Features</h2>
<ul>
<li><p>Supports any scripting language that has multi-line
comments or uses <code>#</code> for single-line comments: Ruby,
Perl, Python, Node.js, Tcl, AWK, UNIX shell, and more!</p></li>
<li><p>Provides a Ruby library and a command-line client too.</p></li>
<li><p>Individual extraction, conversion, and display commands.</p></li>
-<li><p>Implemented in roughly 130 lines of pure Ruby code! :-)</p></li>
+<li><p>Implemented in roughly 150 lines of pure Ruby code! :-)</p></li>
</ul>
<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 is <a href="https://raw.github.com/sunaku/binman/master/bin/binman">a complete example in Ruby</a> to help you get started.
For examples in other scripting languages, see the "Usage" 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>
-<pre><code>gem install binman
+<pre><code class="sh">gem install binman
</code></pre>
<p>If you also want to build your own manual pages:</p>
-<pre><code>gem install md2man -v '~> 3.0'
+<pre><code class="sh">gem install md2man -v '~> 3.0'
</code></pre>
<h3 id="prerequisites"><a name="prerequisites" href="#prerequisites" class="md2man-permalink" title="permalink"></a>Prerequisites</h3>
<ul>
<li>Ruby 1.8.7 or 1.9.2 or newer.</li>
</ul>
<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
+<pre><code class="sh">git clone git://github.com/sunaku/binman
cd binman
bundle install
bundle exec binman --help # run it directly
bundle exec rake --tasks # packaging tasks
</code></pre>
<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
+<pre><code class="sh">binman --help
</code></pre>
<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
+<pre><code class="ruby">#!/usr/bin/env ruby
# your program's manual page goes here
require 'binman'
# OPTION 1: show manual and exit if ARGV has -h or --help except after --
@@ -55,57 +55,57 @@
# OPTION 2: show manual unconditionally
BinMan.show
</code></pre>
<p>You can also specify your program's source file encoding above the manual:</p>
-<pre><code>#!/usr/bin/env ruby
+<pre><code class="ruby">#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# your program's manual page goes here
</code></pre>
<p>You can also write the manual as a multi-line Ruby comment:</p>
-<pre><code>#!/usr/bin/env ruby
+<pre><code class="ruby">#!/usr/bin/env ruby
=begin
your program's manual page goes here
=end
</code></pre>
<p>You can also specify your program's source file encoding above the manual:</p>
-<pre><code>#!/usr/bin/env ruby
+<pre><code class="ruby">#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
=begin
your program's manual page goes here
=end
</code></pre>
<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
+<pre><code class="ruby">#!/usr/bin/sh
# your program's manual page goes here
# OPTION 1: show manual and exit if ARGV has -h or --help except after --
binman help "$0" "$@" && exit
# OPTION 2: show manual unconditionally
binman show "$0"
</code></pre>
<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
+<pre><code class="perl">#!/usr/bin/env perl
# your program's manual page goes here
# OPTION 1: show manual and exit if ARGV has -h or --help except after --
system('binman', 'help', __FILE__, @ARGV) == 0 and exit;
# OPTION 2: show manual unconditionally
system('binman', 'show', __FILE__);
</code></pre>
<p>You can also write the manual as a multi-line Ruby comment after <code>__END__</code>:</p>
-<pre><code>#!/usr/bin/env perl
+<pre><code class="perl">#!/usr/bin/env perl
print "your program's code goes here";
__END__
=begin
your program's manual page goes here
=end
</code></pre>
<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
+<pre><code class="python">#!/usr/bin/env python
# your program's manual page goes here
import sys, subprocess
# OPTION 1: show manual and exit if ARGV has -h or --help except after --
@@ -113,33 +113,33 @@
# OPTION 2: show manual unconditionally
subprocess.call(['binman', 'show', __file__])
</code></pre>
<p>You can also specify your program's source file encoding above the manual:</p>
-<pre><code>#!/usr/bin/env python
+<pre><code class="python">#!/usr/bin/env python
# -*- coding: utf-8 -*-
# your program's manual page goes here
</code></pre>
<p>You can also write the manual as a multi-line Ruby comment inside a docstring:</p>
-<pre><code>#!/usr/bin/env python
+<pre><code class="python">#!/usr/bin/env python
"""
=begin
your program's manual page goes here
=end
"""
</code></pre>
<p>You can also specify your program's source file encoding above the manual:</p>
-<pre><code>#!/usr/bin/env python
+<pre><code class="python">#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
=begin
your program's manual page goes here
=end
"""
</code></pre>
<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
+<pre><code class="awk">#!/usr/bin/awk -f
# your program's manual page goes here
# OPTION 1: show manual and exit if ARGV has -h or --help except after --
BEGIN {getline c <"/proc/self/cmdline"; sub(".*-f\0"," ",c); gsub("\0"," ",c);
if(system("binman help" c) == 0){ exit }}
@@ -147,29 +147,29 @@
# OPTION 2: show manual unconditionally
BEGIN {getline c <"/proc/self/cmdline"; sub(".*-f\0"," ",c); sub("\0.*","",c);
system("binman show" c)}
</code></pre>
<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
+<pre><code class="tcl">#!/usr/bin/env tclsh
# your program's manual page goes here
# OPTION 1: show manual and exit if ARGV has -h or --help except after --
if {![catch {exec -- >/dev/tty binman help $argv0 {*}$argv}]} {exit}
# OPTION 2: show manual unconditionally
exec >/dev/tty binman show $argv0
</code></pre>
<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
+<pre><code class="tcl">#!/usr/bin/env tclsh
if 0 {
=begin
your program's manual page goes here
=end
}
</code></pre>
<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>/*
+<pre><code class="javascript">/*
=begin
your program's manual page goes here
=end
*/
@@ -181,25 +181,25 @@
// OPTION 2: show manual unconditionally
exec(['>/dev/tty', 'binman', 'show', __filename].join(' '));
</code></pre>
<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
+<pre><code class="sh">binman-rake --help
</code></pre>
<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['man/man?/*.?'] # UNIX man pages
+<pre><code class="ruby">s.files += Dir['man/man?/*.?'] # UNIX man pages
s.files += Dir['man/**/*.{html,css,js}'] # HTML man pages
s.add_development_dependency 'md2man', '~> 3.0'
</code></pre>
<p>Add the following line to your Rakefile:</p>
-<pre><code>require 'binman/rakefile'
+<pre><code class="ruby">require 'binman/rakefile'
</code></pre>
<p>You now have a <code>rake binman</code> task that pre-builds UNIX manual page files for
your <code>bin/</code> scripts into a <code>man/</code> directory so that your end-users do not need
<a href="https://github.com/sunaku/md2man">md2man</a> installed in order to view the manual pages you've embedded therein!
There are also sub-tasks to build manual pages individually as <a href="http://troff.org">roff</a> or HTML.</p><p>If you're using Bundler, this task also hooks into its gem packaging tasks and
ensures that your UNIX manual pages are pre-built and packaged into your gem:</p>
-<pre><code>bundle exec rake build
+<pre><code class="shell">bundle exec rake build
gem spec pkg/*.gem | fgrep man/man
</code></pre>
<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>
</html>