Remove most of the html references outside of patchouli.text

This commit is contained in:
object-Object 2023-10-25 22:39:54 -04:00
parent 3afcc4c2e7
commit 5a8bf87218
4 changed files with 7 additions and 9 deletions

View file

@ -5,7 +5,7 @@
{{- formatting.section_header(entry, "h3", "entry-title") }}
{% for page in entry.preprocess_pages() +%}
{% include page.template %}
{% include page.template~".html.jinja" %}
{% endfor %}
{% endcall %}
</div>

View file

@ -56,8 +56,9 @@ def dump_sitemap(root: Path, sitemap: Sitemap):
def assert_version_exists(*, root: Path, version: str):
path = root / "v" / version / "index.html"
if not path.is_file():
# ensure the directory was written and it contains files (not just directories)
path = root / "v" / version
if not path.exists() or not any(path.rglob("*.*")):
raise FileNotFoundError(f"Missing default language for {version}: {path}")

View file

@ -40,9 +40,7 @@ class Page(TypeTaggedUnion, type=None):
template_id = cls.type
if template_id:
cls.__template = (
f"pages/{template_id.namespace}/{template_id.path}.html.jinja"
)
cls.__template = f"pages/{template_id.namespace}/{template_id.path}"
@classproperty
@classmethod

View file

@ -109,9 +109,8 @@ patchouli = "hexdoc.patchouli._hooks:PatchouliPlugin"
[tool.pytest.ini_options]
addopts = ["--import-mode=importlib"]
markers = [
"template",
]
markers = ["template"]
testpaths = ["doc/test"]
[tool.coverage.report]
include_namespace_packages = true