Skip to content

Commit 5da8799

Browse files
authored
Feature/read the docs (#38)
* basic autogenerated docs * docs wip * update category docs * update docs for each namespace * fix format, include module in sphinx conf * fix broken import when building docs * fix broken import when building docs * fix build with local import * update readme * update ci deps
1 parent 7a8ae40 commit 5da8799

20 files changed

+259
-128
lines changed

.readthedocs.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
3+
build:
4+
os: "ubuntu-22.04"
5+
tools:
6+
python: "3.10"
7+
8+
python:
9+
install:
10+
- requirements: docs/requirements.txt
11+
12+
sphinx:
13+
configuration: docs/source/conf.py

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
[![PyPI version](https://badge.fury.io/py/fred-py-api.svg)](https://badge.fury.io/py/fred-py-api)
2+
[![Documentation Status](https://readthedocs.org/projects/fred-py-api/badge/?version=latest)](https://fred-py-api.readthedocs.io/en/latest/?badge=latest)
23
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/fred-py-api?style=flat)](https://pypi.org/project/fred-py-api/)
34
[![codecov](https://codecov.io/gh/zachspar/fred-py-api/branch/main/graph/badge.svg?token=BG1948D8Y7)](https://codecov.io/gh/zachspar/fred-py-api)
45

56
# Fred Python API
67
A fully-featured FRED Command Line Interface & Python API Wrapper.
78

8-
## Documentation:
9+
### Documentation:
10+
- [fred-py-api Docs](https://fred-py-api.readthedocs.io/en/latest/)
11+
12+
### Wiki:
913
- [fred-py-api Wiki](https://github.com/zachspar/fred-py-api/wiki)
1014

1115
### FRED References:

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
click>=7.0
2+
requests>=2.17.3
3+
sphinx==7.2.6
4+
sphinx-rtd-theme==1.3.0rc1

docs/source/categories.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Categories
2+
==========
3+
4+
.. autosummary::
5+
:toctree: generated
6+
7+
.. automodule:: fred.api.categories
8+
:members:

docs/source/conf.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
# -- Project information -----------------------------------------------------
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8+
import os
9+
import sys
10+
11+
sys.path.insert(0, os.path.abspath(os.path.join("..", "..", "src")))
12+
13+
project = "fred-py-api"
14+
copyright = "2024, Zachary Spar"
15+
author = "Zachary Spar"
16+
release = "1.1.3"
17+
18+
# -- General configuration ---------------------------------------------------
19+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
20+
21+
extensions = [
22+
"sphinx.ext.duration",
23+
"sphinx.ext.doctest",
24+
"sphinx.ext.autodoc",
25+
"sphinx.ext.napoleon",
26+
"sphinx.ext.autosummary",
27+
"sphinx.ext.intersphinx",
28+
]
29+
30+
intersphinx_mapping = {
31+
"python": ("https://docs.python.org/3/", None),
32+
"sphinx": ("https://www.sphinx-doc.org/en/master/", None),
33+
}
34+
35+
intersphinx_disabled_domains = ["std"]
36+
37+
templates_path = ["_templates"]
38+
39+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
40+
41+
# -- Options for HTML output -------------------------------------------------
42+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
43+
44+
html_theme = "alabaster"
45+
html_static_path = ["_static"]

docs/source/exceptions.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Exceptions
2+
==========
3+
4+
.. autosummary::
5+
:toctree: generated
6+
7+
.. automodule:: fred.api.exceptions
8+
:members:

docs/source/index.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.. fred-py-api documentation master file, created by
2+
sphinx-quickstart on Fri Mar 22 14:55:11 2024.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to fred-py-api's documentation!
7+
=======================================
8+
9+
.. toctree::
10+
:maxdepth: 3
11+
:caption: Contents:
12+
13+
categories
14+
releases
15+
series
16+
sources
17+
tags
18+
19+
20+
Indices and tables
21+
==================
22+
23+
* :ref:`genindex`
24+
* :ref:`modindex`
25+
* :ref:`search`

docs/source/releases.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Releases
2+
========
3+
4+
.. autosummary::
5+
:toctree: generated
6+
7+
.. automodule:: fred.api.releases
8+
:members:

0 commit comments

Comments
 (0)