org-cv/genfiles.el

35 lines
1,004 B
EmacsLisp
Raw Normal View History

2018-04-19 01:07:52 +00:00
;; remember the current directory, find-file changes it
(defvar cwd default-directory)
(defvar workdir "/tmp/org-cv-exports/")
(find-file "/tmp/install-org.el")
(eval-buffer)
(add-to-list 'load-path cwd)
(require 'ox-moderncv)
(require 'ox-altacv)
(let ((readme (concat cwd "readme.org")))
(find-file readme)
(make-directory workdir t)
(cd workdir)
(org-babel-tangle))
(copy-file (concat cwd "doc/smile.png") workdir)
2018-05-01 16:35:48 +00:00
(defun export-latex (backend file)
2018-04-19 01:07:52 +00:00
(let ((workfile (concat workdir file))
(outfile (concat workdir file ".tex")))
(message (format "%s exists: %s" workfile (file-exists-p workfile)))
(find-file workfile)
(org-mode)
2018-05-01 16:35:48 +00:00
(org-export-to-file backend outfile)
(shell-command (format "pdflatex %s" outfile) "*Messages*" "*Messages*")
(copy-file (concat file ".pdf") (concat cwd "/doc/static/" (concat file ".pdf")))
2018-04-19 01:07:52 +00:00
))
(make-directory (concat cwd "/doc/static/") t)
2018-05-01 16:35:48 +00:00
(export-latex 'altacv "altacv.org")
(export-latex 'moderncv "moderncv.org")