mirror of
https://gitlab.com/Titan-C/org-cv.git
synced 2024-11-14 18:48:30 +00:00
Improve first/last name handling.
By default first/last name are now extracted from the value of #+AUTHOR, but #+FIRSTNAME and #+LASTNAME can be used to override the values if needed.
This commit is contained in:
parent
2a322a9b12
commit
95c9051532
3 changed files with 43 additions and 33 deletions
|
@ -103,20 +103,22 @@ CVs. In addition to the regular document attributes, the following are supported
|
||||||
<div></div>
|
<div></div>
|
||||||
|
|
||||||
| Field | Description |
|
| Field | Description |
|
||||||
|------------------|------------------------------------------------------------|
|
|------------------|-----------------------------------------------------------|
|
||||||
| PHOTOSTYLE | Style of photo to use. Values include |
|
| PHOTOSTYLE | Style of photo to use. Comma-separated values can include |
|
||||||
| | circle/rectangle,edge/noedge,left/right |
|
| | circle/rectangle,edge/noedge,left/right. |
|
||||||
| CVCOLOR | Color of highlights. |
|
| CVCOLOR | Color of highlights. |
|
||||||
| STACKOVERFLOW | Stack overflow, must be specified as `ID username` |
|
| STACKOVERFLOW | Stack overflow, must be specified as `ID username` |
|
||||||
| FONTDIR | Directory where the fonts can be found, defaults |
|
| FONTDIR | Directory where the fonts can be found, defaults |
|
||||||
| | to `fonts/` (as in the standard AwesomeCV) |
|
| | to `fonts/` (as in the standard AwesomeCV) |
|
||||||
| CVHIGHLIGHTS | Whether to colorize highlights. Defaults to true |
|
| CVHIGHLIGHTS | Whether to colorize highlights. Defaults to true |
|
||||||
| QUOTE | Optional quote to include at the top of the CV |
|
| QUOTE | Optional quote to include at the top of the CV |
|
||||||
| FIRSTNAME | Your first name. Must be specified (in addition to AUTHOR) |
|
| FIRSTNAME | First name to be shown in the CV. By default the first |
|
||||||
| LASTNAME | Your last name. Must be specified. |
|
| | space-separated part of AUTHOR is used. |
|
||||||
| CVFOOTER\_LEFT | Text to include in the left footer. |
|
| LASTNAME | Last name to be shown in the CV. By default the second |
|
||||||
| CVFOOTER\_MIDDLE | Text to include in the middle footer. |
|
| | space-separated part of AUTHOR is used. |
|
||||||
| CVFOOTER\_RIGHT | Text to include in the right footer. |
|
| CVFOOTER\_LEFT | Text to include in the left footer. None by default |
|
||||||
|
| CVFOOTER\_MIDDLE | Text to include in the middle footer. None by default. |
|
||||||
|
| CVFOOTER\_RIGHT | Text to include in the right footer. None by default. |
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
(require 'cl-lib)
|
(require 'cl-lib)
|
||||||
(require 'ox-latex)
|
(require 'ox-latex)
|
||||||
(require 'org-cv-utils)
|
(require 'org-cv-utils)
|
||||||
|
(require 'subr)
|
||||||
|
|
||||||
;; Install a default set-up for awesomecv export.
|
;; Install a default set-up for awesomecv export.
|
||||||
(unless (assoc "awesomecv" org-latex-classes)
|
(unless (assoc "awesomecv" org-latex-classes)
|
||||||
|
@ -70,6 +71,7 @@
|
||||||
(:linkedin "LINKEDIN" nil nil parse)
|
(:linkedin "LINKEDIN" nil nil parse)
|
||||||
(:twitter "TWITTER" nil nil parse)
|
(:twitter "TWITTER" nil nil parse)
|
||||||
(:stackoverflow "STACKOVERFLOW" nil nil split)
|
(:stackoverflow "STACKOVERFLOW" nil nil split)
|
||||||
|
(:extrainfo "EXTRAINFO" nil nil parse)
|
||||||
(:with-email nil "email" t t)
|
(:with-email nil "email" t t)
|
||||||
(:fontdir "FONTDIR" nil "fonts/" t)
|
(:fontdir "FONTDIR" nil "fonts/" t)
|
||||||
(:latex-title-command nil nil "\\makecvheader" t)
|
(:latex-title-command nil nil "\\makecvheader" t)
|
||||||
|
@ -120,9 +122,13 @@ holding export options."
|
||||||
(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)))
|
||||||
|
|
||||||
;; Author.
|
;; Author. If FIRSTNAME or LASTNAME are not given, try to deduct
|
||||||
(let ((first-name (org-export-data (plist-get info :firstname) info))
|
;; their values by splitting AUTHOR on white space.
|
||||||
(last-name (org-export-data (plist-get info :lastname) info)))
|
(let* ((author (split-string (org-export-data (plist-get info :author) info)))
|
||||||
|
(first-name-prop (org-export-data (plist-get info :firstname) info))
|
||||||
|
(last-name-prop (org-export-data (plist-get info :lastname) info))
|
||||||
|
(first-name (or (org-string-nw-p first-name-prop) (first author)))
|
||||||
|
(last-name (or (org-string-nw-p last-name-prop) (second author))))
|
||||||
(format "\\name{%s}{%s}\n" first-name last-name))
|
(format "\\name{%s}{%s}\n" first-name last-name))
|
||||||
|
|
||||||
;; Title
|
;; Title
|
||||||
|
|
18
readme.org
18
readme.org
|
@ -220,20 +220,22 @@ CVs. In addition to the regular document attributes, the following are supported
|
||||||
|
|
||||||
#+attr_html: :class table table-striped
|
#+attr_html: :class table table-striped
|
||||||
| Field | Description |
|
| Field | Description |
|
||||||
|-----------------+------------------------------------------------------------|
|
|-----------------+-----------------------------------------------------------|
|
||||||
| PHOTOSTYLE | Style of photo to use. Values include |
|
| PHOTOSTYLE | Style of photo to use. Comma-separated values can include |
|
||||||
| | circle/rectangle,edge/noedge,left/right |
|
| | circle/rectangle,edge/noedge,left/right. |
|
||||||
| CVCOLOR | Color of highlights. |
|
| CVCOLOR | Color of highlights. |
|
||||||
| STACKOVERFLOW | Stack overflow, must be specified as =ID username= |
|
| STACKOVERFLOW | Stack overflow, must be specified as =ID username= |
|
||||||
| FONTDIR | Directory where the fonts can be found, defaults |
|
| FONTDIR | Directory where the fonts can be found, defaults |
|
||||||
| | to =fonts/= (as in the standard AwesomeCV) |
|
| | to =fonts/= (as in the standard AwesomeCV) |
|
||||||
| CVHIGHLIGHTS | Whether to colorize highlights. Defaults to true |
|
| CVHIGHLIGHTS | Whether to colorize highlights. Defaults to true |
|
||||||
| QUOTE | Optional quote to include at the top of the CV |
|
| QUOTE | Optional quote to include at the top of the CV |
|
||||||
| FIRSTNAME | Your first name. Must be specified (in addition to AUTHOR) |
|
| FIRSTNAME | First name to be shown in the CV. By default the first |
|
||||||
| LASTNAME | Your last name. Must be specified. |
|
| | space-separated part of AUTHOR is used. |
|
||||||
| CVFOOTER_LEFT | Text to include in the left footer. |
|
| LASTNAME | Last name to be shown in the CV. By default the second |
|
||||||
| CVFOOTER_MIDDLE | Text to include in the middle footer. |
|
| | space-separated part of AUTHOR is used. |
|
||||||
| CVFOOTER_RIGHT | Text to include in the right footer. |
|
| CVFOOTER_LEFT | Text to include in the left footer. None by default |
|
||||||
|
| CVFOOTER_MIDDLE | Text to include in the middle footer. None by default. |
|
||||||
|
| CVFOOTER_RIGHT | Text to include in the right footer. None by default. |
|
||||||
|
|
||||||
AwesomeCV supports a few additional types of environment types in
|
AwesomeCV supports a few additional types of environment types in
|
||||||
=CV_ENV=, including =cvemployer=, =cvskills=, =cvhonors= and =cvschool=. Some of
|
=CV_ENV=, including =cvemployer=, =cvskills=, =cvhonors= and =cvschool=. Some of
|
||||||
|
|
Loading…
Reference in a new issue