[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: HOWTO export document to wiki text?
From: |
Christian Egli |
Subject: |
[Orgmode] Re: HOWTO export document to wiki text? |
Date: |
Mon, 19 Jan 2009 17:23:45 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
Uwe Koloska <address@hidden> writes:
> there is this very nice export to text feature and the superb HTML export.
> But
> is it possible to convert org to some rich text notation used in wikis? I
> would like to include some of my documents into a wiki (dokuwiki and
> TWiki/Foswiki).
Below is another quick hack solution: a simple sed script which does a
very basic translation between org-mode and mediawiki.
#!/bin/sed -f
# headlines
s/^\* \+\(.*\)$/== \1 ==/
s/^\*\* \+\(.*\)$/=== \1 ===/
s/^\*\*\* \+\(.*\)$/==== \1 ====/
s/^\*\*\*\* \+\(.*\)$/===== \1 =====/
s/^\*\*\*\*\* \+\(.*\)$/====== \1 ======/
# links
s/\[\[\(.*\)\]\[\(.*\)\]\]/[\1 \2]/
# description lists
s/^- \+\([^:]\+\)::\(.*\)$/; \1:\2/
s/^ \+//
# lists
s/^- \+\(.*\)$/* \1/
s/^ \{2\}- \+\(.*\)$/** \1/
s/^ \{4\}- \+\(.*\)$/*** \1/
s/^[1-9]\+\. \+\(.*\)$/# \1/
s/^ \{2\}[1-9]\+\. \+\(.*\)$/## \1/
s/^ \{4\}[1-9]\+\. \+\(.*\)$/### \1/
# source code
s/^: \+\(.*\)$/ \1/
# emphasis, bold
s/\*\([^*]\+\)\*/'''\1'''/
s/ \/\([^/]\+\)\/ / ''\1'' /
# quotes
s/^#+BEGIN_QUOTE$/<blockquote>/
s/^#+END_QUOTE$/<\/blockquote>/
# comments
s/^#+.*$//
# tables
s/^|[-+]\+|$//
s/^|\([^|]*\)|$/|-\n|\1/
s/^|\([^|]*\)|\([^|]*\)|$/|-\n|\1||\2/
s/^|\([^|]*\)|\([^|]*\)|\([^|]*\)|$/|-\n|\1||\2||\3/
s/^|\([^|]*\)|\([^|]*\)|\([^|]*\)|\([^|]*\)|$/|-\n|\1||\2||\3||\4/
Hope that helps
Christian