mirror of
https://gitlab.com/Titan-C/org-cv.git
synced 2024-11-21 05:28:33 +00:00
fix hugo export string replace and build
fix hugo hugo fix collective environments
This commit is contained in:
parent
d89628c2ed
commit
a94bf0e5ad
4 changed files with 33 additions and 15 deletions
|
@ -16,4 +16,8 @@ exclude some tags during export.
|
||||||
(org-export-to-file 'hugocv "hugocv.md"))
|
(org-export-to-file 'hugocv "hugocv.md"))
|
||||||
```
|
```
|
||||||
|
|
||||||
You are responsible for styling your website.
|
You are responsible for styling your website. Use all the CSS magic you know.
|
||||||
|
Each entry is inside a `div` container and each element of the properties has
|
||||||
|
its own class.
|
||||||
|
|
||||||
|
\#+end_src
|
||||||
|
|
23
genfiles.el
23
genfiles.el
|
@ -19,20 +19,24 @@
|
||||||
(require 'ox-awesomecv)
|
(require 'ox-awesomecv)
|
||||||
(require 'ox-awesomecv2))
|
(require 'ox-awesomecv2))
|
||||||
|
|
||||||
(defun export-latex (backend file)
|
(defun export-with (backend file ext)
|
||||||
(let ((workfile (concat cv-workdir file))
|
(let ((workfile (concat cv-workdir file))
|
||||||
(outfile (concat cv-workdir file ".tex"))
|
(outfile (concat cv-workdir file ext)))
|
||||||
(pdffile (concat cv-workdir file ".pdf")))
|
|
||||||
(message (format "%s exists: %s" workfile (file-exists-p workfile)))
|
(message (format "%s exists: %s" workfile (file-exists-p workfile)))
|
||||||
(with-current-buffer
|
(with-current-buffer
|
||||||
(find-file-noselect workfile)
|
(find-file-noselect workfile)
|
||||||
(org-mode)
|
(org-mode)
|
||||||
(message "back %S, out %S" backend outfile)
|
(message "back %S, out %S" backend outfile)
|
||||||
(org-export-to-file backend outfile)
|
(org-export-to-file backend outfile))
|
||||||
(message (format "%s exists: %s" outfile (file-exists-p outfile)))
|
outfile))
|
||||||
(shell-command (format "xelatex --output-directory=%s %s" cv-workdir outfile) "*Messages*" "*Messages*")
|
|
||||||
(message (format "%s exists: %s" pdffile (file-exists-p pdffile)))
|
(defun export-latex (backend file)
|
||||||
(copy-file pdffile (concat cv-cwd "/doc/static/" (concat file ".pdf")) t))))
|
(let ((outfile (export-with backend file ".tex"))
|
||||||
|
(pdffile (concat cv-workdir file ".pdf")))
|
||||||
|
(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)))
|
||||||
|
|
||||||
(let ((readme (concat cv-cwd "readme.org")))
|
(let ((readme (concat cv-cwd "readme.org")))
|
||||||
(make-directory cv-workdir t)
|
(make-directory cv-workdir t)
|
||||||
|
@ -43,10 +47,9 @@
|
||||||
|
|
||||||
(copy-file (concat cv-cwd "doc/smile.png") cv-workdir t)
|
(copy-file (concat cv-cwd "doc/smile.png") cv-workdir t)
|
||||||
(make-directory (concat cv-cwd "/doc/static/") t)
|
(make-directory (concat cv-cwd "/doc/static/") t)
|
||||||
(message "alta %s" (featurep 'ox-altacv))
|
|
||||||
(export-latex 'altacv "altacv.org")
|
(export-latex 'altacv "altacv.org")
|
||||||
(export-latex 'moderncv "moderncv.org")
|
(export-latex 'moderncv "moderncv.org")
|
||||||
(export-latex 'awesomecv2 "awesomecv.org")
|
(export-latex 'awesomecv2 "awesomecv.org")
|
||||||
(export-latex 'awesomecv "awesomecv.org")
|
(export-latex 'awesomecv "awesomecv.org")
|
||||||
(export-latex 'awesomecv "awesome-letter.org")
|
(export-latex 'awesomecv "awesome-letter.org")
|
||||||
(export-latex 'hugocv "hugocv.org")
|
(export-with 'hugocv "hugocv.org" ".md")
|
||||||
|
|
10
ox-hugocv.el
10
ox-hugocv.el
|
@ -59,10 +59,11 @@
|
||||||
(cl-ecase field
|
(cl-ecase field
|
||||||
(host
|
(host
|
||||||
(-some->> (alist-get 'host entry)
|
(-some->> (alist-get 'host entry)
|
||||||
|
(org-string-nw-p)
|
||||||
(format "%s\n{.cv-host}")))
|
(format "%s\n{.cv-host}")))
|
||||||
(date
|
(date
|
||||||
(-some->>
|
(-some->>
|
||||||
(org-cv-utils--format-time-window (alist-get 'from-date entry) (alist-get 'to-date entry))
|
(alist-get 'date entry)
|
||||||
(format "%s\n{.cv-date}")))
|
(format "%s\n{.cv-date}")))
|
||||||
(location
|
(location
|
||||||
(-some->> (alist-get 'location entry)
|
(-some->> (alist-get 'location entry)
|
||||||
|
@ -74,7 +75,7 @@
|
||||||
CONTENTS holds the contents of the headline. INFO is a plist used
|
CONTENTS holds the contents of the headline. INFO is a plist used
|
||||||
as a communication channel."
|
as a communication channel."
|
||||||
(let* ((environment (org-export-get-tags headline info))
|
(let* ((environment (org-export-get-tags headline info))
|
||||||
(env-class (string-replace "cv" "" (cl-find-if (lambda (s) (string-prefix-p "cv" s)) environment)))
|
(env-class (replace-regexp-in-string "^cv" "" (cl-find-if (lambda (s) (string-prefix-p "cv" s)) environment)))
|
||||||
(entry (org-cv-utils--parse-cventry headline info))
|
(entry (org-cv-utils--parse-cventry headline info))
|
||||||
(loffset (string-to-number (plist-get info :hugo-level-offset))) ;"" -> 0, "0" -> 0, "1" -> 1, ..
|
(loffset (string-to-number (plist-get info :hugo-level-offset))) ;"" -> 0, "0" -> 0, "1" -> 1, ..
|
||||||
(level (org-export-get-relative-level headline info))
|
(level (org-export-get-relative-level headline info))
|
||||||
|
@ -98,7 +99,10 @@ as a communication channel."
|
||||||
(let ((environment (cons (org-element-property :CV_ENV headline)
|
(let ((environment (cons (org-element-property :CV_ENV headline)
|
||||||
(org-export-get-tags headline info))))
|
(org-export-get-tags headline info))))
|
||||||
(cond
|
(cond
|
||||||
((cl-find-if (lambda (s) (string-prefix-p "cv" s)) environment)
|
((cl-find-if (lambda (s) (and (string-prefix-p "cv" s)
|
||||||
|
;; avoid conflict with awesomecv block environments
|
||||||
|
(not (member s '("cventries" "cvhonors")))))
|
||||||
|
environment)
|
||||||
(org-hugocv--format-cventry headline contents info))
|
(org-hugocv--format-cventry headline contents info))
|
||||||
((org-export-with-backend 'hugo headline contents info))))))
|
((org-export-with-backend 'hugo headline contents info))))))
|
||||||
|
|
||||||
|
|
|
@ -453,7 +453,14 @@ exclude some tags during export.
|
||||||
(org-export-to-file 'hugocv "hugocv.md"))
|
(org-export-to-file 'hugocv "hugocv.md"))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
You are responsible for styling your website.
|
You are responsible for styling your website. Use all the CSS magic you know.
|
||||||
|
Each entry is inside a =div= container and each element of the properties has
|
||||||
|
its own class.
|
||||||
|
|
||||||
|
#+begin_src org :exports none :tangle hugocv.org
|
||||||
|
,#+HTML_HEAD: <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" />
|
||||||
|
#+end_src
|
||||||
|
|
||||||
# Next block is to generate exports
|
# Next block is to generate exports
|
||||||
#+BEGIN_SRC org :exports none :tangle hugocv.org
|
#+BEGIN_SRC org :exports none :tangle hugocv.org
|
||||||
#+include: basic_cv.org
|
#+include: basic_cv.org
|
||||||
|
|
Loading…
Reference in a new issue