rdoc 6.15.1 → 7.1.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 (88) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +196 -0
  3. data/History.rdoc +1 -1
  4. data/LEGAL.rdoc +6 -0
  5. data/README.md +90 -7
  6. data/doc/markup_reference/markdown.md +558 -0
  7. data/doc/markup_reference/rdoc.rdoc +1169 -0
  8. data/lib/rdoc/code_object/any_method.rb +15 -7
  9. data/lib/rdoc/code_object/class_module.rb +62 -11
  10. data/lib/rdoc/code_object/constant.rb +9 -0
  11. data/lib/rdoc/code_object/context/section.rb +20 -1
  12. data/lib/rdoc/code_object/method_attr.rb +13 -1
  13. data/lib/rdoc/code_object/top_level.rb +31 -18
  14. data/lib/rdoc/comment.rb +190 -8
  15. data/lib/rdoc/cross_reference.rb +30 -21
  16. data/lib/rdoc/generator/aliki.rb +183 -0
  17. data/lib/rdoc/generator/darkfish.rb +8 -2
  18. data/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +8 -0
  19. data/lib/rdoc/generator/template/aliki/_footer.rhtml +23 -0
  20. data/lib/rdoc/generator/template/aliki/_head.rhtml +158 -0
  21. data/lib/rdoc/generator/template/aliki/_header.rhtml +56 -0
  22. data/lib/rdoc/generator/template/aliki/_icons.rhtml +208 -0
  23. data/lib/rdoc/generator/template/aliki/_sidebar_ancestors.rhtml +16 -0
  24. data/lib/rdoc/generator/template/aliki/_sidebar_classes.rhtml +15 -0
  25. data/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +25 -0
  26. data/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +25 -0
  27. data/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +16 -0
  28. data/lib/rdoc/generator/template/aliki/_sidebar_methods.rhtml +41 -0
  29. data/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +67 -0
  30. data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +15 -0
  31. data/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +21 -0
  32. data/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +3 -0
  33. data/lib/rdoc/generator/template/aliki/class.rhtml +220 -0
  34. data/lib/rdoc/generator/template/aliki/css/rdoc.css +1963 -0
  35. data/lib/rdoc/generator/template/aliki/index.rhtml +22 -0
  36. data/lib/rdoc/generator/template/aliki/js/aliki.js +505 -0
  37. data/lib/rdoc/generator/template/aliki/js/c_highlighter.js +299 -0
  38. data/lib/rdoc/generator/template/aliki/js/search_controller.js +129 -0
  39. data/lib/rdoc/generator/template/aliki/js/search_navigation.js +105 -0
  40. data/lib/rdoc/generator/template/aliki/js/search_ranker.js +239 -0
  41. data/lib/rdoc/generator/template/aliki/js/theme-toggle.js +112 -0
  42. data/lib/rdoc/generator/template/aliki/page.rhtml +18 -0
  43. data/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +14 -0
  44. data/lib/rdoc/generator/template/aliki/servlet_root.rhtml +65 -0
  45. data/lib/rdoc/generator/template/darkfish/_head.rhtml +2 -7
  46. data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +1 -1
  47. data/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +1 -0
  48. data/lib/rdoc/generator/template/darkfish/class.rhtml +11 -11
  49. data/lib/rdoc/generator/template/darkfish/css/rdoc.css +19 -0
  50. data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +1 -1
  51. data/lib/rdoc/generator/template/json_index/js/searcher.js +5 -1
  52. data/lib/rdoc/generator.rb +1 -0
  53. data/lib/rdoc/markdown.kpeg +1 -5
  54. data/lib/rdoc/markdown.rb +1 -5
  55. data/lib/rdoc/markup/attribute_manager.rb +28 -1
  56. data/lib/rdoc/markup/blank_line.rb +25 -23
  57. data/lib/rdoc/markup/element.rb +21 -0
  58. data/lib/rdoc/markup/hard_break.rb +30 -27
  59. data/lib/rdoc/markup/heading.rb +166 -77
  60. data/lib/rdoc/markup/pre_process.rb +34 -10
  61. data/lib/rdoc/markup/raw.rb +52 -55
  62. data/lib/rdoc/markup/table.rb +48 -40
  63. data/lib/rdoc/markup/to_ansi.rb +4 -0
  64. data/lib/rdoc/markup/to_bs.rb +4 -0
  65. data/lib/rdoc/markup/to_html.rb +37 -15
  66. data/lib/rdoc/markup/to_html_crossref.rb +24 -5
  67. data/lib/rdoc/markup/to_label.rb +11 -1
  68. data/lib/rdoc/markup/to_rdoc.rb +11 -3
  69. data/lib/rdoc/markup/verbatim.rb +1 -1
  70. data/lib/rdoc/markup.rb +3 -2
  71. data/lib/rdoc/options.rb +21 -10
  72. data/lib/rdoc/parser/c.rb +15 -46
  73. data/lib/rdoc/parser/changelog.rb +8 -0
  74. data/lib/rdoc/parser/prism_ruby.rb +121 -113
  75. data/lib/rdoc/parser/ruby.rb +8 -8
  76. data/lib/rdoc/parser/ruby_tools.rb +5 -7
  77. data/lib/rdoc/parser/simple.rb +4 -21
  78. data/lib/rdoc/rdoc.rb +1 -0
  79. data/lib/rdoc/rubygems_hook.rb +3 -3
  80. data/lib/rdoc/text.rb +16 -1
  81. data/lib/rdoc/token_stream.rb +17 -9
  82. data/lib/rdoc/tom_doc.rb +1 -1
  83. data/lib/rdoc/version.rb +1 -1
  84. data/rdoc.gemspec +3 -3
  85. metadata +36 -9
  86. data/CONTRIBUTING.rdoc +0 -219
  87. data/ExampleMarkdown.md +0 -39
  88. data/ExampleRDoc.rdoc +0 -210
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  ##
3
4
  # A TokenStream is a list of tokens, gathered during the parse of some entity
