From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stig Brautaset Subject: Coloured source code examples in --batch exports? Date: Thu, 13 Jun 2019 16:20:37 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:55643) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbRXK-0004mT-0u for emacs-orgmode@gnu.org; Thu, 13 Jun 2019 11:21:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbRXI-0005lV-U9 for emacs-orgmode@gnu.org; Thu, 13 Jun 2019 11:21:09 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:55989) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hbRXI-0005bS-My for emacs-orgmode@gnu.org; Thu, 13 Jun 2019 11:21:08 -0400 Received: from localhost (82-132-218-229.dab.02.net [82.132.218.229]) (Authenticated sender: stig@brautaset.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 7D69120008 for ; Thu, 13 Jun 2019 15:20:48 +0000 (UTC) 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" To: emacs-orgmode@gnu.org Consider a file =foo.org= with the following content: #+begin_src org :tangle foo.org ,#+begin_src emacs-lisp (defun foo (a b c) "A metasyntactic function that doesn't do much." (interactive) (message "foo")) ,#+end_src #+end_src I can export that to HTML and get a nicely colourized export like so: #+begin_src sh :results output verbatim /Applications/Emacs.app/Contents/MacOS/Emacs --file foo.org --eval '(progn (package-initialize) (org-html-export-to-html nil nil nil t) (kill-emacs))' cat foo.html #+end_src #+RESULTS: :
:
(defun foo (a b c)
:   "A metasyntactic function that doesn't do much."
:   (interactive)
:   (message "foo"))
: 
:
However, I can't run it like that because I'm trying to run it headless on CirleCI, where neither DISPLAY nor TERM environment variables are set. (Yes, I'm trying to automate my blog publishing.) Adding a ~--batch~ flag to the command makes the command run on CircleCI, but I get a less colourful (and less pleasing) result. The markup appears to only use /italic/ and *bold* styles now. #+begin_src sh :results output verbatim /Applications/Emacs.app/Contents/MacOS/Emacs --batch --file foo.org --eval '(progn (package-initialize) (org-html-export-to-html nil nil nil t) (kill-emacs))' cat foo.html #+end_src #+RESULTS: :
:
(defun foo (a b c)
:   "A metasyntactic function that doesn't do much."
:   (interactive)
:   (message "foo"))
: 
:
Is there a way I can get the nicely coloured output while exporting in ~--batch~ mode? Stig PS: In reality I'm using Org's publishing setup, but it was easier to create a minimal example using export than an ECM that involves having to configure ~org-publish-project-alist~...