mirror of
https://gitlab.com/Titan-C/org-cv.git
synced 2024-11-14 18:48:30 +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
|
@ -204,9 +204,9 @@ 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))
|
||||||
|
(from-date (or (org-element-property :FROM headline) (error "No FROM property provided for cventry %s" title)))
|
||||||
(to-date (org-element-property :TO headline))
|
(to-date (org-element-property :TO headline))
|
||||||
(title (org-export-data (org-element-property :title 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) ""))
|
||||||
(divider (if (org-export-last-sibling-p headline info) "" "\\divider")))
|
(divider (if (org-export-last-sibling-p headline info) "" "\\divider")))
|
||||||
|
@ -215,7 +215,9 @@ as a communication channel."
|
||||||
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)))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -70,11 +70,11 @@ 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))
|
||||||
|
(from-date (or (org-element-property :FROM headline) (error "No FROM property provided for cventry %s" title)))
|
||||||
(to-date (org-element-property :TO headline))
|
(to-date (org-element-property :TO headline))
|
||||||
(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))
|
||||||
(title (org-export-data (org-element-property :title 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
|
||||||
|
@ -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))
|
||||||
|
(from-date (or (org-element-property :FROM headline) (error "No FROM property provided for cventry %s" title)))
|
||||||
(to-date (org-element-property :TO headline))
|
(to-date (org-element-property :TO headline))
|
||||||
(title (org-export-data (org-element-property :title 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) ""))
|
||||||
(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