Class: PrettyDoc::Markdown

Inherits:
Converter show all
Defined in:
lib/pretty_doc/converters/markdown.rb

Overview

Markdown Converter

Instance Attribute Summary

Attributes inherited from Converter

#content, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Converter

#as_html, descendants

Class Method Details

.perfer_extsObject



9
10
11
# File 'lib/pretty_doc/converters/markdown.rb', line 9

def self.perfer_exts
  ['.md', '.markdown', '.mdown', '.txt']
end

Instance Method Details

#before_convertObject



13
14
15
16
17
# File 'lib/pretty_doc/converters/markdown.rb', line 13

def before_convert
  self.content = content
    .gsub(/\[NO_TOC\]\n/, "{:.no_toc}\n")
    .gsub(/\[TOC\]\n/, "+ __toc_line__\n{:toc}\n")
end