Skip to content

Commit

Permalink
Merge pull request #17 from punch-mission/new-docs
Browse files Browse the repository at this point in the history
switch to sphinx docs
  • Loading branch information
jmbhughes authored Nov 17, 2023
2 parents 84157c9 + bb0844a commit c5078d2
Show file tree
Hide file tree
Showing 16 changed files with 204 additions and 80 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: deploy-docs

# Only run this when the master branch changes
on:
push:
branches:
- main

# This job installs dependencies, builds the book, and pushes it to `gh-pages`
jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# Install dependencies
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: 3.10

- name: Install dependencies
run: |
pip install -r ./docs/requirements.txt
pip install -r requirements.txt
# Build the book
- name: Sphinx build
run: |
cd ./docs; make html; cd ..
# Push the book's HTML to github-pages
- name: GitHub Pages action
uses: peaceiris/actions-gh-pages@v3.6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/html
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
scripts/credentials.py
/docs/build/
/venv/
/venv-docs/
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)
32 changes: 0 additions & 32 deletions docs/_config.yml

This file was deleted.

9 changes: 0 additions & 9 deletions docs/_toc.yml

This file was deleted.

2 changes: 0 additions & 2 deletions docs/database.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/installing.md

This file was deleted.

32 changes: 0 additions & 32 deletions docs/intro.md

This file was deleted.

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=source
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
Empty file removed docs/references.bib
Empty file.
7 changes: 4 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
jupyter-book
matplotlib
numpy
sphinx
pydata-sphinx-theme
sphinx-autoapi
sphinx-favicon
1 change: 0 additions & 1 deletion docs/running.md

This file was deleted.

Binary file added docs/source/_static/favicon.ico
Binary file not shown.
File renamed without changes
85 changes: 85 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = 'punchpipe'
copyright = '2023, PUNCH Science Operations Center'
author = 'PUNCH Science Operations Center'

# The full version, including alpha/beta/rc tags
release = '0.0.1'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.

extensions = ['autoapi.extension',
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx_favicon']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "pydata_sphinx_theme"
html_show_sourcelink = False
html_static_path = ['_static']
html_theme_options = {
"use_edit_page_button": True,
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/punch-mission/punchpipe",
"icon": "fa-brands fa-github",
"type": "fontawesome",
}
],
"show_nav_level": 1,
"show_toc_level": 3,
"logo": {
"text": "punchpipe",
"image_light": "_static/logo.png",
"image_dark": "_static/logo.png",
}
}
html_context = {
# "github_url": "https://github.com", # or your GitHub Enterprise site
"github_user": "punch-mission",
"github_repo": "punchpipe",
"github_version": "main",
"doc_path": "docs/source/",
}


autoapi_dirs = ['../../punchpipe']

favicons = ["favicon.ico"]
20 changes: 20 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. punchpipe documentation master file, created by
sphinx-quickstart on Fri Nov 10 00:19:10 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to punchpipe's documentation!
=====================================

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



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

0 comments on commit c5078d2

Please sign in to comment.