docgen

package
v0.0.0-...-d0ced46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package docgen generates documentation from Starlark code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	// Normalize normalizes a load() reference relative to the context of the
	// current starlark file.
	Normalize func(parent, ref string) (string, error)
	// 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.

It is a cache of the current loaded modules, which enables following Render() calls to be much faster.

func (*Generator) Render

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

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

Loaded modules are kept as a cache in Generator, making the rendering of multiple starlark files faster.

Directories

Path Synopsis
Package ast defines AST relevant for the documentation generation.
Package ast defines AST relevant for the documentation generation.
Package docstring parses docstrings into more structured representation.
Package docstring parses docstrings into more structured representation.
Package symbols defines a data model representing Starlark symbols.
Package symbols defines a data model representing Starlark symbols.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL