docgen

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package docgen provides common logic for generating markdown doctrees from a root cobra.Command for the vitessio/website repository.

Example usage:

package main

import (
	"github.com/spf13/cobra"

	"vitess.io/vitess/go/cmd/internal/docgen"
	vtctldclient "vitess.io/vitess/go/cmd/vtctldclient/command"
)

func main() {
	cmd := &cobra.Command{
		RunE: func(cmd *cobra.Command, args []string) error {
			dir := cmd.Flags().Arg(0)
			return docgen.GenerateMarkdownTree(vtctldclient.Root, dir)
		}
		Args: cobra.ExactArgs(1),
	}

	cmd.Execute()
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateMarkdownTree

func GenerateMarkdownTree(cmd *cobra.Command, dir string) error

GenerateMarkdownTree generates a markdown doctree for the root cobra.Command written to `dir`. The root command is also renamed to _index.md to remain compatible with the vitessio/website content structure expectations.

Types

This section is empty.

Jump to

Keyboard shortcuts

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