Permalink
Browse files

I went to 11 with this auto-render thing

  • Loading branch information...
relaxdiego committed Sep 23, 2017
1 parent 267d8eb commit de069a6fb8e5f657257cbeea6bfd0509584b94e4
Showing with 53 additions and 34 deletions.
  1. +12 −0 Makefile
  2. +2 −4 Procfile
  3. +0 −7 build
  4. +0 −23 render-resume
  5. +19 −0 script/autorenderer
  6. +4 −0 script/resume-html
  7. +4 −0 script/resume-pdf
  8. +12 −0 start
@@ -0,0 +1,12 @@
ROOTDIR=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))

.PHONY: resume
.DEFAULT: resume

resume: resume.pdf resume/index.html

resume.pdf: resume/resume.adoc resume/index.adoc
@script/resume-pdf

resume/index.html: resume/resume.adoc resume/index.adoc
@script/resume-html
@@ -1,4 +1,2 @@
# Run this using Foreman via `foreman start`
# See: https://github.com/ddollar/foreman
web: jekyll server start
resume: ./render-resume
blog: jekyll server start
resume: script/autorenderer
7 build

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

# In case something changed before this script started
make resume

# Requires fswatch https://github.com/emcrisostomo/fswatch
# `brew install fswatch`

# This loop was inspired by https://superuser.com/a/181543/774060
fswatch -x ./resume |
while read -r path events; do
filename=$(basename "$path")
extension="${filename##*.}"

if [ "$extension" = "adoc" ]; then
echo "Source file changed: $filename"
make resume
fi
done
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
cd $(dirname "${BASH_SOURCE[0]}")/..
asciidoctor --base-dir ./ resume/index.adoc
echo " rendered resume/index.html"
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
cd $(dirname "${BASH_SOURCE[0]}")/..
asciidoctor-pdf --base-dir ./ --destination-dir ./ --out-file resume.pdf resume/index.adoc
echo " rendered ./resume.pdf"
12 start
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

# Run this via `./start`

if hash foreman 2>/dev/null; then
foreman start
else
echo "==============================================="
echo "Please install Foreman before proceeding"
echo "More info at https://github.com/ddollar/foreman"
echo "==============================================="
fi

0 comments on commit de069a6

Please sign in to comment.