- Introduced multiple architecture documentation files covering building block view, runtime view, deployment view, concepts, architecture decisions, quality requirements, technical risks, glossary, UI and styling, testing, CI, and development setup. - Migrated existing content from `architecture_overview.md` and `implementation_plan.md` into structured documentation. - Created scripts for checking broken links in documentation and formatting Markdown files for consistency. - Updated quickstart guide to provide clearer setup instructions and usage overview. - Removed outdated MVP features and testing strategy documents to streamline documentation.
44 lines
1.4 KiB
Python
44 lines
1.4 KiB
Python
"""Simple Markdown link checker for local docs/ files.
|
|
|
|
Checks only local file links (relative paths) and reports missing targets.
|
|
|
|
Run from the repository root using the project's Python environment.
|
|
"""
|
|
import re
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parent.parent
|
|
DOCS = ROOT / 'docs'
|
|
|
|
MD_LINK_RE = re.compile(r"\[([^\]]+)\]\(([^)]+)\)")
|
|
|
|
errors = []
|
|
|
|
for md in DOCS.rglob('*.md'):
|
|
text = md.read_text(encoding='utf-8')
|
|
for m in MD_LINK_RE.finditer(text):
|
|
label, target = m.groups()
|
|
# skip URLs
|
|
if target.startswith('http://') or target.startswith('https://') or target.startswith('#'):
|
|
continue
|
|
# strip anchors
|
|
target_path = target.split('#')[0]
|
|
# if link is to a directory index, allow
|
|
candidate = (md.parent / target_path).resolve()
|
|
if candidate.exists():
|
|
continue
|
|
# check common implicit index: target/ -> target/README.md or target/index.md
|
|
candidate_dir = md.parent / target_path
|
|
if candidate_dir.is_dir():
|
|
if (candidate_dir / 'README.md').exists() or (candidate_dir / 'index.md').exists():
|
|
continue
|
|
errors.append((str(md.relative_to(ROOT)), target, label))
|
|
|
|
if errors:
|
|
print('Broken local links found:')
|
|
for src, tgt, label in errors:
|
|
print(f'- {src} -> {tgt} ({label})')
|
|
exit(2)
|
|
|
|
print('No broken local links detected.')
|