use yaml instead of json for object detector docs

This commit is contained in:
Josh Hawkins
2026-07-07 11:10:48 -05:00
parent 8ff7be43b6
commit 3f63311fcc
6 changed files with 1343 additions and 350 deletions
+9
View File
@@ -0,0 +1,9 @@
const yaml = require("js-yaml");
// Webpack loader that compiles a YAML file into a default-exported JS object,
// so docs data can be authored in YAML (block scalars, no quote/newline
// escaping) but imported exactly like the JSON it replaces.
module.exports = function (source) {
const data = yaml.load(source);
return `export default ${JSON.stringify(data)};`;
};