|
| 1 | +# Build the resume and the publications list (LuaLaTeX + Lua), Word versions, and a local |
| 2 | +# preview of the Jekyll page. Run from the repository root. |
| 3 | +# |
| 4 | +# make resume + pubs PDFs and both .docx files |
| 5 | +# make resume dev/tex/main.tex -> files/sheikhUsmanAli_resume.pdf (files/ is tracked; the site links to it) |
| 6 | +# make pubs dev/tex/publications.tex -> "info/Publications -- Ali.pdf" (the previous file is kept once as "... (original).pdf"); |
| 7 | +# PUBS_DIR=files make pubs publishes it next to the resume |
| 8 | +# make docx Word versions -> files/sheikhUsmanAli_resume.docx, "info/Publications -- Ali.docx" |
| 9 | +# make preview render index.html (Liquid) into _site/ so it can be opened locally (dev/_site/) |
| 10 | +# make static files/resume.html: one self-contained page (CSS/JS inlined) that opens from disk and shows without JavaScript |
| 11 | +# make serve preview + http://localhost:8000 |
| 12 | +# make htmlpdf print the rendered page to PDF with Chrome: A5, zoom 30% (PAPER=A4 ZOOM=100 to change) |
| 13 | +# make banner LinkedIn banners (dark/light/e-ink) -> linkedin/out/*.{svg,pdf,png}, see linkedin/Makefile |
| 14 | +# make fmt format everything: black (python), prettier (json css js md yml), stylua (lua) |
| 15 | +# make lint the same checks without changing files (non-zero exit when something is off) |
| 16 | +# make profile banner.md (GitHub profile README, monospace panel) from dev/config/profile.json |
| 17 | +# make doctor check that the toolchain is complete |
| 18 | +# make clean remove build/ (generated PDFs/DOCX in the root are kept); make distclean also _site/ and .venv/ |
| 19 | +# |
| 20 | +# Language/technology tags in the resume (web, PDF, DOCX): defaults live in _data/personal.json |
| 21 | +# "options"; override per run with |
| 22 | +# make resume RESUME_LANGS=0 hide the tags |
| 23 | +# make resume RESUME_LANGS_LIST=1 show them as a "Tech: ..." line under the text instead of in the heading |
| 24 | +# make resume RESUME_MAX_CHARS=80 strict limit of characters per line for lists (skills, Tech lines, |
| 25 | +# languages): they wrap to a new line between items; default 90 |
| 26 | +# make docx RESUME_CONTACT=0 drop the Phone / Address placeholder lines (options.contact_placeholders); real values go |
| 27 | +# into the git-ignored info/contact.json {"phone": "...", "address": "..."} |
| 28 | +# make docx RESUME_PHOTO=0 drop the bordered 35 x 45 mm photo box in the Word resume (options.photo_placeholder); |
| 29 | +# make docx RESUME_PHOTO_FILE=info/me.jpg put a real photo in it (or set options.photo) |
| 30 | +# make pubs RESUME_ABSTRACT=1 show abstracts (they are placeholders now: fill "abstract" in _data/pubs.json) |
| 31 | +# Publications: _data/pubs.json has placeholders for abstract, doi and links (Paper, PDF, Code, Slides); |
| 32 | +# empty values are not shown. options.show_abstract (default false) switches abstracts on or off. |
| 33 | +# (RESUME_LANGS, RESUME_LANGS_LIST, RESUME_MAX_CHARS, RESUME_ABSTRACT work for resume, docx and preview alike; |
| 34 | +# defaults live in _data/personal.json "options": show_languages, languages_as_list, max_line_chars) |
| 35 | +# |
| 36 | +# index.html contains Liquid ({{ }}, {% %}): opening it straight from disk shows the raw |
| 37 | +# placeholders. Use `make preview` (or GitHub Pages) to see the rendered page. |
| 38 | + |
| 39 | +SHELL := /bin/bash |
| 40 | +BUILD := dev/build |
| 41 | +VENV := dev/.venv |
| 42 | +PY := $(VENV)/bin/python |
| 43 | +LATEXMK := latexmk -lualatex -interaction=nonstopmode -halt-on-error -outdir=$(BUILD) -g |
| 44 | +DATA := $(wildcard _data/*.json) |
| 45 | +LUA := $(wildcard dev/lua/*.lua) |
| 46 | +# published documents go to files/ (tracked in git); personal ones to info/ (git-ignored) |
| 47 | +FILES := files |
| 48 | +RESUME := $(FILES)/sheikhUsmanAli_resume |
| 49 | +PAPER ?= A5 |
| 50 | +ZOOM ?= 30 |
| 51 | +# info/ is git-ignored (personal documents) |
| 52 | +PUBS_DIR ?= info |
| 53 | +PUBS := $(PUBS_DIR)/Publications -- Ali |
| 54 | + |
| 55 | +.PHONY: all resume pubs docx static htmlpdf banner profile preview serve doctor clean distclean venv devtools fmt lint |
| 56 | + |
| 57 | +all: resume pubs docx static |
| 58 | + |
| 59 | +# ---- PDFs (latexmk -g forces a run: the Lua data reads are not tracked by latexmk) ------------- |
| 60 | +resume: |
| 61 | + @mkdir -p $(BUILD) $(FILES) |
| 62 | + $(LATEXMK) dev/tex/main.tex |
| 63 | + cp $(BUILD)/main.pdf "$(RESUME).pdf" |
| 64 | + |
| 65 | +pubs: |
| 66 | + @mkdir -p $(BUILD) $(PUBS_DIR) |
| 67 | + $(LATEXMK) dev/tex/publications.tex |
| 68 | + @[ ! -f "$(PUBS).pdf" ] || [ -f "$(PUBS) (original).pdf" ] || cp "$(PUBS).pdf" "$(PUBS) (original).pdf" |
| 69 | + cp $(BUILD)/publications.pdf "$(PUBS).pdf" |
| 70 | + |
| 71 | +# ---- Word ------------------------------------------------------------------------------------- |
| 72 | +docx: venv |
| 73 | + @mkdir -p $(FILES) |
| 74 | + $(PY) dev/scripts/make_docx.py resume "$(RESUME).docx" |
| 75 | + @mkdir -p $(PUBS_DIR) |
| 76 | + $(PY) dev/scripts/make_docx.py pubs "$(PUBS).docx" |
| 77 | + |
| 78 | +htmlpdf: preview |
| 79 | + $(PY) dev/scripts/print_html.py --paper $(PAPER) --zoom $(ZOOM) -o "$(BUILD)/resume-html-$(PAPER)-$(ZOOM)pct.pdf" |
| 80 | + |
| 81 | +# ---- LinkedIn banner --------------------------------------------------------------------------- |
| 82 | +banner: |
| 83 | + $(MAKE) -C linkedin publish |
| 84 | + |
| 85 | +profile: venv |
| 86 | + $(PY) dev/scripts/make_profile.py |
| 87 | + |
| 88 | +# ---- local preview of the Jekyll page --------------------------------------------------------- |
| 89 | +preview: venv |
| 90 | + @if command -v jekyll >/dev/null; then jekyll build -d dev/_site; else $(PY) dev/scripts/preview.py; fi |
| 91 | + @echo "open dev/_site/index.html" |
| 92 | + |
| 93 | +static: venv |
| 94 | + $(PY) dev/scripts/preview.py --standalone |
| 95 | + |
| 96 | +serve: preview |
| 97 | + cd dev/_site && python3 -m http.server 8000 |
| 98 | + |
| 99 | +# ---- tooling ---------------------------------------------------------------------------------- |
| 100 | +venv: $(VENV)/.ok |
| 101 | + |
| 102 | +$(VENV)/.ok: dev/scripts/requirements.txt |
| 103 | + python3 -m venv $(VENV) |
| 104 | + $(VENV)/bin/pip install --quiet -r dev/scripts/requirements.txt |
| 105 | + @touch $@ |
| 106 | + |
| 107 | +# ---- formatting and linting (same commands as the VS Code tasks in .vscode/tasks.json) -------- |
| 108 | +PRETTIER := npx --yes prettier@3 --config dev/config/prettierrc.json --ignore-path dev/config/prettierignore |
| 109 | +STYLUA := npx --yes @johnnymorganz/stylua-bin |
| 110 | +PRETTIER_GLOB := '**/*.{json,css,js,md,yml,yaml}' |
| 111 | + |
| 112 | +devtools: venv $(VENV)/.dev |
| 113 | + |
| 114 | +$(VENV)/.dev: dev/scripts/requirements-dev.txt |
| 115 | + $(VENV)/bin/pip install --quiet -r dev/scripts/requirements-dev.txt |
| 116 | + @touch $@ |
| 117 | + |
| 118 | +fmt: devtools |
| 119 | + $(PY) -m black --config dev/config/pyproject.toml . |
| 120 | + $(PRETTIER) --write $(PRETTIER_GLOB) |
| 121 | + $(STYLUA) --config-path dev/config/stylua.toml dev/lua |
| 122 | + |
| 123 | +lint: devtools |
| 124 | + $(PY) -m black --config dev/config/pyproject.toml --check --diff . |
| 125 | + $(PRETTIER) --check $(PRETTIER_GLOB) |
| 126 | + $(STYLUA) --config-path dev/config/stylua.toml --check dev/lua |
| 127 | + texlua dev/lua/selftest.lua |
| 128 | + |
| 129 | +doctor: |
| 130 | + @ok=1; for t in lualatex latexmk texlua python3; do \ |
| 131 | + if command -v $$t >/dev/null; then echo "ok $$t"; else echo "MISSING $$t"; ok=0; fi; done; \ |
| 132 | + for f in hyperref.sty titlesec.sty enumitem.sty marvosym.sty tgpagella.sty tgtermes.sty; do \ |
| 133 | + if kpsewhich $$f >/dev/null; then echo "ok $$f"; else echo "MISSING $$f (sudo apt install texlive-latex-extra texlive-fonts-recommended)"; ok=0; fi; done; \ |
| 134 | + if kpsewhich Alegreya.sty >/dev/null; then echo "ok Alegreya"; \ |
| 135 | + else echo "note Alegreya not installed: using TeX Gyre Pagella (sudo apt install texlive-fonts-extra for the original look)"; fi; \ |
| 136 | + if kpsewhich luaotfload-main.lua >/dev/null; then echo "ok luaotfload"; \ |
| 137 | + else echo "note texlive-luatex not installed: fine, the sources use Type1 fonts and pure-Lua JSON (no fontspec/luacode)"; fi; \ |
| 138 | + texlua dev/lua/selftest.lua; \ |
| 139 | + [ $$ok = 1 ] && echo "ready: make" || { echo "fix the MISSING items above"; exit 1; } |
| 140 | + |
| 141 | +clean: |
| 142 | + rm -rf $(BUILD) |
| 143 | + |
| 144 | +distclean: clean |
| 145 | + rm -rf dev/_site $(VENV) |
0 commit comments