rrtf 0.1.2 → 1.0.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.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/.byebug_history +6 -3
  3. data/CHANGELOG.md +24 -0
  4. data/README.md +194 -84
  5. data/documentation/RRTF.html +5 -5
  6. data/documentation/RRTF/AnonymousStyle.html +792 -0
  7. data/documentation/RRTF/BorderFormatting.html +821 -0
  8. data/documentation/RRTF/BorderStyle.html +493 -0
  9. data/documentation/RRTF/CharacterFormatting.html +293 -162
  10. data/documentation/RRTF/CharacterStyle.html +53 -109
  11. data/documentation/RRTF/Colour.html +61 -1
  12. data/documentation/RRTF/ColourTable.html +52 -52
  13. data/documentation/RRTF/CommandNode.html +367 -971
  14. data/documentation/RRTF/ContainerNode.html +44 -44
  15. data/documentation/RRTF/Converters.html +1 -1
  16. data/documentation/RRTF/Converters/HTML.html +1 -1
  17. data/documentation/RRTF/Converters/HTML/Helpers.html +1 -1
  18. data/documentation/RRTF/Converters/HTML/Node.html +1 -1
  19. data/documentation/RRTF/Converters/HTML/NodeSet.html +1 -1
  20. data/documentation/RRTF/Document.html +267 -255
  21. data/documentation/RRTF/DocumentFormatting.html +833 -0
  22. data/documentation/RRTF/DocumentProperties.html +444 -0
  23. data/documentation/RRTF/Font.html +1 -1
  24. data/documentation/RRTF/FontTable.html +1 -1
  25. data/documentation/RRTF/FooterNode.html +16 -16
  26. data/documentation/RRTF/GeometryNode.html +774 -0
  27. data/documentation/RRTF/GeometryProperties.html +1014 -0
  28. data/documentation/RRTF/HeaderNode.html +16 -16
  29. data/documentation/RRTF/ImageNode.html +705 -492
  30. data/documentation/RRTF/Information.html +1 -1
  31. data/documentation/RRTF/LinkNode.html +10 -10
  32. data/documentation/RRTF/ListLevel.html +1 -1
  33. data/documentation/RRTF/ListLevelNode.html +37 -37
  34. data/documentation/RRTF/ListMarker.html +1 -1
  35. data/documentation/RRTF/ListNode.html +19 -19
  36. data/documentation/RRTF/ListTable.html +1 -1
  37. data/documentation/RRTF/ListTemplate.html +1 -1
  38. data/documentation/RRTF/ListTextNode.html +14 -14
  39. data/documentation/RRTF/Node.html +26 -26
  40. data/documentation/RRTF/Page.html +129 -0
  41. data/documentation/RRTF/Page/Margin.html +1158 -0
  42. data/documentation/RRTF/Page/Size.html +946 -0
  43. data/documentation/RRTF/PageFormatting.html +954 -0
  44. data/documentation/RRTF/ParagraphFormatting.html +338 -56
  45. data/documentation/RRTF/ParagraphNode.html +10 -10
  46. data/documentation/RRTF/ParagraphStyle.html +72 -111
  47. data/documentation/RRTF/PositionFormatting.html +780 -0
  48. data/documentation/RRTF/PositionStyle.html +424 -0
  49. data/documentation/RRTF/Properties.html +243 -0
  50. data/documentation/RRTF/RTFError.html +21 -10
  51. data/documentation/RRTF/ShadingFormatting.html +712 -0
  52. data/documentation/RRTF/ShadingStyle.html +424 -0
  53. data/documentation/RRTF/Style.html +284 -697
  54. data/documentation/RRTF/Stylesheet.html +36 -3
  55. data/documentation/RRTF/TableCellNode.html +131 -131
  56. data/documentation/RRTF/TableNode.html +82 -82
  57. data/documentation/RRTF/TableRowNode.html +53 -53
  58. data/documentation/RRTF/TextNode.html +46 -46
  59. data/documentation/RRTF/Utilities.html +837 -17
  60. data/documentation/_index.html +139 -6
  61. data/documentation/class_list.html +1 -1
  62. data/documentation/file.README.html +218 -87
  63. data/documentation/index.html +218 -87
  64. data/documentation/method_list.html +631 -391
  65. data/documentation/top-level-namespace.html +1 -1
  66. data/examples/01.rtf +947 -20
  67. data/examples/01_everything.rb +176 -0
  68. data/examples/02.rtf +13 -0
  69. data/examples/02_basic_paragraph.rb +10 -0
  70. data/examples/03.rtf +20 -0
  71. data/examples/03_paragraph_inline_style.rb +14 -0
  72. data/examples/04.rtf +21 -0
  73. data/examples/04_paragraph_with_character_style.rb +18 -0
  74. data/examples/05.rtf +21 -0
  75. data/examples/05_hyperlinks.rb +21 -0
  76. data/examples/06.rtf +21 -0
  77. data/examples/06_basic_list.rb +21 -0
  78. data/examples/07.rtf +28 -0
  79. data/examples/07_nested_list.rb +27 -0
  80. data/examples/08.rtf +807 -0
  81. data/examples/08_images.rb +17 -0
  82. data/examples/09.rtf +84 -0
  83. data/examples/09_shapes.rb +56 -0
  84. data/examples/10.rtf +34 -0
  85. data/examples/10_stylesheet.rb +18 -0
  86. data/examples/resources/images/redshirt.png +0 -0
  87. data/examples/resources/images/redshirts.jpg +0 -0
  88. data/examples/resources/json/redshirt_styles.json +72 -8
  89. data/examples/~$01.rtf +0 -0
  90. data/lib/rrtf.rb +4 -16
  91. data/lib/rrtf/colour.rb +8 -0
  92. data/lib/rrtf/formatting.rb +988 -0
  93. data/lib/rrtf/node.rb +17 -1851
  94. data/lib/rrtf/node/command_node.rb +242 -0
  95. data/lib/rrtf/node/container_node.rb +75 -0
  96. data/lib/rrtf/node/document.rb +339 -0
  97. data/lib/rrtf/node/footer_node.rb +47 -0
  98. data/lib/rrtf/node/geometry_node.rb +65 -0
  99. data/lib/rrtf/node/header_node.rb +47 -0
  100. data/lib/rrtf/node/image_node.rb +175 -0
  101. data/lib/rrtf/node/link_node.rb +10 -0
  102. data/lib/rrtf/node/list_level_node.rb +44 -0
  103. data/lib/rrtf/node/list_node.rb +30 -0
  104. data/lib/rrtf/node/list_text_node.rb +22 -0
  105. data/lib/rrtf/node/node.rb +53 -0
  106. data/lib/rrtf/node/paragraph_node.rb +11 -0
  107. data/lib/rrtf/node/table_cell_node.rb +233 -0
  108. data/lib/rrtf/node/table_node.rb +136 -0
  109. data/lib/rrtf/node/table_row_node.rb +92 -0
  110. data/lib/rrtf/node/text_node.rb +76 -0
  111. data/lib/rrtf/page.rb +7 -0
  112. data/lib/rrtf/page/margin.rb +98 -0
  113. data/lib/rrtf/page/size.rb +98 -0
  114. data/lib/rrtf/properties.rb +3 -0
  115. data/lib/rrtf/properties/document_properties.rb +34 -0
  116. data/lib/rrtf/properties/geometry_properties.rb +380 -0
  117. data/lib/rrtf/properties/properties.rb +13 -0
  118. data/lib/rrtf/style.rb +4 -5
  119. data/lib/rrtf/style/anonymous_style.rb +73 -0
  120. data/lib/rrtf/style/border_style.rb +27 -0
  121. data/lib/rrtf/style/character_style.rb +1 -7
  122. data/lib/rrtf/style/paragraph_style.rb +0 -6
  123. data/lib/rrtf/style/position_style.rb +26 -0
  124. data/lib/rrtf/style/shading_style.rb +26 -0
  125. data/lib/rrtf/style/style.rb +60 -101
  126. data/lib/rrtf/utilities.rb +138 -0
  127. data/lib/rrtf/version.rb +1 -1
  128. data/rrtf.gemspec +1 -0
  129. metadata +85 -10
  130. data/examples/01_mac_libreoffice5_2_3_3.png +0 -0
  131. data/examples/01_mac_pages6_2.png +0 -0
  132. data/examples/01_mac_textedit1_12.png +0 -0
  133. data/examples/01_mac_word15_36.png +0 -0
  134. data/examples/01_styles_and_paragraphs.rb +0 -32
  135. data/lib/rrtf/paper.rb +0 -53
  136. data/lib/rrtf/style/document_style.rb +0 -116
  137. data/lib/rrtf/style/formatting.rb +0 -320
@@ -98,7 +98,7 @@
98
98
 
99
99
  <dl>
100
100
  <dt>Defined in:</dt>
101
- <dd>lib/rrtf/node.rb</dd>
101
+ <dd>lib/rrtf/node/command_node.rb</dd>
102
102
  </dl>
103
103
 
104
104
  </div>
@@ -118,7 +118,7 @@ class for some specific command node types.</p>
118
118
 
119
119
  </div><div id="subclasses">
120
120
  <h2>Direct Known Subclasses</h2>
