This repository has been archived by the owner on Jun 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
85 lines (70 loc) · 2.75 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Global variables {{{1
# ================
# Where make should look for things
VPATH = lib
vpath %.csl lib/styles
vpath %.yaml .:spec
vpath default.% lib/pandoc-templates
# Branch-specific targets and recipes {{{1
# ===================================
# Jekyll {{{2
# ------
SRC = $(wildcard *.md)
SITE := $(patsubst %.md,docs/%.md, $(SRC))
serve : build
bundle exec jekyll serve 2>&1 | egrep -v 'deprecated'
build : $(SITE)
cp -f _config.yml docs/
bundle exec jekyll build 2>&1 | egrep -v 'deprecated'
docs/%.md : %.md spec/jekyll.yaml lib/templates/default.jekyll
pandoc -o $@ -d spec/jekyll.yaml $<
# Install and cleanup {{{1
# ===================
# `make install` copies various config files and hooks to the .git
# directory and sets up standard empty directories:
# - link-template: sets up the template repo in a branch named `template`, for
# when you want to update local boilerplates across different projects.
# - makedirs: creates standard folders for output (_book), received files
# (_share), and figures (fig).
# - submodule: initializes the submodules for the CSL styles and for the
# Reveal.js framework.
# - virtualenv: sets up a virtual environment (but you still need to activate
# it from the command line).
.PHONY : install link-template makedirs submodule virtualenv bundle serve clean
install : link-template makedirs submodule csl virtualenv license
bundle install
makedirs :
-mkdir _share && mkdir _book && mkdir fig
csl : .install/git/modules/lib/styles/info/sparse-checkout
rsync -aq .install/git/ .git/
cd lib/styles && git config core.sparsecheckout true && \
git checkout master && git pull && \
git read-tree -m -u HEAD
submodule_init :
# Generating a repo from a GitHub template breaks the submodules.
# As a workaround, we init the submodules after cloning the template repo
# instead of including them in the source template.
git submodule add https://github.com/hakimel/reveal.js.git docs/reveal.js
git submodule add https://github.com/citation-style-language/styles.git lib/styles
git sumbodule add https://github.com/jgm/pandoc-templates.git lib/pandoc-templates
template :
-git remote add template git@github.com:p3palazzo/research_template.git
git fetch template
git checkout -B template --track template/master
git checkout -
virtualenv :
python -m venv .venv && source .venv/bin/activate && \
pip install -r .install/requirements.txt
-rm -rf src
bundle :
bundle update
license :
source .venv/bin/activate && \
lice --header cc_by_sa >> README.md && \
lice cc_by_sa -f LICENSE
# `make clean` will clear out a few standard folders where only compiled
# files should be. Anything you might have placed manually in them will
# also be deleted!
clean :
-rm -r _book/* _site/*
# vim: set foldmethod=marker :