Skip to content

Commit

Permalink
Merge pull request #71 from jsheunis/docs
Browse files Browse the repository at this point in the history
Basic docs setup
  • Loading branch information
paola-g authored Dec 3, 2024
2 parents 28f11be + 6174dcf commit 3008e51
Show file tree
Hide file tree
Showing 12 changed files with 198 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/docbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build and deploy docs

on:
push:
branches:
- master

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Pages
id: pages
uses: actions/configure-pages@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./docs/requirements.txt
- name: Build
run: |
cd docs
make html
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./docs/_build/html

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub pages
id: deployment
uses: actions/deploy-pages@v2
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
docs/_build
docs/build
.DS_Store
vb_toolbox/__pycache__
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21 changes: 21 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Documentation setup

The documentation for this project is built with Sphinx.

To be able to contribute to the docs, you need to:

1. Create and activate a virtual environment with a recent Python version
2. Clone the repository
4. Install the developer requirements with `pip`:

```
pip install -r docs/requirements.txt
```

After making changes to the docs, you can build the HTML files from the `docs` directory with:

```
make html
```

The resulting file at `docs/_build/html/index.html` can be opened in your local browser to view your changes. Once the build succeeds locally, create a pull request with your changes.
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sphinx
sphinx-book-theme
Binary file added docs/source/_static/vb_toolbox_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'Vogt-Bailey Index Toolbox'
copyright = '2024, vbtoolbox developers'
author = 'vbtoolbox developers'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = []

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_book_theme'
html_static_path = ['_static']
html_theme_options = {
"logo": {
"text": "Vogt-Bailey Index Toolbox",
"image_light": "_static/vb_toolbox_logo.png",
"image_dark": "_static/vb_toolbox_logo.png",
}
}
19 changes: 19 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.. Vogt-Bailey Index Toolbox documentation master file, created by
sphinx-quickstart on Tue Dec 3 14:13:08 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Vogt-Bailey Index Toolbox docs
==============================

This documentation describes the `Vogt-Bailey Index Toolbox`_.

.. _Vogt-Bailey Index Toolbox: https://github.com/VBIndex/py_vb_toolbox

.. toctree::
:maxdepth: 2
:caption: Contents:

overview
installation
usage
2 changes: 2 additions & 0 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Installation
************
2 changes: 2 additions & 0 deletions docs/source/overview.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Overview
********
2 changes: 2 additions & 0 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Usage
*****

0 comments on commit 3008e51

Please sign in to comment.