md

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidHeadingLevel = errors.New("head level should between [1..6]")

Functions

func Code added in v0.2.0

func Code(txt string) string

Code spans, wraps the input string with backtick (`).

func Em added in v0.2.0

func Em(txt string) string

Em emphasis by wrap text with * or _.

func Escape added in v0.2.0

func Escape(txt string) string

Escape string start with ASCII punctuation character using backslash (\). Strings not start with ASCII punctuation character are returned without escape.

func Image added in v0.2.0

func Image(caption string, urlAndTitle ...string) string

Link generates image with caption and optional url and title.

func Link(txt string, urlAndTitle ...string) string

Link generates link with text and optional url and title.

func Strong added in v0.2.0

func Strong(txt string) string

Strong emphasis by wrap text with ** or __.

Types

type List

type List struct {
	// contains filtered or unexported fields
}

func (*List) NextBullet

func (l *List) NextBullet() string

type Option

type Option func(*Writer)

func Indent

func Indent(indent string) Option

func LineLength

func LineLength(limit int) Option

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(writer io.Writer, options ...Option) *Writer

func (*Writer) BeginOrderedList

func (wr *Writer) BeginOrderedList()

func (*Writer) BeginUnorderedList

func (wr *Writer) BeginUnorderedList()

func (*Writer) EndList

func (wr *Writer) EndList()

func (*Writer) WriteFencedCodeBlock

func (wr *Writer) WriteFencedCodeBlock(code string, language string)

func (*Writer) WriteH1

func (wr *Writer) WriteH1(text string)

func (*Writer) WriteH2

func (wr *Writer) WriteH2(text string)

func (*Writer) WriteH3

func (wr *Writer) WriteH3(text string)

func (*Writer) WriteH4

func (wr *Writer) WriteH4(text string)

func (*Writer) WriteH5

func (wr *Writer) WriteH5(text string)

func (*Writer) WriteH6

func (wr *Writer) WriteH6(text string)

func (*Writer) WriteHorizontalRule

func (wr *Writer) WriteHorizontalRule()

func (*Writer) WriteIndentedCodeBlock

func (wr *Writer) WriteIndentedCodeBlock(code string)

func (*Writer) WriteListItem

func (wr *Writer) WriteListItem(text string)

func (*Writer) WriteParagraph

func (wr *Writer) WriteParagraph(txt string)

Jump to

Keyboard shortcuts

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