121
- <p class="children"><span class='object_link'><a href="Document.html" title="RRTF::Document (class)">Document</a></span>, <span class='object_link'><a href="FooterNode.html" title="RRTF::FooterNode (class)">FooterNode</a></span>, <span class='object_link'><a href="HeaderNode.html" title="RRTF::HeaderNode (class)">HeaderNode</a></span>, <span class='object_link'><a href="LinkNode.html" title="RRTF::LinkNode (class)">LinkNode</a></span>, <span class='object_link'><a href="ListLevelNode.html" title="RRTF::ListLevelNode (class)">ListLevelNode</a></span>, <span class='object_link'><a href="ListNode.html" title="RRTF::ListNode (class)">ListNode</a></span>, <span class='object_link'><a href="ListTextNode.html" title="RRTF::ListTextNode (class)">ListTextNode</a></span>, <span class='object_link'><a href="ParagraphNode.html" title="RRTF::ParagraphNode (class)">ParagraphNode</a></span>, <span class='object_link'><a href="TableCellNode.html" title="RRTF::TableCellNode (class)">TableCellNode</a></span></p>
121
+ <p class="children"><span class='object_link'><a href="Document.html" title="RRTF::Document (class)">Document</a></span>, <span class='object_link'><a href="FooterNode.html" title="RRTF::FooterNode (class)">FooterNode</a></span>, <span class='object_link'><a href="GeometryNode.html" title="RRTF::GeometryNode (class)">GeometryNode</a></span>, <span class='object_link'><a href="HeaderNode.html" title="RRTF::HeaderNode (class)">HeaderNode</a></span>, <span class='object_link'><a href="LinkNode.html" title="RRTF::LinkNode (class)">LinkNode</a></span>, <span class='object_link'><a href="ListLevelNode.html" title="RRTF::ListLevelNode (class)">ListLevelNode</a></span>, <span class='object_link'><a href="ListNode.html" title="RRTF::ListNode (class)">ListNode</a></span>, <span class='object_link'><a href="ListTextNode.html" title="RRTF::ListTextNode (class)">ListTextNode</a></span>, <span class='object_link'><a href="ParagraphNode.html" title="RRTF::ParagraphNode (class)">ParagraphNode</a></span>, <span class='object_link'><a href="TableCellNode.html" title="RRTF::TableCellNode (class)">TableCellNode</a></span></p>
122
122
  </div>
123
123
 
124
124
 
@@ -312,106 +312,6 @@ curly braces.</p>
312
312
  single command node.</p>
313
313
  </div></span>
314
314
 
315
- </li>
316
-
317
-
318
- <li class="public ">
319
- <span class="summary_signature">
320
-
321
- <a href="#background-instance_method" title="#background (instance method)">#<strong>background</strong>(colour) &#x21d2; Object </a>
322
-
323
-
324
-
325
- </span>
326
-
327
-
328
-
329
-
330
-
331
-
332
-
333
-
334
-
335
- <span class="summary_desc"><div class='inline'>
336
- <p>This method provides a short cut means of creating a background colour
337
- command node.</p>
338
- </div></span>
339
-
340
- </li>
341
-
342
-
343
- <li class="public ">
344
- <span class="summary_signature">
345
-
346
- <a href="#bold-instance_method" title="#bold (instance method)">#<strong>bold</strong> &#x21d2; Object </a>
347
-
348
-
349
-
350
- </span>
351
-
352
-
353
-
354
-
355
-
356
-
357
-
358
-
359
-
360
- <span class="summary_desc"><div class='inline'>
361
- <p>This method provides a short cut means of creating a bold command node.</p>
362
- </div></span>
363
-
364
- </li>
365
-
366
-
367
- <li class="public ">
368
- <span class="summary_signature">
369
-
370
- <a href="#colour-instance_method" title="#colour (instance method)">#<strong>colour</strong>(fore, back) &#x21d2; Object </a>
371
-
372
-
373
-
374
- (also: #color)
375
-
376
- </span>
377
-
378
-
379
-
380
-
381
-
382
-
383
-
384
-
385
-
386
- <span class="summary_desc"><div class='inline'>
387
- <p>This method provides a short cut menas of creating a colour node that deals
388
- with foreground and background colours.</p>
389
- </div></span>
390
-
391
- </li>
392
-
393
-
394
- <li class="public ">
395
- <span class="summary_signature">
396
-
397
- <a href="#font-instance_method" title="#font (instance method)">#<strong>font</strong>(font, size = nil) &#x21d2; Object </a>
398
-
399
-
400
-
401
- </span>
402
-
403
-
404
-
405
-
406
-
407
-
408
-
409
-
410
-
411
- <span class="summary_desc"><div class='inline'>
412
- <p>This method provides a short cut means of creating a font command node.</p>
413
- </div></span>
414
-
415
315
  </li>
416
316
 
417
317
 
@@ -442,7 +342,7 @@ with foreground and background colours.</p>
442
342
  <li class="public ">
443
343
  <span class="summary_signature">
444
344
 
445
- <a href="#foreground-instance_method" title="#foreground (instance method)">#<strong>foreground</strong>(colour) &#x21d2; Object </a>
345
+ <a href="#geometry-instance_method" title="#geometry (instance method)">#<strong>geometry</strong>(properties = nil) {|node| ... } &#x21d2; Object </a>
446
346
 
447
347
 
448
348
 
@@ -456,10 +356,7 @@ with foreground and background colours.</p>
456
356
 
457
357
 
458
358
 
459
- <span class="summary_desc"><div class='inline'>
460
- <p>This method provides a short cut means of creating a foreground colour
461
- command node.</p>
462
- </div></span>
359
+ <span class="summary_desc"><div class='inline'></div></span>
463
360
 
464
361
  </li>
465
362
 
@@ -467,7 +364,7 @@ command node.</p>
467
364
  <li class="public ">
468
365
  <span class="summary_signature">
469
366
 
470
- <a href="#image-instance_method" title="#image (instance method)">#<strong>image</strong>(source) &#x21d2; Object </a>
367
+ <a href="#image-instance_method" title="#image (instance method)">#<strong>image</strong>(source, options = {}) &#x21d2; Object </a>
471
368
 
472
369
 
473
370
 
@@ -511,30 +408,6 @@ command node.</p>
511
408
  <p>This is the constructor for the CommandNode class.</p>
512
409
  </div></span>
513
410
 
514
- </li>
515
-
516
-
517
- <li class="public ">
518
- <span class="summary_signature">
519
-
520
- <a href="#italic-instance_method" title="#italic (instance method)">#<strong>italic</strong> &#x21d2; Object </a>
521
-
522
-
523
-
524
- </span>
525
-
526
-
527
-
528
-
529
-
530
-
531
-
532
-
533
-
534
- <span class="summary_desc"><div class='inline'>
535
- <p>This method provides a short cut means of creating an italic command node.</p>
536
- </div></span>
537
-
538
411
  </li>
539
412
 
540
413
 
@@ -632,80 +505,6 @@ unordered list.</p>
632
505
  node.</p>
633
506
  </div></span>
634
507
 
635
- </li>
636
-
637
-
638
- <li class="public ">
639
- <span class="summary_signature">
640
-
641
- <a href="#strike-instance_method" title="#strike (instance method)">#<strong>strike</strong> &#x21d2; Object </a>
642
-
643
-
644
-
645
- </span>
646
-
647
-
648
-
649
-
650
-
651
-
652
-
653
-
654
-
655
- <span class="summary_desc"><div class='inline'>
656
- <p>This method provides a short cut means of creating a strike command node.</p>
657
- </div></span>
658
-
659
- </li>
660
-
661
-
662
- <li class="public ">
663
- <span class="summary_signature">
664
-
665
- <a href="#subscript-instance_method" title="#subscript (instance method)">#<strong>subscript</strong> &#x21d2; Object </a>
666
-
667
-
668
-
669
- </span>
670
-
671
-
672
-
673
-
674
-
675
-
676
-
677
-
678
-
679
- <span class="summary_desc"><div class='inline'>
680
- <p>This method provides a short cut means of creating a subscript command
681
- node.</p>
682
- </div></span>
683
-
684
- </li>
685
-
686
-
687
- <li class="public ">
688
- <span class="summary_signature">
689
-
690
- <a href="#superscript-instance_method" title="#superscript (instance method)">#<strong>superscript</strong> &#x21d2; Object </a>
691
-
692
-
693
-
694
- </span>
695
-
696
-
697
-
698
-
699
-
700
-
701
-
702
-
703
-
704
- <span class="summary_desc"><div class='inline'>
705
- <p>This method provides a short cut means of creating a superscript command
706
- node.</p>
707
- </div></span>
708
-
709
508
  </li>
710
509
 
711
510
 
@@ -754,31 +553,6 @@ node.</p>
754
553
  <p>This method generates the RTF text for a CommandNode object.</p>
755
554
  </div></span>
756
555
 
757
- </li>
758
-
759
-
760
- <li class="public ">
761
- <span class="summary_signature">
762
-
763
- <a href="#underline-instance_method" title="#underline (instance method)">#<strong>underline</strong> &#x21d2; Object </a>
764
-
765
-
766
-
767
- </span>
768
-
769
-
770
-
771
-
772
-
773
-
774
-
775
-
776
-
777
- <span class="summary_desc"><div class='inline'>
778
- <p>This method provides a short cut means of creating an underline command
779
- node.</p>
780
- </div></span>
781
-
782
556
  </li>
783
557
 
784
558
 
@@ -857,16 +631,16 @@ curly braces. Defaults to true.</p>
857
631
  <pre class="lines">
858
632
 
859
633
 
860
- 234
861
- 235
862
- 236
863
- 237
864
- 238
865
- 239
866
- 240</pre>
634
+ 30
635
+ 31
636
+ 32
637
+ 33
638
+ 34
639
+ 35
640
+ 36</pre>
867
641
  </td>
868
642
  <td>
869
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 234</span>
643
+ <pre class="code"><span class="info file"># File 'lib/rrtf/node/command_node.rb', line 30</span>
870
644
 
871
645
  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_parent'>parent</span><span class='comma'>,</span> <span class='id identifier rubyid_prefix'>prefix</span><span class='comma'>,</span> <span class='id identifier rubyid_suffix'>suffix</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_split'>split</span><span class='op'>=</span><span class='kw'>true</span><span class='comma'>,</span> <span class='id identifier rubyid_wrap'>wrap</span><span class='op'>=</span><span class='kw'>true</span><span class='rparen'>)</span>
