unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Rendering buffer to HTML from command line script
@ 2016-02-20 17:20 Stéphane Travostino
  2016-08-05 19:10 ` Thien-Thi Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: Stéphane Travostino @ 2016-02-20 17:20 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I'm trying to create a command line Emacs script that, by specifying a file
and a theme, renders the file to HTML using the theme colours.
For example:

emacs --script render-theme.el some-theme.el test.c > test.c.html

I'm using htmlfontify to render the buffer to HTML, and works great when
called from X, but I get a black and white output when called from the
terminal _with most themes_.

The problem is that themes specify the minimum terminal requirements to
enable a specific face, i.e. minimum amount of colours supported by the
terminal, window-system, etc. (
http://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Faces.html
)

For example: (defface 'foo (((min-colors 88) (class color) etc.))

If I modify the theme to disable these terminal requirements options,
htmlfontify renders correctly.

That's probably a long shot, but is it possible to either force a
particular terminal configuration from command line, or force-enable all
theme faces?

For example, (display-color-cells) in X returns 16777216, while I get 0
when executed from the script; that's probably part of the problem.

Why am I doing this: I want to create an Emacs theme browser web
application which creates a preview of any theme against a few different
file formats, and I want an headless Emacs to create the HTML preview.

Thanks.
Stephane.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-05 19:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.5246.1456006059.843.help-gnu-emacs@gnu.org>
2016-02-24 20:41 ` Rendering buffer to HTML from command line script Gene
2016-02-20 17:20 Stéphane Travostino
2016-08-05 19:10 ` Thien-Thi Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).