selfdoc 0.3.1__py3-none-any.whl
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.
- selfdoc/__init__.py +45 -0
- selfdoc/__main__.py +3 -0
- selfdoc/build.py +1280 -0
- selfdoc/check.py +835 -0
- selfdoc/cli.py +538 -0
- selfdoc/config.py +205 -0
- selfdoc/deploy.py +177 -0
- selfdoc/directives.py +169 -0
- selfdoc/extractors/__init__.py +0 -0
- selfdoc/extractors/go.py +972 -0
- selfdoc/extractors/python.py +828 -0
- selfdoc/extractors/typescript.py +1093 -0
- selfdoc/html.py +2253 -0
- selfdoc/resolver.py +135 -0
- selfdoc/themes/__init__.py +34 -0
- selfdoc/themes/minimal.css +1756 -0
- selfdoc-0.3.1.dist-info/METADATA +197 -0
- selfdoc-0.3.1.dist-info/RECORD +21 -0
- selfdoc-0.3.1.dist-info/WHEEL +4 -0
- selfdoc-0.3.1.dist-info/entry_points.txt +2 -0
- selfdoc-0.3.1.dist-info/licenses/LICENSE +21 -0
selfdoc/__init__.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""selfdoc: Code-aware static site generator with directive-based content extraction."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def _detect_version():
|
|
8
|
+
"""Detect package version, preferring pyproject.toml over installed metadata.
|
|
9
|
+
|
|
10
|
+
Order: pyproject.toml in the source tree (accurate during editable installs)
|
|
11
|
+
-> importlib.metadata (works for regular installs) -> "unknown".
|
|
12
|
+
"""
|
|
13
|
+
# Try reading version from pyproject.toml next to the package source
|
|
14
|
+
try:
|
|
15
|
+
pyproject_path = os.path.realpath(
|
|
16
|
+
os.path.join(os.path.dirname(__file__), "..", "pyproject.toml")
|
|
17
|
+
)
|
|
18
|
+
if os.path.isfile(pyproject_path):
|
|
19
|
+
try:
|
|
20
|
+
import tomllib
|
|
21
|
+
except ModuleNotFoundError:
|
|
22
|
+
import tomli as tomllib # type: ignore[no-redef]
|
|
23
|
+
with open(pyproject_path, "rb") as f:
|
|
24
|
+
data = tomllib.load(f)
|
|
25
|
+
return data["project"]["version"]
|
|
26
|
+
except Exception:
|
|
27
|
+
pass
|
|
28
|
+
|
|
29
|
+
# Fall back to installed dist-info metadata
|
|
30
|
+
try:
|
|
31
|
+
from importlib.metadata import version as _get_version
|
|
32
|
+
return _get_version("selfdoc")
|
|
33
|
+
except Exception:
|
|
34
|
+
pass
|
|
35
|
+
|
|
36
|
+
return "unknown"
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
__version__ = _detect_version()
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def main():
|
|
43
|
+
"""Entry point for the selfdoc CLI."""
|
|
44
|
+
from selfdoc.cli import run
|
|
45
|
+
run()
|
selfdoc/__main__.py
ADDED