mirror of
https://gitlab.com/Titan-C/org-cv.git
synced 2024-11-21 21:48:34 +00:00
Default FROM as error and TO as "Present"
If no FROM property is provided for a given cventry, throw an error. If no TO property is provided, use the atom "Present".
This commit is contained in:
parent
4e059491c0
commit
daf7295688
3 changed files with 28 additions and 22 deletions
16
ox-altacv.el
16
ox-altacv.el
|
@ -204,18 +204,20 @@ e.g. <2002-08-12 Mon> => Aug 2012"
|
||||||
"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 ((from-date (org-element-property :FROM headline))
|
(let* ((title (org-export-data (org-element-property :title headline) info))
|
||||||
(to-date (org-element-property :TO headline))
|
(from-date (or (org-element-property :FROM headline) (error "No FROM property provided for cventry %s" title)))
|
||||||
(title (org-export-data (org-element-property :title headline) info))
|
(to-date (org-element-property :TO headline))
|
||||||
(employer (org-element-property :EMPLOYER headline))
|
(employer (org-element-property :EMPLOYER headline))
|
||||||
(location (or (org-element-property :LOCATION headline) ""))
|
(location (or (org-element-property :LOCATION headline) ""))
|
||||||
(divider (if (org-export-last-sibling-p headline info) "" "\\divider")))
|
(divider (if (org-export-last-sibling-p headline info) "" "\\divider")))
|
||||||
(format "\n\\cvevent{%s}{%s}{%s}{%s}%s\n%s"
|
(format "\n\\cvevent{%s}{%s}{%s}{%s}%s\n%s"
|
||||||
title
|
title
|
||||||
employer
|
employer
|
||||||
(concat (org-altacv-timestamp-to-shortdate from-date)
|
(concat (org-altacv-timestamp-to-shortdate from-date)
|
||||||
" -- "
|
" -- "
|
||||||
(org-altacv-timestamp-to-shortdate to-date))
|
(if (not to-date)
|
||||||
|
"Present"
|
||||||
|
(org-moderncv-timestamp-to-shortdate to-date)))
|
||||||
location contents divider)))
|
location contents divider)))
|
||||||
|
|
||||||
|
|
||||||
|
|
18
ox-hugocv.el
18
ox-hugocv.el
|
@ -70,13 +70,13 @@ e.g. <2002-08-12 Mon> => Aug 2012"
|
||||||
"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 ((from-date (org-element-property :FROM headline))
|
(let* ((title (org-export-data (org-element-property :title headline) info))
|
||||||
(to-date (org-element-property :TO headline))
|
(from-date (or (org-element-property :FROM headline) (error "No FROM property provided for cventry %s" title)))
|
||||||
(loffset (string-to-number (plist-get info :hugo-level-offset))) ;"" -> 0, "0" -> 0, "1" -> 1, ..
|
(to-date (org-element-property :TO headline))
|
||||||
(level (org-export-get-relative-level headline info))
|
(loffset (string-to-number (plist-get info :hugo-level-offset))) ;"" -> 0, "0" -> 0, "1" -> 1, ..
|
||||||
(title (org-export-data (org-element-property :title headline) info))
|
(level (org-export-get-relative-level headline info))
|
||||||
(employer (org-element-property :EMPLOYER headline))
|
(employer (org-element-property :EMPLOYER headline))
|
||||||
(location (or (org-element-property :LOCATION headline) "")))
|
(location (or (org-element-property :LOCATION headline) "")))
|
||||||
(format "\n%s
|
(format "\n%s
|
||||||
|
|
||||||
<ul class=\"cventry\">
|
<ul class=\"cventry\">
|
||||||
|
@ -92,7 +92,9 @@ as a communication channel."
|
||||||
location
|
location
|
||||||
(concat (org-hugocv-timestamp-to-shortdate from-date)
|
(concat (org-hugocv-timestamp-to-shortdate from-date)
|
||||||
" -- "
|
" -- "
|
||||||
(org-hugocv-timestamp-to-shortdate to-date))
|
(if (not to-date)
|
||||||
|
"Present"
|
||||||
|
(org-moderncv-timestamp-to-shortdate to-date)))
|
||||||
contents)))
|
contents)))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -194,16 +194,18 @@ e.g. <2002-08-12 Mon> => Aug 2012"
|
||||||
"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 ((from-date (org-element-property :FROM headline))
|
(let* ((title (org-export-data (org-element-property :title headline) info))
|
||||||
(to-date (org-element-property :TO headline))
|
(from-date (or (org-element-property :FROM headline) (error "No FROM property provided for cventry %s" title)))
|
||||||
(title (org-export-data (org-element-property :title headline) info))
|
(to-date (org-element-property :TO headline))
|
||||||
(employer (org-element-property :EMPLOYER headline))
|
(employer (org-element-property :EMPLOYER headline))
|
||||||
(location (or (org-element-property :LOCATION headline) ""))
|
(location (or (org-element-property :LOCATION headline) ""))
|
||||||
(note (or (org-element-property :NOTE headline) "")))
|
(note (or (org-element-property :NOTE headline) "")))
|
||||||
(format "\\cventry{\\textbf{%s}}{%s}{%s}{%s}{%s}{%s}\n"
|
(format "\\cventry{\\textbf{%s}}{%s}{%s}{%s}{%s}{%s}\n"
|
||||||
(concat (org-moderncv-timestamp-to-shortdate from-date)
|
(concat (org-moderncv-timestamp-to-shortdate from-date)
|
||||||
" -- "
|
" -- "
|
||||||
(org-moderncv-timestamp-to-shortdate to-date))
|
(if (not to-date)
|
||||||
|
"Present"
|
||||||
|
(org-moderncv-timestamp-to-shortdate to-date)))
|
||||||
title employer location note contents)))
|
title employer location note contents)))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue