org-cv/genfiles.el

51 lines
1.7 KiB
EmacsLisp
Raw Normal View History

2023-10-21 21:16:36 +00:00
(defvar cv-cwd default-directory
"remember the current directory, find-file changes it")
2023-10-21 23:53:54 +00:00
(defvar cv-workdir (expand-file-name "org-cv-exports/"))
2023-10-21 21:53:01 +00:00
(toggle-debug-on-error)
2023-10-21 21:16:36 +00:00
(with-current-buffer (find-file-noselect "/tmp/install-org.el")
2023-10-21 21:32:13 +00:00
(eval-buffer))
2018-04-19 01:07:52 +00:00
2023-10-21 21:29:43 +00:00
(use-package ox-hugo
:ensure t
:pin melpa
:after ox)
2018-04-19 01:07:52 +00:00
2023-10-21 21:29:43 +00:00
(use-package ox-moderncv
:load-path cv-cwd
2023-10-21 21:53:01 +00:00
:ensure dash
2023-10-21 21:29:43 +00:00
:init
(require 'ox-altacv)
2023-10-21 21:32:13 +00:00
(require 'ox-hugocv)
2023-10-21 23:21:23 +00:00
(require 'ox-awesomecv)
(require 'ox-awesomecv2))
2023-10-21 21:29:43 +00:00
(defun export-latex (backend file)
(let ((workfile (concat cv-workdir file))
(outfile (concat cv-workdir file ".tex"))
(pdffile (concat cv-workdir file ".pdf")))
(message (format "%s exists: %s" workfile (file-exists-p workfile)))
(with-current-buffer
(find-file-noselect workfile)
(org-mode)
2023-10-21 21:53:01 +00:00
(message "back %S, out %S" backend outfile)
2023-10-21 21:29:43 +00:00
(org-export-to-file backend outfile)
2023-10-21 21:53:01 +00:00
(message (format "%s exists: %s" outfile (file-exists-p outfile)))
(shell-command (format "xelatex --output-directory=%s %s" cv-workdir outfile) "*Messages*" "*Messages*")
(message (format "%s exists: %s" pdffile (file-exists-p pdffile)))
2023-10-21 21:29:43 +00:00
(copy-file pdffile (concat cv-cwd "/doc/static/" (concat file ".pdf")) t))))
2023-10-21 21:16:36 +00:00
(let ((readme (concat cv-cwd "readme.org")))
(make-directory cv-workdir t)
(with-current-buffer
(find-file-noselect readme)
2023-10-21 21:32:13 +00:00
(cd cv-workdir)
2023-10-21 21:16:36 +00:00
(org-babel-tangle)))
2018-04-19 01:07:52 +00:00
2023-10-21 21:16:36 +00:00
(copy-file (concat cv-cwd "doc/smile.png") cv-workdir t)
2023-10-21 21:32:13 +00:00
(make-directory (concat cv-cwd "/doc/static/") t)
2023-10-21 21:53:01 +00:00
(message "alta %s" (featurep 'ox-altacv))
(export-latex 'altacv "altacv.org")
2023-10-21 23:53:54 +00:00
(export-latex 'moderncv "moderncv.org")
2023-10-21 23:21:23 +00:00
(export-latex 'awesomecv2 "awesomecv.org")
(export-latex 'awesomecv "awesome-letter.org")