forked from RaminNietzsche/CVE-Radar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (37 loc) · 1.74 KB
/
Copy pathMakefile
File metadata and controls
48 lines (37 loc) · 1.74 KB
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
# extended-docs — static site builder (MkDocs Material)
# Usage: make install && make serve | make build
PYTHON ?= python3
VENV ?= .venv
PIP := $(VENV)/bin/pip
MKDOCS := PYTHONPATH=. $(VENV)/bin/mkdocs
.PHONY: help install serve build clean open check verify
help:
@echo "extended-docs — دستورات:"
@echo " make install نصب وابستگیها در .venv"
@echo " make serve پیشنمایش زنده (http://127.0.0.1:8000)"
@echo " make build ساخت site/ برای deploy"
@echo " make check build با --strict (CI)"
@echo " make verify build + بررسی رندر Mermaid و zoom JS"
@echo " make clean حذف site/ و .venv"
@echo " make open build + باز کردن site/index.html"
install: $(VENV)/bin/mkdocs
$(VENV)/bin/mkdocs: requirements.txt
$(PYTHON) -m venv $(VENV)
$(PIP) install --upgrade pip
$(PIP) install -r requirements.txt
serve: install
$(MKDOCS) serve -a 127.0.0.1:8000
build: install
$(MKDOCS) build
check: install
$(MKDOCS) build --strict
verify: check
@grep -rq 'vendor/mermaid.min.js' site/ || (echo "ERROR: vendor/mermaid.min.js not in built site" && exit 1)
@grep -rq 'mermaid-zoom' site/ || (echo "ERROR: mermaid-zoom.js not in built site" && exit 1)
@grep -rq 'panzoom' site/ || (echo "ERROR: panzoom.min.js not in built site" && exit 1)
@grep -q 'src="/CVE-Radar/assets/icons/brands/sources/nvd.png"' site/content/en/01-overview/index.html || (echo "ERROR: overview icons not rewritten to site-root asset paths" && exit 1)
@echo "OK: Mermaid + panzoom + zoom scripts bundled (render/zoom runs in browser)."
clean:
rm -rf site/ $(VENV)
open: build
@open site/index.html 2>/dev/null || xdg-open site/index.html 2>/dev/null || echo "Open site/index.html manually"