Make a trail's length one end-to-end walk, and put the map and the trails in the first screen
Mirror to forge / mirror (push) Canceled after 0s
Validate / validate (push) Canceled after 0s
Validate / history (push) Canceled after 0s
Validate / site (push) Canceled after 0s
Validate / deploy (push) Canceled after 0s

Lengths and what belongs:
- A trail's length is now the end-to-end length of its canonical path: one
  branch at a split, no side trails, no system totals. A holder's larger
  figure and the built length of an unfinished trail are separate fields
  (`system_km`, `system_note`, `built_km`), shown under the length.
- Corrected: Florida Trail 1,500 to 1,130 mi, American Discovery Trail
  6,800 to 5,008 mi, Ozark Trail to 230 mi, General Crook Trail to 138 mi,
  Sheltowee Trace to 343 mi, Allegheny Trail to 316 mi, Great Eastern
  Trail to 1,800 mi.
- The Florida Trail's and the Ice Age Trail's main tracks are re-cut as
  one walk; the other branches are alternates.
- A trail must be walkable from end to end today. Nine trails that are
  not, are a network, or fall under the floor move to the "Considered and
  left out" list. The Bayou State Trail is added. 196 trails.

Pages:
- The trail page puts the map and At a glance directly under the title;
  the home page drops its oversized hero and shows the trails and the map
  at once. Place and list pages put the list beside the map.
- Every map starts by itself once the page is ready, over a drawing of
  the tracks that is in the page from the first paint.
- Lists is in the header. The home page shows ten lists chosen in
  `collections.toml`. Tables have equal columns and stack on a phone.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-16 18:57:21 -07:00
1 parent f2d3b71810
commit 8637181a2b
145 files changed
+2178 -1455

No files matched your search

+49 -1
View File
@@ -2,6 +2,7 @@
glossary.toml [[term]] id, term, definition, optional source_url, see
collections.toml [[collection]] id, name, members, definition, source_url, source_publisher
[[list]] key, home (the lists the home page shows, and their order)
authors.toml [[author]] name, credits, optional kind
Each function appends one message per problem to `errors`. Used by tools/validate.py, which passes
@@ -9,12 +10,26 @@ the records it has read. Python 3 standard library only. Fields are in docs/sche
"""
import os
import re
import sys
import tomllib
ID_RE = re.compile(r"[a-z0-9]+(-[a-z0-9]+)*")
DASH_RE = re.compile(r"[–—]| - ")
def built_in_list_keys():
"""The keys of the lists defined in web/olt/browse.py, or None when the generator cannot be read."""
web = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "web")
sys.path.insert(0, web)
try:
from olt import browse
return {lst.key for lst in browse.LISTS}
except Exception: # noqa: BLE001 - without the generator the keys are not checked
return None
finally:
sys.path.remove(web)
def _load(root, name, errors):
path = os.path.join(root, name)
if not os.path.isfile(path):
@@ -120,6 +135,38 @@ def check_collection_entries(entries, trail_ids, errors, where="collections.toml
errors.append(f"{who} member {m} is not a trail in the dataset")
def check_list_entries(entries, list_keys, errors, where="collections.toml"):
"""The [[list]] entries: a list's key and its place on the home page. Optional.
list_keys: the keys of the lists defined in web/olt/browse.py."""
if entries is None:
return
if not isinstance(entries, list):
errors.append(f"{where}: [[list]] must be an array of tables")
return
seen_keys, seen_home = set(), {}
for i, e in enumerate(entries, 1):
if not isinstance(e, dict):
errors.append(f"{where}: [[list]] entry {i} must be a table")
continue
who = f"{where}: [[list]] {e.get('key') or 'entry ' + str(i)}"
check_unknown(e, {"key", "home"}, who, errors)
key = _text(e, "key", who, errors)
if key and list_keys is not None and key not in list_keys:
errors.append(f"{who} is not the key of a list in web/olt/browse.py")
if key in seen_keys:
errors.append(f"{who} appears twice")
seen_keys.add(key)
home = e.get("home")
if home is None:
continue
if isinstance(home, bool) or not isinstance(home, int) or home < 1:
errors.append(f"{who} home must be a whole number from 1")
elif home in seen_home:
errors.append(f"{who} home {home} is also the place of {seen_home[home]}")
else:
seen_home[home] = key
def check_author_entries(entries, routes, errors, where="authors.toml"):
"""routes: [(trail id, route.creator)] for every route in the dataset."""
if not isinstance(entries, list) or not entries:
@@ -162,9 +209,10 @@ def check_datafiles(root, trails, errors):
check_glossary_entries(doc.get("term"), errors)
doc = _load(root, "collections.toml", errors)
if doc is not None:
for name in sorted(set(doc) - {"collection"}):
for name in sorted(set(doc) - {"collection", "list"}):
errors.append(f"collections.toml: unknown top level field {name}")
check_collection_entries(doc.get("collection"), {r.get("id") for r in trails}, errors)
check_list_entries(doc.get("list"), built_in_list_keys(), errors)
doc = _load(root, "authors.toml", errors)
if doc is not None:
for name in sorted(set(doc) - {"author"}):