emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christian Egli <christian.egli@sbszh.ch>
To: emacs-orgmode@gnu.org
Subject: Re: HOWTO export document to wiki text?
Date: Mon, 19 Jan 2009 17:23:45 +0100	[thread overview]
Message-ID: <j2y6x7xo1a.fsf@sbszh.ch> (raw)
In-Reply-To: <200901172203.31914.uwe@koloro.de>

[-- Attachment #1: Type: text/plain, Size: 415 bytes --]

Uwe Koloska <uwe@koloro.de> 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org2mediawiki --]
[-- Type: text/x-sh, Size: 912 bytes --]

#!/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/

[-- Attachment #3: Type: text/plain, Size: 28 bytes --]

 
Hope that helps
Christian

[-- Attachment #4: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  parent reply	other threads:[~2009-01-19 16:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-17 21:03 Uwe Koloska
2009-01-18 18:26 ` Matthew Lundin
2009-01-19  7:42   ` Ian Barton
2009-01-19 15:03     ` Matthew Lundin
2009-01-19 15:27       ` Sebastian Rose
2009-01-19 19:30       ` Ian Barton
2009-01-18 18:27 ` Eric Schulte
2009-01-19 16:23 ` Christian Egli [this message]
2009-01-19  7:05 Rustom Mody
2009-01-19 15:32 ` Carsten Dominik
     [not found] <E1LOku5-0004vu-DT@box188.bluehost.com>
2009-01-19 15:40 ` Robert Goldman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=j2y6x7xo1a.fsf@sbszh.ch \
    --to=christian.egli@sbszh.ch \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: HOWTO export document to wiki text?' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).