[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] PATCH: programming language indicators in HTML export

From: Robert Klein
Subject: Re: [O] PATCH: programming language indicators in HTML export
Date: Mon, 14 Mar 2016 20:25:36 +0100

Hi Rasmus,

Rasmus <address@hidden> wrote:

> Hi Robert,
> Thanks for the patch.
> Robert Klein <address@hidden> writes:
> > any thoughts about this?
> Remind me, would this only show up when hovering above the block with
> the mouse when using this setup?


> The patch would make the default html header a bit longer, which may
> or may not be an issue.  Perhaps more importantly, it also does not
> deal with new languages.  Maybe it would be possible to add a bit of
> JS that would look up the language based on the class of the block in
> question?
> E.g. the block
>      #+BEGIN_SRC rsgrs
>      #+END_SRC
> would have class "src-rsgrs".

This happens already, but the JS would also have to create the
corresponding CSS code (that's what I hardcoded in the patch).

However you'd still need a mapping from src block identifier to
pleasantly readable text, e.g. js -> "Javascript", sql -> "SQL",
emacs-lisp -> "Emacs Lisp", ps -> "PostScript" etc.  When you have all
those it's not that much different from static CSS anymore...

There's no perfect solution, unfortunately, but src blocks have a lot
of limits for each language:
- is there an Emacs mode for editing?
- is there org-babel code for executing?
- is the language supported by the LaTeX listings package?
- or by the pygments library (for the LaTeX minted package)?

Anyway, my patch is basically for those who don't roll their own CSS to
have things mostly working out of the box. 

Best regards

> Thanks,
> Rasmus

reply via email to

[Prev in Thread] Current Thread [Next in Thread]