2

I am using "emacs 24.4.1; htmlfontify 0.21" and try to htmlfontify a ansi-term buffer. But the style in the generated HTML file does not contain colors. This is how it looks:

span.term-bold-0004   { font-size: 105%;  text-decoration: none; }
span.term-bold-0004 a { font-size: 105%;  text-decoration: underline; }
span.term-bold-0006   { font-size: 105%;  text-decoration: none; }
span.term-bold-0006 a { font-size: 105%;  text-decoration: underline; }
span.term-bold-0003   { font-size: 105%;  text-decoration: none; }
span.term-bold-0003 a { font-size: 105%;  text-decoration: underline; }
span.term-bold-0007   { font-size: 105%;  text-decoration: none; }
span.term-bold-0007 a { font-size: 105%;  text-decoration: underline; }

When I htmlfontify a source file the CSS contains the colors:

span.function-name   { color: #0000ff;  font-family: Lucida Console;  font-stretch: semi-condensed;  font-weight: 500;  font-style: normal;  background: #ffffff;  font-size: 14pt;  text-decoration: none; }

What do I have to do to get the colors from the ansi-term right?

ceving
  • 1,308
  • 1
  • 14
  • 28
  • I have a major conceptual problem understanding what you are trying to do. Ansi-term is a kind of shell. Shells allow customization of ansi sequences which do things like make text bold, or underlined and have a foreground and background color. htmlfontify is for HTML text which isn't the same as a buffer containing shell interaction. – rocky Oct 16 '15 at 22:45
  • 1
    @rocky `htmlfontify` is not _for_ HTML, it generates HTML. I would like to generate HTML from a colored `ansi-term` buffer in order to show the colors in a blog. – ceving Oct 19 '15 at 10:45
  • this is still too vague and there are misconceptions about what's supposed to happen. I suspect that's why no one is commenting on or answering your question. When I run htmlfontify on an ansi-term there are some CSS definitions, specifically for span.default and span.term. "span.term-bold a" never has color unless but you can customize that if you want to include color using M-x customize-variable hfy-src-doc-link-style. – rocky Oct 19 '15 at 12:34
  • 1
    @rocky The colors are in the buffer, because it is either red or blue or magenta. Is it really necessary to customize this once again just for the HTML export? – ceving Oct 20 '15 at 07:47
  • To me the question is clear and useful. The OP has an `ansi-term` buffer in `emacs` that shows color. They want to save that into a file readable by some other program. HTML is a natural export format for portable text with color information. The OP is rightfully surprised that doing that works for source code and not for `ansi-term` buffers. – Stéphane Gourichon May 15 '20 at 09:50

0 Answers0