872
646
  <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_parent'>parent</span><span class='rparen'>)</span>
@@ -913,12 +687,12 @@ curly braces. Defaults to true.</p>
913
687
  <pre class="lines">
914
688
 
915
689
 
916
- 211
917
- 212
918
- 213</pre>
690
+ 7
691
+ 8
692
+ 9</pre>
919
693
  </td>
920
694
  <td>
921
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 211</span>
695
+ <pre class="code"><span class="info file"># File 'lib/rrtf/node/command_node.rb', line 7</span>
922
696
 
923
697
  <span class='kw'>def</span> <span class='id identifier rubyid_prefix'>prefix</span>
924
698
  <span class='ivar'>@prefix</span>
@@ -961,12 +735,12 @@ separate lines whether the node is converted to RTF. Defaults to true</p>
961
735
  <pre class="lines">
962
736
 
963
737
 
964
- 217
965
- 218
966
- 219</pre>
738
+ 13
739
+ 14
740
+ 15</pre>
967
741
  </td>
968
742
  <td>
969
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 217</span>
743
+ <pre class="code"><span class="info file"># File 'lib/rrtf/node/command_node.rb', line 13</span>
970
744
 
971
745
  <span class='kw'>def</span> <span class='id identifier rubyid_split'>split</span>
972
746
  <span class='ivar'>@split</span>
@@ -1004,12 +778,12 @@ separate lines whether the node is converted to RTF. Defaults to true</p>
1004
778
  <pre class="lines">
1005
779
 
1006
780
 
1007
- 213
1008
- 214
1009
- 215</pre>
781
+ 9
782
+ 10
783
+ 11</pre>
1010
784
  </td>
1011
785
  <td>
1012
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 213</span>
786
+ <pre class="code"><span class="info file"># File 'lib/rrtf/node/command_node.rb', line 9</span>
1013
787
 
1014
788
  <span class='kw'>def</span> <span class='id identifier rubyid_suffix'>suffix</span>
1015
789
  <span class='ivar'>@suffix</span>
@@ -1052,12 +826,12 @@ curly braces. Defaults to true.</p>
1052
826
  <pre class="lines">
1053
827
 
1054
828
 
1055
- 220
1056
- 221
1057
- 222</pre>
829
+ 16
830
+ 17
831
+ 18</pre>
1058
832
  </td>
1059
833
  <td>
1060
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 220</span>
834
+ <pre class="code"><span class="info file"># File 'lib/rrtf/node/command_node.rb', line 16</span>
1061
835
 
1062
836
  <span class='kw'>def</span> <span class='id identifier rubyid_wrap'>wrap</span>
1063
837
  <span class='ivar'>@wrap</span>
@@ -1112,16 +886,16 @@ new TextNode is created and append to the node.</p>
1112
886
  <pre class="lines">
1113
887
 
1114
888
 
1115
- 248
1116
- 249
1117
- 250
1118
- 251
1119
- 252
1120
- 253
1121
- 254</pre>
889
+ 44
890
+ 45
891
+ 46
892
+ 47
893
+ 48
894
+ 49
895
+ 50</pre>
1122
896
  </td>
1123
897
  <td>
1124
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 248</span>
898
+ <pre class="code"><span class="info file"># File 'lib/rrtf/node/command_node.rb', line 44</span>
1125
899
 
1126
900
  <span class='kw'>def</span> <span class='op'>&lt;&lt;</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
1127
901
  <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>and</span> <span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:text=</span><span class='rparen'>)</span>
@@ -1152,24 +926,50 @@ single command node. The method accepts a block that will be passed a
1152
926
  reference to the node created. Once the block is complete the new node will
1153
927
  be append as the last child of the CommandNode the method is called on.</p>
1154
928
 
1155
- <h4 id="label-Parameters">Parameters</h4>
1156
- <dl class="rdoc-list note-list"><dt>style
1157
- <dd>
1158
- <p>A reference to a CharacterStyle object that contains the style settings to
1159
- be applied.</p>
1160
- </dd></dl>
1161
-
1162
- <h4 id="label-Exceptions">Exceptions</h4>
1163
- <dl class="rdoc-list note-list"><dt>RTFError
1164
- <dd>
1165
- <p>Generated whenever a non-character style is specified to the method.</p>
1166
- </dd></dl>
1167
-
1168
929
 
1169
930
  </div>
1170
931
  </div>
1171
932
  <div class="tags">
1172
933
 
934
+ <div class="examples">
935
+ <p class="tag_title">Examples:</p>
936
+
937
+
938
+ <p class="example_title"><div class='inline'>
939
+ <p>Applying an anonymous style.</p>
940
+ </div></p>
941
+
942
+ <pre class="example code"><code><span class='id identifier rubyid_rtf'>rtf</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Document.html" title="RRTF::Document (class)">Document</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Document.html#initialize-instance_method" title="RRTF::Document#initialize (method)">new</a></span></span>
943
+ <span class='id identifier rubyid_rtf'>rtf</span><span class='period'>.</span><span class='id identifier rubyid_paragraph'>paragraph</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_p'>p</span><span class='op'>|</span>
944
+ <span class='id identifier rubyid_p'>p</span><span class='period'>.</span><span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bold</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>font</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>SWISS:Arial</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_text'>text</span><span class='op'>|</span>
945
+ <span class='id identifier rubyid_text'>text</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Text formatted with an anonymous style.</span><span class='tstring_end'>&quot;</span></span>
946
+ <span class='kw'>end</span>
947
+ <span class='kw'>end</span></code></pre>
948
+
949
+ </div>
950
+ <p class="tag_title">Parameters:</p>
951
+ <ul class="param">
952
+
953
+ <li>
954
+
955
+ <span class='name'>style</span>
956
+
957
+
958
+ <span class='type'>(<tt>Hash</tt>, <tt><span class='object_link'><a href="CharacterStyle.html" title="RRTF::CharacterStyle (class)">CharacterStyle</a></span></tt>)</span>
959
+
960
+
961
+
962
+ &mdash;
963
+ <div class='inline'>
964
+ <p>a reference to a CharacterStyle object that contains the style settings to
965
+ be applied OR a hash of character formatting settings (aka an anonymous
966
+ style).</p>
967
+ </div>
968
+
969
+ </li>
970
+
971
+ </ul>
972
+
1173
973
  <p class="tag_title">Yields:</p>
1174
974
  <ul class="yield">
1175
975
 
@@ -1180,6 +980,24 @@ be applied.</p>
1180
980
 
1181
981
 
1182
982
 
983
+ </li>
984
+
985
+ </ul>
986
+ <p class="tag_title">Raises:</p>
987
+ <ul class="raise">
988
+
989
+ <li>
990
+
991
+
992
+ <span class='type'>(<tt><span class='object_link'><a href="RTFError.html" title="RRTF::RTFError (class)">RTFError</a></span></tt>)</span>
993
+
994
+
995
+
996
+ &mdash;
997
+ <div class='inline'>
998
+ <p>whenever a non-character style is specified.</p>
999
+ </div>
1000
+
1183
1001
  </li>
1184
1002
 
1185
1003
  </ul>
@@ -1190,34 +1008,42 @@ be applied.</p>
1190
1008
  <pre class="lines">
1191
1009
 
1192
1010
 
1193
- 371
1194
- 372
1195
- 373
1196
- 374
1197
- 375
1198
- 376
1199
- 377
1200
- 378
1201
- 379
1202
- 380
1203
- 381
1204
- 382
1205
- 383
1206
- 384
1207
- 385
1208
- 386</pre>
1011
+ 217
1012
+ 218
1013
+ 219
1014
+ 220
1015
+ 221
1016
+ 222
1017
+ 223
1018
+ 224
1019
+ 225
1020
+ 226
1021
+ 227
1022
+ 228
1023
+ 229
1024
+ 230
1025
+ 231
1026
+ 232
1027
+ 233
1028
+ 234
1029
+ 235
1030
+ 236</pre>
1209
1031
  </td>
1210
1032
  <td>
1211
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 371</span>
1033
+ <pre class="code"><span class="info file"># File 'lib/rrtf/node/command_node.rb', line 217</span>
1212
1034
 
1213
1035
  <span class='kw'>def</span> <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span>
1214
1036
  <span class='comment'># Check the input style.
