cmds

package
v0.2.18 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DocsCmd = &cobra.Command{
	Use:   "docs [flags] file [file...]",
	Short: "Work with help documents",
	Args:  cobra.MinimumNArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		gp, of, err := cli.CreateGlazedProcessorFromCobra(cmd)
		cobra.CheckErr(err)

		for _, arg := range args {

			s, err := os.ReadFile(arg)
			cobra.CheckErr(err)

			var metaData map[string]interface{}
			inputReader := bytes.NewReader(s)
			_, err = frontmatter.Parse(inputReader, &metaData)
			cobra.CheckErr(err)

			metaData["path"] = arg

			err = gp.ProcessInputObject(metaData)
			cobra.CheckErr(err)
		}

		s, err := of.Output()
		cobra.CheckErr(err)
		fmt.Print(s)
	},
}
View Source
var MarkdownCmd = &cobra.Command{
	Use:   "markdown",
	Short: "Convert markdown data",
}

Functions

This section is empty.

Types

type ExtensionFlag

type ExtensionFlag struct {
	FlagName string
	FlagDesc string
	Extender goldmark.Extender
}

type JsonCommand added in v0.2.10

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

func NewJsonCommand added in v0.2.10

func NewJsonCommand() (*JsonCommand, error)

func (*JsonCommand) Description added in v0.2.10

func (j *JsonCommand) Description() *cmds.CommandDescription

func (*JsonCommand) Run added in v0.2.10

func (j *JsonCommand) Run(
	ctx context.Context,
	parsedLayers map[string]*layers.ParsedParameterLayer,
	ps map[string]interface{},
	gp *cmds.GlazeProcessor,
) error

type YamlCommand added in v0.2.10

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

func NewYamlCommand added in v0.2.10

func NewYamlCommand() (*YamlCommand, error)

func (*YamlCommand) Description added in v0.2.10

func (y *YamlCommand) Description() *cmds.CommandDescription

func (*YamlCommand) Run added in v0.2.10

func (y *YamlCommand) Run(
	ctx context.Context,
	parsedLayers map[string]*layers.ParsedParameterLayer,
	ps map[string]interface{},
	gp *cmds.GlazeProcessor,
) error

Jump to

Keyboard shortcuts

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