From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Klein Subject: Re: PATCH: programming language indicators in HTML export Date: Mon, 14 Mar 2016 20:25:36 +0100 Message-ID: <20160314202536.6548abed@lt70.fritz.box> References: <20160314151605.214621e9@pckr150.mpip-mainz.mpg.de> <87shztnj84.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60745) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afY7X-0004eJ-3Y for emacs-orgmode@gnu.org; Mon, 14 Mar 2016 15:25:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afY7T-0005ZN-L2 for emacs-orgmode@gnu.org; Mon, 14 Mar 2016 15:25:38 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:52851) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afY7T-0005Yg-B5 for emacs-orgmode@gnu.org; Mon, 14 Mar 2016 15:25:35 -0400 Received: from lt70.fritz.box ([95.88.152.225]) by mrelayeu.kundenserver.de (mreue104) with ESMTPSA (Nemesis) id 0MOzJP-1ai0xm2SVr-006L35 for ; Mon, 14 Mar 2016 20:25:33 +0100 In-Reply-To: <87shztnj84.fsf@gmx.us> 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: emacs-orgmode@gnu.org Hi Rasmus, Rasmus wrote: > Hi Robert, > > Thanks for the patch. > > Robert Klein writes: > > > any thoughts about this? > > Remind me, would this only show up when hovering above the block with > the mouse when using this setup? Yes. > > 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 Robert > > Thanks, > Rasmus >