luci: Index | Files | Directories

package docgen

import ""

Package docgen generates documentation from Starlark code.


Package Files


type Generator Uses

type Generator struct {
    // Starlark produces Starlark module's source code.
    // It is then parsed by the generator to extract documentation from it.
    Starlark func(module string) (src string, err error)
    // contains filtered or unexported fields

Generator renders text templates that have access to parsed structured representation of Starlark modules.

The templates use them to inject documentation extracted from Starlark into appropriate places.

func (*Generator) Render Uses

func (g *Generator) Render(templ string) ([]byte, error)

Render renders the given text template in an environment with access to parsed structured Starlark comments.


astPackage ast defines AST relevant for the documentation generation.
docstringPackage docstring parses docstrings into more structured representation.
symbolsPackage symbols defines a data model representing Starlark symbols.

Package docgen imports 9 packages (graph) and is imported by 1 packages. Updated 2020-12-06. Refresh now. Tools for package owners.