adoc

package
v0.0.0-...-96c5686 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KIND_NOTE         = Kind("note")
	KIND_PRIVATE_NOTE = Kind("private_note")
	KIND_WORK_NOTE    = Kind("work_note")
	KIND_VKV          = Kind("vkv")
	KIND_STORY        = Kind("story")
	KIND_SNIPPET      = Kind("snippet")
	KIND_ESSAY        = Kind("essay")
	KIND_ARTICLE      = Kind("article")
	KIND_TUTORIAL     = Kind("tutorial")
	KIND_UNKNOWN      = Kind("unknown")
)
View Source
const (
	LANGUAGE_EN      = Language("en")
	LANGUAGE_NL      = Language("nl")
	LANGUAGE_UNKNOWN = Language("unknown")
)
View Source
const (
	TITLE_PREFIX        = "= "
	SUBTITLE_PREFIX     = "== "
	SUBSUBTITLE_PREFIX  = "=== "
	PARAGRAPH_SEPARATOR = "\n\n"
	LINE_SEPARATOR      = "\n"
	CODE_PREFIX         = "----\n"
	CODE_SUFFIX         = "\n----"
	LISTITEM_PREFIX     = "* "
)

Variables

This section is empty.

Functions

func ParseHeader

func ParseHeader(text string, doc *ADoc)

Types

type ADoc

type ADoc struct {
	Title    string
	Author   string
	Kind     Kind
	Language Language
	Public   bool
	Path     string
	Date     time.Time
	Tags     []Tag
	Content  []BlockElement
}

func New

func New(text string) *ADoc

type BlockElement

type BlockElement interface {
	Text() string
}

type CodeBlock

type CodeBlock string

func (CodeBlock) Text

func (cb CodeBlock) Text() string

type CodeText

type CodeText string

func (CodeText) Text

func (ct CodeText) Text() string

type EmpText

type EmpText string

func (EmpText) Text

func (et EmpText) Text() string

type InlineElement

type InlineElement interface {
	Text() string
}

func ParseInline

func ParseInline(text string) []InlineElement

type Kind

type Kind string

func NewKind

func NewKind(text string) Kind

type Language

type Language string

func NewLanguage

func NewLanguage(ln string) Language
type Link struct {
	// contains filtered or unexported fields
}
func NewLink(url, title string) Link

func (Link) Text

func (l Link) Text() string

func (Link) URL

func (l Link) URL() string

type List

type List []ListItem

func (List) Text

func (l List) Text() string

type ListItem

type ListItem []InlineElement

func (ListItem) Text

func (li ListItem) Text() string

type Paragraph

type Paragraph []InlineElement

func (Paragraph) Text

func (p Paragraph) Text() string

type PlainText

type PlainText string

func (PlainText) Text

func (pt PlainText) Text() string

type StrongEmpText

type StrongEmpText string

func (StrongEmpText) Text

func (set StrongEmpText) Text() string

type StrongText

type StrongText string

func (StrongText) Text

func (st StrongText) Text() string

type SubSubTitle

type SubSubTitle string

func (SubSubTitle) Text

func (st SubSubTitle) Text() string

type SubTitle

type SubTitle string

func (SubTitle) Text

func (st SubTitle) Text() string

type Tag

type Tag string

Jump to

Keyboard shortcuts

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