From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [New exporter] custom emphasis in org-emphasis-alist Date: Sun, 10 Feb 2013 10:45:37 +0100 Message-ID: <87sj54fqny.fsf@gmail.com> References: <87ehgpc8jw.fsf@univie.ac.at> <876220h8ej.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:45559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4TTx-0000Bh-FJ for emacs-orgmode@gnu.org; Sun, 10 Feb 2013 04:45:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U4TTv-0003hh-LC for emacs-orgmode@gnu.org; Sun, 10 Feb 2013 04:45:57 -0500 Received: from mail-we0-x236.google.com ([2a00:1450:400c:c03::236]:63331) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4TTu-0003hT-Mu for emacs-orgmode@gnu.org; Sun, 10 Feb 2013 04:45:55 -0500 Received: by mail-we0-f182.google.com with SMTP id t57so4148491wey.41 for ; Sun, 10 Feb 2013 01:45:53 -0800 (PST) In-Reply-To: <876220h8ej.fsf@gmail.com> (Nicolas Goaziou's message of "Sun, 10 Feb 2013 09:37:08 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Gregor Kappler Cc: emacs-orgmode@gnu.org Completing myself, > On the other hand, you may be able to parse custom markup with the help > of a filter: > > #+begin_src emacs-lisp > (defun my-special-markup (text backend info) > (when (and (org-export-derived-backend-p backend 'html) > (string-match "\\([ ('\"{]\\|^\\)\\(\\([?!#]\\)\\([^ > ,\"']\\|[^ > ,\"'].*?\\(?: > .*?\\)\\{0,1\\}[^ > ,\"']\\)\\3\\)\\([- .,:!?;'\")}\\]\\|$\\)" > text)) > (format (cond ((equal (match-string 3 text) "?") > "%s") > ((equal (match-string 3 text) "#") "") > (t "%s")) > (match-string 4 text)))) > (add-to-list 'org-export-filter-plain-text-functions 'my-special-markup) > #+end_src This solution will not work but in the simplest cases (no special markup allowed within the tags). For additional syntax, a better option would be to define a macro: #+MACRO: excl @@html:@@$1@@html:@@ Then use it within the buffer: A paragraph and {{{excl(some *bold* text within a special container)}}}. This allow for some flexibility. You can even define a babel block and call it within a paragraph for more complicated (i.e. conditional) stuff. Regards, -- Nicolas Goaziou