Merge pull request #47 from defunkt/process-markdown
Split Markdown processing into its own method
This commit is contained in:
commit
d149a9bbf4
@ -437,8 +437,7 @@ class Rocco
|
|||||||
# dividers and run through the Markdown processor. Then split it back out
|
# dividers and run through the Markdown processor. Then split it back out
|
||||||
# into separate sections.
|
# into separate sections.
|
||||||
markdown = docs_blocks.join("\n\n##### DIVIDER\n\n")
|
markdown = docs_blocks.join("\n\n##### DIVIDER\n\n")
|
||||||
docs_html = Markdown.new(markdown, :smart).
|
docs_html = process_markdown(markdown).
|
||||||
to_html.
|
|
||||||
split(/\n*<h5>DIVIDER<\/h5>\n*/m)
|
split(/\n*<h5>DIVIDER<\/h5>\n*/m)
|
||||||
|
|
||||||
# Combine all code blocks into a single big stream with section dividers and
|
# Combine all code blocks into a single big stream with section dividers and
|
||||||
@ -492,6 +491,11 @@ class Rocco
|
|||||||
docs_html.zip(code_html)
|
docs_html.zip(code_html)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Convert Markdown to classy HTML.
|
||||||
|
def process_markdown(text)
|
||||||
|
Markdown.new(text, :smart).to_html
|
||||||
|
end
|
||||||
|
|
||||||
# We `popen` a read/write pygmentize process in the parent and
|
# We `popen` a read/write pygmentize process in the parent and
|
||||||
# then fork off a child process to write the input.
|
# then fork off a child process to write the input.
|
||||||
def highlight_pygmentize(code)
|
def highlight_pygmentize(code)
|
||||||
|
Loading…
Reference in New Issue
Block a user