1215
- </span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_is_character_style?'>is_character_style?</span>
1216
- <span class='const'><span class='object_link'><a href="RTFError.html" title="RRTF::RTFError (class)">RTFError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_fire'><span class='object_link'><a href="RTFError.html#fire-class_method" title="RRTF::RTFError.fire (method)">fire</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Non-character style specified to the </span><span class='tstring_end'>&quot;</span></span>\
1217
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>CommandNode#apply() method.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1218
- <span class='kw'>end</span>
1219
-
1220
- <span class='comment'># Store fonts and colours.
1037
+ </span> <span class='kw'>case</span> <span class='id identifier rubyid_style'>style</span>
1038
+ <span class='kw'>when</span> <span class='const'>Hash</span>
1039
+ <span class='id identifier rubyid_style'>style</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CharacterStyle.html" title="RRTF::CharacterStyle (class)">CharacterStyle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="CharacterStyle.html#initialize-instance_method" title="RRTF::CharacterStyle#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span>
1040
+ <span class='kw'>when</span> <span class='const'><span class='object_link'><a href="CharacterStyle.html" title="RRTF::CharacterStyle (class)">CharacterStyle</a></span></span>
1041
+ <span class='comment'># use without modification
1042
+ </span> <span class='kw'>else</span>
1043
+ <span class='const'><span class='object_link'><a href="RTFError.html" title="RRTF::RTFError (class)">RTFError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_fire'><span class='object_link'><a href="RTFError.html#fire-class_method" title="RRTF::RTFError.fire (method)">fire</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Invalid character style style &#39;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_style'>style</span><span class='embexpr_end'>}</span><span class='tstring_content'>&#39;.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1044
+ <span class='kw'>end</span> <span class='comment'># case
1045
+ </span>
1046
+ <span class='comment'># Store fonts and colours used in style in font and colour tables.
1221
1047
  </span> <span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_push_colours'>push_colours</span><span class='lparen'>(</span><span class='id identifier rubyid_root'><span class='object_link'><a href="../top-level-namespace.html" title="Top Level Namespace (root)">root</a></span></span><span class='period'>.</span><span class='id identifier rubyid_colours'>colours</span><span class='rparen'>)</span>
1222
1048
  <span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_push_fonts'>push_fonts</span><span class='lparen'>(</span><span class='id identifier rubyid_root'><span class='object_link'><a href="../top-level-namespace.html" title="Top Level Namespace (root)">root</a></span></span><span class='period'>.</span><span class='id identifier rubyid_fonts'>fonts</span><span class='rparen'>)</span>
1223
1049
 
@@ -1229,276 +1055,6 @@ be applied.</p>
1229
1055
  </td>
1230
1056
  </tr>
1231
1057
  </table>
