ronn 0.4.1 → 0.5

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'rake/clean'
2
+ require 'date'
2
3
 
3
4
  task :default => :test
4
5
 
@@ -51,12 +52,6 @@ if defined?(Gem)
51
52
  mv File.basename(f.name), f.name
52
53
  end
53
54
 
54
- file 'pkg/ron-0.4.gem' => %w[pkg/ ron.gemspec] do |f|
55
- sh "gem build ron.gemspec"
56
- mv 'ron-0.4.gem', f.name
57
- end
58
- task :package => 'pkg/ron-0.4.gem'
59
-
60
55
  file package('.tar.gz') => %w[pkg/] + $spec.files do |f|
61
56
  sh <<-SH
62
57
  git archive --prefix=ronn-#{source_version}/ --format=tar HEAD |
@@ -3,7 +3,7 @@
3
3
  # install standard UNIX roff(7) formatted manpages or to generate
4
4
  # beautiful HTML manpages.
5
5
  module Ronn
6
- VERSION = '0.4.1'
6
+ VERSION = '0.5'
7
7
 
8
8
  require 'ronn/document'
9
9
  require 'ronn/roff'
@@ -12,7 +12,7 @@ module Ronn
12
12
  end
13
13
 
14
14
  def to_s
15
- @buf.join.gsub(/\s+$/, '')
15
+ @buf.join.gsub(/[ \t]+$/, '')
16
16
  end
17
17
 
18
18
  protected
@@ -24,6 +24,17 @@ module Ronn
24
24
  end
25
25
  end
26
26
 
27
+ def child_of?(node, tag)
28
+ while node
29
+ if node.name && node.name.downcase == tag
30
+ return true
31
+ else
32
+ node = node.parent
33
+ end
34
+ end
35
+ false
36
+ end
37
+
27
38
  def title_heading(name, section, tagline, manual, version, date)
28
39
  comment "generated with Ronn/v#{Ronn::VERSION}"
29
40
  comment "http://github.com/rtomayko/ronn/"
@@ -63,7 +74,7 @@ module Ronn
63
74
  macro "IP", %w["" 4] if indent
64
75
  macro "nf"
65
76
  write "\n"
66
- inline_filter(node.search('code > *'))
77
+ inline_filter(node.children)
67
78
  macro "fi"
68
79
  macro "IP", %w["" 0] if indent
69
80
 
@@ -118,7 +129,9 @@ module Ronn
118
129
  prev = previous(node)
119
130
  text = node.to_html.dup
120
131
  text.sub!(/^\n+/m, '') if prev && prev.name == 'br'
121
- if node.previous.nil? && node.next
132
+ if child_of?(node, 'pre')
133
+ # leave the text alone
134
+ elsif node.previous.nil? && node.next.nil?
122
135
  text.sub!(/\n+$/m, '')
123
136
  else
124
137
  text.sub!(/\n+$/m, ' ')
@@ -128,9 +141,13 @@ module Ronn
128
141
  elsif node.elem?
129
142
  case node.name
130
143
  when 'code'
131
- write '\fB'
132
- inline_filter(node.children)
133
- write '\fR'
144
+ if child_of?(node, 'pre')
145
+ inline_filter(node.children)
146
+ else
147
+ write '\fB'
148
+ inline_filter(node.children)
149
+ write '\fR'
150
+ end
134
151
 
135
152
  when 'b', 'strong', 'kbd', 'samp'
136
153
  write '\fB'
@@ -167,6 +184,8 @@ module Ronn
167
184
  gsub('&nbsp;', ' ').
168
185
  gsub('&lt;', '<').
169
186
  gsub('&gt;', '>').
