docs

package
v0.0.0-...-553a0ab Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: Apache-2.0 Copyright © 2021 Roberto Hidalgo <milpa@un.rob.mx>

SPDX-License-Identifier: Apache-2.0 Copyright © 2021 Roberto Hidalgo <milpa@un.rob.mx>

SPDX-License-Identifier: Apache-2.0 Copyright © 2021 Roberto Hidalgo <milpa@un.rob.mx>

SPDX-License-Identifier: Apache-2.0 Copyright © 2021 Roberto Hidalgo <milpa@un.rob.mx>

Index

Constants

This section is empty.

Variables

View Source
var LayoutTemplate []byte
View Source
var MilpaDark = ansi.StyleConfig{
	Document: ansi.StyleBlock{
		Margin: uintPointer(0),
		StylePrimitive: ansi.StylePrimitive{
			Color:       nil,
			BlockPrefix: "\n",
			BlockSuffix: "\n",
		},
	},
	List: ansi.StyleList{
		StyleBlock: ansi.StyleBlock{
			Margin: uintPointer(2),
		},
	},
	H1: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Color:           stringptr("193"),
			BackgroundColor: stringptr("22"),
			Bold:            boolptr(true),
		},
	},
	Heading: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Color: stringptr("193"),
			Bold:  boolptr(true),
		},
	},
	Code: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Color:           stringptr("230"),
			BackgroundColor: stringptr("22"),
		},
	},
}
View Source
var MilpaLight = ansi.StyleConfig{
	Document: ansi.StyleBlock{
		Margin: uintPointer(0),
		StylePrimitive: ansi.StylePrimitive{
			Color:       nil,
			BlockPrefix: "\n",
			BlockSuffix: "\n",
		},
	},
	List: ansi.StyleList{
		StyleBlock: ansi.StyleBlock{
			Margin: uintPointer(2),
		},
	},
	H1: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Color:           stringptr("193"),
			BackgroundColor: stringptr("22"),
			Bold:            boolptr(true),
			Prefix:          " ",
			Suffix:          " ",
		},
	},
	H2: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "## ",
		},
	},
	H3: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "### ",
		},
	},
	H4: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "#### ",
		},
	},
	H5: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "##### ",
		},
	},
	H6: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "###### ",
			Color:  stringptr("35"),
			Bold:   boolptr(false),
		},
	},
	Heading: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Color:       stringptr("28"),
			Bold:        boolptr(true),
			BlockSuffix: "\n",
		},
	},
	Code: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Color:           stringptr("22"),
			BackgroundColor: stringptr("194"),
		},
	},
}
View Source
var MilpaNoTTY = ansi.StyleConfig{
	Document: ansi.StyleBlock{
		Margin: uintPointer(0),
		StylePrimitive: ansi.StylePrimitive{
			Color:       nil,
			BlockPrefix: "\n",
			BlockSuffix: "\n",
		},
	},
	List: ansi.StyleList{
		LevelIndent: 2,
		StyleBlock: ansi.StyleBlock{
			Margin: uintPointer(2),
		},
	},
	Item: ansi.StylePrimitive{
		BlockPrefix: "• ",
	},
	Strikethrough: ansi.StylePrimitive{
		CrossedOut: boolptr(true),
	},
	Emph: ansi.StylePrimitive{
		Italic: boolptr(false),
	},
	Strong: ansi.StylePrimitive{
		Bold: boolptr(false),
	},
	Link: ansi.StylePrimitive{
		Underline: boolptr(false),
	},
	LinkText: ansi.StylePrimitive{
		Bold: boolptr(false),
	},
	H1: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Bold:   boolptr(false),
			Prefix: "# ",
			Suffix: "",
		},
	},
	H2: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "## ",
		},
	},
	H3: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "### ",
		},
	},
	H4: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "#### ",
		},
	},
	H5: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "##### ",
		},
	},
	H6: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "###### ",
			Bold:   boolptr(false),
		},
	},
	Heading: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			BlockSuffix: "\n",
			Bold:        boolptr(false),
		},
	},
	Code: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "`",
			Suffix: "`",
		},
	},
}
View Source
var MilpaTrueColorDark = ansi.StyleConfig{
	Document: ansi.StyleBlock{
		Margin: uintPointer(0),
		StylePrimitive: ansi.StylePrimitive{
			Color:       nil,
			BlockPrefix: "\n",
			BlockSuffix: "\n",
		},
	},
	List: ansi.StyleList{
		LevelIndent: 2,
		StyleBlock: ansi.StyleBlock{
			Margin: uintPointer(2),
		},
	},
	Item: ansi.StylePrimitive{
		BlockPrefix: "• ",
	},
	Strikethrough: ansi.StylePrimitive{
		CrossedOut: boolptr(true),
	},
	Emph: ansi.StylePrimitive{
		Italic: boolptr(true),
	},
	Strong: ansi.StylePrimitive{
		Bold: boolptr(true),
	},
	Link: ansi.StylePrimitive{
		Color:     stringptr("30"),
		Underline: boolptr(true),
	},
	LinkText: ansi.StylePrimitive{
		Color: stringptr("35"),
		Bold:  boolptr(true),
	},
	H1: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Color:           stringptr("#cefcd3"),
			BackgroundColor: stringptr("#2b3c2d"),
			Bold:            boolptr(true),
			Prefix:          " ",
			Suffix:          " ",
		},
	},
	H2: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "## ",
		},
	},
	H3: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "### ",
		},
	},
	H4: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "#### ",
		},
	},
	H5: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "##### ",
		},
	},
	H6: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "###### ",
			Color:  stringptr("35"),
			Bold:   boolptr(false),
		},
	},
	Heading: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			BlockSuffix: "\n",
			Color:       stringptr("#c0e394"),
			Bold:        boolptr(true),
		},
	},
	Code: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix:          " ",
			Suffix:          " ",
			Color:           stringptr("#96b452"),
			BackgroundColor: stringptr("#132b17"),
		},
	},
}
View Source
var MilpaTrueColorLight = ansi.StyleConfig{
	Document: ansi.StyleBlock{
		Margin: uintPointer(0),
		StylePrimitive: ansi.StylePrimitive{
			Color:       nil,
			BlockPrefix: "\n",
			BlockSuffix: "\n",
		},
	},
	List: ansi.StyleList{
		LevelIndent: 2,
		StyleBlock: ansi.StyleBlock{
			Margin: uintPointer(2),
		},
	},
	Item: ansi.StylePrimitive{
		BlockPrefix: "• ",
	},
	Strikethrough: ansi.StylePrimitive{
		CrossedOut: boolptr(true),
	},
	Emph: ansi.StylePrimitive{
		Italic: boolptr(true),
	},
	Strong: ansi.StylePrimitive{
		Bold: boolptr(true),
	},
	Link: ansi.StylePrimitive{
		Color:     stringptr("30"),
		Underline: boolptr(true),
	},
	LinkText: ansi.StylePrimitive{
		Color: stringptr("35"),
		Bold:  boolptr(true),
	},
	H1: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Color:           stringptr("#cefcd3"),
			BackgroundColor: stringptr("#2b3c2d"),
			Bold:            boolptr(true),
			Prefix:          " ",
			Suffix:          " ",
		},
	},
	H2: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "## ",
		},
	},
	H3: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "### ",
		},
	},
	H4: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "#### ",
		},
	},
	H5: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "##### ",
		},
	},
	H6: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix: "###### ",
			Color:  stringptr("35"),
			Bold:   boolptr(false),
		},
	},
	Heading: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			BlockSuffix: "\n",
			Color:       stringptr("#12731D"),
			Bold:        boolptr(true),
		},
	},
	Code: ansi.StyleBlock{
		StylePrimitive: ansi.StylePrimitive{
			Prefix:          " ",
			Suffix:          " ",
			Color:           stringptr("#12731D"),
			BackgroundColor: stringptr("#cee3c4"),
		},
	},
}
View Source
var StaticFiles embed.FS

