ron 0.2 → 0.3
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/README.md +133 -0
- data/Rakefile +23 -9
- data/bin/ron +15 -8
- data/lib/ron.rb +1 -1
- data/lib/ron/document.rb +2 -2
- data/lib/ron/layout.html +14 -9
- data/lib/ron/roff.rb +28 -16
- data/man/markdown.5 +1614 -0
- data/man/ron.1 +226 -0
- data/man/ron.1.ron +59 -60
- data/man/ron.5 +210 -0
- data/man/ron.5.ron +35 -33
- data/man/ron.7 +201 -0
- data/man/ron.7.ron +99 -115
- data/ron.gemspec +8 -4
- data/test/ron_test.rb +10 -5
- metadata +7 -4
- data/README +0 -149
data/ron.gemspec
CHANGED
@@ -3,8 +3,8 @@ Gem::Specification.new do |s|
|
|
3
3
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
4
4
|
|
5
5
|
s.name = 'ron'
|
6
|
-
s.version = '0.
|
7
|
-
s.date = '2009-
|
6
|
+
s.version = '0.3'
|
7
|
+
s.date = '2009-12-09'
|
8
8
|
|
9
9
|
s.description = "The opposite of roff"
|
10
10
|
s.summary = "The opposite of roff"
|
@@ -15,16 +15,20 @@ Gem::Specification.new do |s|
|
|
15
15
|
# = MANIFEST =
|
16
16
|
s.files = %w[
|
17
17
|
COPYING
|
18
|
-
README
|
18
|
+
README.md
|
19
19
|
Rakefile
|
20
20
|
bin/ron
|
21
21
|
lib/ron.rb
|
22
22
|
lib/ron/document.rb
|
23
23
|
lib/ron/layout.html
|
24
24
|
lib/ron/roff.rb
|
25
|
+
man/markdown.5
|
25
26
|
man/markdown.5.ron
|
27
|
+
man/ron.1
|
26
28
|
man/ron.1.ron
|
29
|
+
man/ron.5
|
27
30
|
man/ron.5.ron
|
31
|
+
man/ron.7
|
28
32
|
man/ron.7.ron
|
29
33
|
ron.gemspec
|
30
34
|
test/angle_bracket_syntax.html
|
@@ -45,7 +49,7 @@ Gem::Specification.new do |s|
|
|
45
49
|
s.executables = ['ron']
|
46
50
|
s.test_files = s.files.select { |path| path =~ /^test\/.*_test.rb/ }
|
47
51
|
|
48
|
-
s.extra_rdoc_files = %w[
|
52
|
+
s.extra_rdoc_files = %w[COPYING]
|
49
53
|
s.add_dependency 'nokogiri', '~> 1.4'
|
50
54
|
s.add_dependency 'rdiscount', '~> 1.3'
|
51
55
|
s.add_development_dependency 'contest', '~> 0.1'
|
data/test/ron_test.rb
CHANGED
@@ -1,13 +1,18 @@
|
|
1
1
|
require 'contest'
|
2
|
-
require 'ron'
|
3
2
|
|
4
3
|
class RonTest < Test::Unit::TestCase
|
5
4
|
testdir = File.dirname(__FILE__)
|
6
|
-
|
5
|
+
|
6
|
+
# setup PATH so that we execute the right ron command
|
7
|
+
bindir = File.dirname(testdir) + "/bin"
|
7
8
|
ENV['PATH'] = "#{bindir}:#{ENV['PATH']}"
|
8
|
-
ENV['RUBYLIB'] = $LOAD_PATH.join(':')
|
9
9
|
|
10
|
-
|
10
|
+
# make sure the load path is setup correctly
|
11
|
+
libdir = File.expand_path("#{testdir}/../lib")
|
12
|
+
$:.unshift(libdir) unless $:.any? { |path| File.expand_path(path) == libdir }
|
13
|
+
ENV['RUBYLIB'] = $:.join(':')
|
14
|
+
|
15
|
+
require 'ron'
|
11
16
|
|
12
17
|
test "takes ron text on stdin and produces roff on stdout" do
|
13
18
|
output = `echo '# hello(1) -- hello world' | ron --date=2009-11-23`
|
@@ -16,7 +21,7 @@ class RonTest < Test::Unit::TestCase
|
|
16
21
|
assert_equal %[.\\" generated with Ron/v#{Ron::VERSION}], lines.shift
|
17
22
|
assert_equal %[.\\" http://github.com/rtomayko/ron/], lines.shift
|
18
23
|
assert_equal %[.], lines.shift
|
19
|
-
assert_equal %[.TH "HELLO" 1 "November 2009" "" ""], lines.shift
|
24
|
+
assert_equal %[.TH "HELLO" "1" "November 2009" "" ""], lines.shift
|
20
25
|
assert_equal %[.], lines.shift
|
21
26
|
assert_equal %[.SH "NAME"], lines.shift
|
22
27
|
assert_equal %[\\fBhello\\fR \\-\\- hello world], lines.shift
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: "0.
|
4
|
+
version: "0.3"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Tomayko
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-12-09 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -49,20 +49,23 @@ executables:
|
|
49
49
|
extensions: []
|
50
50
|
|
51
51
|
extra_rdoc_files:
|
52
|
-
- README
|
53
52
|
- COPYING
|
54
53
|
files:
|
55
54
|
- COPYING
|
56
|
-
- README
|
55
|
+
- README.md
|
57
56
|
- Rakefile
|
58
57
|
- bin/ron
|
59
58
|
- lib/ron.rb
|
60
59
|
- lib/ron/document.rb
|
61
60
|
- lib/ron/layout.html
|
62
61
|
- lib/ron/roff.rb
|
62
|
+
- man/markdown.5
|
63
63
|
- man/markdown.5.ron
|
64
|
+
- man/ron.1
|
64
65
|
- man/ron.1.ron
|
66
|
+
- man/ron.5
|
65
67
|
- man/ron.5.ron
|
68
|
+
- man/ron.7
|
66
69
|
- man/ron.7.ron
|
67
70
|
- ron.gemspec
|
68
71
|
- test/angle_bracket_syntax.html
|
data/README
DELETED
@@ -1,149 +0,0 @@
|
|
1
|
-
ron(7) -- the opposite of roff
|
2
|
-
==============================
|
3
|
-
|
4
|
-
DESCRIPTION
|
5
|
-
-----------
|
6
|
-
|
7
|
-
Ron is a humane text format and toolchain for
|
8
|
-
creating UNIX man pages -- and things that
|
9
|
-
appear as man pages from a distance. Use it
|
10
|
-
to build and install standard UNIX roff man
|
11
|
-
pages or to generate nicely formatted HTML
|
12
|
-
manual pages for the web.
|
13
|
-
|
14
|
-
The ron file format is based on Markdown. In
|
15
|
-
fact, ron files are 100% Markdown compatible
|
16
|
-
but have a more rigidly defined structure and
|
17
|
-
extend Markdown in some ways to provide
|
18
|
-
features commonly found in man pages (e.g.,
|
19
|
-
definition lists). The ron(5) manual page
|
20
|
-
included with this distribution defines the
|
21
|
-
format in more detail.
|
22
|
-
|
23
|
-
INSTALL
|
24
|
-
-------
|
25
|
-
|
26
|
-
Ron can be installed using rubygems:
|
27
|
-
|
28
|
-
$ [sudo] gem install ron
|
29
|
-
|
30
|
-
Or, clone the git repository and install from
|
31
|
-
source:
|
32
|
-
|
33
|
-
$ git clone git://github.com/rtomayko/ron.git
|
34
|
-
$ cd ron
|
35
|
-
$ rake package
|
36
|
-
$ [sudo] rake install
|
37
|
-
|
38
|
-
EXAMPLES
|
39
|
-
--------
|
40
|
-
|
41
|
-
The .ron files located under the repository's
|
42
|
-
./man directory show off a wide range of ron
|
43
|
-
capabilities. The HTML versions of these
|
44
|
-
files are available at:
|
45
|
-
|
46
|
-
http://rtomayko.github.com/ron/ron.1.html
|
47
|
-
http://rtomayko.github.com/ron/ron.5.html
|
48
|
-
http://rtomayko.github.com/ron/markdown.5.html
|
49
|
-
|
50
|
-
BASIC USAGE
|
51
|
-
-----------
|
52
|
-
|
53
|
-
To generate a roff man page from the included
|
54
|
-
`markdown.5.ron` file and open it in man(1):
|
55
|
-
|
56
|
-
$ ron -b man/markdown.5.ron
|
57
|
-
building: man/markdown.5
|
58
|
-
$ man man/markdown.5
|
59
|
-
|
60
|
-
To generate a standalone HTML version:
|
61
|
-
|
62
|
-
$ ron -b --html man/markdown.5.ron
|
63
|
-
building: man/markdown.5.html
|
64
|
-
$ open man/markdown.5.html
|
65
|
-
|
66
|
-
To build roff and HTML versions of all ron
|
67
|
-
files:
|
68
|
-
|
69
|
-
$ ron -b --roff --html man/*.ron
|
70
|
-
|
71
|
-
If you just want to view a ron file as if it
|
72
|
-
were a man page without building any
|
73
|
-
intermediate files:
|
74
|
-
|
75
|
-
$ ron -m man/markdown.5.ron
|
76
|
-
|
77
|
-
The ron(1) manual page included with this
|
78
|
-
distribution includes full documentation on
|
79
|
-
ron command line options.
|
80
|
-
|
81
|
-
RATIONALE
|
82
|
-
---------
|
83
|
-
|
84
|
-
Some people think UNIX manual pages are a
|
85
|
-
poor and outdated form of documentation. I
|
86
|
-
disagree.
|
87
|
-
|
88
|
-
- Man pages typically follow a well defined
|
89
|
-
structure that's immediately familiar and
|
90
|
-
provides a useful starting point for
|
91
|
-
developers documenting new tools,
|
92
|
-
libraries, and formats.
|
93
|
-
|
94
|
-
- Man pages get to the point. Because they're
|
95
|
-
written in an inverted style, with a
|
96
|
-
SYNOPSIS section followed by additional
|
97
|
-
detail, prose, and finally references to
|
98
|
-
other sources of information, man pages
|
99
|
-
provide the best of both cheat sheet and
|
100
|
-
reference style documentation.
|
101
|
-
|
102
|
-
- Man pages have very limited text formatting
|
103
|
-
capabilities. This is a feature. You get
|
104
|
-
bold and underline, basically, and they're
|
105
|
-
typically applied consistently across man
|
106
|
-
pages.
|
107
|
-
|
108
|
-
- Most man pages use only a single level of
|
109
|
-
section hierarchy (although two levels are
|
110
|
-
technically supported). Hierarchy destroys
|
111
|
-
otherwise good documentation by adding
|
112
|
-
unnecessary complexity. Feynman described
|
113
|
-
the whole of quantum electro dynamics with
|
114
|
-
only two levels of hierarchy. How can you
|
115
|
-
possibly need more? Man pages force you to
|
116
|
-
keep it simple.
|
117
|
-
|
118
|
-
- Man pages have a simple referencing syntax;
|
119
|
-
e.g., sh(1), fork(2), markdown(5). HTML
|
120
|
-
versions can use this to generate links
|
121
|
-
between pages.
|
122
|
-
|
123
|
-
- The classical terminal man page display is
|
124
|
-
typographically well thought out. Big bold
|
125
|
-
section headings, justified monospaced
|
126
|
-
text, nicely indented paragraphs,
|
127
|
-
intelligently aligned definition lists, and
|
128
|
-
an informational header and footer.
|
129
|
-
|
130
|
-
All that being said, trying to figure out how
|
131
|
-
to create a man page can be a really tedious
|
132
|
-
process. The roff/man macro languages are
|
133
|
-
highly extensible, fractured between multiple
|
134
|
-
dialects, and include a bunch of stuff that's
|
135
|
-
entirely irrelevant to modern man page
|
136
|
-
creation. It's also horribly ugly compared to
|
137
|
-
today's humane text formats or even HTML
|
138
|
-
(just sayin').
|
139
|
-
|
140
|
-
Ron aims to address many of the issues with
|
141
|
-
man page creation while preserving the things
|
142
|
-
that makes man pages a great form of
|
143
|
-
documentation.
|
144
|
-
|
145
|
-
COPYRIGHT
|
146
|
-
---------
|
147
|
-
|
148
|
-
Ron is Copyright (C) 2009 Ryan Tomayko
|
149
|
-
See the file COPYING for more information.
|