1232
- </div>
1233
-
1234
- <div class="method_details ">
1235
- <h3 class="signature " id="background-instance_method">
1236
-
1237
- #<strong>background</strong>(colour) &#x21d2; <tt>Object</tt>
1238
-
1239
-
1240
-
1241
-
1242
-
1243
- </h3><div class="docstring">
1244
- <div class="discussion">
1245
-
1246
- <p>This method provides a short cut means of creating a background colour
1247
- command node. The method accepts a block that will be passed a single
1248
- parameter which will be a reference to the background colour node created.
1249
- After the block is complete the background colour node is appended to the
1250
- end of the child nodes on the object that the method is called against.</p>
1251
-
1252
- <h4 id="label-Parameters">Parameters</h4>
1253
- <dl class="rdoc-list note-list"><dt>colour
1254
- <dd>
1255
- <p>The background colour to be applied by the command.</p>
1256
- </dd></dl>
1257
-
1258
-
1259
- </div>
1260
- </div>
1261
- <div class="tags">
1262
-
1263
-
1264
- </div><table class="source_code">
1265
- <tr>
1266
- <td>
1267
- <pre class="lines">
1268
-
1269
-
1270
- 530
1271
- 531
1272
- 532
1273
- 533
1274
- 534
1275
- 535
1276
- 536
1277
- 537
1278
- 538
1279
- 539</pre>
1280
- </td>
1281
- <td>
1282
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 530</span>
1283
-
1284
- <span class='kw'>def</span> <span class='id identifier rubyid_background'>background</span><span class='lparen'>(</span><span class='id identifier rubyid_colour'>colour</span><span class='rparen'>)</span>
1285
- <span class='id identifier rubyid_style'>style</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CharacterStyle.html" title="RRTF::CharacterStyle (class)">CharacterStyle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="CharacterStyle.html#initialize-instance_method" title="RRTF::CharacterStyle#initialize (method)">new</a></span></span>
1286
- <span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_background'>background</span> <span class='op'>=</span> <span class='id identifier rubyid_colour'>colour</span>
1287
- <span class='id identifier rubyid_root'><span class='object_link'><a href="../top-level-namespace.html" title="Top Level Namespace (root)">root</a></span></span><span class='period'>.</span><span class='id identifier rubyid_colours'>colours</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_colour'>colour</span>
1288
- <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
1289
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_node'>node</span><span class='op'>|</span> <span class='kw'>yield</span> <span class='id identifier rubyid_node'>node</span><span class='rbrace'>}</span>
1290
- <span class='kw'>else</span>
1291
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span>
1292
- <span class='kw'>end</span>
1293
- <span class='kw'>end</span></pre>
1294
- </td>
1295
- </tr>
1296
- </table>
1297
- </div>
1298
-
1299
- <div class="method_details ">
1300
- <h3 class="signature " id="bold-instance_method">
1301
-
1302
- #<strong>bold</strong> &#x21d2; <tt>Object</tt>
1303
-
1304
-
1305
-
1306
-
1307
-
1308
- </h3><div class="docstring">
1309
- <div class="discussion">
1310
-
1311
- <p>This method provides a short cut means of creating a bold command node. The
1312
- method accepts a block that will be passed a single parameter which will be
1313
- a reference to the bold node created. After the block is complete the bold
1314
- node is appended to the end of the child nodes on the object that the
1315
- method is call against.</p>
1316
-
1317
-
1318
- </div>
1319
- </div>
1320
- <div class="tags">
1321
-
1322
-
1323
- </div><table class="source_code">
1324
- <tr>
1325
- <td>
1326
- <pre class="lines">
1327
-
1328
-
1329
- 393
1330
- 394
1331
- 395
1332
- 396
1333
- 397
1334
- 398
1335
- 399
1336
- 400
1337
- 401</pre>
1338
- </td>
1339
- <td>
1340
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 393</span>
1341
-
1342
- <span class='kw'>def</span> <span class='id identifier rubyid_bold'>bold</span>
1343
- <span class='id identifier rubyid_style'>style</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CharacterStyle.html" title="RRTF::CharacterStyle (class)">CharacterStyle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="CharacterStyle.html#initialize-instance_method" title="RRTF::CharacterStyle#initialize (method)">new</a></span></span>
1344
- <span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_bold'>bold</span> <span class='op'>=</span> <span class='kw'>true</span>
1345
- <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
1346
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_node'>node</span><span class='op'>|</span> <span class='kw'>yield</span> <span class='id identifier rubyid_node'>node</span><span class='rbrace'>}</span>
1347
- <span class='kw'>else</span>
1348
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span>
1349
- <span class='kw'>end</span>
1350
- <span class='kw'>end</span></pre>
1351
- </td>
1352
- </tr>
1353
- </table>
1354
- </div>
1355
-
1356
- <div class="method_details ">
1357
- <h3 class="signature " id="colour-instance_method">
1358
-
1359
- #<strong>colour</strong>(fore, back) &#x21d2; <tt>Object</tt>
1360
-
1361
-
1362
-
1363
- <span class="aliases">Also known as:
1364
- <span class="names"><span id='color-instance_method'>color</span></span>
1365
- </span>
1366
-
1367
-
1368
-
1369
- </h3><div class="docstring">
1370
- <div class="discussion">
1371
-
1372
- <p>This method provides a short cut menas of creating a colour node that deals
1373
- with foreground and background colours. The method accepts a block that
1374
- will be passed a single parameter which will be a reference to the colour
1375
- node created. After the block is complete the colour node is append to the
1376
- end of the child nodes on the object that the method is called against.</p>
1377
-
1378
- <h4 id="label-Parameters">Parameters</h4>
1379
- <dl class="rdoc-list note-list"><dt>fore
1380
- <dd>
1381
- <p>The foreground colour to be applied by the command.</p>
1382
- </dd><dt>back
1383
- <dd>
1384
- <p>The background colour to be applied by the command.</p>
1385
- </dd></dl>
1386
-
1387
-
1388
- </div>
1389
- </div>
1390
- <div class="tags">
1391
-
1392
-
1393
- </div><table class="source_code">
1394
- <tr>
1395
- <td>
1396
- <pre class="lines">
1397
-
1398
-
1399
- 551
1400
- 552
1401
- 553
1402
- 554
1403
- 555
1404
- 556
1405
- 557
1406
- 558
1407
- 559
1408
- 560
1409
- 561
1410
- 562</pre>
1411
- </td>
1412
- <td>
1413
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 551</span>
1414
-
1415
- <span class='kw'>def</span> <span class='id identifier rubyid_colour'>colour</span><span class='lparen'>(</span><span class='id identifier rubyid_fore'>fore</span><span class='comma'>,</span> <span class='id identifier rubyid_back'>back</span><span class='rparen'>)</span>
1416
- <span class='id identifier rubyid_style'>style</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CharacterStyle.html" title="RRTF::CharacterStyle (class)">CharacterStyle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="CharacterStyle.html#initialize-instance_method" title="RRTF::CharacterStyle#initialize (method)">new</a></span></span>
1417
- <span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_foreground'>foreground</span> <span class='op'>=</span> <span class='id identifier rubyid_fore'>fore</span>
1418
- <span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_background'>background</span> <span class='op'>=</span> <span class='id identifier rubyid_back'>back</span>
1419
- <span class='id identifier rubyid_root'><span class='object_link'><a href="../top-level-namespace.html" title="Top Level Namespace (root)">root</a></span></span><span class='period'>.</span><span class='id identifier rubyid_colours'>colours</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_fore'>fore</span>
1420
- <span class='id identifier rubyid_root'><span class='object_link'><a href="../top-level-namespace.html" title="Top Level Namespace (root)">root</a></span></span><span class='period'>.</span><span class='id identifier rubyid_colours'>colours</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_back'>back</span>
1421
- <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
1422
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_node'>node</span><span class='op'>|</span> <span class='kw'>yield</span> <span class='id identifier rubyid_node'>node</span><span class='rbrace'>}</span>
1423
- <span class='kw'>else</span>
1424
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span>
1425
- <span class='kw'>end</span>
1426
- <span class='kw'>end</span></pre>
1427
- </td>
1428
- </tr>
1429
- </table>
1430
- </div>
1431
-
1432
- <div class="method_details ">
1433
- <h3 class="signature " id="font-instance_method">
1434
-
1435
- #<strong>font</strong>(font, size = nil) &#x21d2; <tt>Object</tt>
1436
-
1437
-
1438
-
1439
-
1440
-
1441
- </h3><div class="docstring">
1442
- <div class="discussion">
1443
-
1444
- <p>This method provides a short cut means of creating a font command node. The
1445
- method accepts a block that will be passed a single parameter which will be
1446
- a reference to the font node created. After the block is complete the font
1447
- node is appended to the end of the child nodes on the object that the
1448
- method is called against.</p>
1449
-
1450
- <h4 id="label-Parameters">Parameters</h4>
1451
- <dl class="rdoc-list note-list"><dt>font
1452
- <dd>
1453
- <p>A reference to font object that represents the font to be used within the
1454
- node.</p>
1455
- </dd><dt>size
1456
- <dd>
1457
- <p>An integer size setting for the font. Defaults to nil to indicate that the
1458
- current font size should be used.</p>
1459
- </dd></dl>
1460
-
1461
-
1462
- </div>
1463
- </div>
1464
- <div class="tags">
1465
-
1466
-
1467
- </div><table class="source_code">
1468
- <tr>
1469
- <td>
1470
- <pre class="lines">
1471
-
1472
-
1473
- 489
1474
- 490
1475
- 491
1476
- 492
1477
- 493
1478
- 494
1479
- 495
1480
- 496
1481
- 497
1482
- 498
1483
- 499</pre>
1484
- </td>
1485
- <td>
1486
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 489</span>
1487
-
1488
- <span class='kw'>def</span> <span class='id identifier rubyid_font'>font</span><span class='lparen'>(</span><span class='id identifier rubyid_font'>font</span><span class='comma'>,</span> <span class='id identifier rubyid_size'>size</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
1489
- <span class='id identifier rubyid_style'>style</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CharacterStyle.html" title="RRTF::CharacterStyle (class)">CharacterStyle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="CharacterStyle.html#initialize-instance_method" title="RRTF::CharacterStyle#initialize (method)">new</a></span></span>
1490
- <span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_font'>font</span> <span class='op'>=</span> <span class='id identifier rubyid_font'>font</span>
1491
- <span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_font_size'>font_size</span> <span class='op'>=</span> <span class='id identifier rubyid_size'>size</span>
1492
- <span class='id identifier rubyid_root'><span class='object_link'><a href="../top-level-namespace.html" title="Top Level Namespace (root)">root</a></span></span><span class='period'>.</span><span class='id identifier rubyid_fonts'>fonts</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_font'>font</span>
1493
- <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
1494
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_node'>node</span><span class='op'>|</span> <span class='kw'>yield</span> <span class='id identifier rubyid_node'>node</span><span class='rbrace'>}</span>
1495
- <span class='kw'>else</span>
1496
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span>
1497
- <span class='kw'>end</span>
1498
- <span class='kw'>end</span></pre>
1499
- </td>
1500
- </tr>
1501
- </table>
1502
1058
  </div>
1503
1059
 
1504
1060
  <div class="method_details ">
@@ -1533,18 +1089,18 @@ current font size should be used.</p>
1533
1089
  <pre class="lines">
1534
1090
 
1535
1091
 
1536
- 335
1537
- 336
1538
- 337
1539
- 338
1540
- 339
1541
- 340
1542
- 341
1543
- 342
1544
- 343</pre>
1092
+ 153
1093
+ 154
1094
+ 155
1095
+ 156
1096
+ 157
1097
+ 158
1098
+ 159
1099
+ 160
1100
+ 161</pre>
1545
1101
  </td>
1546
1102
  <td>
1547
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 335</span>
1103
+ <pre class="code"><span class="info file"># File 'lib/rrtf/node/command_node.rb', line 153</span>
1548
1104
 
1549
1105
  <span class='kw'>def</span> <span class='id identifier rubyid_footnote'>footnote</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
1550
1106
  <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_text'>text</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>and</span> <span class='id identifier rubyid_text'>text</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span>
@@ -1561,9 +1117,9 @@ current font size should be used.</p>
1561
1117
  </div>
1562
1118
 
1563
1119
  <div class="method_details ">
1564
- <h3 class="signature " id="foreground-instance_method">
1120
+ <h3 class="signature " id="geometry-instance_method">
1565
1121
 
1566
- #<strong>foreground</strong>(colour) &#x21d2; <tt>Object</tt>
1122
+ #<strong>geometry</strong>(properties = nil) {|node| ... } &#x21d2; <tt>Object</tt>
1567
1123
 
1568
1124
 
1569
1125
 
@@ -1572,23 +1128,24 @@ current font size should be used.</p>
1572
1128
  </h3><div class="docstring">
1573
1129
  <div class="discussion">
1574
1130
 
1575
- <p>This method provides a short cut means of creating a foreground colour
1576
- command node. The method accepts a block that will be passed a single
1577
- parameter which will be a reference to the foreground colour node created.
1578
- After the block is complete the foreground colour node is appended to the
1579
- end of the child nodes on the object that the method is called against.</p>
1580
-
1581
- <h4 id="label-Parameters">Parameters</h4>
1582
- <dl class="rdoc-list note-list"><dt>colour
1583
- <dd>
1584
- <p>The foreground colour to be applied by the command.</p>
1585
- </dd></dl>
1586
-
1587
1131
 
1588
1132
  </div>
1589
1133
  </div>
1590
1134
  <div class="tags">
1591
1135
 
1136
+ <p class="tag_title">Yields:</p>
1137
+ <ul class="yield">
1138
+
1139
+ <li>
1140
+
1141
+
1142
+ <span class='type'>(<tt>node</tt>)</span>
1143
+
1144
+
1145
+
1146
+ </li>
1147
+
1148
+ </ul>
1592
1149
 
1593
1150
  </div><table class="source_code">
1594
1151
  <tr>
@@ -1596,29 +1153,21 @@ end of the child nodes on the object that the method is called against.</p>
1596
1153
  <pre class="lines">
1597
1154
 
1598
1155
 
1599
- 510
1600
- 511
1601
- 512
1602
- 513
1603
- 514
1604
- 515
1605
- 516
1606
- 517
1607
- 518
1608
- 519</pre>
1156
+ 192
1157
+ 193
1158
+ 194
1159
+ 195
1160
+ 196
1161
+ 197</pre>
1609
1162
  </td>
1610
1163
  <td>
1611
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 510</span>
1612
-
1613
- <span class='kw'>def</span> <span class='id identifier rubyid_foreground'>foreground</span><span class='lparen'>(</span><span class='id identifier rubyid_colour'>colour</span><span class='rparen'>)</span>
1614
- <span class='id identifier rubyid_style'>style</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CharacterStyle.html" title="RRTF::CharacterStyle (class)">CharacterStyle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="CharacterStyle.html#initialize-instance_method" title="RRTF::CharacterStyle#initialize (method)">new</a></span></span>
1615
- <span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_foreground'>foreground</span> <span class='op'>=</span> <span class='id identifier rubyid_colour'>colour</span>
1616
- <span class='id identifier rubyid_root'><span class='object_link'><a href="../top-level-namespace.html" title="Top Level Namespace (root)">root</a></span></span><span class='period'>.</span><span class='id identifier rubyid_colours'>colours</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_colour'>colour</span>
1617
- <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
1618
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_node'>node</span><span class='op'>|</span> <span class='kw'>yield</span> <span class='id identifier rubyid_node'>node</span><span class='rbrace'>}</span>
1619
- <span class='kw'>else</span>
1620
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span>
1621
- <span class='kw'>end</span>
1164
+ <pre class="code"><span class="info file"># File 'lib/rrtf/node/command_node.rb', line 192</span>
1165
+
1166
+ <span class='kw'>def</span> <span class='id identifier rubyid_geometry'>geometry</span><span class='lparen'>(</span><span class='id identifier rubyid_properties'>properties</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
1167
+ <span class='id identifier rubyid_node'>node</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="GeometryNode.html" title="RRTF::GeometryNode (class)">GeometryNode</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="GeometryNode.html#initialize-instance_method" title="RRTF::GeometryNode#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_properties'>properties</span><span class='rparen'>)</span>
1168
+ <span class='kw'>yield</span> <span class='id identifier rubyid_node'>node</span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
1169
+ <span class='id identifier rubyid_store'>store</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
1170
+ <span class='id identifier rubyid_node'>node</span>
1622
1171
  <span class='kw'>end</span></pre>
1623
1172
  </td>
1624
1173
  </tr>
@@ -1628,7 +1177,7 @@ end of the child nodes on the object that the method is called against.</p>
1628
1177
  <div class="method_details ">
1629
1178
  <h3 class="signature " id="image-instance_method">
1630
1179
 
1631
- #<strong>image</strong>(source) &#x21d2; <tt>Object</tt>
1180
+ #<strong>image</strong>(source, options = {}) &#x21d2; <tt>Object</tt>
1632
1181
 
1633
1182
 
1634
1183
 
@@ -1639,70 +1188,76 @@ end of the child nodes on the object that the method is called against.</p>
1639
1188
 
1640
1189
  <p>This method inserts a new image at the current position in a node.</p>
1641
1190
 
1642
- <h4 id="label-Parameters">Parameters</h4>
1643
- <dl class="rdoc-list note-list"><dt>source
1644
- <dd>
1645
- <p>Either a string containing the path and name of a file or a File object for
1646
- the image file to be inserted.</p>
1647
- </dd></dl>
1648
-
1649
- <h4 id="label-Exceptions">Exceptions</h4>
1650
- <dl class="rdoc-list note-list"><dt>RTFError
1651
- <dd>
1652
- <p>Generated whenever an invalid or inaccessible file is specified or the
1653
- image file type is not supported.</p>
1654
- </dd></dl>
1655
-
1656
1191
 
1657
1192
  </div>
1658
1193
  </div>
1659
1194
  <div class="tags">
1195
+ <p class="tag_title">Parameters:</p>
1196
+ <ul class="param">
1660
1197
 
1661
-
1662
- </div><table class="source_code">
1663
- <tr>
1664
- <td>
1665
- <pre class="lines">
1666
-
1667
-
1668
- 354
1669
- 355
1670
- 356</pre>
1671
- </td>
1672
- <td>
1673
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 354</span>
1674
-
1675
- <span class='kw'>def</span> <span class='id identifier rubyid_image'>image</span><span class='lparen'>(</span><span class='id identifier rubyid_source'>source</span><span class='rparen'>)</span>
1676
- <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_store'>store</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="ImageNode.html" title="RRTF::ImageNode (class)">ImageNode</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ImageNode.html#initialize-instance_method" title="RRTF::ImageNode#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_source'>source</span><span class='comma'>,</span> <span class='id identifier rubyid_root'><span class='object_link'><a href="../top-level-namespace.html" title="Top Level Namespace (root)">root</a></span></span><span class='period'>.</span><span class='id identifier rubyid_get_id'>get_id</span><span class='rparen'>)</span><span class='rparen'>)</span>
1677
- <span class='kw'>end</span></pre>
1678
- </td>
1679
- </tr>
1680
- </table>
1198
+ <li>
1199
+
1200
+ <span class='name'>source</span>
1201
+
1202
+
1203
+ <span class='type'>(<tt>String</tt>, <tt>File</tt>)</span>
1204
+
1205
+
1206
+
1207
+ &mdash;
1208
+ <div class='inline'>
1209
+ <p>either a string containing the path and name of a file or a File object for
1210
+ the image file to be inserted.</p>
1681
1211
  </div>
