Re: [O] HTML Syntax Highlighting Questions
On Sun, May 29, 2011 at 8:50 PM, Avdi Grimm a...@avdi.org wrote: How do I control syntax highlighting in HTML export? Specifically, how can I: A. Disable syntax highlighting entirely B. Switch from inline colors to semantic tagging that I can style with a stylesheet? I could swear that I've seen instructions about this somewhere in the past. Aha! I revisited this question, and I found the relevant setting: org-export-htmlize-output-type From the docs: Output type to be used by htmlize when formatting code snippets. Choices are `css', to export the CSS selectors only, or `inline-css', to export the CSS attribute values inline in the HTML. We use as default `inline-css', in order to make the resulting HTML self-containing. However, this will fail when using Emacs in batch mode for export, because then no rich font definitions are in place. It will also not be good if people with different Emacs setup contribute HTML files to a website, because the fonts will represent the individual setups. In these cases, it is much better to let Org/Htmlize assign classes only, and to use a style file to define the look of these classes. To get a start for your css file, start Emacs session and make sure that all the faces you are interested in are defined, for example by loading files in all modes you want. Then, use the command M-x org-export-htmlize-generate-css to extract class definitions. -- Avdi Grimm http://avdi.org
[O] HTML Syntax Highlighting Questions
I feel like this is a stupid question, but I'm having trouble finding the info I need. How do I control syntax highlighting in HTML export? Specifically, how can I: A. Disable syntax highlighting entirely B. Switch from inline colors to semantic tagging that I can style with a stylesheet? I could swear that I've seen instructions about this somewhere in the past. Bonus question: why would HTML syntax highlighting come out monochrome (as seen here: http://avdi.org/devblog/wp-content/uploads/2011/05/html.png) when the export is done in batch mode from the command line? And, more importantly, how can I fix it to generate full-color highlighting in batch mode? Thanks, -- Avdi Grimm http://avdi.org
Re: [O] HTML Syntax Highlighting Questions
Avdi Grimm a...@avdi.org writes: I feel like this is a stupid question, but I'm having trouble finding the info I need. How do I control syntax highlighting in HTML export? Specifically, how can I: A. Disable syntax highlighting entirely Remove htmlize from your load path. B. Switch from inline colors to semantic tagging that I can style with a stylesheet? I could swear that I've seen instructions about this somewhere in the past. Slightly off-topic. As part of my odt exporter work, I would very much want to have the exported code snippets marked up, well, differently. i.e., I need flexibility in *choosing* what the tag ought to be - what you call as semantic tagging. To illustrate, what gets emitted as span.../span in html export should in it's odt equivalent be emitted as text:span.../text:span. I have emphasized it elsewhere, I think Org should use htmlfontify and not htmlize. The principle is that something that is right within the core should be given preference to that which is 3 rd party. Furthermore, htmlfontify can generate htmlized source code that is cross-referenced based on a etags database. If you browse to http://rtfm.etla.org/emacs/htmlfontify/src/htmlfontify.el.html and click on some of the links within the body text you would see that it jumps to their corresponding definitions. Bonus question: why would HTML syntax highlighting come out monochrome (as seen here: http://avdi.org/devblog/wp-content/uploads/2011/05/html.png) when the export is done in batch mode from the command line? And, more importantly, how can I fix it to generate full-color highlighting in batch mode? Let me guess - It is either htmlize not being in your load path during the batch run or font lock being not being explicity turned on during the batch run or font-locking simply not making sense during batch mode. Ultimately htmlize or for that matter htmlfontify seem to depend on the fontification done by the fontification engine. Jambunathan K. --
Re: [O] HTML Syntax Highlighting Questions
On Sun, May 29, 2011 at 9:32 PM, Jambunathan K kjambunat...@gmail.com wrote: Let me guess - It is either htmlize not being in your load path during the batch run or font lock being not being explicity turned on during the batch run or font-locking simply not making sense during batch mode. Ultimately htmlize or for that matter htmlfontify seem to depend on the fontification done by the fontification engine. Hm. Bonus question, then: source code highlighting via Pygments works great with LaTeX export and the minted package. How hard would it be to use Pygments instead of htmlize/htmlfontify for HTML-exported syntax highlighting? ...and who do I need to buy beer for to make this happen, since I don't have time to do it myself? -- Avdi Grimm http://avdi.org
Re: [O] HTML Syntax Highlighting Questions
Avdi Grimm a...@avdi.org writes: On Sun, May 29, 2011 at 9:32 PM, Jambunathan K kjambunat...@gmail.com wrote: Let me guess - It is either htmlize not being in your load path during the batch run or font lock being not being explicity turned on during the batch run or font-locking simply not making sense during batch mode. Ultimately htmlize or for that matter htmlfontify seem to depend on the fontification done by the fontification engine. Hm. Bonus question, then: source code highlighting via Pygments works great with LaTeX export and the minted package. How hard would it be to use Pygments instead of htmlize/htmlfontify for HTML-exported syntax highlighting? ...and who do I need to buy beer for to make this happen, since I don't have time to do it myself? May be you could buy yourself a beer. AFAICS, htmlize generates the css based on face attributes. I am sure you could improve the results by customizing your face definitions - font-lock-keyword-face, font-lock-comment-face etc etc. As someone who is authoring a book you requirements could be stringent. May be you use latex for producing book digitally and html for getting the word out and striving to have similar visual effects on both the mediums. Jambunathan K.
Re: [O] HTML Syntax Highlighting Questions
On Mon, May 30, 2011 at 7:55 AM, Avdi Grimm a...@avdi.org wrote: On Sun, May 29, 2011 at 9:32 PM, Jambunathan K kjambunat...@gmail.com wrote: Let me guess - It is either htmlize not being in your load path during the batch run or font lock being not being explicity turned on during the batch run or font-locking simply not making sense during batch mode. Ultimately htmlize or for that matter htmlfontify seem to depend on the fontification done by the fontification engine. Hm. Bonus question, then: source code highlighting via Pygments works great with LaTeX export and the minted package. How hard would it be to use Pygments instead of htmlize/htmlfontify for HTML-exported syntax highlighting? I've some hackish code, which I use to publish my blog. It essentially, looks at all the code blocks in the html output and replaces them with Pygments output for them. The code is here [1] HTH, Puneeth [1] https://github.com/punchagan/org-hyde/blob/master/org-hyde.el#L109