From d89628c2edd6d80f71ba0ae6d88520e8649e7ba0 Mon Sep 17 00:00:00 2001 From: Oscar Najera Date: Sun, 22 Oct 2023 03:19:18 +0200 Subject: [PATCH] Allow tags or property value fix awesome's environments --- doc/content/post/basic_config.md | 1 - genfiles.el | 2 ++ ox-altacv.el | 6 +++--- ox-awesomecv.el | 27 ++++++++++++++------------- ox-awesomecv2.el | 6 ++++-- ox-hugocv.el | 3 ++- ox-moderncv.el | 6 +++--- readme.org | 7 ++++++- 8 files changed, 34 insertions(+), 24 deletions(-) diff --git a/doc/content/post/basic_config.md b/doc/content/post/basic_config.md index a6ff352..2ffbe55 100644 --- a/doc/content/post/basic_config.md +++ b/doc/content/post/basic_config.md @@ -74,7 +74,6 @@ instead of a range. Both `FROM` and `TO` override `DATE`. I write about awesome stuff I do. ** Other job :cventry: :PROPERTIES: -:CV_ENV: cventry :FROM: <2013-09-01> :TO: <2014-08-07> :LOCATION: my city, your country diff --git a/genfiles.el b/genfiles.el index c89ab1c..d3970c2 100644 --- a/genfiles.el +++ b/genfiles.el @@ -47,4 +47,6 @@ (export-latex 'altacv "altacv.org") (export-latex 'moderncv "moderncv.org") (export-latex 'awesomecv2 "awesomecv.org") +(export-latex 'awesomecv "awesomecv.org") (export-latex 'awesomecv "awesome-letter.org") +(export-latex 'hugocv "hugocv.org") diff --git a/ox-altacv.el b/ox-altacv.el index fd48db6..9fa8c4f 100644 --- a/ox-altacv.el +++ b/ox-altacv.el @@ -206,11 +206,11 @@ as a communication channel." CONTENTS is the contents of the headline. INFO is a plist used as a communication channel." (unless (org-element-property :footnote-section-p headline) - (let ((environment (let ((env (org-element-property :CV_ENV headline))) - (or (org-string-nw-p env) "block")))) + (let ((environment (cons (org-element-property :CV_ENV headline) + (org-export-get-tags headline info)))) (cond ;; is a cv entry - ((equal environment "cventry") + ((member "cventry" environment) (org-altacv--format-cventry headline contents info)) ((org-export-with-backend 'latex headline contents info)))))) diff --git a/ox-awesomecv.el b/ox-awesomecv.el index 4d13db8..644446e 100644 --- a/ox-awesomecv.el +++ b/ox-awesomecv.el @@ -340,25 +340,26 @@ as a communication channel." CONTENTS is the contents of the headline. INFO is a plist used as a communication channel." (unless (org-element-property :footnote-section-p headline) - (let ((environment (let ((env (org-element-property :CV_ENV headline))) - (or (org-string-nw-p env) "block"))) + (let ((environment (cons (org-element-property :CV_ENV headline) + (org-export-get-tags headline info))) (pagebreak (org-string-nw-p (org-element-property :PAGEBREAK headline)))) (concat (when pagebreak "\\clearpage\n") (cond ;; is a cv entry or subentry - ((member environment '("cventry" - "cvsubentry" - "cvemployer" - "cvschool" - "cvhonor" - "cvletter" - "cvletter_notitle" - "lettersection" - "letterheader")) + ((seq-intersection environment '("cventry" + "cvsubentry" + "cvemployer" + "cvschool" + "cvhonor" + "cvletter" + "cvletter_notitle" + "lettersection" + "letterheader")) (org-awesomecv--format-cventry headline contents info)) - ((member environment '("cventries" "cvhonors")) - (org-awesomecv--format-cvenvironment environment headline contents info)) + ((seq-intersection environment '("cventries" "cvhonors")) + (org-awesomecv--format-cvenvironment + (car (seq-intersection environment '("cventries" "cvhonors"))) headline contents info)) ((org-export-with-backend 'latex headline contents info))))))) ;;;; Plain List, to intercept and transform "cvskills" lists diff --git a/ox-awesomecv2.el b/ox-awesomecv2.el index 39f20f0..5aec2fa 100644 --- a/ox-awesomecv2.el +++ b/ox-awesomecv2.el @@ -263,11 +263,13 @@ as a communication channel." CONTENTS is the contents of the headline. INFO is a plist used as a communication channel." (unless (org-element-property :footnote-section-p headline) - (let ((environment (org-export-get-tags headline info))) + (let ((environment (cons (org-element-property :CV_ENV headline) + (org-export-get-tags headline info)))) (cond ;; is a cv entry ((seq-intersection environment '("cventries" "cvhonors")) - (org-cv-awesome2--format-cvenvironment (car environment) headline contents info)) + (org-cv-awesome2--format-cvenvironment + (car (seq-intersection environment '("cventries" "cvhonors"))) headline contents info)) ((seq-intersection environment '("cventry" "cvhonor")) (org-cv-awesome2--entry headline contents info)) ((org-export-with-backend 'latex headline contents info)))))) diff --git a/ox-hugocv.el b/ox-hugocv.el index 5344526..ed7b36c 100644 --- a/ox-hugocv.el +++ b/ox-hugocv.el @@ -95,7 +95,8 @@ as a communication channel." CONTENTS is the contents of the headline. INFO is a plist used as a communication channel." (unless (org-element-property :footnote-section-p headline) - (let ((environment (org-export-get-tags headline info))) + (let ((environment (cons (org-element-property :CV_ENV headline) + (org-export-get-tags headline info)))) (cond ((cl-find-if (lambda (s) (string-prefix-p "cv" s)) environment) (org-hugocv--format-cventry headline contents info)) diff --git a/ox-moderncv.el b/ox-moderncv.el index 6c07b9d..ae635d7 100644 --- a/ox-moderncv.el +++ b/ox-moderncv.el @@ -198,11 +198,11 @@ as a communication channel." CONTENTS is the contents of the headline. INFO is a plist used as a communication channel." (unless (org-element-property :footnote-section-p headline) - (let ((environment (let ((env (org-element-property :CV_ENV headline))) - (or (org-string-nw-p env) "block")))) + (let ((environment (cons (org-element-property :CV_ENV headline) + (org-export-get-tags headline info)))) (cond ;; is a cv entry - ((equal environment "cventry") + ((member "cventry" environment) (org-moderncv--format-cventry headline contents info)) ((org-export-with-backend 'latex headline contents info)))))) diff --git a/readme.org b/readme.org index 0709073..4bd2cea 100644 --- a/readme.org +++ b/readme.org @@ -109,7 +109,6 @@ instead of a range. Both =FROM= and =TO= override =DATE=. I write about awesome stuff I do. ,** Other job :cventry: :PROPERTIES: -:CV_ENV: cventry :FROM: <2013-09-01> :TO: <2014-08-07> :LOCATION: my city, your country @@ -455,6 +454,12 @@ exclude some tags during export. #+END_SRC You are responsible for styling your website. +# Next block is to generate exports +#+BEGIN_SRC org :exports none :tangle hugocv.org +#+include: basic_cv.org +#+include: sideactivities.org +#+include: workcontent.org +#+END_SRC * License :PROPERTIES: