Code Generation
The YAML schema matches the config options
docs/modules/ROOT/attachments/schemas/config/mrdocs.schema.json is generated from src/mrdocs/ConfigOptions.json. Never edit it by hand.
Changing the brief of an option in ConfigOptions.json without regenerating the schema fails:
The generated schema does not match the existing schema.
Please run `utils/codegen/generate-yaml-schema.py` to update the schema.
The fix is to regenerate the file, and to commit it with the change:
python3 utils/codegen/generate-yaml-schema.py
|
Guard
|
The bootstrap options page matches the bootstrap tool
docs/modules/ROOT/partials/bootstrap-options.adoc is generated from the argument parser of utils/bootstrap and the option texts in utils/bootstrap/src/core/option_help.py. Never edit it by hand.
Rewording the help of --preset in option_help.py without regenerating the page fails:
FAIL: /path/to/mrdocs/docs/modules/ROOT/partials/bootstrap-options.adoc is out of date. Run `python utils/docs/generate_bootstrap_options.py --update`.
The fix is the command in the message, with python3:
python3 utils/docs/generate_bootstrap_options.py --update
|
Guard
|
The JSON schemas are valid
The config schema and the generator schema under docs/modules/ROOT/attachments/schemas are valid JSON Schema documents.
A schema with a type that does not exist fails when ajv compiles it:
schema docs/modules/ROOT/attachments/schemas/config/mrdocs.schema.json is invalid
error: schema is invalid: data/properties/auto-brief/type must be equal to one of the allowed values, data/properties/auto-brief/type must be array, data/properties/auto-brief/type must match a schema in anyOf
The fix is to correct the source the schema is generated from and regenerate it, as in The YAML schema matches the config options.
|
Guard
The Without |