基本介绍
Redmine Reformat 通过一套rake任务,实现Redmine富文本字段文本格式的灵活转换和批量格式处理。例如,实现 Redmine UEditor «百度»富文本编辑器 的html和markdown、textile等格式之间相互转换。
功能介绍
- 格式转换可以基于Redmine的每项目、每对象以及每字段。
- 不同的数据集可以使用不同的转换,这在你的Redmine同时采用了多种不同语法习惯时非常有用。
- 支持自定义字段、issue历史记录,甚至支持自定义字段的历史记录
- 支持并行转换,在使用外部工具时尤为方便,例如(pandoc, web services).
- 并行转换支持 Transaction safety
- 目前支持的转换方式包含:
- TextileToMarkdown - a Pandoc-based Textile to Markdown converter. Works on markup level. Battle-tested on ** quarter a million strings. See below for details.
- MarkdownToCommonmark - converts main specifics in old Redmine markdown format (Redcarpet) to CommonMark/GFM.
- RedmineFormatter - produces HTML using Redmine’s internal formatter. Useful when chaining with external converters. See below for details.
- LinkRewriter - useful for refactoring Redmine project structure (renaming, merging). See below for details.
- Ws - calls an external web service, providing input in the POST body and expecting converted output in the response body.
- Feel free to submit more
- Conversions can be chained - e.g. convert Atlassian Wiki Markup (roughly similar to Textile) to HTML and then HTML to Markdown using Turndown.
- Newlines are normalized in a configurable way to make the result deterministic and most matching the converted texts.
安装指导
- 解压附件压缩包至redmine插件目录
- bundle install
- 重新启动redmine
- 安装必要的依赖
举例 textile 转换成 html
bundle exec rake reformat:convert to_formatting=html
/Users/user/Documents/svndata/redmine/app/helpers/application_helper.rb:1001: warning: already initialized constant ApplicationHelper::LINKS_RE
/Users/user/Documents/svndata/redmine/app/helpers/application_helper.rb:1001: warning: previous definition of LINKS_RE was here
Running with setup:
{:converters_json=>"(use default converters)",
:to_formatting=>"html",
:workers=>1,
:dryrun=>false}
All 1/1 workers started.
Settings
Comment: converting 0/0 non-blank [:comments] occurences of 0 total
Document: converting 0/0 non-blank [:description] occurences of 0 total
Issue: converting 4/4 non-blank [:description] occurences of 5 total
Issue: 4 / 4
JournalDetail[Issue.description]: converting 7/7 non-blank [:value, :old_value] occurences of 7 total
JournalDetail[Issue.description]: 7 / 7
Journal: converting 5/5 non-blank [:notes] occurences of 19 total
Journal: 5 / 5
Message: converting 0/0 non-blank [:content] occurences of 0 total
News: converting 0/0 non-blank [:description] occurences of 0 total
Project: converting 1/1 non-blank [:description] occurences of 4 total
Project: 1 / 1
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.
如果使用 TextileToMarkdown 转换器,请 安装pandoc 。 其它格式转换不需要额外依赖
版本更新
0.8.1 (2022-11-05)
兼容性: Redmine 4.0.*, 4.1.*, 4.2.*, 5.0.*
- Added Redmine 5 compatibility. Dropped Redmine 3.x support.
文件
0.7.0 (2021-06-26)
兼容性: Redmine 3.4.*, 4.0.*, 4.1.*, 4.2.*
文件
0.6.1 (2020-06-03)
兼容性: Redmine 3.4.*, 4.0.*, 4.1.*, 4.2.*
Added PUT method to both provided microservicee and WS converter. PUT is now the default when invoking external services - preferring idempotent requests. Improved microservice error handling.
文件
0.5.0 (2020-05-01)
兼容性: Redmine 3.4.*, 4.0.*, 4.1.*, 4.2.*
引入了LinkRewriter转换器用于更新wiki的链接引用。对于项目和wiki重建非常有用,例如重命名项目标识符、合并项目等场景。
文件
评论
添加评论