From mboxrd@z Thu Jan 1 00:00:00 1970 From: tomas@tuxteam.de Subject: Re: [PATCH] org-export-generic, "text markup" -- and a request Date: Fri, 23 Jul 2010 13:19:31 +0200 Message-ID: <20100723111931.GA29930@tomas> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0561220802==" Return-path: Received: from [140.186.70.92] (port=57837 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OcGEK-0006Ip-US for emacs-orgmode@gnu.org; Fri, 23 Jul 2010 07:15:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OcGEJ-0001Nt-CE for emacs-orgmode@gnu.org; Fri, 23 Jul 2010 07:15:52 -0400 Received: from alextrapp1.equinoxe.de ([217.22.192.104]:37818 helo=www.elogos.de) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OcGEJ-0001NW-02 for emacs-orgmode@gnu.org; Fri, 23 Jul 2010 07:15:51 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --===============0561220802== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XOIedfhf+7KOe/yw" Content-Disposition: inline --XOIedfhf+7KOe/yw Content-Type: multipart/mixed; boundary="huq684BweRXVnRxX" Content-Disposition: inline --huq684BweRXVnRxX Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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**, =3Dgrumble=3D would become ''grumble'' and +mumble+ would become mumble. 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__") ("=3D" . "''%s''") ("~" . "''%s''") ("+" . "%s")))) 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 ). 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=E1s --huq684BweRXVnRxX Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="org-export-markup.patch" --huq684BweRXVnRxX-- --XOIedfhf+7KOe/yw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFMSXrDBcgs9XrR2kYRAlBuAJ91su7oJi/pXExd4FSK22eSO4lIRgCffrJi HXaM0BK1gTrGW5fak8pyEtA= =W4IZ -----END PGP SIGNATURE----- --XOIedfhf+7KOe/yw-- --===============0561220802== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============0561220802==--