Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ jobs:
- name: Install external renderers
run: |
sudo apt-get update
sudo apt-get install -y asciidoctor python3-docutils perl
sudo apt-get install -y asciidoctor python3-docutils perl ruby
rdoc --version

- name: Build
run: go build -v ./...
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The default registry comes with all supported formats pre-configured. Native for
| Textile | .textile | consumer-provided (external) |
| MediaWiki | .mediawiki, .wiki | consumer-provided (external) |
| Creole | .creole | consumer-provided (external) |
| RDoc | .rdoc | consumer-provided (external) |
| RDoc | .rdoc | rdoc (external) |

## Format detection

Expand Down Expand Up @@ -85,6 +85,7 @@ The native formats (Markdown, Org-mode) need no external tools. For the others:
| asciidoctor | `gem install asciidoctor` | AsciiDoc |
| rst2html | `pip install docutils` or `apt install python3-docutils` | reStructuredText |
| pod2html | Included with Perl | Pod |
| rdoc | Included with Ruby | RDoc |

## Benchmarks

Expand Down
1 change: 1 addition & 0 deletions markup.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ func NewDefaultRegistry() *Registry {

r.Register(FormatRDoc, NewExternalRenderer(ExternalConfig{
Command: "rdoc",
Args: []string{"--pipe"},
}), ".rdoc")

return r
Expand Down
13 changes: 13 additions & 0 deletions markup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,13 +586,26 @@ func TestRenderRDoc(t *testing.T) {
t.Skip("rdoc renderer not installed")
}
content := readTestdata(t, "README.rdoc")
t.Chdir(t.TempDir())
result, err := r.Render("README.rdoc", content)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if result.Format != FormatRDoc {
t.Errorf("Format = %v, want FormatRDoc", result.Format)
}
for _, want := range []string{"<ul>", "<li>", "<p>One</p>", `<a href="http://github.com">absolute link</a>`, `<a href="rawr.html">relative link</a>`} {
if !strings.Contains(result.HTML, want) {
t.Errorf("expected %q in HTML, got: %s", want, result.HTML)
}
}
entries, err := os.ReadDir(".")
if err != nil {
t.Fatal(err)
}
if len(entries) != 0 {
t.Errorf("renderer created files: %v", entries)
}
}

// --- Input size limit ---
Expand Down
Loading