From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Inline code syntax highlighting Date: Mon, 22 Feb 2016 09:32:49 +0100 Message-ID: <871t852lhq.fsf@nicolasgoaziou.fr> References: <94eb2c071b6cc4b5b7052c4921a6@google.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXltI-0005yI-1D for emacs-orgmode@gnu.org; Mon, 22 Feb 2016 03:30:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXltG-00055a-O0 for emacs-orgmode@gnu.org; Mon, 22 Feb 2016 03:30:47 -0500 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:47439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXltG-00055F-HW for emacs-orgmode@gnu.org; Mon, 22 Feb 2016 03:30:46 -0500 In-Reply-To: <94eb2c071b6cc4b5b7052c4921a6@google.com> (meditans@gmail.com's message of "Sun, 21 Feb 2016 15:11:34 +0000") 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: meditans@gmail.com Cc: emacs-orgmode@gnu.org Hello, meditans@gmail.com writes: > In conclusion, do you have any tips on how to get syntax highlighting > for ~...~ blocks? You can use `org-export-filter-parse-tree' and replace all occurrences of (code ...) into (inline-src-block ...) using a combination of `org-element-map', and `org-element-set-element'. Another option is indeed to create a new export back-end that replaces code transcoder with a custom function, probably something ultimately calling `org-html-inline-src-block', e.g., (defun my-code-to-haskell (code contents info) (let ((haskell `(inline-src-block (:language "haskell" :value ,(org-element-property :value code))))) (org-html-inline-src-block haskell nil info))) (org-export-define-derived-backend 'haskell-html 'html :translate-alist '((code . my-code-to-haskell))) Regards, -- Nicolas Goaziou