My personal dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

generate-html.el 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. (load-file "install.el")
  2. (defmacro do-nothing (name)
  3. `(defun ,name (&rest args) nil))
  4. (do-nothing wolfe:add-to-org-agenda-files)
  5. (do-nothing wolfe:disable-linum-mode)
  6. (setq emacs-dir
  7. (expand-file-name "../emacs/.emacs.d/"
  8. (file-name-directory load-file-name)))
  9. (setq readme-src (concat emacs-dir "README.org"))
  10. (org-babel-tangle-file readme-src)
  11. (defun export-target (target)
  12. (with-current-buffer (find-file-noselect target)
  13. (let ((org-export-headline-levels 10))
  14. (org-html-export-to-html))))
  15. (setq org-html-postamble nil)
  16. (setq org-html-htmlize-output-type 'css)
  17. (setq org-confirm-babel-evaluate nil)
  18. (defun add-faces-css (exporter)
  19. "Insert custom inline css to automatically set the
  20. background of code to whatever theme I'm using's background"
  21. (setq
  22. org-html-head-extra
  23. (concat
  24. org-html-head-extra
  25. (format "<style type=\"text/css\">\n%s</style>\n"
  26. (with-temp-buffer
  27. (insert-file-contents
  28. (concat (file-name-directory load-file-name) "faces.css"))
  29. (buffer-string))))))
  30. (add-hook 'org-export-before-processing-hook 'add-faces-css)
  31. (remove-hook 'org-export-before-processing-hook 'wolfe:org-inline-css-hook)
  32. (message (export-target readme-src))
  33. (cd "../")
  34. (message (export-target "TODO.org"))