emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tomas@tuxteam.de
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] org-export-generic, "text markup" -- and a request
Date: Fri, 23 Jul 2010 13:19:31 +0200	[thread overview]
Message-ID: <20100723111931.GA29930@tomas> (raw)


[-- Attachment #1.1.1: Type: text/plain, Size: 2618 bytes --]

Hi,

I tried contacting the author of org-export-generic, but don't know
whether I succeeded. Since this little patch might be useful, here it
is.

I'm in the enviable situation of transforming some docs (which I've
written in org) to mediawiki (why some people enjoy using their browser
as a doc editor escapes me, but that's for another day :)

For this, I'll have to transform the "text markup" (as I'd call that)
(what org calls "emphasis"), i.e. *foo* would become **foo**, =grumble=
would become ''grumble'' and +mumble+ would become <del>mumble</del>.

You get the idea.

I've come up with a little patch which "works for me". If that seems
useful for you, please accept it; I'd be willing to beat it into shape
if you give me some advice wrt which shape is desirable :-)

Some notes:

The "translation mapping" (org markup -> target markup) lives in the
org-generic-alist under the symbol :markup, like so (this would be for
doku-wiki):

   (org-set-generic-type
      "doku-wiki"
      '(:key-binding   ?K
  [... many lines elided ...]
	:markup (("*" . "**%s**")
                ("/" . "//%s//")
                ("_" . "__%s__")
                ("=" . "''%s''")
                ("~" . "''%s''")
                ("+" . "<del>%s</del>"))))

that is, an alist mapping the (org) markup char to a (target) format
string.

I generated the patch with the -b option. Because I wrapped a
considerable chunk of code with unwind-protect, the white space noise
obscures the patch. As I don't think the patch is final, I preferred to
keep it (human) readable.

The working is fairly straightforward: it tacks the function
org-export-generic-process-markup onto the org-export-preprocess-hook
for the whole duration off org-export-generic (the unwind-protect is
there to take this function off the hook when finished). This
org-e-g-process-markup then makes a pass through the buffer (with
org-emph-re), doing its substitutions. Some fiddling was necessary since
org-emph-re matches (possibly) a bit more than strictly the marked-up
span (I think it would have been better to use zero-width assertions for
the prefix and suffix part of org-emph-re).

Patch attached.

Now the request: I tried (several times) subscribing to this list -- but
didn't succeed (I used -- or rather tried to use -- the web interface at
<http://lists.gnu.org/mailman/listinfo/emacs-orgmode>). So please keep
me in Cc, at least as long as I wrangle with the subscriptions.

If anyone has a hint as to what I could try to subscribe, I'd be glad.

Thanks again, and regards
-- tomás

[-- Attachment #1.1.2: org-export-markup.patch --]
[-- Type: text/x-diff, Size: 0 bytes --]



[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

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

             reply	other threads:[~2010-07-23 11:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-23 11:19 tomas [this message]
2010-07-24  6:39 ` Re: [PATCH] org-export-generic, "text markup" -- and a request Daniel Bausch
2010-07-24  8:23   ` tomas
2010-07-24 11:49     ` David Maus
2010-07-24 14:07       ` tomas
2010-07-25 14:47         ` David Maus
2010-07-25 16:35           ` tomas
2010-07-26 14:41             ` [PATCH] org-export-generic, &quot; text markup&quot; " Robert Goldman
2010-07-31  8:29               ` Bastien
2010-08-02  3:02                 ` Robert Goldman
2010-08-02 13:54 ` Orgmode[PATCH] org-export-generic, "text markup" " Wes Hardaker
2010-08-02 17:29   ` tomas
2010-08-13 20:35   ` Carsten Dominik
2010-08-19  3:04     ` Robert Goldman
2010-08-20 14:09       ` Carsten Dominik
2010-08-20 17:05         ` Robert Goldman
2010-08-21  3:25           ` Carsten Dominik
2010-08-23 14:16             ` Wes Hardaker
2010-08-23 14:24               ` Robert Goldman
2010-08-23 14:15           ` Wes Hardaker

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=20100723111931.GA29930@tomas \
    --to=tomas@tuxteam.de \
    --cc=emacs-orgmode@gnu.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public 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).