Skip to content

Convert html to markdown #10

@mhicauber

Description

@mhicauber

I was using the ckeditor plugin for redmine (as I was using a really old redmine version, that didn't have any rich text capabilities at the time. Now that I've switch to last redmine version, I'd like to stick to native markdown syntax.

So i want to transform all this html stored content to markdown.

I've used following config, but I'm having an error

Any idea what might be wrong ?

convcfg='[{
  "from_formatting": "html",
  "to_formatting": "common_mark",
  "converters": [
    ["Ws", "http://localhost:9999", { "method": "POST" }]
  ]
}]'
rake reformat:convert to_formatting=common_mark converters_json="$convcfg"  dryrun=1 RAILS_ENV=production
Running with setup:
{:converters_json=>
  "[\n" +
  "  {\n" +
  "    \"from_formatting\": \"html\",\n" +
  "    \"to_formatting\": \"common_mark\",\n" +
  "    \"converters\": [\n" +
  "      [\n" +
  "        \"Ws\",\n" +
  "        \"http://localhost:9999\",\n" +
  "        {\n" +
  "          \"method\": \"POST\"\n" +
  "        }\n" +
  "      ]\n" +
  "    ]\n" +
  "  }\n" +
  "]",
 :to_formatting=>"common_mark",
 :workers=>1,
 :dryrun=>true,
 :from_formatting=>"(based on your Setting.text_formatting: CKEditor)"}
All 1/1 workers started.
Settings
Comment: converting 0/0 non-blank [:content] occurences of 0 total
Document: converting 111/111 non-blank [:description] occurences of 336 total
rake aborted!
No converter found for Document#5
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/converters/configured_converters.rb:14:in `convert'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/convert_redmine.rb:238:in `convert'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/convert_redmine.rb:227:in `block (2 levels) in migrate_spec'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/convert_redmine.rb:226:in `each'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/convert_redmine.rb:226:in `map'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/convert_redmine.rb:226:in `block in migrate_spec'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/convert_redmine.rb:54:in `block in pluck_each'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/convert_redmine.rb:39:in `each'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/convert_redmine.rb:39:in `pluck_each'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/convert_redmine.rb:223:in `migrate_spec'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/convert_redmine.rb:160:in `block in migrate_objects'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/convert_redmine.rb:159:in `each'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/convert_redmine.rb:159:in `migrate_objects'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/convert_redmine.rb:128:in `do_migrate'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/convert_redmine.rb:115:in `block (3 levels) in call'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/context.rb:40:in `with_cached_projects'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/convert_redmine.rb:114:in `block (2 levels) in call'
/srv/redmine/app/models/mailer.rb:634:in `with_deliveries'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/convert_redmine.rb:113:in `block in call'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/convert_redmine.rb:112:in `call'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/convert_redmine.rb:107:in `call'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/invoker.rb:36:in `convert_redmine'
/srv/redmine/plugins/redmine_reformat/lib/redmine_reformat/invoker.rb:24:in `run'
/srv/redmine/plugins/redmine_reformat/lib/tasks/reformat.rake:13:in `block (2 levels) in <top (required)>'
Tasks: TOP => reformat:convert
(See full trace by running task with --trace)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions