all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: meditans@gmail.com
Cc: emacs-orgmode@gnu.org
Subject: Re: Inline code syntax highlighting
Date: Mon, 22 Feb 2016 09:32:49 +0100	[thread overview]
Message-ID: <871t852lhq.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <94eb2c071b6cc4b5b7052c4921a6@google.com> (meditans@gmail.com's message of "Sun, 21 Feb 2016 15:11:34 +0000")

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

      reply	other threads:[~2016-02-22  8:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-21 15:11 Inline code syntax highlighting meditans
2016-02-22  8:32 ` Nicolas Goaziou [this message]

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

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

  git send-email \
    --in-reply-to=871t852lhq.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=meditans@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.