4
5
  # (say a method). Entities populate these streams by being registered with the
@@ -44,13 +45,7 @@ module RDoc::TokenStream
44
45
  then 'ruby-identifier'
45
46
  end
46
47
 
47
- comment_with_nl = false
48
- if :on_comment == t[:kind] or :on_embdoc == t[:kind] or :on_heredoc_end == t[:kind]
49
- comment_with_nl = true if "\n" == t[:text][-1]
50
- text = t[:text].rstrip
51
- else
52
- text = t[:text]
53
- end
48
+ text = t[:text]
54
49
 
55
50
  if :on_ident == t[:kind] && starting_title
56
51
  starting_title = false
@@ -64,7 +59,9 @@ module RDoc::TokenStream
64
59
  text = CGI.escapeHTML text
65
60
 
66
61
  if style then
67
- "<span class=\"#{style}\">#{text}</span>#{"\n" if comment_with_nl}"
62
+ end_with_newline = text.end_with?("\n")
63
+ text = text.chomp if end_with_newline
64
+ "<span class=\"#{style}\">#{text}</span>#{"\n" if end_with_newline}"
68
65
  else
69
66
  text
70
67
  end
@@ -87,9 +84,11 @@ module RDoc::TokenStream
87
84
 
88
85
  ##
89
86
  # Starts collecting tokens
87
+ #
90
88
 
91
- def collect_tokens
89
+ def collect_tokens(language)
92
90
  @token_stream = []
91
+ @token_stream_language = language
93
92
  end
94
93
 
95
94
  alias start_collecting_tokens collect_tokens
@@ -115,4 +114,13 @@ module RDoc::TokenStream
115
114
  (token_stream or return '').compact.map { |token| token[:text] }.join ''
116
115
  end
117
116
 
117
+ ##
118
+ # Returns the source language of the token stream as a string
119
+ #
120
+ # Returns 'c' or 'ruby'
121
+
122
+ def source_language
123
+ @token_stream_language == :c ? 'c' : 'ruby'
124
+ end
125
+
118
126
  end
data/lib/rdoc/tom_doc.rb CHANGED
@@ -49,7 +49,7 @@ class RDoc::TomDoc < RDoc::Markup::Parser
49
49
  next unless code_object and
