Skip to content

Commit

Permalink
docs(reference): setup mkdocstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Xenepix committed Nov 26, 2023
1 parent ecdcbb1 commit 46e04a4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
4 changes: 4 additions & 0 deletions django_napse/core/models/accounts/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@


class NapseSpace(models.Model):
"""Categorize and manage money."""

name = models.CharField(max_length=200)
uuid = models.UUIDField(default=uuid.uuid4, editable=False, unique=True)
description = models.TextField()
Expand All @@ -26,6 +28,7 @@ def __str__(self):
return f"SPACE: {self.name}"

def info(self, verbose=True, beacon=""):
"""Info documentation."""
string = ""
string += f"{beacon}Space ({self.pk=}):\n"
string += f"{beacon}Args:\n"
Expand All @@ -41,6 +44,7 @@ def info(self, verbose=True, beacon=""):

@property
def testing(self):
"""Testing property documentation."""
return self.exchange_account.testing

@property
Expand Down
6 changes: 6 additions & 0 deletions docs/sources/reference/space.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
::: django_napse.core.models.NapseSpace
options:
members:
- info
- testing
show_source: false
13 changes: 10 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ plugins:
html_report_dir: htmlcov # default
- neoteroi.mkdocsoad:
use_pymdownx: true
- mkdocstrings:
default_handler: python
handlers:
python:
paths: [src]

markdown_extensions:
- toc:
Expand Down Expand Up @@ -113,8 +118,10 @@ nav:
- "sources/guides/exchange_account.md"
- "sources/guides/space.md"
- "sources/guides/fleet.md"
- Reference:
- "sources/reference/space.md"
- API: "api.md"
- Development: coverage.md
- Contributing:
- Development:
- Contributing: "contributing.md"
- Security: "SECURITY.md"
- Security: "SECURITY.md"
- Coverage: coverage.md
6 changes: 4 additions & 2 deletions requirements/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ platformdirs==3.11.0 # https://github.com/platformdirs/platformdi
# Documentation
mkdocs-material==9.4.10 # https://github.com/squidfunk/mkdocs-material
pygments==2.17.1 # https://github.com/pygments/pygments
mkdocs-plugin-inline-svg==0.1.0 # https://pypi.org/project/mkdocs-plugin-inline-svg/
mkdocs-plugin-inline-svg==0.1.0 # https://pypi.org/project/mkdocs-plugin-inline-svg
mkdocs-coverage==1.0.0 # https://github.com/pawamoy/mkdocs-coverage
neoteroi-mkdocs==1.0.4 # https://github.com/Neoteroi/mkdocs-plugins
drf-spectacular==0.26.5 # https://github.com/tfranzel/drf-spectacular/
drf-spectacular==0.26.5 # https://github.com/tfranzel/drf-spectacular
mkdocstrings==0.24.0 # https://github.com/mkdocstrings/mkdocstrings
mkdocstrings-python==1.7.5 # https://github.com/mkdocstrings/python
# pyyaml==6.0.1 # https://github.com/yaml/pyyaml
# uritemplate==4.1.1 # https://github.com/python-hyper/uritemplate
# pymdown-extensions==10.5.1 # https://github.com/facelessuser/pymdown-extensions
Expand Down

0 comments on commit 46e04a4

Please sign in to comment.