md

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MarkdownTagTitle       = "title"
	MarkdownTagSummary     = "summary"
	MarkdownTagLayout      = "layout"
	MarkdownTagTags        = "tags"
	MarkdownTagCategory    = "category"
	MarkdownTagID          = "id"
	MarkdownTagImage       = "image"
	MarkdownTagBasePath    = "basepath"
	MarkdownTagNextPage    = "next"
	MarkdownTagPrevPage    = "prev"
	MarkdownTagFirstPage   = "first"
	MarkdownTagLastPage    = "last"
	MarkdownTagIndexPage   = "index"
	MarkdownTagAliases     = "aliases"
	MarkdownTagLinks       = "links"
	MarkdownTagDescendants = "descendants"
	MarkdownTagLastMod     = "lastmod"
)
View Source
const (
	DirectAncestorMarker   = "★"
	GeneralNotesSourceName = "General Notes"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

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

func (*Document) AddAlias

func (b *Document) AddAlias(s string)

func (*Document) AddDescendant

func (b *Document) AddDescendant(name string, link string, detail string)
func (b *Document) AddLink(title string, link string)

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) Image

func (b *Document) Image(s string)

func (*Document) LastUpdated added in v0.0.2

func (b *Document) LastUpdated(t time.Time)

func (*Document) Layout

func (b *Document) Layout(s string)

func (*Document) SetFrontMatterField

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

func (*Document) String

func (b *Document) String() string

func (*Document) Summary

func (b *Document) Summary(s string)

func (*Document) Title

func (b *Document) Title(s string)

func (*Document) WriteTo

func (b *Document) WriteTo(w io.Writer) (int64, error)

type Encoder

type Encoder struct {
	LinkBuilder LinkBuilder

	SuppressCitations bool
	// contains filtered or unexported fields
}

func (*Encoder) BlockQuote

func (b *Encoder) BlockQuote(m render.Markdown)

func (*Encoder) ConvertMarkdown

func (e *Encoder) ConvertMarkdown(text string, w io.Writer) error

func (*Encoder) DefinitionList

func (e *Encoder) DefinitionList(markups [][2]render.Markdown)

func (*Encoder) EmptyPara

func (e *Encoder) EmptyPara()

func (*Encoder) EncodeBold

func (e *Encoder) EncodeBold(m string) string

func (*Encoder) EncodeCitationDetail

func (e *Encoder) EncodeCitationDetail(c *model.GeneralCitation) string
func (b *Encoder) EncodeCitationLink(sourceName string, citationText render.Markdown, citationID string) string

func (*Encoder) EncodeImage

func (e *Encoder) EncodeImage(alt string, link string) string

func (*Encoder) EncodeItalic

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

func (*Encoder) EncodeModelLinkDedupe

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

func (*Encoder) EncodeWithCitations

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

func (*Encoder) Figure

func (e *Encoder) Figure(link string, alt string, caption render.Markdown, highlight *model.Region)

func (*Encoder) Heading2

func (e *Encoder) Heading2(m render.Markdown, id string)

func (*Encoder) Heading3

func (e *Encoder) Heading3(m render.Markdown, id string)

func (*Encoder) Heading4

func (e *Encoder) Heading4(m render.Markdown, id string)

func (*Encoder) Image

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

func (*Encoder) OrderedList

func (e *Encoder) OrderedList(ms []render.Markdown)

func (*Encoder) Para

func (b *Encoder) Para(m render.Markdown)

func (*Encoder) ParaWithFigure

func (e *Encoder) ParaWithFigure(text render.Markdown, link string, alt string, caption render.Markdown)

func (*Encoder) Pre

func (e *Encoder) Pre(s string)

func (*Encoder) RawMarkdown

func (e *Encoder) RawMarkdown(s render.Markdown)
func (e *Encoder) ResetSeenLinks()

func (*Encoder) SetBody

func (e *Encoder) SetBody(s string)

func (*Encoder) SetLinkBuilder

func (e *Encoder) SetLinkBuilder(l LinkBuilder)

func (*Encoder) String

func (e *Encoder) String() string

func (*Encoder) Timeline

func (e *Encoder) Timeline(rows []render.TimelineRow)

func (*Encoder) UnorderedList

func (e *Encoder) UnorderedList(ms []render.Markdown)

func (*Encoder) WriteTo

func (e *Encoder) WriteTo(w io.Writer) (int64, error)

type LinkBuilder

type LinkBuilder interface {
	LinkFor(v any) string
}

type MarkupText

type MarkupText string

type PlainText

type PlainText string

Jump to

Keyboard shortcuts

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