From 56dc22749929e260fdab60134d5548ffde894ab0 Mon Sep 17 00:00:00 2001 From: Jukka Aho Date: Sat, 9 May 2026 16:30:27 +0300 Subject: [PATCH] feat(scripts): add check_curated_doc_vocabulary.jl scripts/check_curated_doc_vocabulary.jl | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) --- scripts/check_curated_doc_vocabulary.jl | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 scripts/check_curated_doc_vocabulary.jl diff --git a/scripts/check_curated_doc_vocabulary.jl b/scripts/check_curated_doc_vocabulary.jl new file mode 100644 index 0000000..4a2f83e --- /dev/null +++ b/scripts/check_curated_doc_vocabulary.jl @@ -0,0 +1,28 @@ +#!/usr/bin/env julia +# Fail if obsolete API strings appear in curated website Markdown. +# Run from repository root: +# julia --project=. scripts/check_curated_doc_vocabulary.jl + +const ROOT = dirname(@__DIR__) +const NEEDLES = ["register_fields!", "count_field_dofs"] +# User-facing guides only: developer pages (for example `dof-manager-guide.md`) +# may mention removed APIs when contrasting with `DOFHandler`. +const SCAN_DIRS = [joinpath(ROOT, "juliafem.github.io", "docs", "user-guide")] + +for dir in SCAN_DIRS + isdir(dir) || error("Missing directory: ", dir) + for (root, _, files) in walkdir(dir) + for fn in files + endswith(fn, ".md") || continue + path = joinpath(root, fn) + text = read(path, String) + for needle in NEEDLES + if occursin(needle, text) + rel = relpath(path, ROOT) + error("Curated doc vocabulary: found $(repr(needle)) in ", rel) + end + end + end + end +end +println("check_curated_doc_vocabulary.jl: OK")