This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
forked from swyddfa/esbonio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (34 loc) · 1.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
.PHONY: preview-completion-docs completion-docs
VENV := .env
ifeq ($(CI),true)
PYTHON=python
endif
# Default python env.
ifndef PYTHON
PYTHON=$(VENV)/bin/python
endif
# ---------------------------------------- Development Environments -------------------------------------------
$(VENV)/bin/python:
python3 -m venv $(VENV)
$@ -m pip install --upgrade pip
$@ -m pip install -r docs/requirements.txt
$@ -m pip install -e lib/esbonio[dev]
$@ -m pip install -e lib/esbonio-extensions[dev]
venv: $(VENV)/bin/python
# ---------------------------------------- CompletionItem Documentation ---------------------------------------
DOCUTILS_COMPLETION_DOCS=lib/esbonio/esbonio/lsp/rst/roles.json lib/esbonio/esbonio/lsp/rst/directives.json
SPHINX_COMPLETION_DOCS=lib/esbonio/esbonio/lsp/sphinx/roles.json lib/esbonio/esbonio/lsp/sphinx/directives.json
COMPLETION_DOCS=$(SPHINX_COMPLETION_DOCS) $(DOCUTILS_COMPLETION_DOCS)
# '&:' Indicates that the multiple targets listed are 'grouped' and that they are produced together from running
# the command below once. This prevents the command being run once for each file produced.
# https://www.gnu.org/software/make/manual/html_node/Multiple-Targets.html
#
# '$^' Expands into the list of dependencies of the target (python .... in this case)
# https://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html#Automatic-Variables
$(DOCUTILS_COMPLETION_DOCS) &: $(PYTHON) scripts/generate_docutils_documentation.py
$^ -o lib/esbonio/esbonio/lsp/rst/
$(SPHINX_COMPLETION_DOCS) &: $(PYTHON) scripts/generate_sphinx_documentation.py
$^ -o lib/esbonio/esbonio/lsp/sphinx/
completion-docs: $(COMPLETION_DOCS)
preview-completion-docs: $(COMPLETION_DOCS)
$(PYTHON) scripts/preview_documentation.py $(COMPLETION_DOCS)