mkdocs

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2025 License: MIT Imports: 5 Imported by: 1

README

Go MkDocs

Build Status Lint Status Go Report Card Docs License

Go MkDocs (go-mkdocs) is a package to work with MkDocs. Initial capabilities are to programmatically generate a mkdocs.yml file and HTTP URL anchors.

Documentation

Index

Constants

View Source
const (
	ExtensionAttrList = "attr_list"
	FilenameTOC       = "mkdocs.yml"
	ThemeReadTheDocs  = "readthedocs"
)

Variables

This section is empty.

Functions

func MarkdownExtensionsSimple

func MarkdownExtensionsSimple() []any

func QuoteString added in v0.2.1

func QuoteString(s string) string

func StringToAnchor added in v0.3.0

func StringToAnchor(s string) string

StringToAnchor is an implementation of the MkDocs algorithm to convert strings to HTTP URL anchors. It is useful for autogenerating Markdown files for MkDocs.

Types

type Config

type Config struct {
	SiteName           string `json:"site_name" yaml:"site_name"`
	SiteURL            string `json:"site_url" yaml:"site_url"`
	DocsDir            string `json:"docs_dir" yaml:"docs_dir"`
	Theme              string `json:"theme" yaml:"theme"`
	MarkdownExtensions []any  `json:"markdown_extensions,omitempty" yaml:"markdown_extension,omitempty"`
	Nav                Texts  `json:"-" yaml:"-"`
}

func (*Config) WriteFileYAML

func (cfg *Config) WriteFileYAML(filename string, perm os.FileMode) error

type TOC

type TOC struct {
	Permalink []string `json:"permalink"`
}

type Text added in v0.2.0

type Text struct {
	Key      string
	Val      string
	Children Texts
}

type Texts added in v0.2.0

type Texts []Text

func (Texts) Markdown added in v0.2.0

func (t Texts) Markdown(prefix, indent string) []string

Markdown generates a slice of markdown lines. `Texts` is intended to ease the creation of nested key value pairs where they keys may be dynamic values.

Jump to

Keyboard shortcuts

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