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.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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.d/"
  8. (file-name-directory load-file-name)))
  9. (setq readme-src (concat emacs-dir "README.org"))
  10. (require 'use-package)
  11. (require 's)
  12. (org-babel-tangle-file readme-src)
  13. (defun export-target (target)
  14. (with-current-buffer (find-file-noselect target)
  15. (let ((org-export-headline-levels 10))
  16. (org-html-export-to-html))))
  17. (setq org-html-postamble nil)
  18. (setq org-html-htmlize-output-type 'css)
  19. (setq org-confirm-babel-evaluate nil)
  20. (defun add-faces-css (exporter)
  21. "Insert custom inline css to automatically set the
  22. background of code to whatever theme I'm using's background"
  23. (setq
  24. org-html-head-extra
  25. (concat
  26. org-html-head-extra
  27. (format "<style type=\"text/css\">\n%s</style>\n"
  28. (with-temp-buffer
  29. (insert-file-contents
  30. (concat (file-name-directory load-file-name) "faces.css"))
  31. (buffer-string))))))
  32. (add-hook 'org-export-before-processing-hook 'add-faces-css)
  33. (remove-hook 'org-export-before-processing-hook 'wolfe:org-inline-css-hook)
  34. (message (export-target readme-src))
  35. (cd "../../")
  36. (message (export-target "TODO.org"))