neon-ssg 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.
@@ -0,0 +1,76 @@
1
+ Metadata-Version: 2.3
2
+ Name: neon-ssg
3
+ Version: 0.1.0
4
+ Summary: Static site generator
5
+ Keywords: ssg
6
+ Author: Stephanos Kuma
7
+ Author-email: Stephanos Kuma <stephanos@kuma.ai>
8
+ License: BSD-3-Clause
9
+ Classifier: Development Status :: 1 - Planning
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3 :: Only
12
+ Classifier: Intended Audience :: Developers
13
+ Requires-Dist: dj-settings~=9.0
14
+ Requires-Dist: jinja2~=3.1
15
+ Requires-Dist: markdown~=3.8
16
+ Requires-Dist: pygments~=2.20
17
+ Requires-Dist: pymdown-extensions~=11.0
18
+ Requires-Dist: pyutilkit~=0.13
19
+ Requires-Dist: watchfiles~=1.2
20
+ Requires-Python: >=3.11
21
+ Project-URL: homepage, https://neon-ssg.readthedocs.io/en/stable/
22
+ Project-URL: repository, https://github.com/spapanik/neon-ssg/
23
+ Project-URL: documentation, https://neon-ssg.readthedocs.io/en/stable/
24
+ Description-Content-Type: text/markdown
25
+
26
+ # neon-ssg: Static site generator
27
+
28
+ [![build][build_badge]][build_url]
29
+ [![lint][lint_badge]][lint_url]
30
+ [![tests][tests_badge]][tests_url]
31
+ [![license][licence_badge]][licence_url]
32
+ [![codecov][codecov_badge]][codecov_url]
33
+ [![readthedocs][readthedocs_badge]][readthedocs_url]
34
+ [![pypi][pypi_badge]][pypi_url]
35
+ [![downloads][pepy_badge]][pepy_url]
36
+ [![build automation: yam][yam_badge]][yam_url]
37
+ [![Lint: ruff][ruff_badge]][ruff_url]
38
+
39
+ neon-ssg is an early-stage Python static site generator for documentation.
40
+ It turns Markdown and assets into a static site with configurable navigation.
41
+ The project is intended to grow into a richer documentation experience; today,
42
+ `ssg build` is the implemented command. Development serving, live reload,
43
+ translations and plugins are planned but are not yet available.
44
+
45
+ Install the package with Python 3.11 or newer, then run `ssg build` from a
46
+ project containing a `docs/` directory. The generated site is written to
47
+ `site/`. See the [installation guide](installation.md) and
48
+ [usage guide](usage/index.md) for details.
49
+
50
+ ## Links
51
+
52
+ - [Documentation]
53
+ - [Changelog]
54
+
55
+ [build_badge]: https://github.com/spapanik/neon-ssg/actions/workflows/build.yml/badge.svg
56
+ [build_url]: https://github.com/spapanik/neon-ssg/actions/workflows/build.yml
57
+ [lint_badge]: https://github.com/spapanik/neon-ssg/actions/workflows/lint.yml/badge.svg
58
+ [lint_url]: https://github.com/spapanik/neon-ssg/actions/workflows/lint.yml
59
+ [tests_badge]: https://github.com/spapanik/neon-ssg/actions/workflows/tests.yml/badge.svg
60
+ [tests_url]: https://github.com/spapanik/neon-ssg/actions/workflows/tests.yml
61
+ [licence_badge]: https://img.shields.io/pypi/l/neon-ssg
62
+ [licence_url]: https://neon-ssg.readthedocs.io/en/stable/LICENSE/
63
+ [codecov_badge]: https://codecov.io/github/spapanik/neon-ssg/graph/badge.svg?token=Q20F84BW72
64
+ [codecov_url]: https://codecov.io/github/spapanik/neon-ssg
65
+ [readthedocs_badge]: https://readthedocs.org/projects/neon-ssg/badge/?version=latest
66
+ [readthedocs_url]: https://neon-ssg.readthedocs.io/en/latest/
67
+ [pypi_badge]: https://img.shields.io/pypi/v/neon-ssg
68
+ [pypi_url]: https://pypi.org/project/neon-ssg
69
+ [pepy_badge]: https://pepy.tech/badge/neon-ssg
70
+ [pepy_url]: https://pepy.tech/project/neon-ssg
71
+ [yam_badge]: https://img.shields.io/badge/build%20automation-yamk-success
72
+ [yam_url]: https://github.com/spapanik/yamk
73
+ [ruff_badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json
74
+ [ruff_url]: https://github.com/charliermarsh/ruff
75
+ [Documentation]: https://neon-ssg.readthedocs.io/en/stable/
76
+ [Changelog]: https://neon-ssg.readthedocs.io/en/stable/CHANGELOG/
@@ -0,0 +1,51 @@
1
+ # neon-ssg: Static site generator
2
+
3
+ [![build][build_badge]][build_url]
4
+ [![lint][lint_badge]][lint_url]
5
+ [![tests][tests_badge]][tests_url]
6
+ [![license][licence_badge]][licence_url]
7
+ [![codecov][codecov_badge]][codecov_url]
8
+ [![readthedocs][readthedocs_badge]][readthedocs_url]
9
+ [![pypi][pypi_badge]][pypi_url]
10
+ [![downloads][pepy_badge]][pepy_url]
11
+ [![build automation: yam][yam_badge]][yam_url]
12
+ [![Lint: ruff][ruff_badge]][ruff_url]
13
+
14
+ neon-ssg is an early-stage Python static site generator for documentation.
15
+ It turns Markdown and assets into a static site with configurable navigation.
16
+ The project is intended to grow into a richer documentation experience; today,
17
+ `ssg build` is the implemented command. Development serving, live reload,
18
+ translations and plugins are planned but are not yet available.
19
+
20
+ Install the package with Python 3.11 or newer, then run `ssg build` from a
21
+ project containing a `docs/` directory. The generated site is written to
22
+ `site/`. See the [installation guide](installation.md) and
23
+ [usage guide](usage/index.md) for details.
24
+
25
+ ## Links
26
+
27
+ - [Documentation]
28
+ - [Changelog]
29
+
30
+ [build_badge]: https://github.com/spapanik/neon-ssg/actions/workflows/build.yml/badge.svg
31
+ [build_url]: https://github.com/spapanik/neon-ssg/actions/workflows/build.yml
32
+ [lint_badge]: https://github.com/spapanik/neon-ssg/actions/workflows/lint.yml/badge.svg
33
+ [lint_url]: https://github.com/spapanik/neon-ssg/actions/workflows/lint.yml
34
+ [tests_badge]: https://github.com/spapanik/neon-ssg/actions/workflows/tests.yml/badge.svg
35
+ [tests_url]: https://github.com/spapanik/neon-ssg/actions/workflows/tests.yml
36
+ [licence_badge]: https://img.shields.io/pypi/l/neon-ssg
37
+ [licence_url]: https://neon-ssg.readthedocs.io/en/stable/LICENSE/
38
+ [codecov_badge]: https://codecov.io/github/spapanik/neon-ssg/graph/badge.svg?token=Q20F84BW72
39
+ [codecov_url]: https://codecov.io/github/spapanik/neon-ssg
40
+ [readthedocs_badge]: https://readthedocs.org/projects/neon-ssg/badge/?version=latest
41
+ [readthedocs_url]: https://neon-ssg.readthedocs.io/en/latest/
42
+ [pypi_badge]: https://img.shields.io/pypi/v/neon-ssg
43
+ [pypi_url]: https://pypi.org/project/neon-ssg
44
+ [pepy_badge]: https://pepy.tech/badge/neon-ssg
45
+ [pepy_url]: https://pepy.tech/project/neon-ssg
46
+ [yam_badge]: https://img.shields.io/badge/build%20automation-yamk-success
47
+ [yam_url]: https://github.com/spapanik/yamk
48
+ [ruff_badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json
49
+ [ruff_url]: https://github.com/charliermarsh/ruff
50
+ [Documentation]: https://neon-ssg.readthedocs.io/en/stable/
51
+ [Changelog]: https://neon-ssg.readthedocs.io/en/stable/CHANGELOG/
@@ -0,0 +1,156 @@
1
+ [build-system]
2
+ requires = ["uv_build>=0.11.0,<0.14"]
3
+ build-backend = "uv_build"
4
+
5
+ [project]
6
+ name = "neon-ssg"
7
+ version = "0.1.0"
8
+ readme = "docs/README.md"
9
+ description = "Static site generator"
10
+ keywords = ["ssg"]
11
+ classifiers = [
12
+ "Development Status :: 1 - Planning",
13
+ "Operating System :: OS Independent",
14
+ "Programming Language :: Python :: 3 :: Only",
15
+ "Intended Audience :: Developers",
16
+ ]
17
+ requires-python = ">=3.11"
18
+ dependencies = [
19
+ "dj_settings~=9.0",
20
+ "jinja2~=3.1",
21
+ "markdown~=3.8",
22
+ "pygments~=2.20",
23
+ "pymdown-extensions~=11.0",
24
+ "pyutilkit~=0.13",
25
+ "watchfiles~=1.2",
26
+ ]
27
+
28
+ [[project.authors]]
29
+ name = "Stephanos Kuma"
30
+ email = "stephanos@kuma.ai"
31
+
32
+ [project.license]
33
+ text = "BSD-3-Clause"
34
+
35
+ [project.urls]
36
+ homepage = "https://neon-ssg.readthedocs.io/en/stable/"
37
+ repository = "https://github.com/spapanik/neon-ssg/"
38
+ documentation = "https://neon-ssg.readthedocs.io/en/stable/"
39
+
40
+ [project.scripts]
41
+ ssg = "neon_ssg.__main__:main"
42
+
43
+ [dependency-groups]
44
+ dev = [
45
+ "ipdb~=0.13",
46
+ "ipython~=9.17",
47
+ "ptpython~=3.0",
48
+ { include-group = "lint" },
49
+ { include-group = "test" },
50
+ ]
51
+ lint = [
52
+ "mypy~=2.4",
53
+ "ruff~=0.16",
54
+ "ty~=0.0.89",
55
+ "types-markdown~=3.8",
56
+ "types-pygments~=2.19",
57
+ { include-group = "test_core" },
58
+ ]
59
+ test = [
60
+ "pytest-cov~=7.1",
61
+ { include-group = "test_core" },
62
+ ]
63
+ test_core = ["pytest~=9.1"]
64
+
65
+ [tool.mypy]
66
+ check_untyped_defs = true
67
+ disallow_any_decorated = true
68
+ disallow_any_explicit = true
69
+ disallow_any_expr = false
70
+ disallow_any_generics = true
71
+ disallow_any_unimported = true
72
+ disallow_incomplete_defs = true
73
+ disallow_subclassing_any = true
74
+ disallow_untyped_calls = true
75
+ disallow_untyped_decorators = true
76
+ disallow_untyped_defs = true
77
+ extra_checks = true
78
+ ignore_missing_imports = true
79
+ no_implicit_reexport = true
80
+ show_column_numbers = true
81
+ show_error_codes = true
82
+ strict_equality = true
83
+ warn_redundant_casts = true
84
+ warn_return_any = true
85
+ warn_unused_configs = true
86
+ warn_unused_ignores = true
87
+ warn_unreachable = true
88
+
89
+ [[tool.mypy.overrides]]
90
+ module = "tests.*"
91
+ disallow_any_decorated = false
92
+
93
+ [tool.ruff]
94
+ src = ["src"]
95
+ target-version = "py311"
96
+
97
+ [tool.ruff.lint]
98
+ select = ["ALL"]
99
+ ignore = [
100
+ "C901",
101
+ "CPY001",
102
+ "COM812",
103
+ "D10",
104
+ "D203",
105
+ "D213",
106
+ "PLR09",
107
+ ]
108
+
109
+ [tool.ruff.lint.per-file-ignores]
110
+ "tests/**" = [
111
+ "FBT001",
112
+ "PLR2004",
113
+ "S101",
114
+ "SLF001",
115
+ ]
116
+
117
+ [tool.ruff.lint.flake8-tidy-imports]
118
+ ban-relative-imports = "all"
119
+
120
+ [tool.ruff.lint.flake8-tidy-imports.banned-api.mock]
121
+ msg = "Use unittest.mock"
122
+
123
+ [tool.ruff.lint.flake8-tidy-imports.banned-api.pytz]
124
+ msg = "Use zoneinfo"
125
+
126
+ [tool.ruff.lint.isort]
127
+ combine-as-imports = true
128
+ forced-separate = ["tests"]
129
+ split-on-trailing-comma = false
130
+
131
+ [tool.pytest]
132
+ minversion = "9.0"
133
+ strict = true
134
+ addopts = [
135
+ "-ra",
136
+ "-v",
137
+ ]
138
+ testpaths = ["tests"]
139
+
140
+ [tool.coverage.run]
141
+ branch = true
142
+ source = ["src/"]
143
+ data_file = ".cov_cache/coverage.dat"
144
+ omit = ["src/**/type_defs.py"]
145
+
146
+ [tool.coverage.report]
147
+ exclude_also = [
148
+ "if TYPE_CHECKING:",
149
+ "raise NotImplementedError",
150
+ "raise UnreachableCodeError",
151
+ ]
152
+ fail_under = 100
153
+ precision = 2
154
+ show_missing = true
155
+ skip_covered = true
156
+ skip_empty = true
@@ -0,0 +1,174 @@
1
+ [build-system]
2
+ requires = [
3
+ "uv_build>=0.11.0,<0.14",
4
+ ]
5
+ build-backend = "uv_build"
6
+
7
+ [project]
8
+ name = "neon-ssg"
9
+ version = "0.1.0"
10
+
11
+ authors = [
12
+ { name = "Stephanos Kuma", email = "stephanos@kuma.ai" },
13
+ ]
14
+ license = { text = "BSD-3-Clause" }
15
+
16
+ readme = "docs/README.md"
17
+ description = "Static site generator"
18
+ keywords = [
19
+ "ssg",
20
+ ]
21
+ classifiers = [
22
+ "Development Status :: 1 - Planning",
23
+ "Operating System :: OS Independent",
24
+ "Programming Language :: Python :: 3 :: Only",
25
+ "Intended Audience :: Developers",
26
+ ]
27
+
28
+ requires-python = ">=3.11"
29
+ dependencies = [
30
+ "dj_settings~=9.0",
31
+ "jinja2~=3.1",
32
+ "markdown~=3.8",
33
+ "pygments~=2.20",
34
+ "pymdown-extensions~=11.0",
35
+ "pyutilkit~=0.13",
36
+ "watchfiles~=1.2",
37
+ ]
38
+
39
+ [project.urls]
40
+ homepage = "https://neon-ssg.readthedocs.io/en/stable/"
41
+ repository = "https://github.com/spapanik/neon-ssg/"
42
+ documentation = "https://neon-ssg.readthedocs.io/en/stable/"
43
+
44
+ [project.scripts]
45
+ ssg = "neon_ssg.__main__:main"
46
+
47
+ [dependency-groups]
48
+ dev = [
49
+ "ipdb~=0.13",
50
+ "ipython~=9.17",
51
+ "ptpython~=3.0",
52
+ { include-group = "lint" },
53
+ { include-group = "test" },
54
+ ]
55
+ lint = [
56
+ "mypy~=2.4", # Keep mypy for CI/CD
57
+ "ruff~=0.16",
58
+ "ty~=0.0.89",
59
+ "types-markdown~=3.8",
60
+ "types-pygments~=2.19",
61
+ { include-group = "test_core" },
62
+ ]
63
+ test = [
64
+ "pytest-cov~=7.1",
65
+ { include-group = "test_core" },
66
+ ]
67
+ test_core = [
68
+ "pytest~=9.1",
69
+ ]
70
+
71
+ [tool.mypy]
72
+ # Keep mypy for CI/CD
73
+ check_untyped_defs = true
74
+ disallow_any_decorated = true
75
+ disallow_any_explicit = true
76
+ disallow_any_expr = false # many builtins are Any
77
+ disallow_any_generics = true
78
+ disallow_any_unimported = true
79
+ disallow_incomplete_defs = true
80
+ disallow_subclassing_any = true
81
+ disallow_untyped_calls = true
82
+ disallow_untyped_decorators = true
83
+ disallow_untyped_defs = true
84
+ extra_checks = true
85
+ ignore_missing_imports = true
86
+ no_implicit_reexport = true
87
+ show_column_numbers = true
88
+ show_error_codes = true
89
+ strict_equality = true
90
+ warn_redundant_casts = true
91
+ warn_return_any = true
92
+ warn_unused_configs = true
93
+ warn_unused_ignores = true
94
+ warn_unreachable = true
95
+
96
+ [[tool.mypy.overrides]]
97
+ # Keep mypy for CI/CD
98
+ module = "tests.*"
99
+ disallow_any_decorated = false # mock.MagicMock is Any
100
+
101
+ [tool.ruff]
102
+ src = [
103
+ "src",
104
+ ]
105
+ target-version = "py311"
106
+
107
+ [tool.ruff.lint]
108
+ select = [
109
+ "ALL",
110
+ ]
111
+ ignore = [
112
+ "C901", # Adding a limit to complexity is too arbitrary
113
+ "CPY001", # Use only a project copyright
114
+ "COM812", # Avoid conflicts with the formatter
115
+ "D10", # Not everything needs a docstring
116
+ "D203", # Prefer `no-blank-line-before-class` (D211)
117
+ "D213", # Prefer `multi-line-summary-first-line` (D212)
118
+ "PLR09", # Adding a limit to complexity is too arbitrary
119
+ ]
120
+
121
+ [tool.ruff.lint.per-file-ignores]
122
+ "tests/**" = [
123
+ "FBT001", # Test arguments are handled by pytest
124
+ "PLR2004", # Tests should contain magic number comparisons
125
+ "S101", # Pytest needs assert statements
126
+ "SLF001", # Tests need to access private members for coverage
127
+ ]
128
+
129
+ [tool.ruff.lint.flake8-tidy-imports]
130
+ ban-relative-imports = "all"
131
+
132
+ [tool.ruff.lint.flake8-tidy-imports.banned-api]
133
+ "mock".msg = "Use unittest.mock"
134
+ "pytz".msg = "Use zoneinfo"
135
+
136
+ [tool.ruff.lint.isort]
137
+ combine-as-imports = true
138
+ forced-separate = [
139
+ "tests",
140
+ ]
141
+ split-on-trailing-comma = false
142
+
143
+ [tool.pytest]
144
+ minversion = "9.0"
145
+ strict = true
146
+ addopts = [
147
+ "-ra",
148
+ "-v",
149
+ ]
150
+ testpaths = [
151
+ "tests",
152
+ ]
153
+
154
+ [tool.coverage.run]
155
+ branch = true
156
+ source = [
157
+ "src/",
158
+ ]
159
+ data_file = ".cov_cache/coverage.dat"
160
+ omit = [
161
+ "src/**/type_defs.py",
162
+ ]
163
+
164
+ [tool.coverage.report]
165
+ exclude_also = [
166
+ "if TYPE_CHECKING:",
167
+ "raise NotImplementedError",
168
+ "raise UnreachableCodeError",
169
+ ]
170
+ fail_under = 100
171
+ precision = 2
172
+ show_missing = true
173
+ skip_covered = true
174
+ skip_empty = true
File without changes
@@ -0,0 +1,27 @@
1
+ from __future__ import annotations
2
+
3
+ from pyutilkit.term import SGRCodes, SGRString
4
+
5
+ from neon_ssg.commands.build import BuildCommand
6
+ from neon_ssg.commands.serve import ServeCommand
7
+ from neon_ssg.lib.cli import CLIArgs, parse_args
8
+ from neon_ssg.lib.exceptions import NeonSSGError
9
+
10
+
11
+ def _run(args: CLIArgs) -> None:
12
+ match args.subcommand:
13
+ case "build":
14
+ BuildCommand(verbosity=args.verbosity).run()
15
+ case "serve": # pragma: no branch
16
+ ServeCommand(verbosity=args.verbosity, host=args.host, port=args.port).run()
17
+
18
+
19
+ def main() -> None:
20
+ args = parse_args()
21
+ try:
22
+ _run(args)
23
+ except NeonSSGError as exc:
24
+ SGRString(
25
+ exc, prefix="neon-ssg: ", is_error=True, params=(SGRCodes.RED,)
26
+ ).print()
27
+ raise SystemExit(exc.exit_code) from exc
@@ -0,0 +1,3 @@
1
+ from importlib.metadata import version
2
+
3
+ __version__ = version("neon-ssg")
File without changes
@@ -0,0 +1,8 @@
1
+ class BaseCommand:
2
+ __slots__ = ("verbosity",)
3
+
4
+ def __init__(self, verbosity: int) -> None:
5
+ self.verbosity = verbosity
6
+
7
+ def run(self) -> None:
8
+ raise NotImplementedError
@@ -0,0 +1,34 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import replace
4
+ from typing import TYPE_CHECKING
5
+
6
+ from neon_ssg.commands.base import BaseCommand
7
+ from neon_ssg.lib.build import build
8
+ from neon_ssg.lib.config import resolve_config
9
+ from neon_ssg.lib.diagnostics import DiagnosticCollector
10
+ from neon_ssg.lib.exceptions import BuildFailedError
11
+ from neon_ssg.lib.loader import discover
12
+
13
+ if TYPE_CHECKING:
14
+ from pathlib import Path
15
+
16
+
17
+ class BuildCommand(BaseCommand):
18
+ __slots__ = ("site_root",)
19
+
20
+ def __init__(self, verbosity: int, *, site_root: Path | None = None) -> None:
21
+ super().__init__(verbosity)
22
+ self.site_root = site_root
23
+
24
+ def run(self) -> None:
25
+ source = discover()
26
+ collector = DiagnosticCollector()
27
+ config = resolve_config(source, collector)
28
+ if collector.has_errors:
29
+ raise BuildFailedError(collector.render())
30
+ if self.site_root is not None:
31
+ config = replace(
32
+ config, content=replace(config.content, site_root=self.site_root)
33
+ )
34
+ build(config, source.parser.data)
@@ -0,0 +1,15 @@
1
+ from __future__ import annotations
2
+
3
+ from neon_ssg.commands.base import BaseCommand
4
+
5
+
6
+ class ServeCommand(BaseCommand):
7
+ __slots__ = ("host", "port")
8
+
9
+ def __init__(self, verbosity: int, host: str, port: int) -> None:
10
+ super().__init__(verbosity)
11
+ self.host = host
12
+ self.port = port
13
+
14
+ def run(self) -> None:
15
+ pass
File without changes