fr-docs 5.1.0__tar.gz → 5.2.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.
- {fr_docs-5.1.0 → fr_docs-5.2.0}/PKG-INFO +1 -1
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs/build.py +5 -5
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs/markdown.py +32 -3
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs.egg-info/PKG-INFO +1 -1
- {fr_docs-5.1.0 → fr_docs-5.2.0}/pyproject.toml +1 -1
- {fr_docs-5.1.0 → fr_docs-5.2.0}/LICENSE.md +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/README.md +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs/__init__.py +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs/__main__.py +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs/config.py +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs/config_accessors.py +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs/frontmatter.py +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs/git.py +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs/html_pipeline.py +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs/init.py +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs/search.py +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs/slug.py +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs/syntax.py +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs/template.py +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs/update.py +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs/utils.py +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs.egg-info/SOURCES.txt +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs.egg-info/dependency_links.txt +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs.egg-info/entry_points.txt +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs.egg-info/requires.txt +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/fr_docs.egg-info/top_level.txt +0 -0
- {fr_docs-5.1.0 → fr_docs-5.2.0}/setup.cfg +0 -0
|
@@ -62,9 +62,9 @@ def _best_zstd_level(raw: bytes, configured: int) -> int:
|
|
|
62
62
|
if len(raw) < 1024:
|
|
63
63
|
return min(configured, 19)
|
|
64
64
|
|
|
65
|
-
best_level, best_size = 1, len(zstandard.ZstdCompressor(level=1).compress(raw))
|
|
65
|
+
best_level, best_size = 1, len(zstandard.ZstdCompressor(level=1, threads=16).compress(raw))
|
|
66
66
|
for level in range(2, configured + 1):
|
|
67
|
-
size = len(zstandard.ZstdCompressor(level=level).compress(raw))
|
|
67
|
+
size = len(zstandard.ZstdCompressor(level=level, threads=16).compress(raw))
|
|
68
68
|
if size < best_size:
|
|
69
69
|
best_level, best_size = level, size
|
|
70
70
|
return best_level
|
|
@@ -307,7 +307,7 @@ def _write_zstd_json(config, filename, value):
|
|
|
307
307
|
return len(raw), src.stat().st_size
|
|
308
308
|
|
|
309
309
|
compressed = zstandard.ZstdCompressor(
|
|
310
|
-
level=_best_zstd_level(raw, zstd_level(config))
|
|
310
|
+
level=_best_zstd_level(raw, zstd_level(config)), threads=16
|
|
311
311
|
).compress(raw)
|
|
312
312
|
path = Path(config["_out_dir"]) / filename
|
|
313
313
|
path.write_bytes(compressed)
|
|
@@ -674,7 +674,7 @@ def main(argv=None) -> None:
|
|
|
674
674
|
# Compress search index
|
|
675
675
|
search_raw = json.dumps(search_index, separators=(",", ":")).encode("utf-8")
|
|
676
676
|
compressed = zstandard.ZstdCompressor(
|
|
677
|
-
level=_best_zstd_level(search_raw, zstd_level(config))
|
|
677
|
+
level=_best_zstd_level(search_raw, zstd_level(config)), threads=16
|
|
678
678
|
).compress(search_raw)
|
|
679
679
|
search_index_path = Path(config["_out_dir"], search_index_filename(config))
|
|
680
680
|
search_index_path.parent.mkdir(parents=True, exist_ok=True)
|
|
@@ -732,7 +732,7 @@ def main(argv=None) -> None:
|
|
|
732
732
|
"utf-8"
|
|
733
733
|
)
|
|
734
734
|
compressed = zstandard.ZstdCompressor(
|
|
735
|
-
level=_best_zstd_level(raw, zstd_level(config))
|
|
735
|
+
level=_best_zstd_level(raw, zstd_level(config)), threads=16
|
|
736
736
|
).compress(raw)
|
|
737
737
|
highlight_cache_file.parent.mkdir(parents=True, exist_ok=True)
|
|
738
738
|
highlight_cache_file.write_bytes(compressed)
|
|
@@ -108,6 +108,19 @@ def _extract_footnote_definitions(md_text):
|
|
|
108
108
|
return definitions
|
|
109
109
|
|
|
110
110
|
|
|
111
|
+
def _add_footnote_commas(html_text):
|
|
112
|
+
"""Add commas between consecutive footnote reference links.
|
|
113
|
+
|
|
114
|
+
``[^tag1][^tag2]`` renders as ``<a>2</a><a>3</a>`` which reads as "23";
|
|
115
|
+
insert a comma so it reads "2,3".
|
|
116
|
+
"""
|
|
117
|
+
return re.sub(
|
|
118
|
+
r'(<sup>\d+</sup></a>)(<a href="#fnref-[^"]+" class="footnote-ref">)',
|
|
119
|
+
r'\1,\2',
|
|
120
|
+
html_text,
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
|
|
111
124
|
def process_footnotes(md_text):
|
|
112
125
|
"""Process footnote definitions and references.
|
|
113
126
|
|
|
@@ -143,14 +156,30 @@ def process_footnotes(md_text):
|
|
|
143
156
|
)
|
|
144
157
|
return f'<a href="#fnref-{tag}" class="footnote-ref"><sup>{idx}</sup></a>'
|
|
145
158
|
|
|
146
|
-
#
|
|
159
|
+
# Replace footnote references [^tag] with HTML links
|
|
147
160
|
processed_text = FOOTNOTE_REF_RE.sub(_repl, md_text)
|
|
148
|
-
|
|
161
|
+
|
|
162
|
+
# Only remove definition lines for tags that are actually footnote tags
|
|
163
|
+
# (referenced with [^tag]). Keep standard markdown reference link
|
|
164
|
+
# definitions ([ref]: URL ...) intact so [text][ref] links resolve.
|
|
165
|
+
footnote_ref_tags = set(FOOTNOTE_REF_RE.findall(md_text))
|
|
166
|
+
|
|
167
|
+
def _remove_fn_def(m):
|
|
168
|
+
tag = m.group(1)
|
|
169
|
+
if tag in footnote_ref_tags:
|
|
170
|
+
return ""
|
|
171
|
+
return m.group(0)
|
|
172
|
+
|
|
149
173
|
processed_text = re.sub(
|
|
150
|
-
r"(?m)^\[([^\]]+)\]:\s*\S+.*(?:\n?)$",
|
|
174
|
+
r"(?m)^\[([^\]]+)\]:\s*\S+.*(?:\n?)$",
|
|
175
|
+
_remove_fn_def,
|
|
176
|
+
processed_text,
|
|
151
177
|
)
|
|
152
178
|
processed_text = re.sub(r"\n{3,}", "\n\n", processed_text)
|
|
153
179
|
|
|
180
|
+
# Add commas between consecutive footnote references
|
|
181
|
+
processed_text = _add_footnote_commas(processed_text)
|
|
182
|
+
|
|
154
183
|
return processed_text, footnotes
|
|
155
184
|
|
|
156
185
|
|
|
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "fr-docs"
|
|
9
|
-
version = "5.
|
|
9
|
+
version = "5.2.0"
|
|
10
10
|
description = "Fast static documentation generator with search, versioning, and zero-config setup"
|
|
11
11
|
readme = "README.md"
|
|
12
12
|
requires-python = ">=3.14"
|
|
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
|