Documentation ¶
Index ¶
- Constants
- Variables
- func LinkToParagraph(p *md.Paragraph, url, label string)
- func MkBlockquote() *md.Blockquote
- func MkCode(code string) *md.Codeblock
- func MkEnumRef(enum *Enum) *md.HtmlRef
- func MkFieldTypeLink(field *MessageField) *md.Link
- func MkHeader(text string, level md.HeaderLevel) *md.Header
- func MkImage(url, text, title string) *md.Image
- func MkLink(name, fullName string) *md.Link
- func MkList(ordered bool, parent *md.List) *md.List
- func MkListEntry(list *md.List, element md.Element) *md.ListEntry
- func MkListTextEntry(list *md.List, text string) *md.ListEntry
- func MkMessageRef(msg *Message) *md.HtmlRef
- func MkParagraph() *md.Paragraph
- func MkRow() *md.Row
- func MkRule() *md.Rule
- func MkTable(rows int) *md.Table
- func MkText(text string, emphasis md.TextEmphasis) *md.Text
- func TextToParagraph(p *md.Paragraph, text string, emphasis md.TextEmphasis)
- type AutocodeOpt
- type Codegenerator
- type Config
- type DescriptorParser
- type Entry
- type EntryType
- type Enum
- type EnumField
- type FieldFlags
- type Generator
- type MDGenerator
- type MarkdownRenderer
- type Message
- type MessageField
- type ParsedFile
- type Renderer
- type Syntax
- type Text
- type ValueType
Constants ¶
View Source
const AutocodeMarker = "autocode"
View Source
const AutocodeMaxLengthMarker = "len"
View Source
const AutocodeMaxMarker = "max"
View Source
const AutocodeMinMarker = "min"
View Source
const AutocodeTypeMarker = "type"
View Source
const AutocodeValueMarker = "val"
View Source
const CodeMarker = "code"
View Source
const CodeSyntaxPattern = "(" + CodeMarker + "(\\[[a-zA-Z]+\\])" + "|" + AutocodeMarker + ")"
View Source
const HeaderMarker = "header"
View Source
const IgnoreFileMarker = "ignore-file"
View Source
const IgnoreMarker = "ignore"
View Source
const MarkerDelimiter = "@"
View Source
const TitleMarker = "title"
Variables ¶
View Source
var TestProtoDescriptor []byte
Functions ¶
func LinkToParagraph ¶
func MkBlockquote ¶
func MkBlockquote() *md.Blockquote
func MkFieldTypeLink ¶
func MkFieldTypeLink(field *MessageField) *md.Link
func MkMessageRef ¶
func MkParagraph ¶
func TextToParagraph ¶
func TextToParagraph(p *md.Paragraph, text string, emphasis md.TextEmphasis)
Types ¶
type AutocodeOpt ¶
type AutocodeOpt struct {
// contains filtered or unexported fields
}
type Codegenerator ¶
type Codegenerator struct {
// contains filtered or unexported fields
}
func NewCodegenerator ¶
func NewCodegenerator() *Codegenerator
func (*Codegenerator) Generate ¶
func (g *Codegenerator) Generate(files []ParsedFile, message *Message) (*md.Codeblock, error)
type Config ¶
type Config struct { EmphasisSyntax md.EmphasisSyntax HeaderSyntax md.HeaderSyntax RuleSyntax md.RuleSyntax CodeblockSyntax md.CodeblockSyntax ListSyntax md.ListSyntax }
func DefaultRenderConfig ¶
func DefaultRenderConfig() *Config
type DescriptorParser ¶
type DescriptorParser struct {
// contains filtered or unexported fields
}
func NewDescriptorParser ¶
func NewDescriptorParser(request *plugingo.CodeGeneratorRequest) *DescriptorParser
func (*DescriptorParser) Parse ¶
func (p *DescriptorParser) Parse() ([]ParsedFile, error)
type FieldFlags ¶
type FieldFlags struct {
// contains filtered or unexported fields
}
func (FieldFlags) GetCustomType ¶
func (a FieldFlags) GetCustomType() opt.Opt[ValueType]
func (FieldFlags) GetMaxLength ¶
func (a FieldFlags) GetMaxLength() opt.Opt[int]
type MDGenerator ¶
type MDGenerator struct {
// contains filtered or unexported fields
}
func NewMDGenerator ¶
func NewMDGenerator(codegen *Codegenerator) *MDGenerator
func (*MDGenerator) Generate ¶
func (g *MDGenerator) Generate(parsedFiles []ParsedFile) (*md.Document, error)
type MarkdownRenderer ¶
type MarkdownRenderer struct {
// contains filtered or unexported fields
}
func NewMarkdownRenderer ¶
func NewMarkdownRenderer(config *Config) *MarkdownRenderer
type MessageField ¶
type MessageField struct {
// contains filtered or unexported fields
}
func NewMessageField ¶
func NewMessageField(d *protokit.FieldDescriptor, m *protokit.Descriptor, description string, valueType ValueType, flags *FieldFlags) *MessageField
func (*MessageField) Descriptor ¶
func (m *MessageField) Descriptor() *protokit.FieldDescriptor
func (*MessageField) ValueType ¶
func (m *MessageField) ValueType() ValueType
type ParsedFile ¶
type ParsedFile struct {
// contains filtered or unexported fields
}
func (ParsedFile) Filename ¶
func (p ParsedFile) Filename() string
func (ParsedFile) Index ¶
func (p ParsedFile) Index() int
func (ParsedFile) Title ¶
func (p ParsedFile) Title() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.