1682
-
1683
- <div class="method_details ">
1684
- <h3 class="signature " id="italic-instance_method">
1685
-
1686
- #<strong>italic</strong> &#x21d2; <tt>Object</tt>
1212
+
1213
+ </li>
1687
1214
 
1688
-
1215
+ <li>
1216
+
1217
+ <span class='name'>options</span>
1218
+
1219
+
1220
+ <span class='type'>(<tt>Hash&lt;String, Object&gt;</tt>)</span>
1221
+
1222
+
1223
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
1224
+
1225
+
1226
+ &mdash;
1227
+ <div class='inline'>
1228
+ <p>a hash of options.</p>
1229
+ </div>
1230
+
1231
+ </li>
1689
1232
 
1233
+ </ul>
1690
1234
 
1235
+ <p class="tag_title">Raises:</p>
1236
+ <ul class="raise">
1691
1237
 
1692
- </h3><div class="docstring">
1693
- <div class="discussion">
1694
-
1695
- <p>This method provides a short cut means of creating an italic command node.
1696
- The method accepts a block that will be passed a single parameter which
1697
- will be a reference to the italic node created. After the block is complete
1698
- the italic node is appended to the end of the child nodes on the object
1699
- that the method is call against.</p>
1700
-
1701
-
1702
- </div>
1238
+ <li>
1239
+
1240
+
1241
+ <span class='type'>(<tt><span class='object_link'><a href="RTFError.html" title="RRTF::RTFError (class)">RTFError</a></span></tt>)</span>
1242
+
1243
+
1244
+
1245
+ &mdash;
1246
+ <div class='inline'>
1247
+ <p>whenever an invalid or inaccessible file is specified or the image file
1248
+ type is not supported.</p>
1703
1249
  </div>
1704
- <div class="tags">
1250
+
1251
+ </li>
1705
1252
 
1253
+ </ul>
1254
+
1255
+ <p class="tag_title">See Also:</p>
1256
+ <ul class="see">
1257
+
1258
+ <li><span class='object_link'><a href="ImageNode.html" title="RRTF::ImageNode (class)">ImageNode</a></span></li>
1259
+
1260
+ </ul>
1706
1261
 
1707
1262
  </div><table class="source_code">
1708
1263
  <tr>
@@ -1710,27 +1265,15 @@ that the method is call against.</p>
1710
1265
  <pre class="lines">
1711
1266
 
1712
1267
 
1713
- 408
1714
- 409
1715
- 410
1716
- 411
1717
- 412
1718
- 413
1719
- 414
1720
- 415
1721
- 416</pre>
1268
+ 172
1269
+ 173
1270
+ 174</pre>
1722
1271
  </td>
1723
1272
  <td>
1724
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 408</span>
1273
+ <pre class="code"><span class="info file"># File 'lib/rrtf/node/command_node.rb', line 172</span>
1725
1274
 
1726
- <span class='kw'>def</span> <span class='id identifier rubyid_italic'>italic</span>
1727
- <span class='id identifier rubyid_style'>style</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CharacterStyle.html" title="RRTF::CharacterStyle (class)">CharacterStyle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="CharacterStyle.html#initialize-instance_method" title="RRTF::CharacterStyle#initialize (method)">new</a></span></span>
1728
- <span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_italic'>italic</span> <span class='op'>=</span> <span class='kw'>true</span>
1729
- <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
1730
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_node'>node</span><span class='op'>|</span> <span class='kw'>yield</span> <span class='id identifier rubyid_node'>node</span><span class='rbrace'>}</span>
1731
- <span class='kw'>else</span>
1732
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span>
1733
- <span class='kw'>end</span>
1275
+ <span class='kw'>def</span> <span class='id identifier rubyid_image'>image</span><span class='lparen'>(</span><span class='id identifier rubyid_source'>source</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
1276
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_store'>store</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="ImageNode.html" title="RRTF::ImageNode (class)">ImageNode</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ImageNode.html#initialize-instance_method" title="RRTF::ImageNode#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_source'>source</span><span class='comma'>,</span> <span class='id identifier rubyid_root'><span class='object_link'><a href="../top-level-namespace.html" title="Top Level Namespace (root)">root</a></span></span><span class='period'>.</span><span class='id identifier rubyid_get_id'>get_id</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='rparen'>)</span>
1734
1277
  <span class='kw'>end</span></pre>
1735
1278
  </td>
1736
1279
  </tr>
@@ -1765,13 +1308,13 @@ content.</p>
1765
1308
  <pre class="lines">
1766
1309
 
1767
1310
 
1768
- 326
1769
- 327
1770
- 328
1771
- 329</pre>
1311
+ 144
1312
+ 145
1313
+ 146
1314
+ 147</pre>
1772
1315
  </td>
1773
1316
  <td>
1774
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 326</span>
1317
+ <pre class="code"><span class="info file"># File 'lib/rrtf/node/command_node.rb', line 144</span>
1775
1318
 
1776
1319
  <span class='kw'>def</span> <span class='id identifier rubyid_line_break'>line_break</span>
1777
1320
  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_store'>store</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="" title="RRTF::CommandNode (class)">CommandNode</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="RRTF::CommandNode#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>\line</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>false</span><span class='rparen'>)</span><span class='rparen'>)</span>
@@ -1819,15 +1362,15 @@ content.</p>
1819
1362
  <pre class="lines">
1820
1363
 
1821
1364
 
1822
- 316
1823
- 317
1824
- 318
1825
- 319
1826
- 320
1827
- 321</pre>
1365
+ 134
1366
+ 135
1367
+ 136
1368
+ 137
1369
+ 138
1370
+ 139</pre>
1828
1371
  </td>
1829
1372
  <td>
1830
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 316</span>
1373
+ <pre class="code"><span class="info file"># File 'lib/rrtf/node/command_node.rb', line 134</span>
1831
1374
 
1832
1375
  <span class='kw'>def</span> <span class='id identifier rubyid_link'>link</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='id identifier rubyid_text'>text</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
1833
1376
  <span class='id identifier rubyid_node'>node</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="LinkNode.html" title="RRTF::LinkNode (class)">LinkNode</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="LinkNode.html#initialize-instance_method" title="RRTF::LinkNode#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
@@ -1897,14 +1440,14 @@ the <code>ListLevelNode</code> doc for more information.</p>
1897
1440
  <pre class="lines">
1898
1441
 
1899
1442
 
1900
- 310
1901
- 311
1902
- 312
1903
- 313
1904
- 314</pre>
1443
+ 128
1444
+ 129
1445
+ 130
1446
+ 131
1447
+ 132</pre>
1905
1448
  </td>
1906
1449
  <td>
1907
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 310</span>
1450
+ <pre class="code"><span class="info file"># File 'lib/rrtf/node/command_node.rb', line 128</span>
1908
1451
 
1909
1452
  <span class='kw'>def</span> <span class='id identifier rubyid_list'>list</span><span class='lparen'>(</span><span class='id identifier rubyid_kind'>kind</span><span class='op'>=</span><span class='symbol'>:bullets</span><span class='rparen'>)</span>
1910
1453
  <span class='id identifier rubyid_node'>node</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ListNode.html" title="RRTF::ListNode (class)">ListNode</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ListNode.html#initialize-instance_method" title="RRTF::ListNode#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
@@ -1934,138 +1477,81 @@ which will be a reference to the paragraph node created. After the block is
1934
1477
  complete the paragraph node is appended to the end of the child nodes on
