diff --git a/docs/api.md b/docs/api.md deleted file mode 100644 index 3ef620764e54abfb6f2be658b27d643ebcfe1a23..0000000000000000000000000000000000000000 --- a/docs/api.md +++ /dev/null @@ -1,4 +0,0 @@ - -## Modules - -To Do \ No newline at end of file diff --git a/docs/api/frontend.md b/docs/api/frontend.md new file mode 100644 index 0000000000000000000000000000000000000000..a8edb15112edc1bf3fffdc8a0b22d7aaef44e97b --- /dev/null +++ b/docs/api/frontend.md @@ -0,0 +1,8 @@ + +# Source File Composition + +::: pystencilssfg.composer.SfgComposer + +::: pystencilssfg.source_components.SfgKernelNamespace + +::: pystencilssfg.source_components.SfgKernelHandle diff --git a/docs/api/index.md b/docs/api/index.md new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/docs/api/tree.md b/docs/api/tree.md new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/docs/css/mkdocstrings.css b/docs/css/mkdocstrings.css new file mode 100644 index 0000000000000000000000000000000000000000..c84bd345a3a1188fc523936ad437bf97021c0809 --- /dev/null +++ b/docs/css/mkdocstrings.css @@ -0,0 +1,35 @@ + +h2.doc-heading { + font-size: x-large +} + +h3.doc-heading { + font-size: large; +} + +.doc-class>.doc-heading::before { + font-size: small; + content: "class "; + margin-right: 5pt; +} + +.doc-contents { + border-left: 3pt solid rgb(60, 60, 60); + padding-left: 10pt; +} + +.doc-class .doc-children .doc-attribute>.doc-heading::before { + font-size: small; + content: "attribute "; + margin-right: 5pt; +} + +.doc-class .doc-children .doc-function>.doc-heading::before { + font-size: small; + content: "function "; + margin-right: 5pt; +} + +.doc-children { + padding-left: 10pt; +} \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 0e6b089366d2cb522a17d018d11e9cd1d72bf587..96fb45ba5c34db04e45935b8defa60dab8a32b7c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,15 +1,36 @@ site_name: pystencils Source File Generator Documentation theme: name: material + features: navigation.tabs + palette: + scheme: slate + primary: deep purple + +extra_css: + - css/mkdocstrings.css plugins: + - search + - autorefs - mkdocstrings: default_handler: python handlers: python: paths: [src] + options: + heading_level: 2 + show_root_heading: True + show_root_full_path: False + show_symbol_type_heading: True + show_symbol_type_toc: True + show_source: False + show_signature_annotations: True + signature_crossrefs: True nav: - Home: index.md - - API Documentation: api.md + - 'API Documentation': + - 'Overview': api/index.md + - 'Source File Generator Front-End': api/frontend.md + - 'Kernel Call Tree': api/tree.md \ No newline at end of file diff --git a/src/pystencilssfg/composer.py b/src/pystencilssfg/composer.py index ed0dced3c34c56a85e43726b5b091aceb25d1f72..fc67c8ce04ffb19622cf9ea5e7f25a8f1c4d9b0e 100644 --- a/src/pystencilssfg/composer.py +++ b/src/pystencilssfg/composer.py @@ -16,14 +16,18 @@ if TYPE_CHECKING: class SfgComposer: + """Primary interface for constructing source files in pystencils-sfg.""" + def __init__(self, ctx: SfgContext): self._ctx = ctx @property def kernels(self) -> SfgKernelNamespace: + """The default kernel namespace.""" return self._ctx._default_kernel_namespace def kernel_namespace(self, name: str) -> SfgKernelNamespace: + """Returns the kernel namespace of the given name, creating it if it does not exist yet.""" kns = self._ctx.get_kernel_namespace(name) if kns is None: kns = SfgKernelNamespace(self, name)