Documentation
¶
Overview ¶
Package md provides types and functions for encoding markdown
Index ¶
- Constants
- type CitationList
- type Content
- func (b *Content) BlockQuote(m Text)
- func (e *Content) ConvertMarkdown(text string, w io.Writer) error
- func (e *Content) DefinitionList(markups [][2]Text)
- func (e *Content) EmptyPara()
- func (e *Content) EncodeBold(m Text) Text
- func (e *Content) EncodeImage(alt string, link string) string
- func (e *Content) EncodeItalic(m Text) Text
- func (e *Content) EncodeLink(text Text, url string) Text
- func (e *Content) EncodeModelLink(firstText Text, m any) Text
- func (e *Content) EncodeModelLinkDedupe(firstText Text, subsequentText Text, m any) Text
- func (e *Content) EncodeModelLinkNamed(m any, nc render.NameChooser, pov *model.POV) Text
- func (e *Content) EncodeText(ss ...string) Text
- func (e *Content) EncodeWithCitations(s Text, citations []*model.GeneralCitation) Text
- func (e *Content) FactList(items []render.FactEntry[Text])
- func (e *Content) Figure(link string, alt string, caption Text, highlight *model.Region, ...)
- func (e *Content) GroupedList(groups []render.Grouping[Text])
- func (e *Content) Heading2(m Text, id string)
- func (e *Content) Heading3(m Text, id string)
- func (e *Content) Heading4(m Text, id string)
- func (e *Content) Image(link string, alt string)
- func (e *Content) Markdown(s string)
- func (e *Content) OrderedList(ms []Text)
- func (b *Content) Para(m Text)
- func (e *Content) ParaWithFigure(text Text, link string, alt string, caption Text)
- func (e *Content) Pre(s string)
- func (b *Content) Preface(m Text)
- func (e *Content) ResetSeenLinks()
- func (e *Content) SetBody(s string)
- func (e *Content) SetLinkBuilder(l LinkBuilder)
- func (e *Content) String() string
- func (e *Content) Timeline(rows []render.TimelineRow[Text])
- func (e *Content) UnorderedList(ms []Text)
- func (e *Content) WriteTo(w io.Writer) (int64, error)
- type Document
- func (b *Document) AddAlias(s string)
- func (b *Document) AddDescendant(name string, link string, detail string)
- func (b *Document) AddLink(title string, link string, category model.LinkCategory)
- func (b *Document) AddTag(s string)
- func (b *Document) AddTags(ss []string)
- func (b *Document) BasePath(s string)
- func (b *Document) Category(s string)
- func (b *Document) Comment(s string)
- func (b *Document) ID(s string)
- func (b *Document) Image(s string)
- func (b *Document) LastUpdated(t time.Time)
- func (b *Document) Layout(s string)
- func (b *Document) PageBreak()
- func (b *Document) SetFrontMatterField(field, v string)
- func (b *Document) SetSitemapDisable()
- func (b *Document) String() string
- func (b *Document) Summary(s string)
- func (b *Document) Title(s string)
- func (b *Document) TreeTitle(s string)
- func (b *Document) WriteTo(w io.Writer) (int64, error)
- type LinkBuilder
- type MarkupText
- type PlainText
- type Text
Constants ¶
View Source
const ( MarkdownTagTitle = "title" MarkdownTagSummary = "summary" MarkdownTagLayout = "layout" MarkdownTagTags = "tags" MarkdownTagCategory = "category" MarkdownTagID = "id" MarkdownTagImage = "image" MarkdownTagBasePath = "basepath" MarkdownTagTreeTitle = "treetitle" MarkdownTagNextPage = "next" MarkdownTagPrevPage = "prev" MarkdownTagFirstPage = "first" MarkdownTagLastPage = "last" MarkdownTagIndexPage = "index" MarkdownTagAliases = "aliases" MarkdownTagLinks = "links" MarkdownTagDescendants = "descendants" MarkdownTagLastMod = "lastmod" MarkdownTagSitemap = "sitemap" )
View Source
const ( DirectAncestorMarker = "★" GeneralNotesSourceName = "General Notes" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CitationList ¶
type CitationList struct {
Suppress bool
// contains filtered or unexported fields
}
CitationList tracks citations referenced during encoding and renders them as a footnotes section.
type Content ¶
type Content struct {
LinkBuilder LinkBuilder
Citations CitationList
// contains filtered or unexported fields
}
func (*Content) BlockQuote ¶
func (*Content) DefinitionList ¶
func (*Content) EncodeBold ¶
func (*Content) EncodeItalic ¶
func (*Content) EncodeModelLinkDedupe ¶
func (*Content) EncodeModelLinkNamed ¶
func (*Content) EncodeText ¶
func (*Content) EncodeWithCitations ¶
func (e *Content) EncodeWithCitations(s Text, citations []*model.GeneralCitation) Text
func (*Content) GroupedList ¶ added in v0.0.6
func (*Content) OrderedList ¶
func (*Content) ParaWithFigure ¶
func (*Content) ResetSeenLinks ¶
func (e *Content) ResetSeenLinks()
func (*Content) SetLinkBuilder ¶
func (e *Content) SetLinkBuilder(l LinkBuilder)
func (*Content) UnorderedList ¶
type Document ¶
type Document struct {
Content
// contains filtered or unexported fields
}
func (*Document) AddDescendant ¶
func (*Document) AddLink ¶
func (b *Document) AddLink(title string, link string, category model.LinkCategory)
func (*Document) LastUpdated ¶
func (*Document) SetFrontMatterField ¶
setFrontMatterFieldDict for setting a key on a scalar field for example
field: v
func (*Document) SetSitemapDisable ¶
func (b *Document) SetSitemapDisable()
type LinkBuilder ¶
type MarkupText ¶
type MarkupText string
Click to show internal directories.
Click to hide internal directories.