Skip to content

Commit 2164a8b

Browse files
authored
📝 Create makefile to automate docs building process (#165)
* 📝 Docs(docs/Makefile): automate docs building process * 📝 Docs(docs/README.md): update with instructions to use makefile
1 parent 162bba6 commit 2164a8b

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

docs/Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# List of directories to remove
2+
CLEAN_BUILD_DIRS = _build jupyter_execute
3+
CLEAN_DIRS = $(CLEAN_BUILD_DIRS) downloaded reference sections_readme
4+
5+
.PHONY: clean clean_build
6+
7+
# Removes the specified directories
8+
clean:
9+
rm -rf $(CLEAN_DIRS)
10+
11+
clean_build:
12+
rm -rf $(CLEAN_BUILD_DIRS)
13+
14+
build:
15+
sphinx-apidoc --force --implicit-namespaces --module-first -o reference ../src/vuegen
16+
python split_readme.py
17+
sphinx-build -n -W --keep-going -b html ./ ./_build/

docs/README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,34 @@ poetry install --with docs
1818

1919
## Build docs using Sphinx command line tools
2020

21-
Command to be run from `path/to/docs`, i.e. from within the `docs` package folder:
21+
We use `sphinx-apidoc` to create the API reference files from the source code and
22+
`sphinx-build` to create the html files. Also, we use a custom script `split_readme.py` to
23+
split the main `README.md` file into smaller sections for inclusion in the docs.
2224

23-
Options:
25+
We provide a [Makefile](https://github.com/Multiomics-Analytics-Group/vuegen/blob/HEAD/docs/Makefile)
26+
to simplify the cleaning and building process, which you can run from the `docs` folder:
2427

25-
- `--separate` to build separate pages for each (sub-)module
28+
```bash
29+
# pwd: docs
30+
make clean
31+
make build
32+
```
33+
34+
Alternatevely, you can run these commands manually each at a time, as follows:
2635

2736
```bash
2837
# pwd: docs
29-
# apidoc
3038
sphinx-apidoc --force --implicit-namespaces --module-first -o reference ../src/vuegen
31-
# build docs
39+
python split_readme.py
3240
sphinx-build -n -W --keep-going -b html ./ ./_build/
3341
```
3442

3543
## Include repo README into docs
3644

37-
The README is included in the `Overview` section of the docs. We created a [Python script](https://github.com/Multiomics-Analytics-Group/vuegen/blob/split-readme-docs/docs/split_readme.py) to split the README sections into separate md files, stored in `docs/sections_readme`. The `index.md` file contains the structure of the docs with the generated sections and additional information.
45+
The README is included in the `Overview` section of the docs. We created a
46+
[Python script](https://github.com/Multiomics-Analytics-Group/vuegen/blob/split-readme-docs/docs/split_readme.py) to
47+
split the README sections into separate md files, stored in `docs/sections_readme`. The `index.md` file contains
48+
the structure of the docs with the generated sections and additional information.
3849

3950
Relative links are used in the main README, which need to be resolved when building. It's
4051
possible to include the a `relative-docs` option if one uses `index.md` ([see docs](https://myst-parser.readthedocs.io/en/latest/faq/index.html#include-a-file-from-outside-the-docs-folder-like-readme-md)). This does not work

0 commit comments

Comments
 (0)