187
+ gsub(/&#x([0-9A-Fa-f]+);/) { $1.to_i(16).chr }.
188
+ gsub(/&#(\d+);/) { $1.to_i.chr }.
170
189
  gsub('&amp;', '&')
171
190
  end
172
191
 
@@ -1,4 +1,4 @@
1
- .\" generated with Ronn/v0.3
1
+ .\" generated with Ronn/v0.4.2
2
2
  .\" http://github.com/rtomayko/ronn/
3
3
  .
4
4
  .TH "MARKDOWN" "5" "March 2010" "Ryan Tomayko" "Ronn Manual"
@@ -9,22 +9,30 @@
9
9
  .SH "SYNOPSIS"
10
10
  .
11
11
  .nf
12
+
12
13
  # Header 1 #
13
14
  ## Header 2 ##
14
15
  ### Header 3 ### (Hashes on right are optional)
15
16
  #### Header 4 ####
16
17
  ##### Header 5 #####
18
+
17
19
  This is a paragraph, which is text surrounded by whitespace.
18
20
  Paragraphs can be on one line (or many), and can drone on for
19
21
  hours.
22
+
20
23
  [Reference style links][1] and [inline links](http://example.com)
21
24
  [1]: http://example.com "Title is optional"
25
+
22
26
  Inline markup like _italics_, **bold**, and `code()`.
27
+
23
28
  ![picture alt](/images/photo.jpeg "Title is optional")
29
+
24
30
  > Blockquotes are like quoted text in email replies
25
31
  >> And, they can be nested
32
+
26
33
  code blocks are for preformatted
27
34
  text and must be indented with four spaces
35
+
28
36
  * Bullet lists are easy too
29
37
  * You can
30
38
  * even
@@ -87,12 +95,15 @@ For example, to add an HTML table to a Markdown article:
87
95
  .IP "" 4
88
96
  .
89
97
  .nf
98
+
90
99
  This is a regular paragraph.
100
+
91
101
  <table>
92
102
  <tr>
93
103
  <td>Foo</td>
94
104
  </tr>
95
105
  </table>
106
+
96
107
  This is another regular paragraph.
97
108
  .
98
109
  .fi
@@ -129,6 +140,7 @@ escape ampersands within URLs. Thus, if you want to link to:
129
140
  .IP "" 4
130
141
  .
131
142
  .nf
143
+
132
144
  http://images.google.com/images?num=30&q=larry+bird
133
145
  .
134
146
  .fi
@@ -141,6 +153,7 @@ you need to encode the URL as:
141
153
  .IP "" 4
142
154
  .
143
155
  .nf
156
+
144
157
  http://images.google.com/images?num=30&amp;q=larry+bird
145
158
  .
146
159
  .fi
@@ -164,6 +177,7 @@ So, if you want to include a copyright symbol in your article, you can write:
164
177
  .IP "" 4
165
178
  .
166
179
  .nf
180
+
167
181
  &copy;
168
182
  .
169
183
  .fi
@@ -176,6 +190,7 @@ and Markdown will leave it alone. But if you write:
176
190
  .IP "" 4
177
191
  .
178
192
  .nf
193
+
179
194
  AT&T
180
195
  .
181
196
  .fi
@@ -188,6 +203,7 @@ Markdown will translate it to:
188
203
  .IP "" 4
189
204
  .
190
205
  .nf
206
+
191
207
  AT&amp;T
192
208
  .
193
209
  .fi
@@ -202,6 +218,7 @@ such. But if you write:
202
218
  .IP "" 4
203
219
  .
204
220
  .nf
221
+
205
222
  4 < 5
206
223
  .
207
224
  .fi
@@ -214,6 +231,7 @@ Markdown will translate it to:
214
231
  .IP "" 4
215
232
  .
216
233
  .nf
234
+
217
235
  4 &lt; 5
218
236
  .
219
237
  .fi
@@ -262,8 +280,10 @@ headers) and dashes (for second\-level headers). For example:
262
280
  .IP "" 4
263
281
  .
264
282
  .nf
283
+
265
284
  This is an H1
266
285
  =============
286
+
267
287
  This is an H2
268
288
  \-\-\-\-\-\-\-\-\-\-\-\-\-
269
289
  .
@@ -281,8 +301,11 @@ corresponding to header levels 1\-6. For example:
281
301
  .IP "" 4
282
302
  .
283
303
  .nf
304
+
284
305
  # This is an H1
306
+
285
307
  ## This is an H2
308
+
286
309
  ###### This is an H6
287
310
  .
288
311
  .fi
@@ -299,8 +322,11 @@ determines the header level.) :
299
322
  .IP "" 4
300
323
  .
301
324
  .nf
325
+
302
326
  # This is an H1 #
327
+
303
328
  ## This is an H2 ##
329
+
304
330
  ### This is an H3 ######
305
331
  .
306
332
  .fi
@@ -316,6 +342,7 @@ wrap the text and put a \fB>\fR before every line:
316
342
  .IP "" 4
317
343
  .
318
344
  .nf
345
+
319
346
  > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
320
347
  > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
321
348
  > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
@@ -334,9 +361,11 @@ line of a hard\-wrapped paragraph:
334
361
  .IP "" 4
335
362
  .
336
363
  .nf
364
+
337
365
  > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
338
366
  consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
339
367
  Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
368
+
340
369
  > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
341
370
  id sem consectetuer libero luctus adipiscing.
342
371
  .
@@ -351,6 +380,7 @@ adding additional levels of \fB>\fR:
351
380
  .IP "" 4
352
381
  .
353
382
  .nf
383
+
354
384
  > This is the first level of quoting.
355
385
  >
356
386
  > > This is nested blockquote.
@@ -368,6 +398,7 @@ and code blocks:
368
398
  .IP "" 4
369
399
  .
370
400
  .nf
401
+
371
402
  > ## This is a header.
372
403
  >
373
404
  > 1. This is the first list item.
@@ -396,6 +427,7 @@ Unordered lists use asterisks, pluses, and hyphens \-\- interchangably
396
427
  .IP "" 4
397
428
  .
398
429
  .nf
430
+
399
431
  * Red
400
432
  * Green
401
433
  * Blue
@@ -410,6 +442,7 @@ is equivalent to:
410
442
  .IP "" 4
411
443
  .
412
444
  .nf
445
+
413
446
  + Red
414
447
  + Green
415
448
  + Blue
@@ -424,6 +457,7 @@ and:
424
457
  .IP "" 4
425
458
  .
426
459
  .nf
460
+
427
461
  \- Red
428
462
  \- Green
429
463
  \- Blue
@@ -438,6 +472,7 @@ Ordered lists use numbers followed by periods:
438
472
  .IP "" 4
439
473
  .
440
474
  .nf
475
+
441
476
  1. Bird
442
477
  2. McHale
443
478
  3. Parish
@@ -454,6 +489,7 @@ Markdown produces from the above list is:
454
489
  .IP "" 4
455
490
  .
456
491
  .nf
492
+
457
493
  <ol>
458
494
  <li>Bird</li>
459
495
  <li>McHale</li>
@@ -470,6 +506,7 @@ If you instead wrote the list in Markdown like this:
470
506
  .IP "" 4
471
507
  .
472
508
  .nf
509
+
473
510
  1. Bird
474
511
  1. McHale
475
512
  1. Parish
@@ -484,6 +521,7 @@ or even:
484
521
  .IP "" 4
485
522
  .
486
523
  .nf
524
+
487
525
  3. Bird
488
526
  1. McHale
489
527
  8. Parish
@@ -514,6 +552,7 @@ To make lists look nice, you can wrap items with hanging indents:
514
552
  .IP "" 4
515
553
  .
516
554
  .nf
555
+
517
556
  * Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
518
557
  Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
519
558
  viverra nec, fringilla in, laoreet vitae, risus.
@@ -530,6 +569,7 @@ But if you want to be lazy, you don't have to:
530
569
  .IP "" 4
531
570
  .
532
571
  .nf
572
+
533
573
  * Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
534
574
  Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
535
575
  viverra nec, fringilla in, laoreet vitae, risus.
@@ -547,6 +587,7 @@ items in \fB<p>\fR tags in the HTML output. For example, this input:
547
587
  .IP "" 4
548
588
  .
549
589
  .nf
590
+
550
591
  * Bird
551
592
  * Magic
552
593
  .
@@ -560,6 +601,7 @@ will turn into:
560
601
  .IP "" 4
561
602
  .
562
603
  .nf
604
+
563
605
  <ul>
564
606
  <li>Bird</li>
565
607
  <li>Magic</li>
@@ -575,7 +617,9 @@ But this:
575
617
  .IP "" 4
576
618
  .
577
619
  .nf
620
+
578
621
  * Bird
622
+
579
623
  * Magic
580
624
  .
581
625
  .fi
@@ -588,6 +632,7 @@ will turn into:
588
632
  .IP "" 4
589
633
  .
590
634
  .nf
635
+
591
636
  <ul>
592
637
  <li><p>Bird</p></li>
593
638
  <li><p>Magic</p></li>
@@ -605,12 +650,15 @@ or one tab:
605
650
  .IP "" 4
606
651
  .
607
652
  .nf
653
+
608
654
  1. This is a list item with two paragraphs. Lorem ipsum dolor
609
655
  sit amet, consectetuer adipiscing elit. Aliquam hendrerit
610
656
  mi posuere lectus.
657
+
611
658
  Vestibulum enim wisi, viverra nec, fringilla in, laoreet
612
659
  vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
613
660
  sit amet velit.
661
+
614
662
  2. Suspendisse id sem consectetuer libero luctus adipiscing.
615
663
  .
616
664
  .fi
@@ -625,10 +673,13 @@ lazy:
625
673
  .IP "" 4
626
674
  .
627
675
  .nf
676
+
628
677
  * This is a list item with two paragraphs.
678
+
629
679
  This is the second paragraph in the list item. You're
630
680
  only required to indent the first line. Lorem ipsum dolor
631
681
  sit amet, consectetuer adipiscing elit.
682
+
632
683
  * Another item in the same list.
633
684
  .
634
685
  .fi
@@ -642,7 +693,9 @@ delimiters need to be indented:
642
693
  .IP "" 4
643
694
  .
644
695
  .nf
696
+
645
697
  * A list item with a blockquote:
698
+
646
699
  > This is a blockquote
647
700
  > inside a list item.
648
701
  .
@@ -657,7 +710,9 @@ to be indented \fItwice\fR \-\- 8 spaces or two tabs:
657
710
  .IP "" 4
658
711
  .
659
712
  .nf
713
+
660
714
  * A list item with a code block:
715
+
661
716
  <code goes here>
662
717
  .
663
718
  .fi
@@ -671,6 +726,7 @@ accident, by writing something like this:
671
726
  .IP "" 4
672
727
  .
673
728
  .nf
729
+
674
730
  1986. What a great season.
675
731
  .
676
732
  .fi
@@ -684,6 +740,7 @@ line. To avoid this, you can backslash\-escape the period:
684
740
  .IP "" 4
685
741
  .
686
742
  .nf
743
+
687
744
  1986\\. What a great season.
688
745
  .
689
746
  .fi
@@ -703,7 +760,9 @@ block by at least 4 spaces or 1 tab. For example, given this input:
703
760
  .IP "" 4
704
761
  .
705
762
  .nf
763
+
706
764
  This is a normal paragraph:
765
+
707
766
  This is a code block.
708
767
  .
709
768
  .fi
@@ -716,7 +775,9 @@ Markdown will generate:
716
775
  .IP "" 4
717
776
  .
718
777
  .nf
778
+
719
779
  <p>This is a normal paragraph:</p>
780
+
720
781
  <pre><code>This is a code block.
721
782
  </code></pre>
722
783
  .
@@ -731,7 +792,9 @@ line of the code block. For example, this:
731
792
  .IP "" 4
732
793
  .
733
794
  .nf
795
+
734
796
  Here is an example of AppleScript:
797
+
735
798
  tell application "Foo"
736
799
  beep
737
800
  end tell
@@ -746,7 +809,9 @@ will turn into:
746
809
  .IP "" 4
747
810
  .
748
811
  .nf
812
+
749
813
  <p>Here is an example of AppleScript:</p>
814
+
750
815
  <pre><code>tell application "Foo"
751
816
  beep
752
817
  end tell
@@ -770,6 +835,7 @@ ampersands and angle brackets. For example, this:
770
835
  .IP "" 4
771
836
  .
772
837
  .nf
838
+
773
839
  <div class="footer">
774
840
  &copy; 2004 Foo Corporation
775
841
  </div>
@@ -784,6 +850,7 @@ will turn into:
784
850
  .IP "" 4
785
851
  .
786
852
  .nf
853
+
787
854
  <pre><code>&lt;div class="footer"&gt;
788
855
  &amp;copy; 2004 Foo Corporation
789
856
  &lt;/div&gt;
@@ -807,10 +874,15 @@ following lines will produce a horizontal rule:
807
874
  .IP "" 4
808
875
  .
809
876
  .nf
877
+
810
878
  * * *
879
+
811
880
  ***
881
+
812
882
  *****
883
+
813
884
  \- \- \-
885
+
814
886
  \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
815
887
  .
816
888
  .fi
@@ -834,7 +906,9 @@ title for the link, surrounded in quotes. For example:
834
906
  .IP "" 4
835
907
  .
836
908
  .nf
909
+
837
910
  This is [an example](http://example.com/ "Title") inline link.
911
+
838
912
  [This link](http://example.net/) has no title attribute.
839
913
  .
840
914
  .fi
@@ -847,8 +921,10 @@ Will produce:
847
921
  .IP "" 4
848
922
  .
849
923
  .nf
924
+
850
925
  <p>This is <a href="http://example.com/" title="Title">
851
926
  an example</a> inline link.</p>
927
+
852
928
  <p><a href="http://example.net/">This link</a> has no
853
929
  title attribute.</p>
854
930
  .
@@ -863,6 +939,7 @@ use relative paths:
863
939
  .IP "" 4
864
940
  .
865
941
  .nf
942
+
866
943
  See my [About](/about/) page for details.
867
944
  .
868
945
  .fi
@@ -876,6 +953,7 @@ which you place a label of your choosing to identify the link:
876
953
  .IP "" 4
877
954
  .
878
955
  .nf
956
+
879
957
  This is [an example][id] reference\-style link.
880
958
  .
881
959
  .fi
@@ -888,6 +966,7 @@ You can optionally use a space to separate the sets of brackets:
888
966
  .IP "" 4
889
967
  .
890
968
  .nf
969
+
891
970
  This is [an example] [id] reference\-style link.
892
971
  .
893
972
  .fi
@@ -901,6 +980,7 @@ on a line by itself:
901
980
  .IP "" 4
902
981
  .
903
982
  .nf
983
+
904
984
  [id]: http://example.com/ "Optional Title Here"
905
985
  .
906
986
  .fi
@@ -935,6 +1015,7 @@ The following three link definitions are equivalent:
935
1015
  .IP "" 4
936
1016
  .
937
1017
  .nf
1018
+
938
1019
  [foo]: http://example.com/ "Optional Title Here"
939
1020
  [foo]: http://example.com/ 'Optional Title Here'
940
1021
  [foo]: http://example.com/ (Optional Title Here)
@@ -953,6 +1034,7 @@ The link URL may, optionally, be surrounded by angle brackets:
953
1034
  .IP "" 4
954
1035
  .
955
1036
  .nf
1037
+
956
1038
  [id]: <http://example.com/> "Optional Title Here"
957
1039
  .
958
1040
  .fi
@@ -966,6 +1048,7 @@ or tabs for padding, which tends to look better with longer URLs:
966
1048
  .IP "" 4
967
1049
  .
968
1050
  .nf
1051
+
969
1052
  [id]: http://example.com/longish/path/to/resource/here
970
1053
  "Optional Title Here"
971
1054
  .
@@ -985,6 +1068,7 @@ links:
985
1068
  .IP "" 4
986
1069
  .
987
1070
  .nf
1071
+
988
1072
  [link text][a]
989
1073
  [link text][A]
990
1074
  .
@@ -1004,6 +1088,7 @@ Just use an empty set of square brackets \-\- e.g., to link the word
1004
1088
  .IP "" 4
1005
1089
  .
1006
1090
  .nf
1091
+
1007
1092
  [Google][]
1008
1093
  .
1009
1094
  .fi
@@ -1016,6 +1101,7 @@ And then define the link:
1016
1101
  .IP "" 4
1017
1102
  .
1018
1103
  .nf
1104
+
1019
1105
  [Google]: http://google.com/
1020
1106
  .
1021
1107
  .fi
@@ -1029,6 +1115,7 @@ multiple words in the link text:
1029
1115
  .IP "" 4
1030
1116
  .
1031
1117
  .nf
1118
+
1032
1119
  Visit [Daring Fireball][] for more information.
1033
1120
  .
1034
1121
  .fi
@@ -1041,6 +1128,7 @@ And then define the link:
1041
1128
  .IP "" 4
1042
1129
  .
1043
1130
  .nf
1131
+
1044
1132
  [Daring Fireball]: http://daringfireball.net/
1045
1133
  .
1046
1134
  .fi
@@ -1059,8 +1147,10 @@ Here's an example of reference links in action:
1059
1147
  .IP "" 4
1060
1148
  .
1061
1149
  .nf
1150
+
1062
1151
  I get 10 times more traffic from [Google] [1] than from
1063
1152
  [Yahoo] [2] or [MSN] [3].
1153
+
1064
1154
  [1]: http://google.com/ "Google"
1065
1155
  [2]: http://search.yahoo.com/ "Yahoo Search"
1066
1156
  [3]: http://search.msn.com/ "MSN Search"
@@ -1075,8 +1165,10 @@ Using the implicit link name shortcut, you could instead write:
1075
1165
  .IP "" 4
1076
1166
  .
1077
1167
  .nf
1168
+
1078
1169
  I get 10 times more traffic from [Google][] than from
1079
1170
  [Yahoo][] or [MSN][].
1171
+
1080
1172
  [google]: http://google.com/ "Google"
1081
1173
  [yahoo]: http://search.yahoo.com/ "Yahoo Search"
1082
1174
  [msn]: http://search.msn.com/ "MSN Search"
@@ -1091,6 +1183,7 @@ Both of the above examples will produce the following HTML output:
1091
1183
  .IP "" 4
1092
1184
  .
1093
1185
  .nf
1186
+
1094
1187
  <p>I get 10 times more traffic from <a href="http://google.com/"
1095
1188
  title="Google">Google</a> than from
1096
1189
  <a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a>
@@ -1107,6 +1200,7 @@ Markdown's inline link style:
1107
1200
  .IP "" 4
1108
1201
  .
1109
1202
  .nf
1203
+
1110
1204
  I get 10 times more traffic from [Google](http://google.com/ "Google")
1111
1205
  than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
1112
1206
  [MSN](http://search.msn.com/ "MSN Search").
@@ -1139,9 +1233,13 @@ HTML \fB<em>\fR tag; double \fB*\fR's or \fB_\fR's will be wrapped with an HTML
1139
1233
  .IP "" 4
1140
1234
  .
1141
1235
  .nf
1236
+
1142
1237
  *single asterisks*
1238
+
1143
1239
  _single underscores_
1240
+
1144
1241
  **double asterisks**
1242
+
1145
1243
  __double underscores__
1146
1244
  .
1147
1245
  .fi
@@ -1154,9 +1252,13 @@ will produce:
1154
1252
  .IP "" 4
1155
1253
  .
1156
1254
  .nf
1255
+
1157
1256
  <em>single asterisks</em>
1257
+
1158
1258
  <em>single underscores</em>
1259
+
1159
1260
  <strong>double asterisks</strong>
1261
+
1160
1262
  <strong>double underscores</strong>
1161
1263
  .
1162
1264
  .fi
@@ -1173,6 +1275,7 @@ Emphasis can be used in the middle of a word:
1173
1275
  .IP "" 4
1174
1276
  .
1175
1277
  .nf
1278
+
1176
1279
  un*frigging*believable
1177
1280
  .
1178
1281
  .fi
@@ -1191,6 +1294,7 @@ escape it:
1191
1294
  .IP "" 4
1192
1295
  .
1193
1296
  .nf
1297
+
1194
1298
  \\*this text is surrounded by literal asterisks\\*
1195
1299
  .
1196
1300
  .fi
@@ -1205,6 +1309,7 @@ normal paragraph. For example:
1205
1309
  .IP "" 4
1206
1310
  .
1207
1311
  .nf
1312
+
1208
1313
  Use the `printf()` function.
1209
1314
  .
1210
1315
  .fi
@@ -1217,6 +1322,7 @@ will produce:
1217
1322
  .IP "" 4
1218
1323
  .
1219
1324
  .nf
1325
+
1220
1326
  <p>Use the <code>printf()</code> function.</p>
1221
1327
  .
1222
1328
  .fi
@@ -1230,6 +1336,7 @@ multiple backticks as the opening and closing delimiters:
1230
1336
  .IP "" 4
1231
1337
  .
1232
1338
  .nf
1339
+
1233
1340
  ``There is a literal backtick (`) here.``
1234
1341
  .
1235
1342
  .fi
@@ -1242,6 +1349,7 @@ which will produce this:
1242
1349
  .IP "" 4
1243
1350
  .
1244
1351
  .nf
1352
+
1245
1353
  <p><code>There is a literal backtick (`) here.</code></p>
1246
1354
  .
1247
1355
  .fi
@@ -1256,7 +1364,9 @@ literal backtick characters at the beginning or end of a code span:
1256
1364
  .IP "" 4
1257
1365
  .
1258
1366
  .nf
1367
+
1259
1368
  A single backtick in a code span: `` ` ``
1369
+
1260
1370
  A backtick\-delimited string in a code span: `` `foo` ``
1261
1371
  .
1262
1372
  .fi
@@ -1269,7 +1379,9 @@ will produce:
1269
1379
  .IP "" 4
1270
1380
  .
1271
1381
  .nf
1382
+
1272
1383
  <p>A single backtick in a code span: <code>`</code></p>
1384
+
1273
1385
  <p>A backtick\-delimited string in a code span: <code>`foo`</code></p>
1274
1386
  .
1275
1387
  .fi
@@ -1284,6 +1396,7 @@ tags. Markdown will turn this:
1284
1396
  .IP "" 4
1285
1397
  .
1286
1398
  .nf
1399
+
1287
1400
  Please don't use any `<blink>` tags.
1288
1401
  .
1289
1402
  .fi
@@ -1296,6 +1409,7 @@ into:
1296
1409
  .IP "" 4
1297
1410
  .
1298
1411
  .nf
1412
+
1299
1413
  <p>Please don't use any <code>&lt;blink&gt;</code> tags.</p>
1300
1414
  .
1301
1415
  .fi
@@ -1308,6 +1422,7 @@ You can write this:
1308
1422
  .IP "" 4
1309
1423
  .
1310
1424
  .nf
1425
+
1311
1426
  `&#8212;` is the decimal\-encoded equivalent of `&mdash;`.
1312
1427
  .
1313
1428
  .fi
@@ -1320,6 +1435,7 @@ to produce:
1320
1435
  .IP "" 4
1321
1436
  .
1322
1437
  .nf
1438
+
1323
1439
  <p><code>&amp;#8212;</code> is the decimal\-encoded
1324
1440
  equivalent of <code>&amp;mdash;</code>.</p>
1325
1441
  .
@@ -1341,7 +1457,9 @@ Inline image syntax looks like this:
1341
1457
  .IP "" 4
1342
1458
  .
1343
1459
  .nf
1460
+
1344
1461
  ![Alt text](/path/to/img.jpg)
1462
+
1345
1463
  ![Alt text](/path/to/img.jpg "Optional title")
1346
1464
  .
1347
1465
  .fi
@@ -1371,6 +1489,7 @@ Reference\-style image syntax looks like this:
1371
1489
  .IP "" 4
1372
1490
  .
1373
1491
  .nf
1492
+
1374
1493
  ![Alt text][id]
1375
1494
  .
1376
1495
  .fi
@@ -1384,6 +1503,7 @@ are defined using syntax identical to link references:
1384
1503
  .IP "" 4
1385
1504
  .
1386
1505
  .nf
1506
+
1387
1507
  [id]: url/to/image "Optional title attribute"
1388
1508
  .
1389
1509
  .fi
@@ -1403,6 +1523,7 @@ Markdown supports a shortcut style for creating "automatic" links for URLs and e
1403
1523
  .IP "" 4
1404
1524
  .
1405
1525
  .nf
1526
+
1406
1527
  <http://example.com/>
1407
1528
  .
1408
1529
  .fi
@@ -1415,6 +1536,7 @@ Markdown will turn this into:
1415
1536
  .IP "" 4
1416
1537
  .
1417
1538
  .nf
1539
+
1418
1540
  <a href="http://example.com/">http://example.com/</a>
1419
1541
  .
1420
1542
  .fi
@@ -1430,6 +1552,7 @@ spambots. For example, Markdown will turn this:
1430
1552
  .IP "" 4
1431
1553
  .
1432
1554
  .nf
1555
+
1433
1556
  <address@example.com>
1434
1557
  .
1435
1558
  .fi
@@ -1442,6 +1565,7 @@ into something like this:
1442
1565
  .IP "" 4
1443
1566
  .
1444
1567
  .nf
1568
+
1445
1569
  <a href="&#x6D;&#x61;i&#x6C;&#x74;&#x6F;:&#x61;&#x64;&#x64;&#x72;&#x65;
1446
1570
  &#115;&#115;&#64;&#101;&#120;&#x61;&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;
1447
1571
  &#109;">&#x61;&#x64;&#x64;&#x72;&#x65;&#115;&#115;&#64;&#101;&#120;&#x61;
@@ -1470,6 +1594,7 @@ backslashes before the asterisks, like this:
1470
1594
  .IP "" 4
1471
1595
  .
1472
1596
  .nf
1597
+
1473
1598
  \\*literal asterisks\\*
1474
1599
  .
1475
1600
  .fi
@@ -1482,6 +1607,7 @@ Markdown provides backslash escapes for the following characters:
1482
1607
  .IP "" 4
1483
1608
  .
1484
1609
  .nf
1610
+
1485
1611
  \\ backslash
1486
1612
  ` backtick
1487
1613
  * asterisk
@@ -1503,7 +1629,7 @@ _ underscore
1503
1629
  Markdown was created by John Gruber.
1504
1630
  .
1505
1631
  .P
1506
- Manual page by Ryan Tomayko. It's pretty much a direct copy of the\fIMarkdown Syntax Reference\fR,
1632
+ Manual page by Ryan Tomayko. It's pretty much a direct copy of the \fIMarkdown Syntax Reference\fR,
1507
1633
  also by John Gruber.
1508
1634
  .
1509
1635
  .SH "SEE ALSO"
data/man/ronn.1 CHANGED
@@ -1,7 +1,7 @@
1
- .\" generated with Ronn/v0.3
1
+ .\" generated with Ronn/v0.4.2
2
2
  .\" http://github.com/rtomayko/ronn/
3
3
  .
4
- .TH "RONN" "1" "March 2010" "Ryan Tomayko" "Ronn Manual"
4
+ .TH "RONN" "1" "April 2010" "Ryan Tomayko" "Ronn Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBronn\fR \-\- build markdown\-based man pages
@@ -51,7 +51,7 @@ arguments change this behavior:
51
51
  .
52
52
  .TP
53
53
  \fB\-b\fR, \fB\-\-build\fR
54
- Write output directly to files instead of standard output. When the\fB\-\-roff\fR option is provided, writes roff output to \fIfile\fR.\fIsection\fR.
54
+ Write output directly to files instead of standard output. When the \fB\-\-roff\fR option is provided, writes roff output to \fIfile\fR.\fIsection\fR.
55
55
  When the \fB\-\-html\fR option is provided, writes output to
56
56
  '\fIfile\fR.\fIsection\fR.html'.
57
57
  .
@@ -117,6 +117,7 @@ Generate \fBroff(7)\fR output on stdout:
117
117
  .IP "" 4
118
118
  .
119
119
  .nf
120
+
120
121
  $ ronn < hello.1.ronn
121
122
  .
122
123
  .fi
@@ -129,6 +130,7 @@ Build a roff file based on the input filename:
129
130
  .IP "" 4
130
131
  .
131
132
  .nf
133
+
132
134
  $ ronn \-b hello.1.ronn
133
135
  building: hello.1
134
136
  $ man hello.1
@@ -143,6 +145,7 @@ Build and open a standalone HTML file based on the input filename:
143
145
  .IP "" 4
144
146
  .
145
147
  .nf
148
+
146
149
  $ ronn \-b \-\-html test.1.ronn
147
150
  $ open test.1.html
148
151
  .
@@ -157,6 +160,7 @@ directory:
157
160
  .IP "" 4
158
161
  .
159
162
  .nf
163
+
160
164
  $ ronn \-b \-\-roff \-\-html *.ronn
161
165
  building: hello.1
162
166
  building: hello.1.html
@@ -173,6 +177,7 @@ View a ronn file in the same way as man(1) without building a roff file:
173
177
  .IP "" 4
174
178
  .
175
179
  .nf
180
+
176
181
  $ ronn \-m hello.1.ronn
177
182
  .
178
183
  .fi
@@ -185,6 +190,7 @@ Install the roff man page for a ronn file:
185
190
  .IP "" 4
186
191
  .
187
192
  .nf
193
+
188
194
  $ ronn \-i hello.1.ronn
189
195
  .
190
196
  .fi
data/man/ronn.5 CHANGED
@@ -1,4 +1,4 @@
1
- .\" generated with Ronn/v0.3
1
+ .\" generated with Ronn/v0.4.2
2
2
  .\" http://github.com/rtomayko/ronn/
3
3
  .
4
4
  .TH "RONN" "5" "March 2010" "Ryan Tomayko" "Ronn Manual"
@@ -9,20 +9,29 @@
9
9
  .SH "SYNOPSIS"
10
10
  .
11
11
  .nf
12
+
12
13
  name(1) \-\- one sentence description
13
14
  ===================================
15
+
14
16
  ## SECTION HEADING
17
+
15
18
  A normal paragraph. This can span multiple lines and is
16
19
  terminated with two or more line endings \-\- just like
17
20
  Markdown.
21
+
18
22
  ## INLINE MARKUP
23
+
19
24
  Inline markup is used for `code` and `user input` (displayed
20
25
  in boldface), and also <variables> or _emphasis_.
26
+
21
27
  Manual page references like sh(1), markdown(5), roff(7), etc.
22
28
  are displayed in boldface and hyperlinked in HTML output.
29
+
23
30
  ## DEFINITION LISTS
31
+
24
32
  Definition lists are used to define options, arguments,
25
33
  variables, and other type of terms:
34
+
26
35
  * `\-a`, `\-\-arg1`=[_OPTION_]:
27
36
  One or more paragraphs describing the argument.
28
37
  * `\-b`, `\-\-arg2`:
@@ -53,6 +62,7 @@ this information. For example, this very man page begins:
53
62
  .IP "" 4
54
63
  .
55
64
  .nf
65
+
56
66
  ronn(5) \-\- humane manual page authoring format
57
67
  =============================================
58
68
  .
@@ -61,7 +71,7 @@ ronn(5) \-\- humane manual page authoring format
61
71
  .IP "" 0
62
72
  .
63
73
  .P
64
- Here, we're saying that the man page documents a thing named\fBronn\fR in manual section \fB5\fR (the "file formats" section; see
74
+ Here, we're saying that the man page documents a thing named \fBronn\fR in manual section \fB5\fR (the "file formats" section; see
65
75
  manpages(5) for full section list) and that's quickly described
66
76
  as a "humane manual page authoring format".
67
77
  .
@@ -78,6 +88,7 @@ headings. A hash prefix syntax:
78
88
  .IP "" 4
79
89
  .
80
90
  .nf
91
+
81
92
  ## HEADING TEXT
82
93
  .
83
94
  .fi
@@ -90,6 +101,7 @@ Or, a dash underline syntax:
90
101
  .IP "" 4
91
102
  .
92
103
  .nf
104
+
93
105
  HEADING TEXT
94
106
  \-\-\-\-\-\-\-\-\-\-\-\-
95
107
  .
@@ -139,6 +151,7 @@ Here is grep(1)'s DESCRIPTION section represented in \fBronn\fR:
139
151
  .IP "" 4
140
152
  .
141
153
  .nf
154
+
142
155
  `Grep` searches the named input _FILE_ (or standard input if
143
156
  no files are named, or the file name `\-` is given) for lines
144
157
  containing a match to the given _PATTERN_. By default, `grep`
@@ -163,16 +176,20 @@ multiple paragraphs, code blocks, standard lists, and nested
163
176
  definition lists.
164
177
  .
165
178
  .P
166
- An example definition list, taken from BSD test(1)'s\fBDESCRIPTION\fR section:
179
+ An example definition list, taken from BSD test(1)'s \fBDESCRIPTION\fR section:
167
180
  .
168
181
  .IP "" 4
169
182
  .
170
183
  .nf
184
+
171
185
  The following primaries are used to construct expressions:
186
+
172
187
  * `\-b` _file_:
173
188
  True if _file_ exists and is a block special file.
189
+
174
190
  * `\-c` _file_:
175
191
  True if _file_ exists and is a character special file.
192
+
176
193
  * `\-d` _file_:
177
194
  True if file exists and is a directory.
178
195
  .
data/man/ronn.7 CHANGED
@@ -1,4 +1,4 @@
1
- .\" generated with Ronn/v0.3
1
+ .\" generated with Ronn/v0.4.2
2
2
  .\" http://github.com/rtomayko/ronn/
3
3
  .
4
4
  .TH "RONN" "7" "March 2010" "Ryan Tomayko" "Ronn Manual"
@@ -55,6 +55,7 @@ Install with Rubygems:
55
55
  .IP "" 4
56
56
  .
57
57
  .nf
58
+
58
59
  $ [sudo] gem install ronn
59
60
  $ ronn \-\-help
60
61
  .
@@ -68,6 +69,7 @@ Or, clone the git repository:
68
69
  .IP "" 4
69
70
  .
70
71
  .nf
72
+
71
73
  $ git clone git://github.com/rtomayko/ronn.git
72
74
  $ PATH=ronn/bin:$PATH
73
75
  $ ronn \-\-help
@@ -77,11 +79,13 @@ $ ronn \-\-help
77
79
  .IP "" 0
78
80
  .
79
81
  .SH "BASIC USAGE"
80
- To generate a roff man page from the included\fI\fBmarkdown.5.ronn\fR\fR file and open it with man(1):
82
+ To generate a roff man page from the included \fBmarkdown.5.ronn\fR file and
83
+ open it with man(1):
81
84
  .
82
85
  .IP "" 4
83
86
  .
84
87
  .nf
88
+
85
89
  $ ronn \-b man/markdown.5.ronn
86
90
  building: man/markdown.5
87
91
  $ man man/markdown.5
@@ -96,6 +100,7 @@ To generate a standalone HTML version:
96
100
  .IP "" 4
97
101
  .
98
102
  .nf
103
+
99
104
  $ ronn \-b \-\-html man/markdown.5.ronn
100
105
  building: man/markdown.5.html
101
106
  $ open man/markdown.5.html
@@ -110,6 +115,7 @@ To build roff and HTML versions of all ronn files:
110
115
  .IP "" 4
111
116
  .
112
117
  .nf
118
+
113
119
  $ ronn \-b \-\-roff \-\-html man/*.ronn
114
120
  .
115
121
  .fi
@@ -123,6 +129,7 @@ building intermediate files:
123
129
  .IP "" 4
124
130
  .
125
131
  .nf
132
+
126
133
  $ ronn \-m man/markdown.5.ronn
127
134
  .
128
135
  .fi
@@ -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 = 'ronn'
6
- s.version = '0.4.1'
7
- s.date = '2010-03-08'
6
+ s.version = '0.5'
7
+ s.date = '2010-04-02'
8
8
 
9
9
  s.description = "The opposite of roff"
10
10
  s.summary = "The opposite of roff"
@@ -17,9 +17,7 @@ Gem::Specification.new do |s|
17
17
  COPYING
18
18
  README.md
19
19
  Rakefile
20
- bin/ron
21
20
  bin/ronn
22
- lib/ron.rb
23
21
  lib/ronn.rb
24
22
  lib/ronn/document.rb
25
23
  lib/ronn/layout.html
@@ -32,7 +30,6 @@ Gem::Specification.new do |s|
32
30
  man/ronn.5.ronn
33
31
  man/ronn.7
34
32
  man/ronn.7.ronn
35
- ron.gemspec
36
33
  ronn.gemspec
37
34
  test/angle_bracket_syntax.html
38
35
  test/angle_bracket_syntax.ronn
@@ -55,12 +52,12 @@ Gem::Specification.new do |s|
55
52
  ]
56
53
  # = MANIFEST =
57
54
 
58
- s.executables = ['ronn', 'ron']
55
+ s.executables = ['ronn']
59
56
  s.test_files = s.files.select { |path| path =~ /^test\/.*_test.rb/ }
60
57
 
61
58
  s.extra_rdoc_files = %w[COPYING]
62
- s.add_dependency 'hpricot', '~> 0.8.2'
63
- s.add_dependency 'rdiscount', '~> 1.5.8'
59
+ s.add_dependency 'hpricot', '>= 0.8.2'
60
+ s.add_dependency 'rdiscount', '>= 1.5.8'
64
61
  s.add_development_dependency 'contest', '~> 0.1'
65
62
 
66
63
  s.has_rdoc = true
@@ -9,6 +9,7 @@ Your output <i>might</i> look like this:
9
9
  .IP "" 4
10
10
  .
11
11
  .nf
12
+
12
13
  * Chris
13
14
  *
14
15
  * &lt;b&gt;GitHub&lt;/b&gt;
@@ -17,3 +18,4 @@ Your output <i>might</i> look like this:
17
18
  .fi
18
19
  .
19
20
  .IP "" 0
21
+
metadata CHANGED
@@ -4,9 +4,8 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 4
8
- - 1
9
- version: 0.4.1
7
+ - 5
8
+ version: "0.5"
10
9
  platform: ruby
11
10
  authors:
12
11
  - Ryan Tomayko
@@ -14,7 +13,7 @@ autorequire:
14
13
  bindir: bin
15
14
  cert_chain: []
16
15
 
17
- date: 2010-03-08 00:00:00 -08:00
16
+ date: 2010-04-02 00:00:00 -07:00
18
17
  default_executable:
19
18
  dependencies:
20
19
  - !ruby/object:Gem::Dependency
@@ -22,7 +21,7 @@ dependencies:
22
21
  prerelease: false
23
22
  requirement: &id001 !ruby/object:Gem::Requirement
24
23
  requirements:
25
- - - ~>
24
+ - - ">="
26
25
  - !ruby/object:Gem::Version
27
26
  segments:
28
27
  - 0
@@ -36,7 +35,7 @@ dependencies:
36
35
  prerelease: false
37
36
  requirement: &id002 !ruby/object:Gem::Requirement
38
37
  requirements:
39
- - - ~>
38
+ - - ">="
40
39
  - !ruby/object:Gem::Version
41
40
  segments:
42
41
  - 1
@@ -62,7 +61,6 @@ description: The opposite of roff
62
61
  email: rtomayko@gmail.com
63
62
  executables:
64
63
  - ronn
65
- - ron
66
64
  extensions: []
67
65
 
68
66
  extra_rdoc_files:
@@ -71,9 +69,7 @@ files:
71
69
  - COPYING
72
70
  - README.md
73
71
  - Rakefile
74
- - bin/ron
75
72
  - bin/ronn
76
- - lib/ron.rb
77
73
  - lib/ronn.rb
78
74
  - lib/ronn/document.rb
79
75
  - lib/ronn/layout.html
@@ -86,7 +82,6 @@ files:
86
82
  - man/ronn.5.ronn
87
83
  - man/ronn.7
88
84
  - man/ronn.7.ronn
89
- - ron.gemspec
90
85
  - ronn.gemspec
91
86
  - test/angle_bracket_syntax.html
92
87
  - test/angle_bracket_syntax.ronn
data/bin/ron DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env ruby
2
- exec File.dirname(__FILE__) + '/ronn', *ARGV
data/lib/ron.rb DELETED
@@ -1,3 +0,0 @@
1
- # Ron 0.3 compatibility shim
2
- require 'ronn'
3
- Ron = Ronn
@@ -1,50 +0,0 @@
1
- Gem::Specification.new do |s|
2
- s.specification_version = 2 if s.respond_to? :specification_version=
3
- s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
4
-
5
- s.name = 'ron'
6
- s.version = '0.4'
7
- s.date = '2010-03-08'
8
-
9
- s.description = "ron -- the opposite of roff -- is now known as 'ronn'"
10
-
11
- s.summary = (<<-TEXT).gsub(/^ {4}/, '')
12
- IMPORTANT: ron -- the opposite of roff -- is now known as "ronn". Ownership
13
- of the "ron" gem will be handed over to the Ruby Object Notation (Ron)
14
- project in the not-too-distant future.
15
-
16
- If you came here looking for "ron" -- the opposite of roff --, see the
17
- "ronn" gem instead: http://rubygems.org/gems/ronn
18
-
19
- If you came here looking for Ron (Ruby Object Notation), see the "Ron"
20
- gem instead: http://rubygems.org/gems/Ron
21
- TEXT
22
-
23
- s.authors = ["Ryan Tomayko"]
24
- s.email = "rtomayko@gmail.com"
25
- s.files = %w[ron.gemspec]
26
- s.executables = []
27
- s.test_files = []
28
-
29
- s.has_rdoc = true
30
- s.homepage = "http://rtomayko.github.com/ronn/"
31
- s.require_paths = ['.']
32
- s.add_dependency 'ronn', '>= 0.4'
33
-
34
- s.post_install_message = (<<-TEXT).gsub(/^ {4}/, '')
35
- ==================================================================
36
- WARNING: ron -- the opposite of roff -- is now known as "ronn"
37
-
38
- The "ronn" gem has automatically been installed. However, in the
39
- not-too-distant future, the "ron" gem will be owned by the
40
- Ruby Object Notation <http://github.com/coatl/ron> project. Please
41
- use the "ronn" gem to install ronn -- the opposite of roff -- from
42
- this point forward.
43
-
44
- If you meant to install the Ruby Object Notation (Ron) gem,
45
- uninstall the "ron" and "ronn" gems and install the "Ron" gem:
46
- gem uninstall ron ronn
47
- gem install Ron
48
- ==================================================================
49
- TEXT
50
- end