-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from deeprob-org/issue-#10
PR for Issue #10
- Loading branch information
Showing
7 changed files
with
119 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# This is a workflow for pushing versioned documentation to the gh-pages branch | ||
name: Sphinx-MultiDoc | ||
|
||
on: | ||
# Permits manual workflow dispatch | ||
workflow_dispatch: | ||
|
||
# Triggers the workflow on push events on the main branch and tags | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checks-out your repository, so your job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
# Setup a Python environment | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
architecture: 'x64' | ||
|
||
# Install dependencies | ||
- name: Install Dependencies | ||
working-directory: docs | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install git+https://github.com/samtygier-stfc/sphinx-multiversion.git@prebuild_command | ||
# Build versioned documentation | ||
- name: Build Versioned Documentation | ||
working-directory: docs | ||
run: make | ||
|
||
# Deploy versioned documentation, using GitHub Pages | ||
- name: Deploy Documentation | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
force_orphan: true | ||
enable_jekyll: false | ||
publish_dir: docs/_build | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
api | ||
_build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,16 @@ | ||
SPHINX_BUILD = sphinx-build | ||
SPHINX_APIDOC = sphinx-apidoc | ||
SPHINX_BUILD = sphinx-multiversion | ||
SPHINX_BUILD_DIR = _build | ||
SPHINX_SOURCE_DIR = . | ||
SPHINX_API_DIR = api | ||
API_SOURCE_DIR = ../deeprob | ||
SPHINX_INDEX_FILE = index.html | ||
|
||
.PHONY: clean | ||
|
||
# Make the HTML static site | ||
sphinx_html: sphinx_api | ||
$(SPHINX_BUILD) -M html $(SPHINX_SOURCE_DIR) $(SPHINX_BUILD_DIR) | ||
|
||
# Make the API pages | ||
sphinx_api: | ||
$(SPHINX_APIDOC) -o $(SPHINX_API_DIR) $(API_SOURCE_DIR) | ||
sphinx_html: | ||
$(SPHINX_BUILD) $(SPHINX_SOURCE_DIR) $(SPHINX_BUILD_DIR) | ||
cp $(SPHINX_SOURCE_DIR)/$(SPHINX_INDEX_FILE) $(SPHINX_BUILD_DIR) | ||
|
||
# Clean directories | ||
clean: | ||
rm -rf $(SPHINX_API_DIR) | ||
rm -rf $(SPHINX_BUILD_DIR) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
## Documentation | ||
|
||
The source code documentation is hosted using GitHub Pages at | ||
[deeprob-org.github.io/deeprob-kit](https://deeprob-org.github.io/deeprob-kit/). | ||
|
||
The documentation is generated automatically by Sphinx, using sources stored in the `docs` directory | ||
(with a slightly modified [*Read-the-Docs*](https://readthedocs.org/) theme). | ||
Sooner or later we will make it available also online, probably hosted using GitHub pages. | ||
In particular, the documentation is versioned, i.e. there is a documentation page for the main branch and for every tag | ||
(or release) of the library. | ||
|
||
If you wish to build the documentation yourself, you will need to install the dependencies listed in `requirements.txt`. | ||
Moreover, in order to build versioned documentation, it is necessary to install a | ||
[fork of sphinx-multiversion](https://github.com/Holzhaus/sphinx-multiversion/pull/62) as following: | ||
```shell | ||
pip install git+https://github.com/samtygier-stfc/sphinx-multiversion.git@prebuild_command | ||
``` | ||
|
||
If you wish to build the documentation yourself, you will need to install the dependencies listed in `requirements.txt` | ||
and execute the Makefile script as following: | ||
```bash | ||
Finally, it's possible to execute the Makefile script as following: | ||
```shell | ||
# Clean existing documentation (optional) | ||
make clean | ||
|
||
# Build source code API documentation | ||
make sphinx_api | ||
|
||
# Build HTML documentation | ||
make sphinx_html | ||
make | ||
``` | ||
The output HTML documentation can be found inside `_build/html` directory. | ||
The output HTML documentation, for any local branch and tag (or release), can be found inside the `_build` | ||
directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions"> | ||
<span class="rst-current-version" data-toggle="rst-current-version"> | ||
<span class="fa fa-book"> Other Versions</span> | ||
v: {{ current_version.name }} | ||
<span class="fa fa-caret-down"></span> | ||
</span> | ||
<div class="rst-other-versions"> | ||
{%- if versions.tags %} | ||
<dl> | ||
<dt>Tags</dt> | ||
{%- for item in versions.tags %} | ||
<dd><a href="{{ item.url }}">{{ item.name }}</a></dd> | ||
{%- endfor %} | ||
</dl> | ||
{%- endif %} | ||
{%- if versions.branches %} | ||
<dl> | ||
<dt>Branches</dt> | ||
{%- for item in versions.branches %} | ||
<dd><a href="{{ item.url }}">{{ item.name }}</a></dd> | ||
{%- endfor %} | ||
</dl> | ||
{%- endif %} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-US"> | ||
<head> | ||
<title>Redirecting to https://deeprob-org.github.io/deeprob-kit/main</title> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="refresh" content="0; URL=https://deeprob-org.github.io/deeprob-kit/main/index.html"> | ||
<link rel="canonical" href="https://deeprob-org.github.io/deeprob-kit/main/index.html"> | ||
</head> | ||
</html> |