プロジェクト

全般

プロフィール

Vote #65771

未完了

Add docbook export to wiki

Admin Redmine さんが約2年前に追加. 約2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Wiki_1
対象バージョン:
-
開始日:
2009/09/27
期日:
進捗率:

0%

予定工数:
category_id:
1
version_id:
0
issue_org_id:
3933
author_id:
3315
assigned_to_id:
0
comments:
3
status_id:
1
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

Hi,
i'd love to export docbook straight from the wiki, then i could create a docbook ref file somewhere and include via url some selected wiki pages in my wiki.

Thanks !


journals

Any news on this? Maybe plagin is available?
--------------------------------------------------------------------------------
There is a gem @redcloth-formatters-docbook@ which can do some basic conversion from textile to docbook.
Safe the TODO's which are easy enough to add conversion works quite nice.
So I thought I share this little program and maybe someone can integrate something in Redmine.

<pre>
# Convert textile formatted files to docbook
#

require 'optparse'
require 'fileutils'
require 'rubygems'
require 'RedCloth'
require 'redcloth-formatters-docbook'

revision = "0.9 - 2012-08-29"

# CHANGELOG
# 0.9 initial version

# Program options
@options = {}

optparse = OptionParser.new do|opts|
# Set a banner, displayed at the top
# of the help screen.
opts.banner = "Usage: tex2doc.rb [optionen] datei ..."

# Define the options, and what they do
opts.on( '-v', '--version', 'Print version' ) do
puts "tex2doc " + revision
end

# This displays the help screen, all programs are
# assumed to have this option.
opts.on( '-h', '--help', 'This message' ) do
puts opts
exit
end
end

# Parse the command-line. Remember there are two forms
# of the parse method. The 'parse' method simply parses
# ARGV, while the 'parse!' method parses ARGV and removes
# any options found there, as well as any parameters for
# the options. What's left is the list of files to resize.
optparse.parse!

puts "Tex2Doc Version #{revision}, Help: -h, --help" unless ARGV.size > 0

# TODO replace <pre> by <programlisting>
# TODO search empty table cells ||, fill with a single blank should do
# TODO escape <, >, &

ARGV.each do |file|
textile = File.open(file, 'rb') { |f| f.read }
docbook = RedCloth.new(textile).to_docbook
File.open(file + '.xml', "w") { |f| f.write docbook }
end
</pre>

--------------------------------------------------------------------------------

Admin Redmine さんが約2年前に更新

  • カテゴリWiki_1 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0