Skip to content

Commit

Permalink
Added sphinx-autoapi. Fixed some documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
WyvernIXTL committed May 11, 2024
1 parent 5935b1d commit 934b706
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/build/

# PyBuilder
.pybuilder/
Expand Down
9 changes: 0 additions & 9 deletions doc/api.rst

This file was deleted.

7 changes: 5 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
# -- Project information -----------------------------------------------------

project = 'installation-instruction'
copyright = '2024, Adam McKellar'
author = 'Adam McKellar'
copyright = '2024, Adam McKellar, Kanushka Gupta, Timo Ege'
author = 'Adam McKellar, Kanushka Gupta, Timo Ege'

# -- General configuration ---------------------------------------------------

Expand All @@ -20,8 +20,11 @@
"sphinx_mdinclude",
"sphinx.ext.autodoc",
"sphinx_rtd_theme",
"autoapi.extension",
]

autoapi_dirs = ['../installation_instruction']

# Add any paths that contain templates here, relative to this directory.
templates_path = []

Expand Down
1 change: 0 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ installation-instruction
:caption: Contents:

intro
api

Indices and tables
==================
Expand Down
1 change: 1 addition & 0 deletions installation_instruction/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
del metadata

from installation_instruction.installation_instruction import InstallationInstruction
import installation_instruction.helpers

7 changes: 5 additions & 2 deletions installation_instruction/installation_instruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def validate_and_render(self, input: dict) -> tuple[str, bool]:
:ptype input: dict
:return: Returns instructions as string and False. Or Error and True.
:rtpye: (str, bool)
:raise Exception: If no delimiter is found.
:raise Exception: If schema or user input is invalid.
"""
validate(input, self.schema)
instruction = self.template.render(input)
Expand All @@ -55,8 +55,11 @@ def validate_and_render(self, input: dict) -> tuple[str, bool]:

def __init__(self, config: str) -> None:
"""
:param config: Config file with schema and template seperated by ------ delimiter.
Returns `InstallationInstruction` from config string.
:param config: Config string with schema and template seperated by delimiter.
:raise Exception: If schema part of config is neither valid json nor valid yaml.
:raise Exception: If no delimiter is found.
"""
(schema, template) = helpers._split_string_at_delimiter(config)
try:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ docs = [
"sphinx",
"sphinx_mdinclude",
"sphinx_rtd_theme",
"sphinx-autoapi",
]


Expand Down

0 comments on commit 934b706

Please sign in to comment.