mirror of
https://gitlab.com/Titan-C/org-cv.git
synced 2024-11-21 21:48:34 +00:00
Support for AwesomeCV
Added a new ox-awesomecv.el, which provides support for the AwesomeCV LaTeX class: https://github.com/posquit0/Awesome-CV Added the corresponding documentation in the README as well. An example of a CV produced with this exporter can be found at https://zzamboni.org/vita/
This commit is contained in:
parent
91e5a55fe1
commit
51c7ef8ed5
3 changed files with 218 additions and 12 deletions
|
@ -92,3 +92,86 @@ When exporting you can call the following function to get the latex file.
|
||||||
<object data="altacv.org.pdf" type="application/pdf" width="100%" height="500px">
|
<object data="altacv.org.pdf" type="application/pdf" width="100%" height="500px">
|
||||||
<p>Alternative text - include a link <a href="altacv.org.pdf">to the PDF!</a></p>
|
<p>Alternative text - include a link <a href="altacv.org.pdf">to the PDF!</a></p>
|
||||||
</object>
|
</object>
|
||||||
|
|
||||||
|
|
||||||
|
## Using AwesomeCV {#using-awesomecv}
|
||||||
|
|
||||||
|
[AwesomeCV](https://github.com/posquit0/Awesome-CV) is another LaTeX template for producing nice-looking
|
||||||
|
CVs. AwesomeCV supports a few additional types of environment types in
|
||||||
|
`CV_ENV`, including `cvemployer`, `cvskills`, `cvhonors` and `cvschool`. Some of
|
||||||
|
these support additional property fields:
|
||||||
|
|
||||||
|
<div class="ox-hugo-table table table-striped">
|
||||||
|
<div></div>
|
||||||
|
|
||||||
|
| Field | Description |
|
||||||
|
|------------|----------------------------------------------------------------------|
|
||||||
|
| FROM | Start date of the entry |
|
||||||
|
| TO | End date of the entry |
|
||||||
|
| DATE | Shortcut to specify both `FROM` and `TO` as the same date. |
|
||||||
|
| | Both `FROM` and `TO` override `DATE`. |
|
||||||
|
| EMPLOYER | Employer or organization, can also be specified |
|
||||||
|
| | as `ORGANIZATION`, `SCHOOL`, `EVENT` or `POSITION` (different |
|
||||||
|
| | names make more sense depending on the type of environment) |
|
||||||
|
| LABEL | In `cvsubentry` environments, adds the given text to the left |
|
||||||
|
| | of the date range, can be used to add additional information |
|
||||||
|
| | to the entry. |
|
||||||
|
| RIGHT\_IMG | path to an image to include floating to the right of a `cventry`, |
|
||||||
|
| | a `cvsubentry` or `cvschool` entry. Meant to be used to show a logo. |
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
All the supported values of `CV_ENV` are described below.
|
||||||
|
|
||||||
|
|
||||||
|
### `cventries` {#cventries}
|
||||||
|
|
||||||
|
Enclose all the subheaders in a `cventries` environment. Subheaders can
|
||||||
|
be of type `cventry`, `cvschool`, or `cvemployer`.
|
||||||
|
|
||||||
|
|
||||||
|
### `cvhonors` {#cvhonors}
|
||||||
|
|
||||||
|
Enclose all the subheaders in a `cvhonors` environment. Subheaders must
|
||||||
|
be of type `cvhonor`
|
||||||
|
|
||||||
|
|
||||||
|
### `cventry` {#cventry}
|
||||||
|
|
||||||
|
Converts to a `\cventry` command. Supports attributes `FROM`, `TO`, `DATE`,
|
||||||
|
`EMPLOYER`, `LOCATION`, `RIGHT_IMG`.
|
||||||
|
|
||||||
|
|
||||||
|
### `cvsubentry` {#cvsubentry}
|
||||||
|
|
||||||
|
Converts to a `\cvsubentry` command. Supports attributes `FROM`, `TO`, `DATE`,
|
||||||
|
`LABEL` `RIGHT_IMG`.
|
||||||
|
|
||||||
|
|
||||||
|
### `cvemployer` {#cvemployer}
|
||||||
|
|
||||||
|
Converts to a `\cventry` with only the title line. Supports attributes
|
||||||
|
`FROM`, `TO`, `DATE` and `LOCATION`.
|
||||||
|
|
||||||
|
|
||||||
|
### `cvschool` {#cvschool}
|
||||||
|
|
||||||
|
Converts to a `\cventry`. The headline should contain the degree
|
||||||
|
obtained, shown as the main title. Supports attributes `LOCATION`,
|
||||||
|
`SCHOOL`, `FROM`, `TO`, `DATE` and `RIGHT_IMG`.
|
||||||
|
|
||||||
|
|
||||||
|
### `cvhonor` {#cvhonor}
|
||||||
|
|
||||||
|
Converts to a `\cvhonor` command (must be inside a `cvhonors`
|
||||||
|
headline). Supports attributes `LOCATION`, `EMPLOYER` (in this case `EVENT`
|
||||||
|
or `POSITION` might be more semantically accurate, and can also be
|
||||||
|
used), `FROM`, `TO`, `DATE`.
|
||||||
|
|
||||||
|
|
||||||
|
### `cvskills` {#cvskills}
|
||||||
|
|
||||||
|
Converts to a `\cvskills` environment. The headline must contain a
|
||||||
|
[description list](https://orgmode.org/manual/Plain-lists.html), which gets converted into a sequence of `\cvskill`
|
||||||
|
commands, with the term as the skill title and the description as its
|
||||||
|
contents.
|
||||||
|
|
|
@ -117,7 +117,6 @@ holding export options."
|
||||||
;; photo
|
;; photo
|
||||||
(let* ((photo (plist-get info :photo))
|
(let* ((photo (plist-get info :photo))
|
||||||
(photo-style (plist-get info :photostyle))
|
(photo-style (plist-get info :photostyle))
|
||||||
(_ (message "photo=%s photo-style=%s" photo photo-style))
|
|
||||||
(style-str (if photo-style (format "[%s]" photo-style) "")))
|
(style-str (if photo-style (format "[%s]" photo-style) "")))
|
||||||
(when (org-string-nw-p photo) (format "\\photo%s{%s}\n" style-str photo)))
|
(when (org-string-nw-p photo) (format "\\photo%s{%s}\n" style-str photo)))
|
||||||
|
|
||||||
|
@ -194,7 +193,7 @@ holding export options."
|
||||||
(footer-mid (format-spec (or (plist-get info :cvfooter_middle) "") spec))
|
(footer-mid (format-spec (or (plist-get info :cvfooter_middle) "") spec))
|
||||||
(footer-right (format-spec (or (plist-get info :cvfooter_right) "") spec)))
|
(footer-right (format-spec (or (plist-get info :cvfooter_right) "") spec)))
|
||||||
(when (not (string= "" (concat footer-left footer-mid footer-right)))
|
(when (not (string= "" (concat footer-left footer-mid footer-right)))
|
||||||
(format "\\makecvfooter{%s}{%s}{%s}" footer-left footer-mid footer-right)))
|
(format "\\makecvfooter{%s}{%s}{%s}\n" footer-left footer-mid footer-right)))
|
||||||
|
|
||||||
;; Document's body.
|
;; Document's body.
|
||||||
contents
|
contents
|
||||||
|
@ -204,31 +203,78 @@ holding export options."
|
||||||
;; Document end.
|
;; Document end.
|
||||||
"\\end{document}")))
|
"\\end{document}")))
|
||||||
|
|
||||||
|
;;;; Produce latex code for a right-float image
|
||||||
|
(defun org-awesomecv--cventry-right-img-code (file)
|
||||||
|
(if file
|
||||||
|
(format "\\begin{wrapfigure}{r}{0.15\\textwidth}
|
||||||
|
\\raggedleft\\vspace{-4.0mm}
|
||||||
|
\\includegraphics[width=0.1\\textwidth]{%s}
|
||||||
|
\\end{wrapfigure}" file) ""))
|
||||||
|
|
||||||
|
;;;; Individual cventry/cvsubentry/cvemployer/cvschool headlines
|
||||||
(defun org-awesomecv--format-cventry (headline contents info)
|
(defun org-awesomecv--format-cventry (headline contents info)
|
||||||
"Format HEADLINE as as cventry.
|
"Format HEADLINE as as cventry.
|
||||||
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* ((entrytype (org-element-property :CV_ENV headline))
|
(let* ((entrytype (org-element-property :CV_ENV headline))
|
||||||
(title (org-export-data (org-element-property :title headline) info))
|
(title (org-export-data (org-element-property :title headline) info))
|
||||||
(from-date (or (org-element-property :FROM headline) (error "No FROM property provided for cventry %s" title)))
|
(date (org-element-property :DATE headline))
|
||||||
(to-date (org-element-property :TO headline))
|
(from-date (or (org-element-property :FROM headline) date))
|
||||||
(employer (org-element-property :EMPLOYER headline))
|
(to-date (or (org-element-property :TO headline) date))
|
||||||
(location (or (org-element-property :LOCATION headline) "")))
|
(employer (or (org-element-property :ORGANIZATION headline)
|
||||||
|
(org-element-property :SCHOOL headline)
|
||||||
|
(org-element-property :EMPLOYER headline)
|
||||||
|
(org-element-property :EVENT headline)
|
||||||
|
(org-element-property :POSITION headline)))
|
||||||
|
(location (or (org-element-property :LOCATION headline) ""))
|
||||||
|
(right-img (org-element-property :RIGHT_IMG headline))
|
||||||
|
(label (or (org-element-property :LABEL headline) nil))
|
||||||
|
(label-str (if label (format "%s\\hfill{}" label) "")))
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
|
((string= entrytype "cvemployer")
|
||||||
|
(format "\n\\cventry{%s}{%s}{}{}{}\n%s\n"
|
||||||
|
title
|
||||||
|
(format "%s\\hfill %s" (org-cv-utils--format-time-window from-date to-date) location)
|
||||||
|
contents)
|
||||||
|
)
|
||||||
((string= entrytype "cventry")
|
((string= entrytype "cventry")
|
||||||
(format "\n\\cventry\n{%s}\n{%s}\n{%s}\n{%s}\n{\n%s}\n"
|
(format "\n\\cventry\n{%s}\n{%s}\n{%s}\n{%s}\n{\n%s%s}\n"
|
||||||
employer
|
employer
|
||||||
location
|
location
|
||||||
title
|
title
|
||||||
(org-cv-utils--format-time-window from-date to-date)
|
(org-cv-utils--format-time-window from-date to-date)
|
||||||
|
(org-awesomecv--cventry-right-img-code right-img)
|
||||||
contents))
|
contents))
|
||||||
((string= entrytype "cvsubentry")
|
((string= entrytype "cvsubentry")
|
||||||
(format "\n\\cvsubentry\n{%s}\n{%s}\n{\n%s}\n"
|
(format "\n\\cvsubentry\n{%s}\n{%s}\n{\n%s%s}\n"
|
||||||
title
|
title
|
||||||
|
(format "%s%s" label-str (org-cv-utils--format-time-window from-date to-date))
|
||||||
|
(org-awesomecv--cventry-right-img-code right-img)
|
||||||
|
contents))
|
||||||
|
((string= entrytype "cvschool")
|
||||||
|
(format "\n\\cventry\n{%s}\n{%s}\n{%s}\n{%s}\n{\n%s%s}\n"
|
||||||
|
title
|
||||||
|
location
|
||||||
|
employer
|
||||||
(org-cv-utils--format-time-window from-date to-date)
|
(org-cv-utils--format-time-window from-date to-date)
|
||||||
contents)))))
|
(org-awesomecv--cventry-right-img-code right-img)
|
||||||
|
contents))
|
||||||
|
((string= entrytype "cvhonor")
|
||||||
|
(format "\n\\cvhonor\n{%s}\n{%s}\n{%s}\n{%s}\n"
|
||||||
|
title
|
||||||
|
employer
|
||||||
|
location
|
||||||
|
(org-cv-utils--format-time-window from-date to-date))))))
|
||||||
|
|
||||||
|
;;;; Headlines of type "cventries"
|
||||||
|
(defun org-awesomecv--format-cvenvironment (environment headline contents info)
|
||||||
|
"Format HEADLINE as as a cventries/cvhonors environment.
|
||||||
|
CONTENTS holds the contents of the headline. INFO is a plist used
|
||||||
|
as a communication channel."
|
||||||
|
(format "%s\n\\begin{%s}\n%s\\end{%s}\n"
|
||||||
|
(org-export-with-backend 'latex headline nil info)
|
||||||
|
environment contents environment))
|
||||||
|
|
||||||
;;;; Headline
|
;;;; Headline
|
||||||
(defun org-awesomecv-headline (headline contents info)
|
(defun org-awesomecv-headline (headline contents info)
|
||||||
|
@ -240,8 +286,14 @@ as a communication channel."
|
||||||
(or (org-string-nw-p env) "block"))))
|
(or (org-string-nw-p env) "block"))))
|
||||||
(cond
|
(cond
|
||||||
;; is a cv entry or subentry
|
;; is a cv entry or subentry
|
||||||
((or (string= environment "cventry") (string= environment "cvsubentry"))
|
((or (string= environment "cventry")
|
||||||
|
(string= environment "cvsubentry")
|
||||||
|
(string= environment "cvemployer")
|
||||||
|
(string= environment "cvschool")
|
||||||
|
(string= environment "cvhonor"))
|
||||||
(org-awesomecv--format-cventry headline contents info))
|
(org-awesomecv--format-cventry headline contents info))
|
||||||
|
((or (string= environment "cventries") (string= environment "cvhonors"))
|
||||||
|
(org-awesomecv--format-cvenvironment environment headline contents info))
|
||||||
((org-export-with-backend 'latex headline contents info))))))
|
((org-export-with-backend 'latex headline contents info))))))
|
||||||
|
|
||||||
;;;; Plain List, to intercept and transform "cvskills" lists
|
;;;; Plain List, to intercept and transform "cvskills" lists
|
||||||
|
@ -250,11 +302,12 @@ as a communication channel."
|
||||||
"Transcode a PLAIN-LIST element from Org to LaTeX.
|
"Transcode a PLAIN-LIST element from Org to LaTeX.
|
||||||
CONTENTS is the contents of the list. INFO is a plist holding
|
CONTENTS is the contents of the list. INFO is a plist holding
|
||||||
contextual information."
|
contextual information."
|
||||||
(let* ((cv-env (org-entry-get (org-element-property :begin plain-list) "CV_ENV" t)))
|
(let* ((cv-env (org-entry-get (org-element-property :begin plain-list) "CV_ENV" nil))
|
||||||
|
(parent-type (car (org-element-property :parent plain-list))))
|
||||||
(cond
|
(cond
|
||||||
((string= cv-env "cvskills")
|
((string= cv-env "cvskills")
|
||||||
(format "\\begin{cvskills}\n%s\\end{cvskills}" contents))
|
(format "\\begin{cvskills}\n%s\\end{cvskills}" contents))
|
||||||
((or (string= cv-env "cventry") (string= cv-env "cvsubentry"))
|
((and (eq parent-type 'section) (or (string= cv-env "cventry") (string= cv-env "cvsubentry") (string= cv-env "cvschool")))
|
||||||
(format "\\begin{cvitems}\n%s\\end{cvitems}" contents))
|
(format "\\begin{cvitems}\n%s\\end{cvitems}" contents))
|
||||||
(t
|
(t
|
||||||
(org-latex-plain-list plain-list contents info)))))
|
(org-latex-plain-list plain-list contents info)))))
|
||||||
|
|
70
readme.org
70
readme.org
|
@ -213,6 +213,76 @@ When exporting you can call the following function to get the latex file.
|
||||||
</object>
|
</object>
|
||||||
#+END_EXPORT
|
#+END_EXPORT
|
||||||
|
|
||||||
|
** Using AwesomeCV
|
||||||
|
|
||||||
|
[[https://github.com/posquit0/Awesome-CV][AwesomeCV]] is another LaTeX template for producing nice-looking
|
||||||
|
CVs. AwesomeCV supports a few additional types of environment types in
|
||||||
|
=CV_ENV=, including =cvemployer=, =cvskills=, =cvhonors= and =cvschool=. Some of
|
||||||
|
these support additional property fields:
|
||||||
|
|
||||||
|
#+attr_html: :class table table-striped
|
||||||
|
| Field | Description |
|
||||||
|
|-----------+------------------------------------------------------------------|
|
||||||
|
| FROM | Start date of the entry |
|
||||||
|
| TO | End date of the entry |
|
||||||
|
| DATE | Shortcut to specify both =FROM= and =TO= as the same date. |
|
||||||
|
| | Both =FROM= and =TO= override =DATE=. |
|
||||||
|
| EMPLOYER | Employer or organization, can also be specified |
|
||||||
|
| | as =ORGANIZATION=, =SCHOOL=, =EVENT= or =POSITION= (different |
|
||||||
|
| | names make more sense depending on the type of environment) |
|
||||||
|
| LABEL | In =cvsubentry= environments, adds the given text to the left |
|
||||||
|
| | of the date range, can be used to add additional information |
|
||||||
|
| | to the entry. |
|
||||||
|
| RIGHT_IMG | path to an image to include floating to the right of a =cventry=, |
|
||||||
|
| | a =cvsubentry= or =cvschool= entry. Meant to be used to show a logo. |
|
||||||
|
|
||||||
|
All the supported values of =CV_ENV= are described below.
|
||||||
|
|
||||||
|
*** =cventries=
|
||||||
|
|
||||||
|
Enclose all the subheaders in a =cventries= environment. Subheaders can
|
||||||
|
be of type =cventry=, =cvschool=, or =cvemployer=.
|
||||||
|
|
||||||
|
*** =cvhonors=
|
||||||
|
|
||||||
|
Enclose all the subheaders in a =cvhonors= environment. Subheaders must
|
||||||
|
be of type =cvhonor=
|
||||||
|
|
||||||
|
*** =cventry=
|
||||||
|
|
||||||
|
Converts to a =\cventry= command. Supports attributes =FROM=, =TO=, =DATE=,
|
||||||
|
=EMPLOYER=, =LOCATION=, =RIGHT_IMG=.
|
||||||
|
|
||||||
|
*** =cvsubentry=
|
||||||
|
|
||||||
|
Converts to a =\cvsubentry= command. Supports attributes =FROM=, =TO=, =DATE=,
|
||||||
|
=LABEL= =RIGHT_IMG=.
|
||||||
|
|
||||||
|
*** =cvemployer=
|
||||||
|
|
||||||
|
Converts to a =\cventry= with only the title line. Supports attributes
|
||||||
|
=FROM=, =TO=, =DATE= and =LOCATION=.
|
||||||
|
|
||||||
|
*** =cvschool=
|
||||||
|
|
||||||
|
Converts to a =\cventry=. The headline should contain the degree
|
||||||
|
obtained, shown as the main title. Supports attributes =LOCATION=,
|
||||||
|
=SCHOOL=, =FROM=, =TO=, =DATE= and =RIGHT_IMG=.
|
||||||
|
|
||||||
|
*** =cvhonor=
|
||||||
|
|
||||||
|
Converts to a =\cvhonor= command (must be inside a =cvhonors=
|
||||||
|
headline). Supports attributes =LOCATION=, =EMPLOYER= (in this case =EVENT=
|
||||||
|
or =POSITION= might be more semantically accurate, and can also be
|
||||||
|
used), =FROM=, =TO=, =DATE=.
|
||||||
|
|
||||||
|
*** =cvskills=
|
||||||
|
|
||||||
|
Converts to a =\cvskills= environment. The headline must contain a
|
||||||
|
[[https://orgmode.org/manual/Plain-lists.html][description list]], which gets converted into a sequence of =\cvskill=
|
||||||
|
commands, with the term as the skill title and the description as its
|
||||||
|
contents.
|
||||||
|
|
||||||
* Markdown Hugo Exporter
|
* Markdown Hugo Exporter
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:EXPORT_FILE_NAME: hugo_export
|
:EXPORT_FILE_NAME: hugo_export
|
||||||
|
|
Loading…
Reference in a new issue