Skip to content

Commit bc6cb8a

Browse files
committed
docs(lox-space): test Python reference docs
1 parent adec1fd commit bc6cb8a

File tree

6 files changed

+783
-1
lines changed

6 files changed

+783
-1
lines changed

crates/lox-space/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,6 @@ docs/_build/
7373

7474
# Pyenv
7575
.python-version
76+
77+
# MkDocs documentation
78+
site/

crates/lox-space/docs/index.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2025 Helge Eichhorn <[email protected]>
3+
4+
SPDX-License-Identifier: MPL-2.0
5+
-->
6+
7+
# Welcome to MkDocs
8+
9+
For full documentation visit [mkdocs.org](https://www.mkdocs.org).
10+
11+
## Commands
12+
13+
* `mkdocs new [dir-name]` - Create a new project.
14+
* `mkdocs serve` - Start the live-reloading docs server.
15+
* `mkdocs build` - Build the documentation site.
16+
* `mkdocs -h` - Print help message and exit.
17+
18+
## Project layout
19+
20+
mkdocs.yml # The configuration file.
21+
docs/
22+
index.md # The documentation homepage.
23+
... # Other markdown pages, images and other files.
24+
25+
::: lox_space.Time

crates/lox-space/lox_space.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ class TimeScale:
216216
def name(self) -> str: ...
217217

218218
class Time:
219+
"""The Time class."""
219220
def __new__(
220221
cls,
221222
scale: Scale | TimeScale,

crates/lox-space/mkdocs.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# SPDX-FileCopyrightText: 2025 Helge Eichhorn <[email protected]>
2+
#
3+
# SPDX-License-Identifier: MPL-2.0
4+
5+
site_name: My Docs
6+
theme:
7+
name: material
8+
palette:
9+
scheme: slate
10+
primary: indigo
11+
plugins:
12+
- mkdocstrings:
13+
handlers:
14+
python:
15+
16+
# Where to find your sources, see "Finding modules".
17+
# paths: [src]
18+
19+
# Load object inventories to enable cross-references to other projects.
20+
inventories:
21+
- https://docs.python.org/3/objects.inv
22+
# Also load inventories of your dependencies, generally served at
23+
# https://docs-url-for-your-dependency/objects.inv.
24+
25+
options:
26+
27+
# DOCSTRINGS -------------------------------------------------------------
28+
docstring_options:
29+
# Discard first line of `__init__` method docstrings,
30+
# useful when merging such docstrings into their parent class'.
31+
ignore_init_summary: true
32+
33+
# Tables are generally too large, lists will fix this.
34+
docstring_section_style: list
35+
36+
# CROSS-REFERENCES -------------------------------------------------------
37+
# Enable relative crossrefs and scoped crossrefs, see Docstrings options.
38+
# relative_crossrefs: true # Sponsors only!
39+
# scoped_crossrefs: true # Sponsors only!
40+
41+
# Enable cross-references in signatures.
42+
signature_crossrefs: true
43+
44+
# Unwrap actual types from `Annotated` type annotations.
45+
unwrap_annotated: true
46+
47+
# MEMBERS ----------------------------------------------------------------
48+
# Only render pulic symbols.
49+
# filters: public # Sponsors only!
50+
# Comment the option otherwise to get the default filters.
51+
52+
# Show class inherited members.
53+
inherited_members: true
54+
55+
# Render auto-generated summaries of attributes, functions, etc.
56+
# at the start of each symbol's documentation.
57+
summary: true
58+
59+
# HEADINGS ---------------------------------------------------------------
60+
# For auto-generated pages, one module per page,
61+
# make the module heading be the H1 heading of the page.
62+
heading_level: 1
63+
64+
# Render headings for parameters, making them linkable.
65+
parameter_headings: true
66+
67+
# Render headings for type parameters too.
68+
type_parameter_headings: true
69+
70+
# Always show the heading for the symbol you render with `::: id`.
71+
show_root_heading: true
72+
73+
# Only show the name of the symbols you inject render `::: id`.
74+
show_root_full_path: false
75+
76+
# Show the type of symbol (class, function, etc.) in the heading.
77+
show_symbol_type_heading: true
78+
79+
# Show the type of symbol (class, function, etc.) in the table of contents.
80+
show_symbol_type_toc: true
81+
82+
# SIGNATURES -------------------------------------------------------------
83+
# Format code to 80 + 10% margin (Black and Ruff defaults)
84+
# in signatures and attribute value code blocks.
85+
# Needs Black/Ruff installed.
86+
line_length: 88
87+
88+
# Merge signature and docstring of `__init__` methods
89+
# into their parent class signature and docstring.
90+
merge_init_into_class: true
91+
92+
# Render signatures and attribute values in a separate code block,
93+
# below the symbol heading.
94+
separate_signature: true
95+
96+
# Show type annotations in signatures.
97+
show_signature_annotations: true
98+
99+
# Show type parameters in signatures.
100+
show_signature_type_parameters: true
101+
102+
# OTHER ------------------------------------------------------------------
103+
# Show backlinks to other documentation sections within each symbol.
104+
# backlinks: tree # Sponsors only!
105+
106+
# Show base classes OR inheritance diagram.
107+
show_bases: false
108+
# show_inheritance_diagram: true # Sponsors only!

crates/lox-space/pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ dynamic = ["version"]
1515

1616
[dependency-groups]
1717
dev = ["black", "ipython", "maturin", "pytest", "pytest-codspeed"]
18+
docs = ["mkdocs", "mkdocstrings[python]>=0.18", "mkdocs-material"]
1819

1920
[build-system]
2021
requires = ["maturin>=1.3,<2.0"]
@@ -34,6 +35,7 @@ markers = [
3435
cache-keys = [
3536
{ file = "pyproject.toml" },
3637
{ file = "Cargo.toml" },
38+
{ file = "**/*.pyi" },
3739
{ file = "**/*.rs" },
3840
{ file = "../**/*.rs" },
3941
]

0 commit comments

Comments
 (0)