-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fully automate resume render process
- Loading branch information
1 parent
ffebc53
commit 6b5b222
Showing
4 changed files
with
27 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,4 @@ | |||
# Run this using Foreman via `foreman start` | |||
# See: https://github.com/ddollar/foreman | |||
web: jekyll server start | |||
resume: ./render-resume |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,23 @@ | |||
#!/usr/bin/env bash | #!/usr/bin/env bash | ||
asciidoctor-pdf resume/index.adoc |
|
||
mv resume/index.pdf resume.pdf | # Requires fswatch https://github.com/emcrisostomo/fswatch | ||
asciidoctor resume/index.adoc | # `brew install fswatch` | ||
|
|||
function render_resume { | |||
set -x | |||
asciidoctor-pdf --base-dir ./ resume/index.adoc | |||
mv resume/index.pdf resume.pdf | |||
asciidoctor --base-dir ./ resume/index.adoc | |||
{ set +x; } 2>/dev/null | |||
} | |||
|
|||
# This loop was inspired by https://superuser.com/a/181543/774060 | |||
fswatch -x ./resume | | |||
while read -r path events; do | |||
if [ $(basename $path) = "resume.adoc" ]; then | |||
echo "Detected fsevent:" | |||
echo " $(basename $path) $events" | |||
echo "Rendering resume:" | |||
render_resume | |||
fi | |||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters