generate

package
v0.2.0-beta Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: MIT Imports: 11 Imported by: 0

README

Generate events

Parse the markdown table of events located in the discord-api-docs sub module and extract each row. We then generate a list of events. This is expected to always work, every commit pushed to the main branch is checked for changed.

If the code generation fails as there were changes in the discord-api-docs markdown, we fix the parsing, instead of going back to handwriting the values. This is the current best effort to stay up to date and automatically detect changes.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(data any, templatePath, targetPath string)

Types

type MarkdownTable

type MarkdownTable struct {
	Title  string
	Header MarkdownTableRow
	Rows   []MarkdownTableRow
}

func ExtractMarkdownTables

func ExtractMarkdownTables(markdownFilePath string, filter TableNameFilter) []*MarkdownTable

func (*MarkdownTable) String

func (mdt *MarkdownTable) String() string

type MarkdownTableBuilder

type MarkdownTableBuilder struct {
	// contains filtered or unexported fields
}

func (*MarkdownTableBuilder) AddLine

func (mdt *MarkdownTableBuilder) AddLine(line string)

func (*MarkdownTableBuilder) SetTitle

func (mdt *MarkdownTableBuilder) SetTitle(line string)

func (*MarkdownTableBuilder) Transform

func (mdt *MarkdownTableBuilder) Transform() *MarkdownTable

type MarkdownTableRow

type MarkdownTableRow []string

type TableNameFilter

type TableNameFilter func(name string) bool

func AnyTable

func AnyTable(names []string) TableNameFilter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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