Skip to content

Commit

Permalink
Run sphinx-quickstart
Browse files Browse the repository at this point in the history
  • Loading branch information
tillywoodfield committed Apr 17, 2024
1 parent 9b3a268 commit 1dbe338
Show file tree
Hide file tree
Showing 8 changed files with 181 additions and 4 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pip install -r requirements_dev.txt
### Update dependencies
```
python -m piptools compile --extra=dev -o requirements_dev.txt pyproject.toml
pip install -r requirements_dev.txt
```

### Run linting
Expand All @@ -19,3 +20,15 @@ black iati_sphinx_theme
isort iati_sphinx_theme
flake8 iati_sphinx_theme
```

### Documentation with live preview

1. Install the theme locally:
```
pip install -e .
```

2. Start the docs development server:
```
sphinx-autobuild docs docs/_build/html
```
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_build
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 = .
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)
26 changes: 26 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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 = "IATI Sphinx Theme"
copyright = "2024 IATI Secretariat"
author = "IATI Secretariat"

# -- 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 = "iati_sphinx_theme"
html_static_path = ["_static"]
4 changes: 4 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
=================
IATI Sphinx Theme
=================

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
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ dynamic = ["version", "description"]
dependencies = []

[project.optional-dependencies]
dev = ["black", "isort", "flake8", "Flake8-pyproject"]
dev = [
"black",
"isort",
"flake8",
"Flake8-pyproject",
"sphinx-autobuild"
]

[project.entry-points."sphinx.html_themes"]
iati_sphinx_theme = "iati_sphinx_theme"
Expand Down
78 changes: 75 additions & 3 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,58 @@
#
# pip-compile --extra=dev --output-file=requirements_dev.txt pyproject.toml
#
alabaster==0.7.16
# via sphinx
anyio==4.3.0
# via
# starlette
# watchfiles
babel==2.14.0
# via sphinx
black==24.4.0
# via iati_sphinx_theme (pyproject.toml)
certifi==2024.2.2
# via requests
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via black
# via
# black
# uvicorn
colorama==0.4.6
# via sphinx-autobuild
docutils==0.21.1
# via sphinx
exceptiongroup==1.2.0
# via anyio
flake8==7.0.0
# via
# flake8-pyproject
# iati_sphinx_theme (pyproject.toml)
flake8-pyproject==1.2.3
# via iati_sphinx_theme (pyproject.toml)
h11==0.14.0
# via uvicorn
idna==3.7
# via
# anyio
# requests
imagesize==1.4.1
# via sphinx
isort==5.13.2
# via iati_sphinx_theme (pyproject.toml)
jinja2==3.1.3
# via sphinx
markupsafe==2.1.5
# via jinja2
mccabe==0.7.0
# via flake8
mypy-extensions==1.0.0
# via black
packaging==24.0
# via black
# via
# black
# sphinx
pathspec==0.12.1
# via black
platformdirs==4.2.0
Expand All @@ -30,9 +64,47 @@ pycodestyle==2.11.1
# via flake8
pyflakes==3.2.0
# via flake8
pygments==2.17.2
# via sphinx
requests==2.31.0
# via sphinx
sniffio==1.3.1
# via anyio
snowballstemmer==2.2.0
# via sphinx
sphinx==7.3.5
# via sphinx-autobuild
sphinx-autobuild==2024.4.16
# via iati_sphinx_theme (pyproject.toml)
sphinxcontrib-applehelp==1.0.8
# via sphinx
sphinxcontrib-devhelp==1.0.6
# via sphinx
sphinxcontrib-htmlhelp==2.0.5
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.7
# via sphinx
sphinxcontrib-serializinghtml==1.1.10
# via sphinx
starlette==0.37.2
# via sphinx-autobuild
tomli==2.0.1
# via
# black
# flake8-pyproject
# sphinx
typing-extensions==4.11.0
# via black
# via
# anyio
# black
# uvicorn
urllib3==2.2.1
# via requests
uvicorn==0.29.0
# via sphinx-autobuild
watchfiles==0.21.0
# via sphinx-autobuild
websockets==12.0
# via sphinx-autobuild

0 comments on commit 1dbe338

Please sign in to comment.