Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# List of directories to remove
CLEAN_BUILD_DIRS = _build jupyter_execute
CLEAN_DIRS = $(CLEAN_BUILD_DIRS) downloaded reference sections_readme

.PHONY: clean clean_build

# Removes the specified directories
clean:
rm -rf $(CLEAN_DIRS)

clean_build:
rm -rf $(CLEAN_BUILD_DIRS)

build:
sphinx-apidoc --force --implicit-namespaces --module-first -o reference ../src/vuegen
python split_readme.py
sphinx-build -n -W --keep-going -b html ./ ./_build/
23 changes: 17 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,34 @@ poetry install --with docs

## Build docs using Sphinx command line tools

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

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

- `--separate` to build separate pages for each (sub-)module
```bash
# pwd: docs
make clean
make build
```

Alternatevely, you can run these commands manually each at a time, as follows:

```bash
# pwd: docs
# apidoc
sphinx-apidoc --force --implicit-namespaces --module-first -o reference ../src/vuegen
# build docs
python split_readme.py
sphinx-build -n -W --keep-going -b html ./ ./_build/
```

## Include repo README into docs

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.
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.

Relative links are used in the main README, which need to be resolved when building. It's
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
Expand Down