Checking the documentation
ringdoc check finds the broken links, missing images, errors in the outputs and outputs that changed.
The command#
ringdoc check [docproject.ring]The site is built again (the outputs of the programs come from the cache), then every page is read and:
- a link to a page of the project, or to a heading (
page.html#heading), is checked; - a link to a file of the site (an image, a style, a script) is checked;
- links to other sites (
http,https,mailto) are counted but not followed; - a directive or a gallery that nobody knows is reported;
- a Ring error in the output of a program is reported;
- an output that is not the expected one is reported.
The last line is ok: N links and files checked, no problem, or FAILED: N problem(s) ... after the list of them. (Ring cannot set the exit code of a program, so a script that needs it looks for the word FAILED.)
Expected outputs#
When a file demo.ring.expected is next to demo.ring, the output of {{output:demo.ring}} must be the same text (without the trailing newline). The documentation then tests the package: if a change of the package changes what a documented program prints, the next build prints a warning, and check reports it.
ring demo.ring > demo.ring.expectedThe outputs of build are cached; build --refresh runs the programs again, and check after it uses the fresh outputs.
Warnings of build#
ringdoc build itself prints a warning: line for each Ring error in an output and each output that is not the expected one.