1
0
Fork 0
org-cv/genfiles.el

59 lines
1.9 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-with (backend file ext)
2023-10-21 21:29:43 +00:00
(let ((workfile (concat cv-workdir file))
(outfile (concat cv-workdir file ext)))
2023-10-21 21:29:43 +00:00
(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)
(org-export-to-file backend outfile))
outfile))
(defun export-latex (backend file)
(let ((outfile (export-with backend file ".tex"))
(pdffile (concat cv-workdir file ".pdf")))
(cd cv-workdir)
(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)))
(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
(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 "awesomecv.org")
(export-latex 'awesomecv "awesome-letter.org")
2023-10-22 02:42:12 +00:00
(copy-file
(export-with 'hugocv "hugocv.org" ".md")
(concat cv-cwd "/doc/content/post/cv.md"))