项目

一般

简介

安装百度redmine_ueditor后如何兼容textile和markdown格式?

0

redmineplugins.cn Admin
20 天 之前增加

用户经常会遇到安装redmine_ueditor 插件后无法兼容之前录入的textile或markdown文本问题。一个简便的方法是可以利用redmine_reformat 插件实现快速的格式转换,具体方法是:

  • 首先安装redmine_reformat插件
  • 以markdown转换html为例,设置环境变量
    convcfg='[{
      "from_formatting": "markdown",
      "to_formatting": "html",
      "converters": "RedmineFormatter" 
    }]'
    
  • 将环境变量导入命令行
    bundle exec rake reformat:convert to_formatting=html converters_json="$convcfg" 
    
  • 转换过程,正常输出如下
    Running with setup:
    {:converters_json=>
      "[\n" +
      "  {\n" +
      "    \"from_formatting\": \"markdown\",\n" +
      "    \"to_formatting\": \"html\",\n" +
      "    \"converters\": \"RedmineFormatter\"\n" +
      "  }\n" +
      "]",
     :to_formatting=>"html",
     :workers=>1,
     :dryrun=>false}
    All 1/1 workers started.
    Settings
    Comment: converting 0/0 non-blank [:content] occurences of 0 total
    Document: converting 0/0 non-blank [:description] occurences of 0 total
    Issue: converting 0/0 non-blank [:description] occurences of 2 total
    JournalDetail[Issue.description]: converting 0/0 non-blank [:value, :old_value] occurences of 0 total
    Journal: converting 0/0 non-blank [:notes] occurences of 2 total
    Message: converting 0/0 non-blank [:content] occurences of 0 total
    News: converting 0/0 non-blank [:description] occurences of 0 total
    Project: converting 0/0 non-blank [:description] occurences of 1 total
    WikiContent: converting 0/0 non-blank [:text] occurences of 0 total
    Wiki versions: converting 0/0 historic content revisions
    1/1 workers finished successfuly.
    1/1 workers confirmed completion.
    Progress monitoring finished.