Skip to content

Commit

Permalink
ronn --markdown generates post-filtered markdown files
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomayko committed Jun 17, 2010
1 parent cce5473 commit 634d8e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/ronn
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ ARGV.options do |argv|
argv.on("-r", "--roff") { (formats ||= []) << 'roff' }
argv.on("-5", "--html") { (formats ||= []) << 'html' }
argv.on("-f", "--fragment") { (formats ||= []) << 'html_fragment' }
argv.on("--markdown") { (formats ||= []) << 'markdown' }

# html output options
argv.on("-s", "--style=V") { |val| styles += val.split(/[, \n]+/) }
Expand Down Expand Up @@ -196,7 +197,7 @@ ARGV.each do |file|
case format
when 'html'
warn "%5s: %-48s%15s" % [format, path, '+' + doc.styles.join(',')]
when 'roff', 'html_fragment'
when 'roff', 'html_fragment', 'markdown'
warn "%5s: %-48s" % [format, path]
end

Expand Down
4 changes: 4 additions & 0 deletions lib/ronn/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ def to_html_fragment(wrap_class='mp')
].join("\n")
end

def to_markdown
markdown
end

def to_h
%w[name section tagline manual organization date styles toc].
inject({}) { |hash, name| hash[name] = send(name); hash }
Expand Down

0 comments on commit 634d8e6

Please sign in to comment.