I've been maintaining my personal webpage by using the htmlize feature with org-mode. Basically, I have a directory ~/webpage with many subdirectories containing .org files. I then run a script that finds each .org file under ~/webpage and runs htmlize on the file. The script is:

(add-to-list 'load-path "/home/brian/.emacs.d/elpa/htmlize-20130207.1202/")
(require 'htmlize)

(defun htmlize-files-in-dir (dir)
  (htmlize-many-files (directory-files dir t ".org$")))

My issue is that in order for each page to conform to my emacs theme, the script has to open a new instance of emacs for each file. After some googling I found that there exists a function org-export-htmlize-generate-css that would generate a global css style file for my theme. Obtaining such a css file would allow my script to run a lot faster (and would prevent the annoying emacs windows from flashing every time I run the script). However, my version of emacs (24.3.1) does not have the function org-export-htmlize-generate-css. Does anyone have an idea how I could obtain this function?

  • Install the org-ehtml package. I have the org-export-htmlize-generate-css command, and I think it comes from that package. However, I do not know whether this will solve your problem and answer the question in the title. If it does solve your problem, I can post it as an answer to be more visible for future readers, but others might have better advice for your issue. – elethan Dec 16 '15 at 18:49
  • I just installed org-ehtml and I still don't have org-export-htmlize-generate-css – Brian Fitzpatrick Dec 16 '15 at 18:52
  • Sorry, as you have realized, I was mistaken. It looks like this function is in a file called ox-html.el which I think is actually bundled with my version of org-mode. I am using the "stock" version of org-mode that comes with emacs, but I am on emacs 24.5, so I am sure that is why I have it and you don't. You could potentially install a newer version of org-mode by following these instructions: orgmode.org/manual/Installation.html#Installation and that might get you the function you are looking for, but I wouldn't swear to it. – elethan Dec 16 '15 at 19:00
  • I'm running org version 8.3.2. Which do you have? – Brian Fitzpatrick Dec 16 '15 at 19:08
  • Ha, OK, I am running 8.2.10, so I guess getting a newer version might not do the trick...If it helps at all, I found the ox-html.el file in /usr/local/share/emacs/24.5(3 in your case)/lisp/org – elethan Dec 16 '15 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.