Functions

func DevelopmentStaticResourceHandler

func DevelopmentStaticResourceHandler() http.Handler

func EmbeddedStaticResourceHandler

func EmbeddedStaticResourceHandler() http.Handler
func FixLinks(contents []byte) []byte

func FromQuery

func FromQuery(query []string) ([]byte, error)

func RenderHandler

func RenderHandler(serverAddr string) func(http.ResponseWriter, *http.Request)

Types

type Entries

type Entries []*Entry

type Entry

type Entry struct {
	ID      string
	Title   template.HTML
	Entries Entries
}

func (*Entry) Append

func (i *Entry) Append() *Entry

func (*Entry) Last

func (i *Entry) Last() *Entry

type FrontMatter

type FrontMatter struct {
	Weight      int
	Description string
	Title       string
}

type Page

type Page struct {
	Name     string
	Path     string
	Weight   int
	Children *Pages
}

func (Page) Sort

func (p Page) Sort()

type Pages

type Pages []*Page

func (Pages) Len

func (p Pages) Len() int

func (Pages) Less

func (p Pages) Less(i, j int) bool

func (Pages) Swap

func (p Pages) Swap(i, j int)

type TemplateContents

type TemplateContents struct {
	Base           string
	IsHome         bool
	Permalink      string
	RelPermalink   string
	Content        template.HTML
	Description    string
	Tree           *Page
	TOC            *Entries
	CommandPattern string
}

Jump to

Keyboard shortcuts

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