md

package
v0.0.0-...-a1877fd Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MarkdownTagTitle     = "title"
	MarkdownTagSummary   = "summary"
	MarkdownTagLayout    = "layout"
	MarkdownTagTags      = "tags"
	MarkdownTagCategory  = "category"
	MarkdownTagID        = "id"
	MarkdownTagBasePath  = "basepath"
	MarkdownTagNextPage  = "next"
	MarkdownTagPrevPage  = "prev"
	MarkdownTagFirstPage = "first"
	MarkdownTagLastPage  = "last"
	MarkdownTagIndexPage = "index"
)
View Source
const DirectAncestorMarker = "★"

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	Encoder
	// contains filtered or unexported fields
}

func (*Document) AddTag

func (b *Document) AddTag(s string)

func (*Document) AddTags

func (b *Document) AddTags(ss []string)

func (*Document) BasePath

func (b *Document) BasePath(s string)

func (*Document) Category

func (b *Document) Category(s string)

func (*Document) ID

func (b *Document) ID(s string)

func (*Document) Layout

func (b *Document) Layout(s string)

func (*Document) Markdown

func (b *Document) Markdown() string

func (*Document) SetFrontMatterField

func (b *Document) SetFrontMatterField(k, v string)

func (*Document) Summary

func (b *Document) Summary(s string)

func (*Document) Title

func (b *Document) Title(s string)

func (*Document) WriteMarkdown

func (b *Document) WriteMarkdown(w io.Writer) error

type Encoder

type Encoder struct {
	LinkBuilder LinkBuilder

	SuppressCitations bool
	// contains filtered or unexported fields
}

func (*Encoder) BlockQuote

func (b *Encoder) BlockQuote(s string)

func (*Encoder) DefinitionList

func (b *Encoder) DefinitionList(items [][2]string)

func (*Encoder) EmptyPara

func (b *Encoder) EmptyPara()

func (*Encoder) EncodeBlockQuote

func (b *Encoder) EncodeBlockQuote(s string) string

func (*Encoder) EncodeBold

func (b *Encoder) EncodeBold(s string) string

func (*Encoder) EncodeCitation

func (b *Encoder) EncodeCitation(citation string, detail string, citationID string) string

func (*Encoder) EncodeCitationDetail

func (b *Encoder) EncodeCitationDetail(c *model.GeneralCitation) string

func (*Encoder) EncodeDefinitionList

func (b *Encoder) EncodeDefinitionList(items [][2]string) string

func (*Encoder) EncodeEmptyPara

func (b *Encoder) EncodeEmptyPara() string

func (*Encoder) EncodeHeading1

func (e *Encoder) EncodeHeading1(s string) string

func (*Encoder) EncodeHeading2

func (b *Encoder) EncodeHeading2(s string) string

func (*Encoder) EncodeHeading3

func (b *Encoder) EncodeHeading3(s string) string

func (*Encoder) EncodeHeading4

func (b *Encoder) EncodeHeading4(s string) string

func (*Encoder) EncodeItalic

func (b *Encoder) EncodeItalic(s string) string
func (b *Encoder) EncodeLink(text string, url string) string
func (b *Encoder) EncodeModelLink(firstText string, m any) string

func (*Encoder) EncodeModelLinkDedupe

func (b *Encoder) EncodeModelLinkDedupe(firstText string, subsequentText string, m any) string

func (*Encoder) EncodeOrderedList

func (b *Encoder) EncodeOrderedList(items []string) string

func (*Encoder) EncodePara

func (b *Encoder) EncodePara(s string) string

func (*Encoder) EncodePre

func (b *Encoder) EncodePre(s string) string

func (*Encoder) EncodeUnorderedList

func (b *Encoder) EncodeUnorderedList(items []string) string

func (*Encoder) EncodeWithCitations

func (b *Encoder) EncodeWithCitations(s string, citations []*model.GeneralCitation) string

func (*Encoder) Heading1

func (e *Encoder) Heading1(s string)

func (*Encoder) Heading2

func (b *Encoder) Heading2(s string)

func (*Encoder) Heading3

func (b *Encoder) Heading3(s string)

func (*Encoder) Heading4

func (b *Encoder) Heading4(s string)

func (*Encoder) Image

func (b *Encoder) Image(alt string, link string)

func (*Encoder) Markdown

func (e *Encoder) Markdown() string

func (*Encoder) OrderedList

func (b *Encoder) OrderedList(items []string)

func (*Encoder) Para

func (b *Encoder) Para(s string)

func (*Encoder) Pre

func (b *Encoder) Pre(s string)

func (*Encoder) RawMarkdown

func (e *Encoder) RawMarkdown(s string)
func (b *Encoder) ResetSeenLinks()

func (*Encoder) SetBody

func (e *Encoder) SetBody(s string)

func (*Encoder) SetLinkBuilder

func (e *Encoder) SetLinkBuilder(l LinkBuilder)

func (*Encoder) UnorderedList

func (b *Encoder) UnorderedList(items []string)

func (*Encoder) WriteMarkdown

func (e *Encoder) WriteMarkdown(w io.Writer) error

type LinkBuilder

type LinkBuilder interface {
	LinkFor(v any) string
}

Jump to

Keyboard shortcuts

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