{"record":{"id":"fa022cba91ce93e8","repo":"FuelLabs/fuels-rs","slug":"file-not-in-summary-md","errorCode":null,"errorMessage":"file `{}` not in SUMMARY.md","messagePattern":"file `(.+?)` not in SUMMARY\\.md","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"scripts/check-docs/src/lib.rs","lineNumber":225,"sourceCode":"            path.canonicalize()\n                .unwrap_or_else(|e| panic!(\"could not canonicalize md path: {e} {path:?}\"))\n        })\n        .collect()\n}\n\npub fn validate_md_files(\n    md_files_summary: HashSet<PathBuf>,\n    md_files_in_src: String,\n) -> Vec<Error> {\n    md_files_in_src\n        .lines()\n        .filter_map(|file| {\n            let file = PathBuf::from(file)\n                .canonicalize()\n                .expect(\"could not canonicalize md path\");\n\n            (!md_files_summary.contains(&file))\n                .then(|| anyhow!(\"file `{}` not in SUMMARY.md\", file.to_str().unwrap()))\n        })\n        .collect()\n}\n\npub fn search_for_pattern(pattern: &str, location: &str) -> anyhow::Result<String> {\n    let grep_project = std::process::Command::new(\"grep\")\n        .arg(\"-H\") // print filename\n        .arg(\"-n\") // print line-number\n        .arg(\"-r\") // search recursively\n        .arg(\"--binary-files=without-match\")\n        .arg(\"--exclude-dir=check-docs\")\n        .arg(pattern)\n        .arg(location)\n        .output()\n        .expect(\"failed grep command\");\n\n    if !grep_project.status.success() {\n        bail!(\"Failed running `grep` command for pattern '{}'\", pattern);","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/FuelLabs/fuels-rs/blob/d9a250a51818dda64bfeb5ef7cc19cf27bdcd623/scripts/check-docs/src/lib.rs#L207-L243","documentation":"Doc-checking error (scripts/check-docs): a markdown file exists under the mdbook src/ directory but is not referenced by SUMMARY.md. The check compares the canonicalized set of files listed in SUMMARY.md with files found by scanning the source tree; every .md file must be reachable from the book's table of contents.","triggerScenarios":"Adding a markdown page under docs/src (or wherever the mdbook source lives) without adding a corresponding entry/link in SUMMARY.md; leaving draft or moved pages in the tree; renaming a file that SUMMARY.md still lists under the old name (old name disappears from the summary set, new file is orphaned).","commonSituations":"Draft pages committed accidentally; docs restructures that move files into subdirectories without updating SUMMARY.md; deleted pages that still exist in the working tree.","solutions":["If the page should ship: add an entry (or an inline [link](page.md)) to SUMMARY.md at the right position in the chapter list.","If the page is a draft/leftover: delete it or move it outside the mdbook src directory.","If a file was renamed, update SUMMARY.md to the new path so the canonicalized sets match.","Re-run the check-docs tooling to confirm."],"exampleFix":"# before: docs/src/advanced/storage.md exists but is unlisted\n# SUMMARY.md\n# [Intro](intro.md)\n# after\n# Summary\n[Intro](intro.md)\n# Advanced\n- [Storage](advanced/storage.md)","handlingStrategy":"validation","validationCode":"let summary_files: HashSet<PathBuf> = parse_summary_entries(\"docs/src/SUMMARY.md\")\n    .into_iter().filter_map(|p| p.canonicalize().ok()).collect();\nfor md in walkdir::WalkDir::new(\"docs/src\").into_iter().filter_map(Result::ok) {\n    if md.path().extension() == Some(\"md\".as_ref()) {\n        let c = md.path().canonicalize()?;\n        assert!(summary_files.contains(&c) || md.path().ends_with(\"SUMMARY.md\"), \"{} not referenced in SUMMARY.md\", md.path().display());\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add the SUMMARY.md entry in the same commit that adds the markdown file.","Keep drafts outside the mdbook src directory (e.g. docs/drafts/) until ready.","Update SUMMARY.md paths immediately when renaming or moving pages."],"tags":["docs","check-docs","mdbook","summary"],"backgroundTag":null,"analyzedSha":"d9a250a51818dda64bfeb5ef7cc19cf27bdcd623","analyzedAt":"2026-08-16T09:49:30.618Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}