hypermarkdown 0.3.0__tar.gz → 0.3.1__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.
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/CHANGELOG.md +16 -1
- {hypermarkdown-0.3.0/src/hypermarkdown.egg-info → hypermarkdown-0.3.1}/PKG-INFO +1 -1
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/__init__.py +1 -1
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/diagram.py +3 -3
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/resolve.py +30 -3
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1/src/hypermarkdown.egg-info}/PKG-INFO +1 -1
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/LICENSE +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/MANIFEST.in +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/README.md +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/pyproject.toml +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/setup.cfg +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/cli.py +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/config.py +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/embed.py +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/frontmatter.py +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/graph.py +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/imports.py +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/lint/__init__.py +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/lint/report.py +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/lint/rules.py +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/mkdocs_plugin.py +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/model.py +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/parse.py +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/render/__init__.py +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/render/flat.py +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/scan.py +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown/urls.py +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown.egg-info/SOURCES.txt +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown.egg-info/dependency_links.txt +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown.egg-info/entry_points.txt +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown.egg-info/requires.txt +0 -0
- {hypermarkdown-0.3.0 → hypermarkdown-0.3.1}/src/hypermarkdown.egg-info/top_level.txt +0 -0
|
@@ -13,6 +13,20 @@ only for the Python API.
|
|
|
13
13
|
|
|
14
14
|
## [Unreleased]
|
|
15
15
|
|
|
16
|
+
## [0.3.1] — 2026-11-13
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- **A nested vault is no longer swept into the vault around it.** A directory
|
|
20
|
+
below the namespace root that carries its own `.hmd/` is another vault, and
|
|
21
|
+
the outer `Workspace` now loads none of its cards. Before, a bare name unique
|
|
22
|
+
in the outer vault became HMD002 as soon as the inner vault had a card of the
|
|
23
|
+
same name, an inner card's absolute link was reported as HMD001 when linted
|
|
24
|
+
from the outer root, and a MkDocs site rooted at the outer vault published
|
|
25
|
+
the inner vault's public cards as its own pages. An import naming a
|
|
26
|
+
directory inside a nested vault is HMD015, the same as a missing directory.
|
|
27
|
+
Linting the nested vault with `--root` set to it, or from a card inside it,
|
|
28
|
+
is unchanged.
|
|
29
|
+
|
|
16
30
|
## [0.3.0] — 2026-09-14
|
|
17
31
|
|
|
18
32
|
### Added
|
|
@@ -243,7 +257,8 @@ Deliberate, and tracked per proposal under `doc/proposals/HMD-NNNN/STATUS.md`:
|
|
|
243
257
|
Both specifications — the format and the site — are still `drafted`. Expect the
|
|
244
258
|
format to move before `1.0`.
|
|
245
259
|
|
|
246
|
-
[Unreleased]: https://github.com/ewiger/hypermarkdown/compare/v0.3.
|
|
260
|
+
[Unreleased]: https://github.com/ewiger/hypermarkdown/compare/v0.3.1...HEAD
|
|
261
|
+
[0.3.1]: https://github.com/ewiger/hypermarkdown/compare/v0.3.0...v0.3.1
|
|
247
262
|
[0.3.0]: https://github.com/ewiger/hypermarkdown/compare/v0.2.0...v0.3.0
|
|
248
263
|
[0.2.0]: https://github.com/ewiger/hypermarkdown/compare/v0.1.1...v0.2.0
|
|
249
264
|
[0.1.1]: https://github.com/ewiger/hypermarkdown/compare/v0.1.0...v0.1.1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"""D2 diagrams for the Python
|
|
1
|
+
"""D2 diagrams for the Python implementation (HMD-0022 §5-§7).
|
|
2
2
|
|
|
3
|
-
HMD-0022 is a proposal of the TypeScript
|
|
3
|
+
HMD-0022 is a proposal of the TypeScript implementation and does not change this one: a
|
|
4
4
|
site build has a build step and no webview, so the no-subprocess rule of its §1
|
|
5
5
|
does not apply here and the `d2` binary stays the engine. What this module
|
|
6
6
|
takes from it is the part that *is* shared — the semantics.
|
|
@@ -30,7 +30,7 @@ from dataclasses import dataclass
|
|
|
30
30
|
#: The fence info strings this module claims.
|
|
31
31
|
LANGUAGES = frozenset({"d2"})
|
|
32
32
|
|
|
33
|
-
#: Bounds on a single render (HMD-0022 §4). Shared with the TypeScript
|
|
33
|
+
#: Bounds on a single render (HMD-0022 §4). Shared with the TypeScript implementation so
|
|
34
34
|
#: that a diagram refused there is refused here.
|
|
35
35
|
TIMEOUT_SECONDS = 2
|
|
36
36
|
MAX_SOURCE_BYTES = 64 * 1024
|
|
@@ -13,7 +13,7 @@ from dataclasses import dataclass, field
|
|
|
13
13
|
from enum import Enum
|
|
14
14
|
from pathlib import Path
|
|
15
15
|
|
|
16
|
-
from .config import Config
|
|
16
|
+
from .config import MARKER_DIR, Config
|
|
17
17
|
from .model import PRIVATE, PUBLIC, Document, ImportStmt
|
|
18
18
|
from .parse import parse
|
|
19
19
|
|
|
@@ -58,13 +58,16 @@ class Workspace:
|
|
|
58
58
|
#: Root-relative parts -> the pages addressable under them, for phase 3.
|
|
59
59
|
self._by_parts: dict[tuple[str, ...], list[Path]] = {}
|
|
60
60
|
self._import_tables: dict[Path, ImportTable] = {}
|
|
61
|
+
#: Roots of the vaults nested below this one; their cards are not ours.
|
|
62
|
+
self._nested_roots: frozenset[Path] = frozenset()
|
|
61
63
|
self._load()
|
|
62
64
|
|
|
63
65
|
# -- loading ---------------------------------------------------------
|
|
64
66
|
|
|
65
67
|
def _load(self) -> None:
|
|
68
|
+
self._nested_roots = self._find_nested_roots()
|
|
66
69
|
for path in sorted(self.root.rglob(f"*{SUFFIX}")):
|
|
67
|
-
if not path.is_file() or self._hidden(path):
|
|
70
|
+
if not path.is_file() or self._hidden(path) or self._in_nested_vault(path):
|
|
68
71
|
continue
|
|
69
72
|
self._pages.append(path)
|
|
70
73
|
text = path.read_text(encoding="utf-8")
|
|
@@ -81,6 +84,28 @@ class Workspace:
|
|
|
81
84
|
def _hidden(self, path: Path) -> bool:
|
|
82
85
|
return any(part.startswith(".") for part in path.relative_to(self.root).parts)
|
|
83
86
|
|
|
87
|
+
def _find_nested_roots(self) -> frozenset[Path]:
|
|
88
|
+
"""Directories below the root that carry their own `.hmd/`.
|
|
89
|
+
|
|
90
|
+
Each one is the root of another vault, so nothing beneath it belongs
|
|
91
|
+
to this one. The root's own marker does not count: every vault has one.
|
|
92
|
+
"""
|
|
93
|
+
nested = set()
|
|
94
|
+
for marker in self.root.rglob(MARKER_DIR):
|
|
95
|
+
directory = marker.parent
|
|
96
|
+
if directory == self.root or not marker.is_dir():
|
|
97
|
+
continue
|
|
98
|
+
if self._hidden(directory):
|
|
99
|
+
continue
|
|
100
|
+
nested.add(directory)
|
|
101
|
+
return frozenset(nested)
|
|
102
|
+
|
|
103
|
+
def _in_nested_vault(self, path: Path) -> bool:
|
|
104
|
+
"""Whether `path` is a nested vault's root or lies beneath one."""
|
|
105
|
+
return any(
|
|
106
|
+
path == nested or nested in path.parents for nested in self._nested_roots
|
|
107
|
+
)
|
|
108
|
+
|
|
84
109
|
# -- naming ----------------------------------------------------------
|
|
85
110
|
|
|
86
111
|
def rel(self, path: Path) -> str:
|
|
@@ -133,7 +158,9 @@ class Workspace:
|
|
|
133
158
|
("HMD003", f"import ref {stmt.ref!r} resolves outside the namespace root")
|
|
134
159
|
)
|
|
135
160
|
continue
|
|
136
|
-
|
|
161
|
+
# A nested vault is another namespace, so a directory inside one
|
|
162
|
+
# does not exist as far as this vault is concerned.
|
|
163
|
+
if not directory.is_dir() or self._in_nested_vault(directory):
|
|
137
164
|
table.problems.append(("HMD015", f"import ref {stmt.ref!r} does not exist"))
|
|
138
165
|
continue
|
|
139
166
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|