Skip to content

Commit b3cbd47

Browse files
authored
Rebuild RDoc markup documentation (#1542)
1. README now has a better section about supported markup formats 2. RDoc markup related reference are now consolidated under `doc/markup_reference/rdoc.rdoc` 3. Markdown markup now has a more comprehensive reference in `doc/markup_reference/markdown.md` (#1536, #1538, #1540, and #1541 were all discovered when I was preparing for this PR 😄)
1 parent c4a58cb commit b3cbd47

File tree

10 files changed

+1920
-1591
lines changed

10 files changed

+1920
-1591
lines changed

AGENTS.md

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,10 @@ exe/
220220

221221
### Documentation
222222

223-
- `README.md` - Basic usage guide
224-
- `ExampleRDoc.rdoc` - RDoc markup examples
225-
- `doc/rdoc/markup_reference.rb` - RDoc markup references
226-
- `ExampleMarkdown.md` - Markdown examples
223+
- `README.md` - Basic usage guide and markup format reference
224+
- `markup_reference/rdoc.rdoc` - Comprehensive RDoc markup syntax reference
225+
- `markup_reference/markdown.md` - Markdown syntax reference
226+
- `doc/rdoc/example.rb` - Ruby code examples for cross-references and directives
227227

228228
## Architecture Notes
229229

@@ -268,6 +268,53 @@ Use Red, Green, Refactor approach:
268268
3. Check output in `_site/` directory
269269
4. Check coverage: `bundle exec rake coverage`
270270

271+
### Modifying Markup Reference Documentation
272+
273+
When editing markup reference documentation, such as `doc/markup_reference/markdown.md` and `doc/markup_reference/rdoc.rdoc`:
274+
275+
1. **Always verify rendering** - After making changes, test that the content renders correctly using Ruby:
276+
277+
For Markdown files:
278+
279+
```ruby
280+
ruby -r rdoc -r rdoc/markdown -e '
281+
md = RDoc::Markdown.new
282+
doc = md.parse("YOUR CONTENT HERE")
283+
formatter = RDoc::Markup::ToHtml.new(RDoc::Options.new)
284+
puts formatter.convert(doc)
285+
'
286+
```
287+
288+
For RDoc files:
289+
290+
```ruby
291+
ruby -r rdoc -e '
292+
parser = RDoc::Markup::Parser.new
293+
doc = parser.parse("YOUR CONTENT HERE")
294+
formatter = RDoc::Markup::ToHtml.new(RDoc::Options.new)
295+
puts formatter.convert(doc)
296+
'
297+
```
298+
299+
2. **Watch for rendering issues:**
300+
- Backtick escaping (especially nested code blocks)
301+
- Tilde characters being interpreted as strikethrough
302+
- Special characters in examples
303+
- Anchor links pointing to correct headings
304+
305+
3. **Known RDoc Markdown limitations:**
306+
- Only triple backticks for fenced code blocks (no tildes, no quad-backticks)
307+
- Tilde fences (`~~~`) conflict with strikethrough syntax
308+
- Use 4-space indentation to show literal code fence examples
309+
310+
4. **Full verification**: Generate documentation and inspect the HTML output:
311+
312+
```bash
313+
bundle exec rake rerdoc
314+
# Inspect the generated HTML file directly
315+
grep -A5 "your content" _site/path/to/file.html
316+
```
317+
271318
### Modifying Themes/Styling
272319

273320
When making changes to theme CSS or templates (e.g., Darkfish or Aliki themes):

ExampleMarkdown.md

Lines changed: 0 additions & 50 deletions
This file was deleted.

ExampleRDoc.rdoc

Lines changed: 0 additions & 222 deletions
This file was deleted.

0 commit comments

Comments
 (0)