Skip to content

Commit

Permalink
Adding asciidoc markup support
Browse files Browse the repository at this point in the history
  • Loading branch information
kraman committed Apr 10, 2013
1 parent 4e54631 commit 3b17289
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ group :development do
gem 'simplecov'
end

group :asciidoc do
gem 'asciidoctor'
end

group :markdown do
gem 'redcarpet', '= 1.17.2', :platforms => :mri
gem 'kramdown', :platforms => :jruby
Expand Down
7 changes: 7 additions & 0 deletions lib/yard/templates/helpers/html_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ def html_markup_markdown(text)
end
end

# Converts Asciidoc to HTML
# @param [String] text input Asciidoc text
# @return [String] output HTML
def html_markup_asciidoc(text)
markup_class(:asciidoc).render(text)
end

# Converts Textile to HTML
# @param [String] text the input Textile text
# @return [String] output HTML
Expand Down
4 changes: 4 additions & 0 deletions lib/yard/templates/helpers/markup_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def clear_markup_cache
:rdoc => [
{:lib => nil, :const => 'YARD::Templates::Helpers::Markup::RDocMarkup'},
],
:asciidoc => [
{:lib => :asciidoctor, :const => 'Asciidoctor'}
],
:ruby => [],
:text => [],
:pre => [],
Expand All @@ -54,6 +57,7 @@ def clear_markup_cache
:html => ['htm', 'html', 'shtml'],
:text => ['txt'],
:textile => ['textile', 'txtile'],
:asciidoc => ['asciidoc'],
:markdown => ['markdown', 'md', 'mdown', 'mkd'],
:rdoc => ['rdoc'],
:ruby => ['rb', 'ru']
Expand Down

0 comments on commit 3b17289

Please sign in to comment.