Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rename project to "md2man": better reflect purpose

  • Loading branch information...
commit fb220e4bd40fb3c6de10c11bb803069310ac52a2 1 parent 316846b
@sunaku sunaku authored
View
36 README.markdown
@@ -1,8 +1,8 @@
-Redman - UNIX man pages in Markdown
+md2man - write UNIX man pages in Markdown
==============================================================================
-Redman is a Ruby library for converting [Markdown] documents into UNIX man
-pages ([Roff] documents) using the awesome [Redcarpet2] library.
+md2man is a Ruby library and command-line program that converts [Markdown]
+documents into UNIX man pages (really [Roff] documents) using [Redcarpet2].
[Roff]: http://troff.org
[Markdown]: http://daringfireball.net/projects/markdown/
@@ -14,29 +14,37 @@ Installation
As a Ruby gem:
- gem install redman
+ gem install md2man
As a Git clone:
- git clone git://github.com/sunaku/redman
- cd redman
+ git clone git://github.com/sunaku/md2man
+ cd md2man
bundle install
------------------------------------------------------------------------------
-Usage
+Command Usage
+------------------------------------------------------------------------------
+
+Read the manual page:
+
+ md2man --help
+
+------------------------------------------------------------------------------
+Library Usage
------------------------------------------------------------------------------
Use the default renderer:
- require 'redman'
- markdown = Redcarpet::Markdown.new(Redman::Roff, your_options_hash)
+ require 'md2man'
+ markdown = Redcarpet::Markdown.new(Md2man::Roff, your_options_hash)
your_roff_output = markdown.render(your_markdown_input)
Or extend it for yourself:
- require 'redman'
+ require 'md2man'
- class YourManpageRenderer < Redman::Roff
+ class YourManpageRenderer < Md2man::Roff
# ... your stuff here ...
# See Redcarpet::Render::Base documentation for more information:
# http://rdoc.info/github/tanoku/redcarpet/master/Redcarpet/Render/Base
@@ -46,10 +54,10 @@ Or extend it for yourself:
your_roff_output = markdown.render(your_markdown_input)
------------------------------------------------------------------------------
-Specification
+Document Format
------------------------------------------------------------------------------
-Redman introduces the following additions to the core [Markdown] language:
+md2man introduces the following additions to the core [Markdown] language:
* If a paragraph's first or subsequent lines are uniformly indented by two
spaces, then it is considered to be a "tagged paragraph" and its body is
@@ -117,7 +125,7 @@ Redman introduces the following additions to the core [Markdown] language:
Limitations
------------------------------------------------------------------------------
-At present, Redman does not translate the following [Redcarpet2] node types:
+At present, md2man does not translate the following [Redcarpet2] node types:
* `block_html`
* `strikethrough`
View
20 bin/redman → bin/md2man
@@ -1,25 +1,25 @@
#!/usr/bin/env ruby
=begin
-REDMAN 1 "2011-12-06" "1.0.0" "Ruby User Manuals"
-=================================================
+MD2MAN 1 "2011-12-06" "1.0.0"
+=============================
NAME
----
-redman - transforms markdown(7) into roff(7)
+md2man - convert markdown(7) into roff(7)
SYNOPSIS
--------
-`redman` [*OPTION*]... [*FILE*]
+`md2man` [*OPTION*]... [*FILE*]
DESCRIPTION
-----------
-Transforms markdown(7) input from the given *FILE* into roff(7) using
-[Redcarpet2] and then prints the result to the standard output stream.
-If *FILE* is not given, the standard input stream is read in its place.
+This program converts markdown(7) input from the given *FILE* into roff(7)
+using [Redcarpet2] and then prints the result to the standard output stream.
+If *FILE* is not given, then the standard input stream is read in its place.
### Document Format
@@ -51,7 +51,7 @@ SEE ALSO
markdown(7), roff(7)
-[Redman]: https://github.com/sunaku/redman
+[md2man]: https://github.com/sunaku/md2man
[Redcarpet2]: https://github.com/tanoku/redcarpet
=end =========================================================================
@@ -59,9 +59,9 @@ markdown(7), roff(7)
require 'binman'
BinMan.help
-require 'redman'
+require 'md2man'
puts Redcarpet::Markdown.new(
- Redman::Roff,
+ Md2man::Roff,
:tables => true,
:autolink => true,
:superscript => true,
View
2  lib/md2man.rb
@@ -0,0 +1,2 @@
+require 'md2man/version'
+require 'md2man/roff'
View
14 lib/redman/roff.rb → lib/md2man/roff.rb
@@ -1,6 +1,6 @@
require 'redcarpet'
-module Redman
+module Md2man
class Roff < Redcarpet::Render::Base
#-------------------------------------------------------------------------
@@ -57,7 +57,7 @@ def block_quote quote
end
def block_html html
- warn "redman/roff: block_html not implemented: #{html.inspect}"
+ warn "md2man/roff: block_html not implemented: #{html.inspect}"
end
def header text, level
@@ -149,11 +149,11 @@ def triple_emphasis text
end
def strikethrough text
- warn "redman/roff: strikethrough not implemented: #{text.inspect}"
+ warn "md2man/roff: strikethrough not implemented: #{text.inspect}"
end
def superscript text
- warn "redman/roff: superscript not implemented: #{text.inspect}"
+ warn "md2man/roff: superscript not implemented: #{text.inspect}"
end
def codespan code
@@ -180,11 +180,11 @@ def autolink link, link_type
end
def image link, title, alt_text
- warn "redman/roff: image not implemented: #{link.inspect}"
+ warn "md2man/roff: image not implemented: #{link.inspect}"
end
def raw_html html
- warn "redman/roff: raw_html not implemented: #{html.inspect}"
+ warn "md2man/roff: raw_html not implemented: #{html.inspect}"
end
#-------------------------------------------------------------------------
@@ -199,7 +199,7 @@ def entity text
if unicode = entity_to_unicode(text)
unicode_to_glyph unicode
else
- warn "redman/roff: entity not implemented: #{text.inspect}"
+ warn "md2man/roff: entity not implemented: #{text.inspect}"
end
end
View
2  lib/redman/version.rb → lib/md2man/version.rb
@@ -1,3 +1,3 @@
-module Redman
+module Md2man
VERSION = "1.0.0"
end
View
2  lib/redman.rb
@@ -1,2 +0,0 @@
-require 'redman/version'
-require 'redman/roff'
View
8 redman.gemspec → md2man.gemspec
@@ -1,14 +1,14 @@
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
-require "redman/version"
+require "md2man/version"
require "binman/gemspec"
Gem::Specification.new do |s|
- s.name = "redman"
- s.version = Redman::VERSION
+ s.name = "md2man"
+ s.version = Md2man::VERSION
s.authors,
s.email = File.read('LICENSE').scan(/Copyright \d+ (.+) <(.+?)>/).transpose
- s.homepage = "http://github.com/sunaku/redman"
+ s.homepage = "http://github.com/sunaku/md2man"
s.summary = "UNIX man pages using Redcarpet2"
s.description = nil
View
6 test/redman/roff_test.rb → test/md2man/roff_test.rb
@@ -7,12 +7,12 @@
# man 7 groff
require 'test_helper'
-require 'redman/roff'
+require 'md2man/roff'
-describe Redman::Roff do
+describe Md2man::Roff do
before do
@markdown = Redcarpet::Markdown.new(
- Redman::Roff,
+ Md2man::Roff,
:tables => true,
:autolink => true,
:superscript => true,
Please sign in to comment.
Something went wrong with that request. Please try again.