Alex Rivera | Logout

How to get htmlize.el work for project publishing in Emacs org-mode?

Asked 2010-12-03T03:33:24.507
10

I want to publish a project in Emacs org-mode, which contains several .html files. There are some python code examples in them that I wanna highlight. But htmlize.el won't do that for me. Strangely, when exporting single .html file (using C-c C-e h), the code examples are highlighted . So how could I get htmlize.el work for project publishing?

Edit
Report

1 Answer

3

You have to put your code inside #+BEGIN_SRC and #+END_SRC . For example

* My python code
#+BEGIN_SRC python
def foo():
  if bar == 1:
     bar = 2
  else: 
     bar = 3
#+END_SRC
answered 2010-12-03T09:20:15.180

Your Answer