Module: SDocHelpers::MarkdownFiles

Defined in:
lib/sdoc_helpers/markdown.rb

Instance Method Summary collapse

Instance Method Details

#descriptionObject



5
6
7
8
9
10
# File 'lib/sdoc_helpers/markdown.rb', line 5

def description
  return super unless full_name =~ /\.(md|markdown)$/
  # assuming your path is ROOT/html or ROOT/doc
  path = Dir.pwd + '/../' + full_name
  Markdown.new(gfm(File.read(path))).to_html + open_links_in_new_window
end


12
13
14
15
16
17
18
# File 'lib/sdoc_helpers/markdown.rb', line 12

def open_links_in_new_window
  <<-html
<script type="text/javascript">$(function() {
  $('a').each(function() { $(this).attr('target', '_blank') })
})</script>
html
end