1935
1478
  the object that the method is called against.</p>
1936
1479
 
1937
- <h4 id="label-Parameters">Parameters</h4>
1938
- <dl class="rdoc-list note-list"><dt>style
1939
- <dd>
1940
- <p>A reference to a ParagraphStyle object that defines the style for the new
1941
- paragraph. Defaults to nil to indicate that the currently applied paragraph
1942
- styling should be used.</p>
1943
- </dd></dl>
1944
-
1945
1480
 
1946
1481
  </div>
1947
1482
  </div>
1948
1483
  <div class="tags">
1949
1484
 
1950
- <p class="tag_title">Yields:</p>
1951
- <ul class="yield">
1485
+ <div class="examples">
1486
+ <p class="tag_title">Examples:</p>
1487
+
1488
+
1489
+ <p class="example_title"><div class='inline'>
1490
+ <p>Applying an anonymous style.</p>
1491
+ </div></p>
1492
+
1493
+ <pre class="example code"><code><span class='id identifier rubyid_rtf'>rtf</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Document.html" title="RRTF::Document (class)">Document</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Document.html#initialize-instance_method" title="RRTF::Document#initialize (method)">new</a></span></span>
1494
+ <span class='id identifier rubyid_rtf'>rtf</span><span class='period'>.</span><span class='id identifier rubyid_paragraph'>paragraph</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bold</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>font</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>SWISS:Arial</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_p'>p</span><span class='op'>|</span>
1495
+ <span class='id identifier rubyid_p'>p</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Paragraph formatted with an anonymous style.</span><span class='tstring_end'>&quot;</span></span>
1496
+ <span class='kw'>end</span></code></pre>
1497
+
1498
+ </div>
1499
+ <p class="tag_title">Parameters:</p>
1500
+ <ul class="param">
1952
1501
 
1953
1502
  <li>
1954
1503
 
1504
+ <span class='name'>style</span>
1955
1505
 
1956
- <span class='type'>(<tt>node</tt>)</span>
1506
+
1507
+ <span class='type'>(<tt>Hash</tt>, <tt><span class='object_link'><a href="ParagraphStyle.html" title="RRTF::ParagraphStyle (class)">ParagraphStyle</a></span></tt>)</span>
1957
1508
 
1958
1509
 
1510
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
1511
+
1512
+
1513
+ &mdash;
1514
+ <div class='inline'>
1515
+ <p>a reference to a ParagraphStyle object that contains the style settings to
1516
+ be applied OR a hash of paragraph formatting settings (aka an anonymous
1517
+ style).</p>
1518
+ </div>
1959
1519
 
1960
1520
  </li>
1961
1521
 
1962
1522
  </ul>
1963
1523
 
1964
- </div><table class="source_code">
1965
- <tr>
1966
- <td>
1967
- <pre class="lines">
1968
-
1969
-
1970
- 285
1971
- 286
1972
- 287
1973
- 288
1974
- 289</pre>
1975
- </td>
1976
- <td>
1977
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 285</span>
1978
-
1979
- <span class='kw'>def</span> <span class='id identifier rubyid_paragraph'>paragraph</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
1980
- <span class='id identifier rubyid_node'>node</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ParagraphNode.html" title="RRTF::ParagraphNode (class)">ParagraphNode</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ParagraphNode.html#initialize-instance_method" title="RRTF::ParagraphNode#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span>
1981
- <span class='kw'>yield</span> <span class='id identifier rubyid_node'>node</span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
1982
- <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_store'>store</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
1983
- <span class='kw'>end</span></pre>
1984
- </td>
1985
- </tr>
1986
- </table>
1987
- </div>
1988
-
1989
- <div class="method_details ">
1990
- <h3 class="signature " id="strike-instance_method">
1991
-
1992
- #<strong>strike</strong> &#x21d2; <tt>Object</tt>
1993
-
1994
-
1995
-
1996
-
1997
-
1998
- </h3><div class="docstring">
1999
- <div class="discussion">
2000
-
2001
- <p>This method provides a short cut means of creating a strike command node.
2002
- The method accepts a block that will be passed a single parameter which
2003
- will be a reference to the strike node created. After the block is complete
2004
- the strike node is appended to the end of the child nodes on the object
2005
- that the method is call against.</p>
2006
-
2007
-
2008
- </div>
2009
- </div>
2010
- <div class="tags">
2011
-
2012
-
2013
- </div><table class="source_code">
2014
- <tr>
2015
- <td>
2016
- <pre class="lines">
2017
-
2018
-
2019
- 468
2020
- 469
2021
- 470
2022
- 471
2023
- 472
2024
- 473
2025
- 474
2026
- 475
2027
- 476</pre>
2028
- </td>
2029
- <td>
2030
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 468</span>
2031
-
2032
- <span class='kw'>def</span> <span class='id identifier rubyid_strike'>strike</span>
2033
- <span class='id identifier rubyid_style'>style</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CharacterStyle.html" title="RRTF::CharacterStyle (class)">CharacterStyle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="CharacterStyle.html#initialize-instance_method" title="RRTF::CharacterStyle#initialize (method)">new</a></span></span>
2034
- <span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_strike'>strike</span> <span class='op'>=</span> <span class='kw'>true</span>
2035
- <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
2036
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_node'>node</span><span class='op'>|</span> <span class='kw'>yield</span> <span class='id identifier rubyid_node'>node</span><span class='rbrace'>}</span>
2037
- <span class='kw'>else</span>
2038
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span>
2039
- <span class='kw'>end</span>
2040
- <span class='kw'>end</span></pre>
2041
- </td>
2042
- </tr>
2043
- </table>
2044
- </div>
2045
-
2046
- <div class="method_details ">
2047
- <h3 class="signature " id="subscript-instance_method">
2048
-
2049
- #<strong>subscript</strong> &#x21d2; <tt>Object</tt>
1524
+ <p class="tag_title">Yields:</p>
1525
+ <ul class="yield">
2050
1526
 
2051
-
1527
+ <li>
1528
+
1529
+
1530
+ <span class='type'>(<tt>node</tt>)</span>
1531
+
1532
+
1533
+
1534
+ </li>
2052
1535
 
2053
-
1536
+ </ul>
1537
+ <p class="tag_title">Raises:</p>
1538
+ <ul class="raise">
2054
1539
 
2055
- </h3><div class="docstring">
2056
- <div class="discussion">
2057
-
2058
- <p>This method provides a short cut means of creating a subscript command
2059
- node. The method accepts a block that will be passed a single parameter
2060
- which will be a reference to the subscript node created. After the block is
2061
- complete the subscript node is appended to the end of the child nodes on
2062
- the object that the method is call against.</p>
2063
-
2064
-
2065
- </div>
1540
+ <li>
1541
+
1542
+
1543
+ <span class='type'>(<tt><span class='object_link'><a href="RTFError.html" title="RRTF::RTFError (class)">RTFError</a></span></tt>)</span>
1544
+
1545
+
1546
+
1547
+ &mdash;
1548
+ <div class='inline'>
1549
+ <p>whenever a non-paragraph style is specified.</p>
2066
1550
  </div>
2067
- <div class="tags">
1551
+
1552
+ </li>
2068
1553
 
1554
+ </ul>
2069
1555
 
2070
1556
  </div><table class="source_code">
2071
1557
  <tr>
@@ -2073,84 +1559,51 @@ the object that the method is call against.</p>
2073
1559
  <pre class="lines">
2074
1560
 
2075
1561
 
2076
- 438
2077
- 439
2078
- 440
2079
- 441
2080
- 442
2081
- 443
2082
- 444
2083
- 445
2084
- 446</pre>
1562
+ 87
1563
+ 88
1564
+ 89
1565
+ 90
1566
+ 91
1567
+ 92
1568
+ 93
1569
+ 94
1570
+ 95
1571
+ 96
1572
+ 97
1573
+ 98
1574
+ 99
1575
+ 100
1576
+ 101
1577
+ 102
1578
+ 103
1579
+ 104
1580
+ 105
1581
+ 106
1582
+ 107</pre>
2085
1583
  </td>
2086
1584
  <td>
2087
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 438</span>
2088
-
2089
- <span class='kw'>def</span> <span class='id identifier rubyid_subscript'>subscript</span>
2090
- <span class='id identifier rubyid_style'>style</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CharacterStyle.html" title="RRTF::CharacterStyle (class)">CharacterStyle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="CharacterStyle.html#initialize-instance_method" title="RRTF::CharacterStyle#initialize (method)">new</a></span></span>
2091
- <span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_subscript'>subscript</span> <span class='op'>=</span> <span class='kw'>true</span>
2092
- <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
2093
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_node'>node</span><span class='op'>|</span> <span class='kw'>yield</span> <span class='id identifier rubyid_node'>node</span><span class='rbrace'>}</span>
2094
- <span class='kw'>else</span>
2095
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span>
2096
- <span class='kw'>end</span>
2097
- <span class='kw'>end</span></pre>
2098
- </td>
2099
- </tr>
2100
- </table>
2101
- </div>
2102
-
2103
- <div class="method_details ">
2104
- <h3 class="signature " id="superscript-instance_method">
2105
-
2106
- #<strong>superscript</strong> &#x21d2; <tt>Object</tt>
2107
-
2108
-
2109
-
1585
+ <pre class="code"><span class="info file"># File 'lib/rrtf/node/command_node.rb', line 87</span>
2110
1586
 
