org-cv/genfiles.el
2018-05-01 18:14:16 +02:00

34 lines
889 B
EmacsLisp

;; 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)
(defun export-latex (file)
(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)
(org-export-to-file 'altacv outfile)
(shell-command (format "pdflatex %s" outfile))
(copy-file (concat file ".pdf") cwd)
))
(export-latex "altacv.org")
(export-latex "moderncv.org")
(copy-directory workdir cwd)