Documentation
¶
Overview ¶
Command docsnippets checks that code blocks in docs/site that claim to be copied from an example match that region exactly. A claim is a paragraph right after the block that starts with "(Copied from [`examples/x`](…), region `name`.)" or, for a file already named on the page, "(Region `name`.)". The example is examples/x/main.go, or the file itself when the link names a .go or .templ file (examples/x/migrations.go). First-party plugins are examples too: plugins/x/plugin.go. Go and templ code blocks are checked. Indentation common to every line, and blank lines at the start and end, are ignored on both sides, so a region inside a function body can be shown unindented, and one in a package can start with a blank line that keeps "// region" out of the next declaration's doc comment. See docs/contributing/documentation-guide.md §7. Run it with `make docs-check`.