50
50
  RDoc::Comment === comment and comment.format == 'tomdoc'
51
51
 
52
- comment.text.gsub!(/(\A\s*# )(Public|Internal|Deprecated):\s+/) do
52
+ comment.text.gsub!(/\A(\s*# |)(Public|Internal|Deprecated):\s+/) do
53
53
  section = code_object.add_section $2
54
54
  code_object.temporary_section = section
55
55
 
data/lib/rdoc/version.rb CHANGED
@@ -5,6 +5,6 @@ module RDoc
5
5
  ##
6
6
  # RDoc version you are using
7
7
 
8
- VERSION = '6.15.1'
8
+ VERSION = '7.1.0'
9
9
 
10
10
  end
data/rdoc.gemspec CHANGED
@@ -38,10 +38,10 @@ RDoc includes the +rdoc+ and +ri+ tools for generating and displaying documentat
38
38
  # for ruby core repository. It was generated by
39
39
  # `git ls-files -z`.split("\x0").each {|f| puts " #{f.dump}," unless f.start_with?(*%W[test/ spec/ features/ .]) }
40
40
  non_lib_files = [
41
- "CONTRIBUTING.rdoc",
41
+ "CONTRIBUTING.md",
42
42
  "CVE-2013-0256.rdoc",
43
- "ExampleMarkdown.md",
44
- "ExampleRDoc.rdoc",
43
+ "doc/markup_reference/markdown.md",
44
+ "doc/markup_reference/rdoc.rdoc",
45
45
  "History.rdoc",
46
46
  "LEGAL.rdoc",
47
47
  "LICENSE.rdoc",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.15.1
4
+ version: 7.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Hodel
@@ -13,7 +13,7 @@ authors:
13
13
  - ITOYANAGI Sakura
14
14
  bindir: exe
15
15
  cert_chain: []
16
- date: 2025-10-31 00:00:00.000000000 Z
16
+ date: 2026-01-13 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: psych
@@ -73,10 +73,8 @@ executables:
73
73
  - ri
74
74
  extensions: []
75
75
  extra_rdoc_files:
76
- - CONTRIBUTING.rdoc
76
+ - CONTRIBUTING.md
77
77
  - CVE-2013-0256.rdoc
78
- - ExampleMarkdown.md
79
- - ExampleRDoc.rdoc
80
78
  - History.rdoc
81
79
  - LEGAL.rdoc
82
80
  - LICENSE.rdoc
@@ -84,16 +82,16 @@ extra_rdoc_files:
84
82
  - RI.md
85
83
  - TODO.rdoc
86
84
  files:
87
- - CONTRIBUTING.rdoc
85
+ - CONTRIBUTING.md
88
86
  - CVE-2013-0256.rdoc
89
- - ExampleMarkdown.md
90
- - ExampleRDoc.rdoc
91
87
  - History.rdoc
92
88
  - LEGAL.rdoc
93
89
  - LICENSE.rdoc
94
90
  - README.md
95
91
  - RI.md
96
92
  - TODO.rdoc
93
+ - doc/markup_reference/markdown.md
94
+ - doc/markup_reference/rdoc.rdoc
97
95
  - exe/rdoc
98
96
  - exe/ri
99
97
  - lib/rdoc.rb
@@ -124,6 +122,7 @@ files:
124
122
  - lib/rdoc/erb_partial.rb
125
123
  - lib/rdoc/erbio.rb
126
124
  - lib/rdoc/generator.rb
125
+ - lib/rdoc/generator/aliki.rb
127
126
  - lib/rdoc/generator/darkfish.rb
128
127
  - lib/rdoc/generator/json_index.rb
129
128
  - lib/rdoc/generator/markup.rb
@@ -132,6 +131,33 @@ files:
132
131
  - lib/rdoc/generator/pot/po.rb
133
132
  - lib/rdoc/generator/pot/po_entry.rb
134
133
  - lib/rdoc/generator/ri.rb
134
+ - lib/rdoc/generator/template/aliki/_aside_toc.rhtml
135
+ - lib/rdoc/generator/template/aliki/_footer.rhtml
136
+ - lib/rdoc/generator/template/aliki/_head.rhtml
137
+ - lib/rdoc/generator/template/aliki/_header.rhtml
138
+ - lib/rdoc/generator/template/aliki/_icons.rhtml
139
+ - lib/rdoc/generator/template/aliki/_sidebar_ancestors.rhtml
140
+ - lib/rdoc/generator/template/aliki/_sidebar_classes.rhtml
141
+ - lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml
142
+ - lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml
143
+ - lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml
144
+ - lib/rdoc/generator/template/aliki/_sidebar_methods.rhtml
145
+ - lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml
146
+ - lib/rdoc/generator/template/aliki/_sidebar_search.rhtml
147
+ - lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml
148
+ - lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml
149
+ - lib/rdoc/generator/template/aliki/class.rhtml
150
+ - lib/rdoc/generator/template/aliki/css/rdoc.css
151
+ - lib/rdoc/generator/template/aliki/index.rhtml
152
+ - lib/rdoc/generator/template/aliki/js/aliki.js
153
+ - lib/rdoc/generator/template/aliki/js/c_highlighter.js
154
+ - lib/rdoc/generator/template/aliki/js/search_controller.js
155
+ - lib/rdoc/generator/template/aliki/js/search_navigation.js
156
+ - lib/rdoc/generator/template/aliki/js/search_ranker.js
157
+ - lib/rdoc/generator/template/aliki/js/theme-toggle.js
158
+ - lib/rdoc/generator/template/aliki/page.rhtml
159
+ - lib/rdoc/generator/template/aliki/servlet_not_found.rhtml
160
+ - lib/rdoc/generator/template/aliki/servlet_root.rhtml
135
161
  - lib/rdoc/generator/template/darkfish/_footer.rhtml
136
162
  - lib/rdoc/generator/template/darkfish/_head.rhtml
137
163
  - lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml
@@ -206,6 +232,7 @@ files:
206
232
  - lib/rdoc/markup/blank_line.rb
207
233
  - lib/rdoc/markup/block_quote.rb
208
234
  - lib/rdoc/markup/document.rb
235
+ - lib/rdoc/markup/element.rb
209
236
  - lib/rdoc/markup/formatter.rb
210
237
  - lib/rdoc/markup/hard_break.rb
211
238
  - lib/rdoc/markup/heading.rb
@@ -296,7 +323,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
296
323
  - !ruby/object:Gem::Version
297
324
  version: '2.2'
298
325
  requirements: []
299
- rubygems_version: 3.6.7
326
+ rubygems_version: 4.0.3
300
327
  specification_version: 4
301
328
  summary: RDoc produces HTML and command-line documentation for Ruby projects
302
329
  test_files: []
data/CONTRIBUTING.rdoc DELETED
@@ -1,219 +0,0 @@
1
- = Developer Introduction
2
-
3
- So you want to write a generator, fix a bug, or otherwise work with RDoc. This
4
- document provides an overview of how RDoc works from parsing options to
5
- generating output. Most of the documentation can be found in the specific
6
- classes for each feature.
7
-
8
- == Bugs
9
-
10
- If you think you found a bug, file a ticket on the {issues
11
- tracker}[https://github.com/ruby/rdoc/issues] on github.
12
-
13
- If your bug involves an error RDoc produced please include a sample file that
14
- illustrates the problem or link to the repository or gem that is associated
15
- with the bug.
16
-
17
- Please include steps to reproduce the issue. Here are some examples of good
18
- issues:
19
-
20
- * https://github.com/ruby/rdoc/issues/55
21
- * https://github.com/ruby/rdoc/issues/61
22
-
23
- == Developer Quick Start
24
-
25
- RDoc uses bundler for development. To get ready to work on RDoc run:
26
-
27
- $ gem install bundler
28
- [...]
29
- $ bundle install
30
- [...]
31
- $ rake
32
- [...]
33
-
34
- This will install all the necessary dependencies for development with rake,
35
- generate documentation and run the tests for the first time.
36
-
37
- If the tests don't pass on the first run check the {GitHub Actions page}[https://github.com/ruby/rdoc/actions] to see if there are any known failures
38
- (there shouldn't be).
39
-
40
- You can now use `rake` and `autotest` to run the tests.
41
-
42
- Note: the `rake` command must be used first before running any tests, because
43
- it's used to generate various parsers implemented in RDoc. Also `rake clean` is
44
- helpful to delete these generated files.
45
-
46
- == Glossary
47
-
48
- Here are definitions for some common terms in the RDoc documentation. The
49
- list also briefly describes how the components of RDoc interact.
50
-
51
- parser::
52
- Parses files and creates a documentation tree from the contents.
53
-
54
- documentation tree::
55
- The documentation tree represents files, classes, modules, methods,
56
- constants, includes, comments and other ruby syntax features as a tree.
57
- RDoc walks this tree with a generator to create documentation.
58
-
59
- generator::
60
- Walks the documentation tree and generates output.
61
-
62
- RDoc ships with two generators, the Darkfish generator creates HTML and the
63
- RI generator creates an RI data store.
64
-
65
- markup parser::
66
- Parses comments from a file into a generic markup tree.
67
-
68
- The markup parsers allow RDoc to handle RDoc, TomDoc, rd and Markdown format
69
- documentation with common formatters.
70
-
71
- markup tree::
72
- Each parsed comment has a markup tree that represents common markup items
73
- such as headings, paragraphs, lists or verbatim text sections for example
74
- code or output.
75
-
76
- A generator uses a formatters to walks the tree to create output. Some
77
- generators use multiple formatters on a markup tree to produce the output.
78
-
79
- formatter::
80
- Converts a parsed markup tree into some form other form of markup.
81
-
82
- Formatters can either produce a one-to-one conversion, such as ToHtml, or
83
- extract part of the parsed result, such as ToHtmlSnippet which outputs the
84
- first 100 characters as HTML.
85
-
86
- == Plugins
87
-
88
- When 'rdoc/rdoc' is loaded RDoc looks for 'rdoc/discover' files in your
89
- installed gems. This can be used to load parsers, alternate generators, or
90
- additional preprocessor directives. An rdoc plugin layout should look
91
- something like this:
92
-
93
- lib/rdoc/discover.rb
94
- lib/my/rdoc/plugin.rb
95
- # etc.
96
-
97
- In your rdoc/discover.rb file you will want to wrap the loading of your plugin
98
- in an RDoc version check like this:
99
-
100
- begin
101
- gem 'rdoc', '~> 3'
102
- require 'my/rdoc/plugin'
103
- rescue Gem::LoadError
104
- end
105
-
106
- === Plugin Types
107
-
108
- In RDoc you can change the following behaviors:
109
-
110
- * Add a parser for a new file format
111
- * Add a new output generator
112
- * Add a new markup directive
113
- * Add a new type of documentation markup
114
- * Add a new type of formatter
115
-
116
- All of these are described below
117
-
118
- == Option Parsing
119
-
120
- Option parsing is handled by RDoc::Options. When you're writing a generator
121
- you can provide the user with extra options by providing a class method
122
- +setup_options+. The option parser will call this after your generator is
123
- loaded. See RDoc::Generator for details.
124
-
125
- == File Parsing
126
-
127
- After options are parsed, RDoc parses files from the files and directories in
128
- ARGV. RDoc compares the filename against what each parser claims it can parse
129
- via RDoc::Parser#parse_files_matching. For example, RDoc::Parser::C can parse
130
- C files, C headers, C++ files, C++ headers and yacc grammars.
131
-
132
- Once a matching parser class is found it is instantiated and +scan+ is called.
133
- The parser needs to extract documentation from the file and add it to the RDoc
134
- document tree. Usually this involves starting at the root and adding a class
135
- or a module (RDoc::TopLevel#add_class and RDoc::TopLevel#add_module) and
136
- proceeding to add classes, modules and methods to each nested item.
137
-
138
- When the parsers are finished the document tree is cleaned up to remove
139
- dangling references to aliases and includes that were not found (and may exist
140
- in a separate library) through RDoc::ClassModule#complete.
141
-
142
- To write your own parser for a new file format see RDoc::Parser.
143
-
144
- === Documentation Tree
145
-
146
- The parsers build a documentation tree that is composed of RDoc::CodeObject and
147
- its subclasses. There are various methods to walk the tree to extract
148
- information, see RDoc::Context and its subclasses.
149
-
150
- Within a class or module, attributes, methods and constants are divided into
151
- sections. The section represents a functional grouping of parts of the class.
152
- TomDoc uses the sections "Public", "Internal" and "Deprecated". The sections
153
- can be enumerated using RDoc::Context#each_section.
154
-
155
- == Output Generation
156
-
157
- An RDoc generator turns the documentation tree into some other kind of output.
158
- RDoc comes with an HTML generator (RDoc::Generator::Darkfish) and an RI
159
- database generator (RDoc::Generator::RI). The output a generator creates does
160
- not have to be human-readable.
161
-
162
- To create your own generator see RDoc::Generator.
163
-
164
- === Comments
165
-
166
- In RDoc 3.10 and newer the comment on an RDoc::CodeObject is now an
167
- RDoc::Comment object instead of a String. This is to support various
168
- documentation markup formats like rdoc, TomDoc and rd. The comments are
169
- normalized to remove comment markers and remove indentation then parsed lazily
170
- via RDoc::Comment#document to create a generic markup tree that can be
171
- processed by a formatter.
172
-
173
- To add your own markup format see RDoc::Markup@Other+directives
174
-
175
- ==== Formatters
176
-
177
- To transform a comment into some form of output an RDoc::Markup::Formatter
178
- subclass is used like RDoc::Markup::ToHtml. A formatter is a visitor that
179
- walks a parsed comment tree (an RDoc::Markup::Document) of any format. To help
180
- write a formatter RDoc::Markup::FormatterTestCase exists for generic parsers,
181
- and RDoc::Markup::TextFormatterTestCase which contains extra test cases for
182
- text-type output (like +ri+ output).
183
-
184
- RDoc ships with formatters that will turn a comment into HTML, rdoc-markup-like
185
- text, ANSI or terminal backspace highlighted text, HTML, cross-referenced HTML,
186
- an HTML snippet free of most markup, an HTML label for use in id attributes, a
187
- table-of-contents page, and text with only code blocks.
188
-
189
- The output of the formatter does not need to be text or text-like.
190
- RDoc::Markup::ToLabel creates an HTML-safe label for use in an HTML id
191
- attribute. A formatter could count the number of words and the average word
192
- length for a comment, for example.
193
-
194
- ==== Directives
195
-
196
- For comments in markup you can add new directives (:nodoc: is a directive).
197
- Directives may replace text or store it off for later use.
198
-
199
- See RDoc::Markup::PreProcess::register for details.
200
-
201
- === JSONIndex
202
-
203
- RDoc contains a special generator, RDoc::Generator::JSONIndex, which creates a
204
- JSON-based search index and includes a search engine for use with HTML output.
205
- This generator can be used to add searching to any HTML output and is designed
206
- to be called from inside an HTML generator.
207
-
208
- == Markup
209
-
210
- Additional documentation markup formats can be added to RDoc. A markup
211
- parsing class must respond to \::parse and accept a String argument containing
212
- the markup format. An RDoc::Document containing documentation items
213
- (RDoc::Markup::Heading, RDoc::Markup::Paragraph, RDoc::Markup::Verbatim, etc.)
214
- must be returned.
215
-
216
- To register the parser with rdoc, add the markup type's name and class to the
217
- RDoc::Text::MARKUP_FORMAT hash like:
218
-
219
- RDoc::Text::MARKUP_FORMAT['rdoc'] = RDoc::Markup
data/ExampleMarkdown.md DELETED
@@ -1,39 +0,0 @@
1
- # Example Markdown
2
-
3
- This document contains example output to show RDoc styling. This file was
4
- created from a Markdown file.
5
-
6
- For the following styles, see ExampleRDoc.rdoc for style examples:
7
-
8
- * Headings
9
- * Paragraphs
10
- * Code blocks (verbatim sections)
11
- * Definition lists
12
- * Ordered lists
13
- * Unordered lists
14
-
15
- These items all use the same styles as RDoc format files.
16
-
17
- ## Footnotes
18
-
19
- Footnotes are rendered at the bottom of the documentation section[^1]. For
20
- pages this will be at the bottom of the page. For method documentation this
21
- will be at the end of the current method.
22
-
23
- [^1]: Here is the footnote content. As you can see it is at the bottom of the
24
- page.
25
-
26
- ## Blockquotes
27
-
28
- Here is how a blockquote looks.
29
-
30
- > We finished our first sensor sweep of the neutral zone. Now, how the hell do
31
- > we defeat an enemy that knows us better than we know ourselves? and attack
32
- > the Romulans.
33
- >
34
- > > Sorry, Data. I guess it's better to be lucky than good. The unexpected is
35
- > > our normal routine. Could someone survive inside a transporter buffer for
36
- > > 75 years?
37
-
38
- This text is from [Riker Ipsum](http://rikeripsum.com)
39
-
data/ExampleRDoc.rdoc DELETED
@@ -1,210 +0,0 @@
1
- = Example \RDoc
2
-
3
- This document contains example output to show RDoc styling. This file was
4
- created from a RDoc Markup file.
5
-
6
- == Headings
7
-
8
- You should not use headings beyond level 3, it is a sign of poor organization
9
- of your code or documentation. It also becomes difficult for the user to
10
- figure out what you are attempting to explain to them as they have to track
11
- the multiple layers of nesting.
12
-
13
- = Heading level 1
14
-
15
- Above is a level one heading.
16
-
17
- These paragraphs are filler that exist so you can see how the heading
18
- interacts with paragraphs before and after the heading. As you can see each
19
- different heading has a different amount of margin above and below.
20
-
21
- This should be sufficient to give you a proper picture of how it will appear in
22
- your documentation.
23
-
24
- == Heading level 2
25
-
26
- Above is a level two heading.
27
-
28
- These paragraphs are filler that exist so you can see how the heading
29
- interacts with paragraphs before and after the heading. As you can see each
30
- different heading has a different amount of margin above and below.
31
-
32
- This should be sufficient to give you a proper picture of how it will appear in
33
- your documentation.
34
-
35
- === Heading level 3
36
-
37
- Above is a level three heading.
38
-
39
- These paragraphs are filler that exist so you can see how the heading
40
- interacts with paragraphs before and after the heading. As you can see each
41
- different heading has a different amount of margin above and below.
42
-
43
- This should be sufficient to give you a proper picture of how it will appear in
44
- your documentation.
45
-
46
- ==== Heading level 4
47
-
48
- Above is a level four heading.
49
-
50
- These paragraphs are filler that exist so you can see how the heading
51
- interacts with paragraphs before and after the heading. As you can see each
52
- different heading has a different amount of margin above and below.
53
-
54
- This should be sufficient to give you a proper picture of how it will appear in
55
- your documentation.
56
-
57
- ===== Heading level 5
58
-
59
- Above is a level five heading.
60
-
61
- These paragraphs are filler that exist so you can see how the heading
62
- interacts with paragraphs before and after the heading. As you can see each
63
- different heading has a different amount of margin above and below.
64
-
65
- This should be sufficient to give you a proper picture of how it will appear in
66
- your documentation.
67
-
68
- ====== Heading level 6
69
-
70
- Above is a level six heading.
71
-
72
- These paragraphs are filler that exist so you can see how the heading
73
- interacts with paragraphs before and after the heading. As you can see each
74
- different heading has a different amount of margin above and below.
75
-
76
- This should be sufficient to give you a proper picture of how it will appear in
77
- your documentation.
78
-
79
- == Paragraphs
80
-
81
- This is how a paragraph looks. Since it is difficult to generate good content
82
- for paragraphs I have chosen to use {Riker Ipsum}[http://rikeripsum.com] for
83
- nonsense filler content. In the previous sentence you can see how a link is
84
- formatted.
85
-
86
- Here is an example of *bold* and _emphasis_ styling. Try not to combine the
87
- two or use them too often. Here is an example of <code>inline verbatim
88
- text</code>. That should be enough of a taste of inline markup in paragraphs.
89
- The Riker Ipsum filler follows:
90
-
91
- Shields up! Rrrrred alert! Well, I'll say this for him - he's sure of himself.
92
- and attack the Romulans. Worf, It's better than music. It's jazz. This should
93
- be interesting. When has justice ever been as simple as a rule book? Flair is
94
- what marks the difference between artistry and mere competence.
95
-
96
- Sorry, Data. I think you've let your personal feelings cloud your judgement. We
97
- finished our first sensor sweep of the neutral zone. Yes, absolutely, I do
98
- indeed concur, wholeheartedly! Mr. Worf, you do remember how to fire phasers? A
99
- lot of things can change in twelve years, Admiral. Your shields were failing,
100
- sir.
101
-
102
- == Verbatim sections
103
-
104
- A verbatim section typically contains source code or example output. This is
105
- how verbatim blocks of code looks:
106
-
107
- def local responder
108
- responder.ping do |value|
109
- return value
110
- end
111
- end
112
-
113
- def ping uri
114
- @uri = uri
115
- @remote = DRb::DRbObject.new_with_uri @uri
116
-
117
- @remote.ping do |value|
118
- return value
119
- end
120
- end
121
-
122
- This is a paragraph following the verbatim block so you can see how leading and trailing paragraphs interact with it.
123
-
124
- == Unordered lists
125
-
126
- Here is an unordered list. As you can see it uses non-numeral markers for each list item:
127
-
128
- * This is the top-most item in the list.
129
- * This is a second item in the list.
130
-
131
- Unlike the first item, this item has more than one paragraph so you can see
132
- how they interact.
133
- * This is a third item in the list. Like the item before it, this item has a
134
- second paragraph.
135
-
136
- Here is the second paragraph in the list item.
137
- * A final list item.
138
-
139
- == Ordered lists
140
-
141
- Here is an ordered list. As you can see it uses numeral markers for each list
142
- item:
143
-
144
- 1. This is the first item in the list.
145
- 1. This is the second item in the list.
146
-
147
- Unlike the first item, this item has more than one paragraph so you can see
148
- how they interact.
149
- 1. This is the third item in the list. Like the item before it, this item has
150
- a second paragraph.
151
-
152
- Here is the second paragraph in the third list item.
153
- 1. The fourth and final list item.
154
-
155
- == Definition lists
156
-
157
- === "Note" list
158
-
159
- The "note" syntax can be used to create a definition list:
160
-
161
- note::
162
- description
163
-
164
- Here is such a definition list:
165
-
166
- cat::
167
- A cat is a small mammal that is commonly kept as a pet.
168
-
169
- dog::
170
- A dog is a mammal that is also kept as a pet. A dog may range in size from
171
- smaller than a cat to larger than a human.
172
-
173
- Typically dogs are easier to train to respond to commands than cats.
174
-
175
- rabbit::
176
- Rabbits are also mammals, but are infrequently kept as pets. Most rabbits
177
- are wild.
178
-
179
- === "Label" list
180
-
181
- The "label" syntax can be used to create a definition list:
182
-
183
- [label]
184
- description
185
-
186
- Here is such a definition list:
187
-
188
- [cat]
189
- A cat is a small mammal that is commonly kept as a pet.
190
-
191
- [dog]
192
- A dog is a mammal that is also kept as a pet. A dog may range in size from
193
- smaller than a cat to larger than a human.
194
-
195
- Typically dogs are easier to train to respond to commands than cats.
196
-
197
- [rabbit]
198
- Rabbits are also mammals, but are infrequently kept as pets. Most rabbits
199
- are wild.
200
-
201
- == Rule
202
-
203
- A rule is a horizontal divider between two paragraphs. Following this
204
- paragraph is a rule.
205
-
206
- ---
207
-
208
- In historic versions of RDoc you could control the height of the rule in HTML
209
- output. This is no longer true as HTML 5 does not support this.
210
-