Skip to content

Commit

Permalink
Initial commit of docs files
Browse files Browse the repository at this point in the history
  • Loading branch information
dwest77a committed Jul 24, 2024
1 parent 2cefd8d commit d64d0e9
Show file tree
Hide file tree
Showing 10 changed files with 193 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Sphinx build

on:
# Push/Pull for main branch.
push:
branches: [main]
pull_request:
branches: [main]

# Run workflow manually from actions tab.
workflow_dispatch:

jobs:
build:
# Linux version requirements
runs-on: ubuntu-latest
steps:
# Checkout and build the docs with sphinx
- uses: actions/checkout@v2

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

- name: Build HTML
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
# pre-build-command: "mkdir /tmp/sphinx-log"
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: html-docs
path: docs/build/html/
# Deploys to the gh-pages branch if the commit was made to main, the
# gh-pages then takes over serving the html
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
Binary file added docs/.DS_Store
Binary file not shown.
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)
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
9 changes: 9 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sphinx==7.1.2
sphinx_rtd_theme==2.0.0

scipy==1.12.0
netCDF4==1.6.5
h5py==3.11.0
dask==2024.7.0
cftime==1.6.4
cfunits==3.3.7
Binary file added docs/source/_images/ceda.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_images/favicon.ico
Binary file not shown.
36 changes: 36 additions & 0 deletions docs/source/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

{% extends "!layout.html" %}
{% block footer %} {{ super() }}

<style>
/* Sidebar header (and topbar for mobile) */
.wy-side-nav-search, .wy-nav-top {
background: #01a33f78;
}

.caption-text, .header h1 {
color: #54d656
}

.note {
background: #BEEF9E
}
.admonition-title {
background: #335145
}

.wy-nav-side {
background: #001711;
}

</style>
{% endblock %}

<!--
a {
color: #828C51;
}
a:visited {
color: #a2b442;
} -->
41 changes: 41 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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

import os
import sys
sys.path.insert(0, os.path.abspath('../../'))

project = 'CFAPyX Package'
copyright = ('2022-2024, Centre of Environmental Data Analysis Developers,'
'Scientific and Technical Facilities Council (STFC),'
'UK Research and Innovation (UKRI). '
'BSD 2-Clause License. All rights reserved.')
author = 'Daniel Westwood'
release = 'v1.1'

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

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.autosectionlabel'
]

templates_path = ['_templates']
exclude_patterns = []


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

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']

html_logo = '_images/ceda.png'
html_favicon = '_images/favicon.ico'
9 changes: 9 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. kerchunk*builder documentation master file, created by
sphinx*quickstart on Thu Jan 25 10:40:18 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
CFAPyX - Documentation
============================

Welcome to the **CFAPyX** Documentation!

0 comments on commit d64d0e9

Please sign in to comment.