diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2013-10-26 01:11:05 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2013-10-26 01:23:21 -0600 |
| commit | 997de61b7309ba1f5d5eb21dd85f0d44787d31b0 (patch) | |
| tree | 43ab92d6aea0556c2a8babc6bc8d36b0c7a3b2c5 /Rakefile | |
| parent | db1ad70202e58b66ba7b836f6a09ae79516ddf37 (diff) | |
prevent YARD from mangling command statements in README
Diffstat (limited to 'Rakefile')
| -rw-r--r-- | Rakefile | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -61,6 +61,18 @@ begin require 'yard' require 'yard-tomdoc' require './lib/asciidoctor' + require './lib/asciidoctor/extensions' + + # Prevent YARD from breaking command statements in literal paragraphs + class CommandBlockPostprocessor < Asciidoctor::Extensions::Postprocessor + def process output + output.gsub(/<pre>\$ (.+?)<\/pre>/m, '<pre class="command code"><span class="const">$</span> \1</pre>') + end + end + Asciidoctor::Extensions.register do |doc| + postprocessor CommandBlockPostprocessor + end + # register .adoc extension for AsciiDoc markup helper YARD::Templates::Helpers::MarkupHelper::MARKUP_EXTENSIONS[:asciidoc] = %w(adoc) YARD::Rake::YardocTask.new do |yard| @@ -76,7 +88,6 @@ begin --exclude backends --exclude opal_ext --hide-api private - --no-highlight -o rdoc --plugin tomdoc --title Asciidoctor\ API\ Documentation |
