Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

Add sphinx and Read the Docs #240

Merged
merged 51 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
44bedca
add configuration file
zaqqwerty Apr 27, 2022
b34bf1f
update config
zaqqwerty Apr 27, 2022
fed17f9
initial sphinx files
zaqqwerty Apr 27, 2022
cb4279a
generate docs
zaqqwerty Apr 27, 2022
b7d4f85
remove generated files
zaqqwerty Apr 27, 2022
a81fabe
move sphinx to dev
zaqqwerty Apr 27, 2022
1551fef
lock update
zaqqwerty Apr 27, 2022
4b5610b
go back to default theme
zaqqwerty Apr 27, 2022
9877fd1
add myst parser
zaqqwerty Apr 27, 2022
40a816a
ignore generated docs
zaqqwerty Apr 27, 2022
de12b2a
try solution for poetry plus rtd
zaqqwerty Apr 27, 2022
2b2386d
remove old file
zaqqwerty Apr 27, 2022
fd503c6
try different syntax
zaqqwerty Apr 27, 2022
003b91f
try asdf
zaqqwerty Apr 27, 2022
fb14747
test
zaqqwerty Apr 27, 2022
727fded
test
zaqqwerty Apr 27, 2022
811f740
try again
zaqqwerty Apr 27, 2022
ea6db2a
change asdf plugic
zaqqwerty Apr 27, 2022
8f66f3a
try again
zaqqwerty Apr 27, 2022
73fa2cc
does source work
zaqqwerty Apr 27, 2022
102d823
try downgrading
zaqqwerty Apr 27, 2022
ec0c5d0
fix
zaqqwerty Apr 27, 2022
c216195
what if i delete that section
zaqqwerty Apr 27, 2022
3eba5e0
remove parser
zaqqwerty Apr 27, 2022
990e0c6
try removing parser
zaqqwerty Apr 27, 2022
dc6cf52
add theme
zaqqwerty Apr 27, 2022
dc59827
try again
zaqqwerty Apr 27, 2022
49598ef
move sphinx dependencies to their own location
zaqqwerty Apr 27, 2022
7071b78
pyproject
zaqqwerty Apr 27, 2022
3b21ae9
update theme
zaqqwerty Apr 27, 2022
2c061e8
pass if there are just warnings
zaqqwerty Apr 27, 2022
a18f685
revert lock
zaqqwerty Apr 27, 2022
440c772
remove generated files
zaqqwerty Apr 27, 2022
5429f23
try poetry for sphinx again
zaqqwerty Apr 27, 2022
41095ba
try extras group
zaqqwerty Apr 27, 2022
444142b
update names
zaqqwerty Apr 27, 2022
1e96ee1
remove duplicate
zaqqwerty Apr 27, 2022
7fc1cc0
move files to docs source
zaqqwerty Apr 27, 2022
9d0000c
add install and contrib to toc
zaqqwerty Apr 27, 2022
0dca3ba
add myst parser for markdown
zaqqwerty Apr 27, 2022
c5504a4
myst added to docs extras
zaqqwerty Apr 27, 2022
b62dd20
try importing
zaqqwerty Apr 27, 2022
e57b990
try different dependency group
zaqqwerty Apr 27, 2022
e53d7e0
lower python version
zaqqwerty Apr 27, 2022
9386fdb
try adding doc command back
zaqqwerty Apr 27, 2022
a36b658
try updating
zaqqwerty Apr 27, 2022
4d22e00
pin deps to tfq reqs
zaqqwerty Apr 27, 2022
84e6914
move reqs
zaqqwerty Apr 27, 2022
cb00e8e
match tfq deps
zaqqwerty Apr 27, 2022
471b090
revert unnecessary changes
zaqqwerty Apr 27, 2022
8a9a8ae
docs working
zaqqwerty Apr 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ __pycache__/
*.swp
*.swo

# ignore generated docs files
/docs/build/
16 changes: 16 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2

build:
os: ubuntu-20.04
tools:
python: "3.9"

sphinx:
configuration: docs/source/conf.py

python:
install:
- method: pip
path: .
extra_requirements:
- doc
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
68 changes: 68 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# 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('.'))
sys.path.insert(0, os.path.abspath("../"))

import myst_parser
import qhbmlib
import sphinx_rtd_theme


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

project = 'QHBM Library'
copyright = '2022, The QHBM Library Authors'
author = 'The QHBM Library Authors'

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


# -- 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 = [
'myst_parser',
'sphinx.ext.autodoc',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sphinx_rtd_theme',
]

# 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 = []

# Add .rst for the index and .md for other documents
source_suffix = {
'.md': 'markdown',
'.rst': 'restructuredtext',
}


# -- 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 = 'sphinx_rtd_theme'
File renamed without changes.
16 changes: 16 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Welcome to QHBM Library's documentation!
========================================

.. toctree::
:maxdepth: 2

install
contributing
reference

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

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
File renamed without changes.
30 changes: 30 additions & 0 deletions docs/source/reference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
API Reference
=============


Data
----

.. automodule:: qhbmlib.data
:members:


Models
------

.. automodule:: qhbmlib.models
:members:


Inference
---------

.. automodule:: qhbmlib.inference
:members:


Utils
-----

.. automodule:: qhbmlib.utils
:members:
Loading