Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
noc0lour committed May 24, 2023
1 parent c564e60 commit 03a30af
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,6 @@ dmypy.json

# Cython debug symbols
cython_debug/

_build/
docs/api/
54 changes: 54 additions & 0 deletions docs/_templates/package.rst_t
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

{%- macro automodule(modname, options) -%}
.. automodule:: {{ modname }}
{%- for option in options %}
:{{ option }}:
{%- endfor %}
{%- endmacro %}

{%- macro toctree(docnames) -%}
.. toctree::
:maxdepth: {{ maxdepth }}
{% for docname in docnames %}
{{ docname }}
{%- endfor %}
{%- endmacro %}

{%- if is_namespace %}
{{- pkgname | e | heading }}
{% else %}
{{- pkgname | e | heading }}
{% endif %}

{%- if is_namespace %}
.. py:module:: {{ pkgname }}
{% endif %}

{%- if modulefirst and not is_namespace %}
{{ automodule(pkgname, automodule_options) }}
{% endif %}

{%- if subpackages %}

{{ toctree(subpackages) }}
{% endif %}

{%- if submodules %}
{% if separatemodules %}
{{ toctree(submodules) }}
{% else %}
{%- for submodule in submodules %}
{% if show_headings %}
{{- submodule | e | heading(2) }}
{% endif %}
{{ automodule(submodule, automodule_options) }}
{% endfor %}
{%- endif %}
{%- endif %}

{%- if not modulefirst and not is_namespace %}
Module contents
---------------

{{ automodule(pkgname, automodule_options) }}
{% endif %}
6 changes: 4 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
import os
from sphinx_pyproject import SphinxConfig
module_dir = os.path.join(__file__, "../src/mokka")

module_dir = os.path.join(os.path.dirname(__file__), "../src/mokka")

config = SphinxConfig("../pyproject.toml", globalns=globals())

author
author=config.author
project=config.name
17 changes: 8 additions & 9 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
.. mokka documentation master file, created by
sphinx-quickstart on Wed Jan 11 17:28:53 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to mokka's documentation!
===================================
MOKKa
===================================

Welcome to the documentation of the MOKKa package.
This package aims to collect useful building blocks for physical layer simulations of communication systems implemented in various machine learning frameworks.


.. toctree::
:maxdepth: 3
:caption: Contents:
:maxdepth: 2
:caption: Contents

source/mokka
api/mokka

Indices and tables
==================
Expand Down
5 changes: 5 additions & 0 deletions docs/make-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

rm -rf docs/api
sphinx-apidoc -o docs/api -E -M -T -d 3 -t docs/_templates src/
sphinx-build -b html docs/ _build/html
Empty file removed docs/source/.keepdir
Empty file.
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ requires = [
build-backend = "flit_core.buildapi"

[project]
name = "mokka"
name = "MOKKa"
readme = "README.md"
requires-python = ">=3.9"
license = {file = "COPYING"}
Expand All @@ -29,7 +29,7 @@ dependencies = [
version = "1.0.0"
description = "A machine learning toolbox for communications engineering"
keywords = ["communications engineering", "machine learning"]
#dynamic = ["version", "description"]
# dynamic = ["version", "description"]

[project.optional-dependencies]
torch = [
Expand All @@ -50,6 +50,7 @@ dev = [
"python-lsp-black",
"sphinx",
"sphinx-pyproject",
"sphinx_rtd_theme"
]
remotelog = [
"wandb",
Expand All @@ -69,12 +70,14 @@ language = "en"
package_root = "mokka"
extensions = [
"sphinx.ext.autodoc",
"sphinx_rtd_theme",
"sphinx.ext.mathjax",
]
templates_path = [ "_templates", ]
html_static_path = [ "_static", ]
source_suffix = ".rst"
master_doc = "index"
html_theme = "alabaster"
html_theme = "sphinx_rtd_theme"
autodoc_exclude_members = [
"__dict__",
"__class__",
Expand Down

0 comments on commit 03a30af

Please sign in to comment.