Class: Migrator::Converter::TwfToMarkdown
- Inherits:
-
Object
- Object
- Migrator::Converter::TwfToMarkdown
- Defined in:
- lib/tractive/migrator/converter/twf_to_markdown.rb
Overview
twf => Trac wiki format
Instance Method Summary collapse
- #convert(str, image_options = {}) ⇒ Object
-
#initialize(base_url, attachment_options, changeset_base_url, wiki_attachments_url, revmap_file_path, options = {}) ⇒ TwfToMarkdown
constructor
A new instance of TwfToMarkdown.
Constructor Details
#initialize(base_url, attachment_options, changeset_base_url, wiki_attachments_url, revmap_file_path, options = {}) ⇒ TwfToMarkdown
Returns a new instance of TwfToMarkdown.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/tractive/migrator/converter/twf_to_markdown.rb', line 9 def initialize(base_url, , changeset_base_url, , revmap_file_path, = {}) @base_url = base_url @attach_url = [:url] @attach_hashed = [:hashed] @changeset_base_url = changeset_base_url @wiki_attachments_url = @revmap = load_revmap_file(revmap_file_path) @git_repo = [:git_repo] @home_page_name = [:home_page_name] @wiki_extensions = [:wiki_extensions] @source_folders = [:source_folders] end |
Instance Method Details
#convert(str, image_options = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/tractive/migrator/converter/twf_to_markdown.rb', line 23 def convert(str, = {}) # Fix 'Windows EOL' to 'Linux EOL' str.gsub!("\r\n", "\n") convert_tables(str) convert_newlines(str) convert_comments(str) convert_html_snippets(str) convert_code_snippets(str) convert_headings(str) convert_links(str, @git_repo) convert_font_styles(str) convert_changeset(str, @changeset_base_url) convert_image(str, @base_url, @attach_url, @wiki_attachments_url, ) convert_ticket(str, @base_url) revert_intermediate_references(str) str end |