Skip to content

Commit

Permalink
added documentation on RTD with sphinx
Browse files Browse the repository at this point in the history
  • Loading branch information
mpecchi committed May 1, 2024
1 parent 569e537 commit 6c6b1a4
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 1 deletion.
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
1 change: 1 addition & 0 deletions docs/source/README.md
36 changes: 36 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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 = "myfigure"
copyright = "2024, Matteo Pecchi"
author = "Matteo Pecchi"
release = "1.0.0"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
"sphinx.ext.autodoc",
"sphinx_autodoc_typehints",
"sphinx.ext.viewcode",
"myst_parser",
"sphinx.ext.napoleon",
]


exclude_patterns = []

templates_path = ["_templates"]


# -- 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"]
autoclass_content = "both"
23 changes: 23 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. myfigure documentation master file, created by
sphinx-quickstart on Tue Apr 30 22:46:15 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to myfigure's documentation!
====================================

.. toctree::
:maxdepth: 4
:caption: Contents:

README.md

myfigure


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

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
7 changes: 7 additions & 0 deletions docs/source/myfigure.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
tga_data_analysis.myfigure
================================

.. automodule:: myfigure.myfigure
:members:
:undoc-members:
:show-inheritance:
Binary file added docs/source/requirements.txt
Binary file not shown.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.0.0"
authors = [
{ name = "Matteo Pecchi"}
]
description = "a class for standardized accessible plots"
description = "standardized accessible plots"
readme = "README.md"
license = { text = "MIT" }
classifiers = [
Expand All @@ -26,6 +26,7 @@ dependencies = [

[project.urls]
Homepage = "https://github.com/mpecchi/tga_data_analysis"
Documentation = "https://myfigure.readthedocs.io/en/latest/"

[tool.black]
line-length = 100
Expand Down

0 comments on commit 6c6b1a4

Please sign in to comment.