2111
-
2112
- </h3><div class="docstring">
2113
- <div class="discussion">
2114
-
2115
- <p>This method provides a short cut means of creating a superscript command
2116
- node. The method accepts a block that will be passed a single parameter
2117
- which will be a reference to the superscript node created. After the block
2118
- is complete the superscript node is appended to the end of the child nodes
2119
- on the object that the method is call against.</p>
2120
-
2121
-
2122
- </div>
2123
- </div>
2124
- <div class="tags">
2125
-
2126
-
2127
- </div><table class="source_code">
2128
- <tr>
2129
- <td>
2130
- <pre class="lines">
2131
-
2132
-
2133
- 453
2134
- 454
2135
- 455
2136
- 456
2137
- 457
2138
- 458
2139
- 459
2140
- 460
2141
- 461</pre>
2142
- </td>
2143
- <td>
2144
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 453</span>
1587
+ <span class='kw'>def</span> <span class='id identifier rubyid_paragraph'>paragraph</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
1588
+ <span class='comment'># parse style
1589
+ </span> <span class='kw'>case</span> <span class='id identifier rubyid_style'>style</span>
1590
+ <span class='kw'>when</span> <span class='const'>Hash</span>
1591
+ <span class='id identifier rubyid_style'>style</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ParagraphStyle.html" title="RRTF::ParagraphStyle (class)">ParagraphStyle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ParagraphStyle.html#initialize-instance_method" title="RRTF::ParagraphStyle#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span>
1592
+ <span class='kw'>when</span> <span class='const'><span class='object_link'><a href="ParagraphStyle.html" title="RRTF::ParagraphStyle (class)">ParagraphStyle</a></span></span>
1593
+ <span class='comment'># use without modification
1594
+ </span> <span class='kw'>when</span> <span class='kw'>nil</span>
1595
+ <span class='comment'># allow nil style
1596
+ </span> <span class='kw'>else</span>
1597
+ <span class='const'><span class='object_link'><a href="RTFError.html" title="RRTF::RTFError (class)">RTFError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_fire'><span class='object_link'><a href="RTFError.html#fire-class_method" title="RRTF::RTFError.fire (method)">fire</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Invalid paragraph style &#39;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_style'>style</span><span class='embexpr_end'>}</span><span class='tstring_content'>&#39;.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1598
+ <span class='kw'>end</span> <span class='comment'># case
1599
+ </span>
1600
+ <span class='comment'># Store fonts and colours used in style in font and colour tables.
1601
+ </span> <span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_push_colours'>push_colours</span><span class='lparen'>(</span><span class='id identifier rubyid_root'><span class='object_link'><a href="../top-level-namespace.html" title="Top Level Namespace (root)">root</a></span></span><span class='period'>.</span><span class='id identifier rubyid_colours'>colours</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1602
+ <span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_push_fonts'>push_fonts</span><span class='lparen'>(</span><span class='id identifier rubyid_root'><span class='object_link'><a href="../top-level-namespace.html" title="Top Level Namespace (root)">root</a></span></span><span class='period'>.</span><span class='id identifier rubyid_fonts'>fonts</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
2145
1603
 
2146
- <span class='kw'>def</span> <span class='id identifier rubyid_superscript'>superscript</span>
2147
- <span class='id identifier rubyid_style'>style</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CharacterStyle.html" title="RRTF::CharacterStyle (class)">CharacterStyle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="CharacterStyle.html#initialize-instance_method" title="RRTF::CharacterStyle#initialize (method)">new</a></span></span>
2148
- <span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_superscript'>superscript</span> <span class='op'>=</span> <span class='kw'>true</span>
2149
- <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
2150
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_node'>node</span><span class='op'>|</span> <span class='kw'>yield</span> <span class='id identifier rubyid_node'>node</span><span class='rbrace'>}</span>
2151
- <span class='kw'>else</span>
2152
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span>
2153
- <span class='kw'>end</span>
1604
+ <span class='id identifier rubyid_node'>node</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ParagraphNode.html" title="RRTF::ParagraphNode (class)">ParagraphNode</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ParagraphNode.html#initialize-instance_method" title="RRTF::ParagraphNode#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span>
1605
+ <span class='kw'>yield</span> <span class='id identifier rubyid_node'>node</span> <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
1606
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_store'>store</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
2154
1607
  <span class='kw'>end</span></pre>
2155
1608
  </td>
2156
1609
  </tr>
@@ -2210,15 +1663,15 @@ the node the method is called upon after the block is complete.</p>
2210
1663
  <pre class="lines">
2211
1664
 
2212
1665
 
2213
- 573
2214
- 574
2215
- 575
2216
- 576
2217
- 577
2218
- 578</pre>
1666
+ 185
1667
+ 186
1668
+ 187
1669
+ 188
1670
+ 189
1671
+ 190</pre>
2219
1672
  </td>
2220
1673
  <td>
2221
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 573</span>
1674
+ <pre class="code"><span class="info file"># File 'lib/rrtf/node/command_node.rb', line 185</span>
2222
1675
 
2223
1676
  <span class='kw'>def</span> <span class='id identifier rubyid_table'>table</span><span class='lparen'>(</span><span class='id identifier rubyid_rows'>rows</span><span class='comma'>,</span> <span class='id identifier rubyid_columns'>columns</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_widths'>widths</span><span class='rparen'>)</span>
2224
1677
  <span class='id identifier rubyid_node'>node</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="TableNode.html" title="RRTF::TableNode (class)">TableNode</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="TableNode.html#initialize-instance_method" title="RRTF::TableNode#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_rows'>rows</span><span class='comma'>,</span> <span class='id identifier rubyid_columns'>columns</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_widths'>widths</span><span class='rparen'>)</span>
@@ -2257,26 +1710,26 @@ the node the method is called upon after the block is complete.</p>
2257
1710
  <pre class="lines">
2258
1711
 
2259
1712
 
2260
- 257
2261
- 258
2262
- 259
2263
- 260
2264
- 261
2265
- 262
2266
- 263
2267
- 264
2268
- 265
2269
- 266
2270
- 267
2271
- 268
2272
- 269
2273
- 270
2274
- 271
2275
- 272
2276
- 273</pre>
1713
+ 53
1714
+ 54
1715
+ 55
1716
+ 56
1717
+ 57
1718
+ 58
1719
+ 59
1720
+ 60
1721
+ 61
1722
+ 62
1723
+ 63
1724
+ 64
1725
+ 65
1726
+ 66
1727
+ 67
1728
+ 68
1729
+ 69</pre>
2277
1730
  </td>
2278
1731
  <td>
2279
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 257</span>
1732
+ <pre class="code"><span class="info file"># File 'lib/rrtf/node/command_node.rb', line 53</span>
2280
1733
 
2281
1734
  <span class='kw'>def</span> <span class='id identifier rubyid_to_rtf'>to_rtf</span>
2282
1735
  <span class='id identifier rubyid_text'>text</span> <span class='op'>=</span> <span class='const'>StringIO</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
@@ -2298,63 +1751,6 @@ the node the method is called upon after the block is complete.</p>
2298
1751
  </td>
2299
1752
  </tr>
2300
1753
  </table>
2301
- </div>
2302
-
2303
- <div class="method_details ">
2304
- <h3 class="signature " id="underline-instance_method">
2305
-
2306
- #<strong>underline</strong> &#x21d2; <tt>Object</tt>
2307
-
2308
-
2309
-
2310
-
2311
-
2312
- </h3><div class="docstring">
2313
- <div class="discussion">
2314
-
2315
- <p>This method provides a short cut means of creating an underline command
2316
- node. The method accepts a block that will be passed a single parameter
2317
- which will be a reference to the underline node created. After the block is
2318
- complete the underline node is appended to the end of the child nodes on
2319
- the object that the method is call against.</p>
2320
-
2321
-
2322
- </div>
2323
- </div>
2324
- <div class="tags">
2325
-
2326
-
2327
- </div><table class="source_code">
2328
- <tr>
2329
- <td>
2330
- <pre class="lines">
2331
-
2332
-
2333
- 423
2334
- 424
2335
- 425
2336
- 426
2337
- 427
2338
- 428
2339
- 429
2340
- 430
2341
- 431</pre>
2342
- </td>
2343
- <td>
2344
- <pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 423</span>
2345
-
2346
- <span class='kw'>def</span> <span class='id identifier rubyid_underline'>underline</span>
2347
- <span class='id identifier rubyid_style'>style</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CharacterStyle.html" title="RRTF::CharacterStyle (class)">CharacterStyle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="CharacterStyle.html#initialize-instance_method" title="RRTF::CharacterStyle#initialize (method)">new</a></span></span>
2348
- <span class='id identifier rubyid_style'>style</span><span class='period'>.</span><span class='id identifier rubyid_underline'>underline</span> <span class='op'>=</span> <span class='kw'>true</span>
2349
- <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
2350
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_node'>node</span><span class='op'>|</span> <span class='kw'>yield</span> <span class='id identifier rubyid_node'>node</span><span class='rbrace'>}</span>
2351
- <span class='kw'>else</span>
2352
- <span class='id identifier rubyid_apply'>apply</span><span class='lparen'>(</span><span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span>
2353
- <span class='kw'>end</span>
2354
- <span class='kw'>end</span></pre>
2355
- </td>
2356
- </tr>
2357
- </table>
2358
1754
  </div>
2359
1755
 
2360
1756
  </div>
@@ -2362,7 +1758,7 @@ the object that the method is call against.</p>
2362
1758
  </div>
2363
1759
 
2364
1760
  <div id="footer">
2365
- Generated on Mon Jul 24 15:49:00 2017 by
1761
+ Generated on Mon Jul 31 21:49:00 2017 by
2366
1762
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2367
1763
  0.9.9 (ruby-2.3.3).
2368
1764
  </div>