Documentation ¶
Overview ¶
Package doc contains documentation generator.
Index ¶
- Variables
- func FormatStrings() []string
- func Generate(mod *idl.Module, options ...Option) ([]byte, error)
- func Inject(target []byte, name string, source []byte) ([]byte, error)
- type Format
- type Option
- func WithFormat(format Format) Option
- func WithGitHubRepo(repo string) Option
- func WithHeading(heading uint) Option
- func WithLinkExamples(flag bool) Option
- func WithLinkPackages(flag bool) Option
- func WithLinkReleases(flag bool) Option
- func WithOuter(outer []byte) Option
- func WithTemplate(tmpl string) Option
- func WithTemplateName(name string) Option
Constants ¶
This section is empty.
Variables ¶
var ErrMissingMarker = errors.New("missing marker comment")
ErrMissingMarker returned by Inject when no marker comment was found.
Functions ¶
func FormatStrings ¶
func FormatStrings() []string
FormatStrings returns a slice of all String values of the enum
func Inject ¶
Inject insert a text into the target document at the place indicated by the marker with the given name. The beginning of the insertion point is indicated by the line containing only the text "<!-- begin:NAME -->", and the end is indicated by the line containing only the text "<!-- end:NAME -->", where NAME is the name of the marker.
Types ¶
type Format ¶
type Format int
Format describes output formt.
func FormatString ¶
FormatString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (Format) IsAFormat ¶
IsAFormat returns "true" if the value is listed in the enum definition. "false" otherwise
func (Format) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for Format
func (Format) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for Format
func (*Format) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for Format
func (*Format) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for Format
type Option ¶
type Option func(*options)
Option defines a documentation generator option function.
func WithFormat ¶
WithFormat can be used to specify the output format.
func WithGitHubRepo ¶ added in v0.1.2
WithGitHubRepo can be used to specify the GitHub repository in owner/name form.
func WithHeading ¶
WithHeading can be used to specify the initial heading level.
func WithLinkExamples ¶ added in v0.1.2
WithLinkExamples can be used to enable/disable examples folder link.
func WithLinkPackages ¶ added in v0.1.2
WithLinkPackages can be used to enable/disable GitHub container packages link.
func WithLinkReleases ¶ added in v0.1.2
WithLinkReleases can be used to enable/disable GitHub releases link.
func WithTemplate ¶
WithTemplate can be used to specify go template source.
func WithTemplateName ¶
WithTemplateName can be used to specify go template name.