Module: SDocHelpers::MarkdownFiles
- Defined in:
- lib/sdoc_helpers/markdown.rb
Instance Method Summary collapse
Instance Method Details
#description ⇒ Object
3 4 5 6 7 8 |
# File 'lib/sdoc_helpers/markdown.rb', line 3 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(File.read(path)).to_html + open_links_in_new_window end |
#open_links_in_new_window ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/sdoc_helpers/markdown.rb', line 10 def open_links_in_new_window <<-html <script type="text/javascript">$(function() { $('a').each(function() { $(this).attr('target', '_blank') }) })</script> html end |