docgen

Guides

Run docgen on docgen

Show what docgen does to a sample directory. docgen runs itself on a copy of the directory, so the page always holds real output. This site uses it for each example.

<!-- docgen:docgen root=examples/sample page=docs/page.md -->
<!-- /docgen:docgen -->

This is the result for page=docs/machines/guide-const.md, the page before and after docgen update:

v2/machine/machine.go

const DefaultWait = 250 * time.Millisecond

docs/machines/guide-const.md

Before
The default wait is <!-- docgen:const pkg=machine name=DefaultWait --><!-- /docgen:const -->.
After
The default wait is <!-- docgen:const pkg=machine name=DefaultWait -->`250ms`<!-- /docgen:const -->.
Preview

The default wait is 250ms.

The outer run skips the pages under root.

module= names the module in root. depth in .docgen.yaml limits nested markers.

For details, see docgen:docgen.

Source: docs/guides/sample.md