add support for mobile and homepage options

This commit is contained in:
Óscar Nájera 2018-03-23 00:40:15 +01:00
parent be4bf7904e
commit 61620192d0

View file

@ -21,6 +21,9 @@
;;; Define Back-End ;;; Define Back-End
(org-export-define-derived-backend 'orgcv 'latex (org-export-define-derived-backend 'orgcv 'latex
:options-alist
'((:mobile "MOBILE" nil nil parse)
(:homepage "HOMEPAGE" nil nil parse))
:translate-alist '((template . org-cv-template))) :translate-alist '((template . org-cv-template)))
;;;; Template ;;;; Template
@ -51,12 +54,20 @@ holding export options."
(let ((auth (plist-get info :author))) (let ((auth (plist-get info :author)))
(and auth (org-export-data auth info)))))) (and auth (org-export-data auth info))))))
(format "\\name{%s}{}\n" author)) (format "\\name{%s}{}\n" author))
;; email
(let ((email (and (plist-get info :with-email) (let ((email (and (plist-get info :with-email)
(org-export-data (plist-get info :email) info)))) (org-export-data (plist-get info :email) info))))
(when email (format "\\email{%s}\n" email))) (when email (format "\\email{%s}\n" email)))
;; phone
(let ((mobile (org-export-data (plist-get info :mobile) info)))
(when mobile (format "\\phone[mobile]{%s}\n" mobile)))
;; homepage
(let ((homepage (org-export-data (plist-get info :homepage) info)))
(when homepage (format "\\homepage{%s}\n" homepage)))
;; Date. ;; Date.
(let ((date (and (plist-get info :with-date) (org-export-get-date info)))) (let ((date (and (plist-get info :with-date) (org-export-get-date info))))
(format "\\date{%s}\n" (org-export-data date info))) (format "\\date{%s}\n" (org-export-data date info)))
;; Title and subtitle. ;; Title and subtitle.
(let* ((subtitle (plist-get info :subtitle)) (let* ((subtitle (plist-get info :subtitle))
(formatted-subtitle (formatted-subtitle