zmerge 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.
zmerge-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Markus Bilz
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.
zmerge-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,94 @@
1
+ Metadata-Version: 2.4
2
+ Name: zmerge
3
+ Version: 0.1.0
4
+ Summary: Merge the documentation of multiple Zensical projects into one site with working links and a global search 📚.
5
+ Keywords: documentation,monorepo,zensical,mkdocs
6
+ Author: Markus Bilz
7
+ Author-email: Markus Bilz <github@markusbilz.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Programming Language :: Python :: 3 :: Only
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Intended Audience :: Developers
19
+ Classifier: Topic :: Documentation
20
+ Classifier: Topic :: Software Development :: Documentation
21
+ Requires-Dist: pyyaml>=6.0
22
+ Requires-Dist: tomli-w>=1.2
23
+ Requires-Dist: zensical>=0.0.39
24
+ Requires-Python: >=3.11
25
+ Project-URL: Homepage, https://github.com/KarelZe/zmerge
26
+ Project-URL: Documentation, https://karelze.github.io/zmerge/
27
+ Project-URL: Bug Tracker, https://github.com/KarelZe/zmerge/issues
28
+ Description-Content-Type: text/markdown
29
+
30
+ # zmerge 📚
31
+
32
+ [![PyPI](https://img.shields.io/pypi/v/zmerge)](https://pypi.org/project/zmerge/)
33
+ [![Test](https://github.com/KarelZe/zmerge/actions/workflows/test.yml/badge.svg)](https://github.com/KarelZe/zmerge/actions/workflows/test.yml)
34
+ [![Docs](https://img.shields.io/badge/docs-zensical-blue)](https://karelze.github.io/zmerge/)
35
+
36
+ `zmerge` merges the documentation of multiple [Zensical](https://zensical.org/) projects into one site with working
37
+ links, a single navigation and one global search. It fills the gap left by the
38
+ [mkdocs-monorepo-plugin](https://github.com/backstage/mkdocs-monorepo-plugin) until Zensical ships
39
+ [an official solution](https://github.com/zensical/backlog/issues/22).
40
+
41
+ - **No custom Zensical, no plugins.** zmerge assembles one regular Zensical project and builds it with `zensical build`.
42
+ - **One site.** One navigation, one global search, one link check across all projects.
43
+ - **Links that work everywhere.** Links between projects use the projects' published URLs and are rewritten into
44
+ validated relative links when merging.
45
+ - **Per-project settings.** Markdown extensions, plugins, mkdocstrings options and snippets of every project are merged.
46
+ - **Local or git.** Include projects from local paths or straight from git repositories.
47
+ - **Fast.** Hardlinks instead of copies, incremental re-assembly in a few milliseconds, and `zmerge serve` for live
48
+ previews.
49
+
50
+ ## Installation
51
+
52
+ ```bash
53
+ uv tool install zmerge --with mkdocstrings-python # mkdocstrings-python only if you render API docs
54
+ ```
55
+
56
+ ## Quick start
57
+
58
+ Include other projects in the `nav` of an umbrella project's `zensical.toml`, just like with the
59
+ mkdocs-monorepo-plugin:
60
+
61
+ ```toml
62
+ [project]
63
+ site_name = "My projects"
64
+ site_url = "https://example.github.io/"
65
+ nav = [
66
+ { Home = "index.md" },
67
+ { lev = "!include ../lev/zensical.toml" },
68
+ { dame = "!include git+https://github.com/KarelZe/dame-rs.git" },
69
+ ]
70
+ ```
71
+
72
+ Then build or preview the merged site:
73
+
74
+ ```bash
75
+ zmerge build --strict
76
+ zmerge serve
77
+ ```
78
+
79
+ Add `.zmerge/` and `.zmerge.toml` to your `.gitignore`. See the [documentation](https://karelze.github.io/zmerge/) for
80
+ the configuration, linking between projects and [limitations](https://karelze.github.io/zmerge/limitations/), and
81
+ [examples/karelze](examples/karelze) for a complete umbrella site.
82
+
83
+ ## Development
84
+
85
+ ```bash
86
+ uv sync
87
+ uv run pytest
88
+ uv run prek run --all-files
89
+ uv run zensical serve
90
+ ```
91
+
92
+ > [!WARNING]
93
+ > zmerge is not affiliated with the Zensical project. It is purely meant as a temporary solution until Zensical ships
94
+ > official support for merging projects, tracked in [zensical/backlog#22](https://github.com/zensical/backlog/issues/22).
zmerge-0.1.0/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # zmerge 📚
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/zmerge)](https://pypi.org/project/zmerge/)
4
+ [![Test](https://github.com/KarelZe/zmerge/actions/workflows/test.yml/badge.svg)](https://github.com/KarelZe/zmerge/actions/workflows/test.yml)
5
+ [![Docs](https://img.shields.io/badge/docs-zensical-blue)](https://karelze.github.io/zmerge/)
6
+
7
+ `zmerge` merges the documentation of multiple [Zensical](https://zensical.org/) projects into one site with working
8
+ links, a single navigation and one global search. It fills the gap left by the
9
+ [mkdocs-monorepo-plugin](https://github.com/backstage/mkdocs-monorepo-plugin) until Zensical ships
10
+ [an official solution](https://github.com/zensical/backlog/issues/22).
11
+
12
+ - **No custom Zensical, no plugins.** zmerge assembles one regular Zensical project and builds it with `zensical build`.
13
+ - **One site.** One navigation, one global search, one link check across all projects.
14
+ - **Links that work everywhere.** Links between projects use the projects' published URLs and are rewritten into
15
+ validated relative links when merging.
16
+ - **Per-project settings.** Markdown extensions, plugins, mkdocstrings options and snippets of every project are merged.
17
+ - **Local or git.** Include projects from local paths or straight from git repositories.
18
+ - **Fast.** Hardlinks instead of copies, incremental re-assembly in a few milliseconds, and `zmerge serve` for live
19
+ previews.
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ uv tool install zmerge --with mkdocstrings-python # mkdocstrings-python only if you render API docs
25
+ ```
26
+
27
+ ## Quick start
28
+
29
+ Include other projects in the `nav` of an umbrella project's `zensical.toml`, just like with the
30
+ mkdocs-monorepo-plugin:
31
+
32
+ ```toml
33
+ [project]
34
+ site_name = "My projects"
35
+ site_url = "https://example.github.io/"
36
+ nav = [
37
+ { Home = "index.md" },
38
+ { lev = "!include ../lev/zensical.toml" },
39
+ { dame = "!include git+https://github.com/KarelZe/dame-rs.git" },
40
+ ]
41
+ ```
42
+
43
+ Then build or preview the merged site:
44
+
45
+ ```bash
46
+ zmerge build --strict
47
+ zmerge serve
48
+ ```
49
+
50
+ Add `.zmerge/` and `.zmerge.toml` to your `.gitignore`. See the [documentation](https://karelze.github.io/zmerge/) for
51
+ the configuration, linking between projects and [limitations](https://karelze.github.io/zmerge/limitations/), and
52
+ [examples/karelze](examples/karelze) for a complete umbrella site.
53
+
54
+ ## Development
55
+
56
+ ```bash
57
+ uv sync
58
+ uv run pytest
59
+ uv run prek run --all-files
60
+ uv run zensical serve
61
+ ```
62
+
63
+ > [!WARNING]
64
+ > zmerge is not affiliated with the Zensical project. It is purely meant as a temporary solution until Zensical ships
65
+ > official support for merging projects, tracked in [zensical/backlog#22](https://github.com/zensical/backlog/issues/22).
@@ -0,0 +1,147 @@
1
+ [build-system]
2
+ requires = ["uv_build>=0.12.0,<0.14.0"]
3
+ build-backend = "uv_build"
4
+
5
+ [project]
6
+ name = "zmerge"
7
+ version = "0.1.0"
8
+ description = "Merge the documentation of multiple Zensical projects into one site with working links and a global search 📚."
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ requires-python = ">=3.11"
13
+ keywords = [
14
+ "documentation",
15
+ "monorepo",
16
+ "zensical",
17
+ "mkdocs",
18
+ ]
19
+ classifiers = [
20
+ "Development Status :: 3 - Alpha",
21
+ "Environment :: Console",
22
+ "Programming Language :: Python :: 3 :: Only",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Programming Language :: Python :: 3.13",
26
+ "Programming Language :: Python :: 3.14",
27
+ "Operating System :: OS Independent",
28
+ "Intended Audience :: Developers",
29
+ "Topic :: Documentation",
30
+ "Topic :: Software Development :: Documentation",
31
+ ]
32
+ dependencies = [
33
+ "pyyaml>=6.0",
34
+ "tomli-w>=1.2",
35
+ "zensical>=0.0.39",
36
+ ]
37
+
38
+ [[project.authors]]
39
+ name = "Markus Bilz"
40
+ email = "github@markusbilz.com"
41
+
42
+ [project.scripts]
43
+ zmerge = "zmerge.cli:main"
44
+
45
+ [project.urls]
46
+ Homepage = "https://github.com/KarelZe/zmerge"
47
+ Documentation = "https://karelze.github.io/zmerge/"
48
+ "Bug Tracker" = "https://github.com/KarelZe/zmerge/issues"
49
+
50
+ [dependency-groups]
51
+ test = [
52
+ "mkdocstrings-python",
53
+ "pytest",
54
+ "pytest-cov",
55
+ ]
56
+ docs = ["zensical"]
57
+ dev = [
58
+ { include-group = "test" },
59
+ { include-group = "docs" },
60
+ "prek>=0.5",
61
+ "ruff",
62
+ "ty",
63
+ ]
64
+
65
+ [tool.pytest.ini_options]
66
+ minversion = "8.0"
67
+ addopts = "-ra -p no:warnings -v --cov --cov-report term-missing --doctest-modules"
68
+ testpaths = [
69
+ "tests",
70
+ "src",
71
+ ]
72
+
73
+ [tool.coverage.run]
74
+ source = ["zmerge"]
75
+ branch = true
76
+
77
+ [tool.coverage.report]
78
+ exclude_also = [
79
+ "if __name__ == .__main__.:",
80
+ "if TYPE_CHECKING:",
81
+ ]
82
+ show_missing = true
83
+
84
+ [tool.ty.rules]
85
+ unresolved-import = "error"
86
+ unused-ignore-comment = "warn"
87
+ possibly-unresolved-reference = "error"
88
+ redundant-cast = "error"
89
+ deprecated = "error"
90
+
91
+ [tool.uv]
92
+ exclude-newer = "7 days"
93
+
94
+ [tool.ruff]
95
+ line-length = 120
96
+
97
+ [tool.ruff.lint]
98
+ select = [
99
+ "A",
100
+ "C4",
101
+ "D",
102
+ "DOC",
103
+ "E",
104
+ "F",
105
+ "FURB",
106
+ "I",
107
+ "N",
108
+ "PT",
109
+ "PTH",
110
+ "RET",
111
+ "RUF",
112
+ "SIM",
113
+ "TC",
114
+ "TD",
115
+ "TID",
116
+ "UP",
117
+ "W",
118
+ ]
119
+ ignore = [
120
+ "D203",
121
+ "D212",
122
+ "DOC502",
123
+ "E501",
124
+ ]
125
+ preview = true
126
+
127
+ [tool.ruff.lint.per-file-ignores]
128
+ "tests/*" = ["D"]
129
+
130
+ [tool.ruff.lint.pydocstyle]
131
+ convention = "google"
132
+
133
+ [tool.ruff.lint.pydoclint]
134
+ ignore-one-line-docstrings = true
135
+
136
+ [tool.ruff.lint.isort]
137
+ known-first-party = ["zmerge"]
138
+ section-order = [
139
+ "future",
140
+ "standard-library",
141
+ "third-party",
142
+ "first-party",
143
+ "local-folder",
144
+ ]
145
+
146
+ [tool.ruff.format]
147
+ preview = true
@@ -0,0 +1,127 @@
1
+ [build-system]
2
+ requires = ["uv_build>=0.12.0,<0.14.0"]
3
+ build-backend = "uv_build"
4
+
5
+ [project]
6
+ name = "zmerge"
7
+ version = "0.1.0"
8
+ authors = [{ name = "Markus Bilz", email = "github@markusbilz.com" }]
9
+ description = "Merge the documentation of multiple Zensical projects into one site with working links and a global search 📚."
10
+ readme = "README.md"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ requires-python = ">=3.11"
14
+ keywords = ["documentation", "monorepo", "zensical", "mkdocs"]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Environment :: Console",
18
+ "Programming Language :: Python :: 3 :: Only",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Programming Language :: Python :: 3.14",
23
+ "Operating System :: OS Independent",
24
+ "Intended Audience :: Developers",
25
+ "Topic :: Documentation",
26
+ "Topic :: Software Development :: Documentation",
27
+ ]
28
+
29
+ dependencies = ["pyyaml>=6.0", "tomli-w>=1.2", "zensical>=0.0.39"]
30
+
31
+ [project.scripts]
32
+ zmerge = "zmerge.cli:main"
33
+
34
+ [project.urls]
35
+ "Homepage" = "https://github.com/KarelZe/zmerge"
36
+ "Documentation" = "https://karelze.github.io/zmerge/"
37
+ "Bug Tracker" = "https://github.com/KarelZe/zmerge/issues"
38
+
39
+ [dependency-groups]
40
+ test = ["mkdocstrings-python", "pytest", "pytest-cov"]
41
+ docs = ["zensical"]
42
+ dev = [
43
+ { include-group = "test" },
44
+ { include-group = "docs" },
45
+ "prek>=0.5",
46
+ "ruff",
47
+ "ty",
48
+ ]
49
+
50
+ [tool.pytest.ini_options]
51
+ minversion = "8.0"
52
+ addopts = "-ra -p no:warnings -v --cov --cov-report term-missing --doctest-modules"
53
+ testpaths = ["tests", "src"]
54
+
55
+ [tool.coverage.run]
56
+ source = ["zmerge"]
57
+ branch = true
58
+
59
+ [tool.coverage.report]
60
+ exclude_also = ["if __name__ == .__main__.:", "if TYPE_CHECKING:"]
61
+ show_missing = true
62
+
63
+ [tool.ty.rules]
64
+ unresolved-import = "error"
65
+ unused-ignore-comment = "warn"
66
+ possibly-unresolved-reference = "error"
67
+ redundant-cast = "error"
68
+ deprecated = "error"
69
+
70
+ [tool.uv]
71
+ exclude-newer = "7 days"
72
+
73
+ [tool.ruff]
74
+
75
+ line-length = 120
76
+
77
+ [tool.ruff.lint]
78
+
79
+ # See rules: https://beta.ruff.rs/docs/rules/
80
+ select = [
81
+ "A", # shadow builtins
82
+ "C4", # Catch incorrect use of comprehensions, dict, list, etc
83
+ "D", # pydocstyle
84
+ "DOC", # pydoclint
85
+ "E", # PyCodeStyle errors
86
+ "F", # Pyflakes rules
87
+ "FURB", # refurb
88
+ "I", # isort
89
+ "N", # enforce naming conventions, e.g. ClassName vs function_name
90
+ "PT", # pytest
91
+ "PTH", # flake8-use-pathlib
92
+ "RET", # Good return practices
93
+ "RUF", # ruff-specific rules
94
+ "SIM", # Common simplification rules
95
+ "TC", # Enforce importing certain types in a TYPE_CHECKING block
96
+ "TD", # Be diligent with TODO comments
97
+ "TID", # Some good import practices
98
+ "UP", # Warn if certain things can changed due to newer Python versions
99
+ "W", # PyCodeStyle warnings
100
+ ]
101
+
102
+ ignore = ["D203", "D212", "DOC502", "E501"]
103
+
104
+ preview = true
105
+
106
+ [tool.ruff.lint.per-file-ignores]
107
+ "tests/*" = ["D"]
108
+
109
+ [tool.ruff.lint.pydocstyle]
110
+ convention = "google"
111
+
112
+ [tool.ruff.lint.pydoclint]
113
+ # Short helpers document their behaviour in one line.
114
+ ignore-one-line-docstrings = true
115
+
116
+ [tool.ruff.lint.isort]
117
+ known-first-party = ["zmerge"]
118
+ section-order = [
119
+ "future",
120
+ "standard-library",
121
+ "third-party",
122
+ "first-party",
123
+ "local-folder",
124
+ ]
125
+
126
+ [tool.ruff.format]
127
+ preview = true
@@ -0,0 +1,7 @@
1
+ """Merge the documentation of multiple Zensical projects into one site."""
2
+
3
+ from importlib.metadata import version
4
+
5
+ __version__ = version("zmerge")
6
+
7
+ __all__ = ["__version__"]
@@ -0,0 +1,8 @@
1
+ """Entry point for ``python -m zmerge``."""
2
+
3
+ import sys
4
+
5
+ from zmerge.cli import main
6
+
7
+ if __name__ == "__main__":
8
+ sys.exit(main())