fumero 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
fumero-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Important Looking Pirates AB
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
fumero-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,131 @@
1
+ Metadata-Version: 2.4
2
+ Name: fumero
3
+ Version: 0.1.0
4
+ Summary: Generate a Fumadocs API reference from a Python module.
5
+ Keywords: api-reference,documentation,mdx
6
+ Author: Fredrik Brännbacka, Ludvig Holmkvist
7
+ Author-email: Fredrik Brännbacka <fredrik.brannbacka@ilpvfx.com>, Ludvig Holmkvist <ludvig.holmkvist@ilpvfx.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Topic :: Documentation
16
+ Classifier: Topic :: Software Development :: Documentation
17
+ Classifier: Typing :: Typed
18
+ Requires-Dist: griffe>=2.1.0
19
+ Requires-Dist: jinja2>=3.1.6
20
+ Requires-Python: >=3.11
21
+ Project-URL: Documentation, https://ilpvfx.github.io/fumero/
22
+ Project-URL: Repository, https://github.com/ilpvfx/fumero
23
+ Project-URL: Changelog, https://github.com/ilpvfx/fumero/blob/main/CHANGELOG.md
24
+ Description-Content-Type: text/markdown
25
+
26
+ <div align="center">
27
+ <h1>Fumero</h1>
28
+ <p><strong>Generate a Fumadocs API reference from a Python module.</strong></p>
29
+ </div>
30
+
31
+ Fumero reads an importable module with [griffe](https://mkdocstrings.github.io/griffe/) and writes
32
+ a [Fumadocs](https://fumadocs.dev) API reference: one page per module and one per class, alongside
33
+ the React components that render them.
34
+
35
+ The reference is generated from the code. Signatures, type annotations and default values are read
36
+ from the source, and the prose is taken from the docstrings. Nothing is restated by hand, so the
37
+ reference cannot fall out of step with the code it documents.
38
+
39
+ ## Install
40
+
41
+ ```sh
42
+ uv add fumero --dev # or pip install fumero
43
+ ```
44
+
45
+ ## Quick start
46
+
47
+ Install the components into the docs app that will render the output:
48
+
49
+ ```sh
50
+ fumero init src/components/mdx
51
+ ```
52
+
53
+ Register them once, so every generated page knows how to render itself:
54
+
55
+ ```tsx
56
+ // src/mdx-components.tsx
57
+ import defaultMdxComponents from 'fumadocs-ui/mdx';
58
+ import * as Pdx from '@/components/mdx/pdx-components';
59
+
60
+ export function getMDXComponents(components?: MDXComponents): MDXComponents {
61
+ return { ...defaultMdxComponents, ...Pdx, ...components };
62
+ }
63
+ ```
64
+
65
+ The loader plugin that came with them labels the sidebar entries that lead to a module:
66
+
67
+ ```ts
68
+ // src/lib/source.ts
69
+ import { fumeroPlugin } from '@/components/mdx/pdx-plugin';
70
+
71
+ export const source = loader({
72
+ plugins: [fumeroPlugin()],
73
+ baseUrl: '/docs',
74
+ source: docs.toFumadocsSource(),
75
+ });
76
+ ```
77
+
78
+ A generated page carries its kind under `_fumero`, and Fumadocs keeps only the frontmatter its schema
79
+ names, so let the rest through:
80
+
81
+ ```ts
82
+ // source.config.ts
83
+ schema: pageSchema.loose(),
84
+ ```
85
+
86
+ Then document a module:
87
+
88
+ ```sh
89
+ fumero generate example --output content/docs/api --base-url /api --with-meta
90
+ ```
91
+
92
+ ## Configuration
93
+
94
+ Every option is a flag on `fumero generate` and a key in a `[tool.fumero]` table. Options that do
95
+ not change between runs belong in `pyproject.toml`:
96
+
97
+ ```toml
98
+ [tool.fumero]
99
+ output = "content/docs/api"
100
+ base-url = "/api"
101
+ exclude = ["example.internal", "*.tests"]
102
+ with-meta = true
103
+ ```
104
+
105
+ A flag overrides the file, which overrides the defaults.
106
+
107
+ ## Documentation
108
+
109
+ The full documentation lives at [here](https://ilpvfx.github.io/fumero/). Fumero documents
110
+ itself, so the API reference there is a working example of the output as much as it is a reference.
111
+
112
+ ## Development
113
+
114
+ This project uses [devenv](https://devenv.sh) to manage the development environment. It sets up
115
+ Python, uv, and everything else you need.
116
+
117
+ ```sh
118
+ # Install devenv if you haven't already
119
+ # https://devenv.sh/getting-started/
120
+
121
+ # Enter the dev shell - this installs all dependencies automatically
122
+ devenv shell
123
+ ```
124
+
125
+ Once you are in the shell, lint, type check, and test with:
126
+
127
+ ```sh
128
+ uv run ruff check
129
+ uv run ty check
130
+ uv run pytest
131
+ ```
fumero-0.1.0/README.md ADDED
@@ -0,0 +1,106 @@
1
+ <div align="center">
2
+ <h1>Fumero</h1>
3
+ <p><strong>Generate a Fumadocs API reference from a Python module.</strong></p>
4
+ </div>
5
+
6
+ Fumero reads an importable module with [griffe](https://mkdocstrings.github.io/griffe/) and writes
7
+ a [Fumadocs](https://fumadocs.dev) API reference: one page per module and one per class, alongside
8
+ the React components that render them.
9
+
10
+ The reference is generated from the code. Signatures, type annotations and default values are read
11
+ from the source, and the prose is taken from the docstrings. Nothing is restated by hand, so the
12
+ reference cannot fall out of step with the code it documents.
13
+
14
+ ## Install
15
+
16
+ ```sh
17
+ uv add fumero --dev # or pip install fumero
18
+ ```
19
+
20
+ ## Quick start
21
+
22
+ Install the components into the docs app that will render the output:
23
+
24
+ ```sh
25
+ fumero init src/components/mdx
26
+ ```
27
+
28
+ Register them once, so every generated page knows how to render itself:
29
+
30
+ ```tsx
31
+ // src/mdx-components.tsx
32
+ import defaultMdxComponents from 'fumadocs-ui/mdx';
33
+ import * as Pdx from '@/components/mdx/pdx-components';
34
+
35
+ export function getMDXComponents(components?: MDXComponents): MDXComponents {
36
+ return { ...defaultMdxComponents, ...Pdx, ...components };
37
+ }
38
+ ```
39
+
40
+ The loader plugin that came with them labels the sidebar entries that lead to a module:
41
+
42
+ ```ts
43
+ // src/lib/source.ts
44
+ import { fumeroPlugin } from '@/components/mdx/pdx-plugin';
45
+
46
+ export const source = loader({
47
+ plugins: [fumeroPlugin()],
48
+ baseUrl: '/docs',
49
+ source: docs.toFumadocsSource(),
50
+ });
51
+ ```
52
+
53
+ A generated page carries its kind under `_fumero`, and Fumadocs keeps only the frontmatter its schema
54
+ names, so let the rest through:
55
+
56
+ ```ts
57
+ // source.config.ts
58
+ schema: pageSchema.loose(),
59
+ ```
60
+
61
+ Then document a module:
62
+
63
+ ```sh
64
+ fumero generate example --output content/docs/api --base-url /api --with-meta
65
+ ```
66
+
67
+ ## Configuration
68
+
69
+ Every option is a flag on `fumero generate` and a key in a `[tool.fumero]` table. Options that do
70
+ not change between runs belong in `pyproject.toml`:
71
+
72
+ ```toml
73
+ [tool.fumero]
74
+ output = "content/docs/api"
75
+ base-url = "/api"
76
+ exclude = ["example.internal", "*.tests"]
77
+ with-meta = true
78
+ ```
79
+
80
+ A flag overrides the file, which overrides the defaults.
81
+
82
+ ## Documentation
83
+
84
+ The full documentation lives at [here](https://ilpvfx.github.io/fumero/). Fumero documents
85
+ itself, so the API reference there is a working example of the output as much as it is a reference.
86
+
87
+ ## Development
88
+
89
+ This project uses [devenv](https://devenv.sh) to manage the development environment. It sets up
90
+ Python, uv, and everything else you need.
91
+
92
+ ```sh
93
+ # Install devenv if you haven't already
94
+ # https://devenv.sh/getting-started/
95
+
96
+ # Enter the dev shell - this installs all dependencies automatically
97
+ devenv shell
98
+ ```
99
+
100
+ Once you are in the shell, lint, type check, and test with:
101
+
102
+ ```sh
103
+ uv run ruff check
104
+ uv run ty check
105
+ uv run pytest
106
+ ```
@@ -0,0 +1,63 @@
1
+ [project]
2
+ name = "fumero"
3
+ version = "0.1.0"
4
+ description = "Generate a Fumadocs API reference from a Python module."
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ license = "MIT"
8
+ license-files = ["LICENSE"]
9
+ keywords = [
10
+ "api-reference",
11
+ "documentation",
12
+ "mdx",
13
+ ]
14
+ classifiers = [
15
+ "Development Status :: 3 - Alpha",
16
+ "Intended Audience :: Developers",
17
+ "Programming Language :: Python :: 3.11",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Programming Language :: Python :: 3.13",
20
+ "Topic :: Documentation",
21
+ "Topic :: Software Development :: Documentation",
22
+ "Typing :: Typed",
23
+ ]
24
+ dependencies = [
25
+ "griffe>=2.1.0",
26
+ "jinja2>=3.1.6",
27
+ ]
28
+
29
+ [[project.authors]]
30
+ name = "Fredrik Brännbacka"
31
+ email = "fredrik.brannbacka@ilpvfx.com"
32
+
33
+ [[project.authors]]
34
+ name = "Ludvig Holmkvist"
35
+ email = "ludvig.holmkvist@ilpvfx.com"
36
+
37
+ [project.urls]
38
+ Documentation = "https://ilpvfx.github.io/fumero/"
39
+ Repository = "https://github.com/ilpvfx/fumero"
40
+ Changelog = "https://github.com/ilpvfx/fumero/blob/main/CHANGELOG.md"
41
+
42
+ [project.scripts]
43
+ fumero = "fumero.tools.fumero:main"
44
+
45
+ [dependency-groups]
46
+ dev = [
47
+ "pytest>=9.1.1",
48
+ "ruff>=0.16.0",
49
+ "ty>=0.0.63",
50
+ ]
51
+
52
+ [build-system]
53
+ requires = ["uv_build>=0.11.25,<0.12.0"]
54
+ build-backend = "uv_build"
55
+
56
+ [tool.fumero]
57
+ base-url = "/api"
58
+ clean = true
59
+ output = "docs/content/docs/api"
60
+ with-meta = true
61
+
62
+ [tool.ruff]
63
+ line-length = 100
@@ -0,0 +1,55 @@
1
+ [project]
2
+ name = "fumero"
3
+ version = "0.1.0"
4
+ description = "Generate a Fumadocs API reference from a Python module."
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "Fredrik Brännbacka", email = "fredrik.brannbacka@ilpvfx.com" },
8
+ { name = "Ludvig Holmkvist", email = "ludvig.holmkvist@ilpvfx.com" },
9
+ ]
10
+ requires-python = ">=3.11"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ keywords = ["api-reference", "documentation", "mdx"]
14
+ classifiers = [
15
+ "Development Status :: 3 - Alpha",
16
+ "Intended Audience :: Developers",
17
+ "Programming Language :: Python :: 3.11",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Programming Language :: Python :: 3.13",
20
+ "Topic :: Documentation",
21
+ "Topic :: Software Development :: Documentation",
22
+ "Typing :: Typed",
23
+ ]
24
+ dependencies = [
25
+ "griffe>=2.1.0",
26
+ "jinja2>=3.1.6",
27
+ ]
28
+
29
+ [project.urls]
30
+ Documentation = "https://ilpvfx.github.io/fumero/"
31
+ Repository = "https://github.com/ilpvfx/fumero"
32
+ Changelog = "https://github.com/ilpvfx/fumero/blob/main/CHANGELOG.md"
33
+
34
+ [dependency-groups]
35
+ dev = [
36
+ "pytest>=9.1.1",
37
+ "ruff>=0.16.0",
38
+ "ty>=0.0.63",
39
+ ]
40
+
41
+ [build-system]
42
+ requires = ["uv_build>=0.11.25,<0.12.0"]
43
+ build-backend = "uv_build"
44
+
45
+ [project.scripts]
46
+ fumero = "fumero.tools.fumero:main"
47
+
48
+ [tool.fumero]
49
+ base-url = "/api"
50
+ clean = true
51
+ output = "docs/content/docs/api"
52
+ with-meta = true
53
+
54
+ [tool.ruff]
55
+ line-length = 100
@@ -0,0 +1,72 @@
1
+ """Turn a Python module into a Fumadocs API reference.
2
+
3
+ fumero reads a module with [griffe][griffe], writes the MDX a Fumadocs site renders, and ships the
4
+ React components that render it. Signatures, type annotations and default values are read from the
5
+ source, and the prose is taken from the docstrings.
6
+
7
+ ### One call
8
+
9
+ ```python
10
+ from pathlib import Path
11
+
12
+ import fumero
13
+
14
+ result = fumero.generate(
15
+ "example",
16
+ fumero.Config(output=Path("content/docs/api"), base_url="/docs/api", clean=True),
17
+ )
18
+ ```
19
+
20
+ Nothing here prints and nothing exits. [`generate`] hands back a [`Result`] naming every page it
21
+ wrote and every reference it could not resolve, which leaves a build script free to decide what
22
+ that is worth:
23
+
24
+ ```python
25
+ if not result.ok:
26
+ raise SystemExit("the reference has broken links")
27
+ ```
28
+
29
+ [`ModuleNotFound`] is the one error to expect. Documenting a module means importing it, so a
30
+ module that will not import is the end of the run rather than a page with gaps in it.
31
+
32
+ ### A layer down
33
+
34
+ [`generate`] is two steps taken together, and they come apart when several modules are documented
35
+ into one site, or when the tree is already loaded:
36
+
37
+ ```python
38
+ config = fumero.Config(base_url="/docs/api")
39
+ module = fumero.load_module("example", config)
40
+ result = fumero.Renderer(config).render(module, Path("content/docs/api"))
41
+ ```
42
+
43
+ A [`LinkTable`] is collected across the whole tree before anything is written, which is what lets
44
+ a page reference a symbol whose own page is written later.
45
+
46
+ [griffe]: https://mkdocstrings.github.io/griffe/
47
+ """
48
+
49
+ from . import error, model
50
+ from .component import component_source, init, plugin_source
51
+ from .config import Config, Dialect
52
+ from .link import LinkTable
53
+ from .mdx import encode_text
54
+ from .parse import load_module
55
+ from .render import Renderer, Result, UnresolvedLink, generate
56
+
57
+ __all__ = [
58
+ "Config",
59
+ "Dialect",
60
+ "LinkTable",
61
+ "Renderer",
62
+ "Result",
63
+ "UnresolvedLink",
64
+ "component_source",
65
+ "encode_text",
66
+ "error",
67
+ "generate",
68
+ "init",
69
+ "load_module",
70
+ "model",
71
+ "plugin_source",
72
+ ]
@@ -0,0 +1,7 @@
1
+ """Run the command line as `python -m fumero`."""
2
+
3
+ import sys
4
+
5
+ from .tools.fumero import main
6
+
7
+ sys.exit(main())