aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-10-27 17:14:15 +0200
committerWojtek Kosior <koszko@koszko.org>2022-10-27 17:14:15 +0200
commit728fcad5e498ac26b108383d7117ad59ad029fd3 (patch)
tree7b1e1f408c42b96cc62db287ce070e8a2cef2609 /src
parent32a2de0c3ff6dec5bc3ef6496b7e3cdde671e5f3 (diff)
downloadhaketilo-hydrilla-728fcad5e498ac26b108383d7117ad59ad029fd3.tar.gz
haketilo-hydrilla-728fcad5e498ac26b108383d7117ad59ad029fd3.zip
[proxy] gather available doc page identifiers programmatically
Diffstat (limited to 'src')
-rw-r--r--src/hydrilla/proxy/self_doc.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/hydrilla/proxy/self_doc.py b/src/hydrilla/proxy/self_doc.py
index ccf0e12..838df57 100644
--- a/src/hydrilla/proxy/self_doc.py
+++ b/src/hydrilla/proxy/self_doc.py
@@ -6,6 +6,16 @@
import jinja2
+from pathlib import Path
+
+
+here = Path(__file__).resolve().parent
+
loader = jinja2.PackageLoader(__package__, package_path='self_doc')
-page_names = {'url_patterns', 'policy_selection'}
+suffix_len = len('.html.jinja')
+page_names = frozenset(
+ path.name[:-suffix_len]
+ for path in (here / 'self_doc').glob('*.html.jinja')
+ if path.name != 'doc_base.html.jinja'
+)