feat(schema): 2.1 types, fragments, and JSON Schemas
Add the term, equation, value, and misconception registries (src/model/course/glossary.rs) and the new optional fields on objectives, targets, lectures, readings, bank options, and policy. Load registry entries from objective files, glossary.yaml, and course.yaml, with one definition site per id as for every other registry. Port every edit in docs/design/2.1/build_schemas.py into the hand-written schema builders, add glossary.schema.json, and test the generated schemas against the targets; the only differences are two 2.0 spellings the code already had. The 2.0 example fragments load and validate unchanged. The 2.1 example bank gains `status: draft`, which every coursebank item requires. tests/docs.rs skips docs/design/, which holds design records rather than guide pages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
47 files changed
+10568
-55
No files matched your search
@@ -38,6 +38,10 @@ fn root() -> PathBuf {
|
||||
|
||||
/// Every `.md` file under `docs/`, sorted so failures are reported in a stable
|
||||
/// order.
|
||||
///
|
||||
/// `docs/design/` is skipped. It holds design records (a specification, its
|
||||
/// examples, an implementation plan), which are read in the repository rather
|
||||
/// than compiled into the guide, and whose example output is quoted as written.
|
||||
fn markdown_files(dir: &Path, out: &mut Vec<PathBuf>) {
|
||||
let Ok(entries) = std::fs::read_dir(dir) else {
|
||||
return;
|
||||
@@ -45,6 +49,9 @@ fn markdown_files(dir: &Path, out: &mut Vec<PathBuf>) {
|
||||
let mut paths: Vec<PathBuf> = entries.filter_map(|e| e.ok()).map(|e| e.path()).collect();
|
||||
paths.sort();
|
||||
for path in paths {
|
||||
if path.ends_with("docs/design") {
|
||||
continue;
|
||||
}
|
||||
if path.is_dir() {
|
||||
markdown_files(&path, out);
|
||||
} else if path.extension().is_some_and(|e| e == "md") {
|
||||
|
||||
Reference in new issue
Block a user