markup

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsReadmeFile

func IsReadmeFile(name string) bool

IsReadmeFile reports whether name looks like a README file based on its name.

func ReadmeFileType

func ReadmeFileType(name string) (string, bool)

ReadmeFileType reports whether name looks like a README file based on its name and find the parser via its ext name

func RegisterParser

func RegisterParser(parser Parser)

RegisterParser registers a new markup file parser

func Render

func Render(filename string, rawBytes []byte, urlPrefix string, metas map[string]string) []byte

Render renders markup file to HTML with all specific handling stuff.

func RenderString

func RenderString(filename string, raw, urlPrefix string, metas map[string]string) string

RenderString renders Markdown to HTML with special links and returns string type.

func RenderWiki

func RenderWiki(filename string, rawBytes []byte, urlPrefix string, metas map[string]string) string

RenderWiki renders markdown wiki page to HTML and return HTML string

func Type

func Type(filename string) string

Type returns if markup format via the filename

Types

type Parser

type Parser interface {
	Name() string // markup format name
	Extensions() []string
	Render(rawBytes []byte, urlPrefix string, metas map[string]string, isWiki bool) []byte
}

Parser defines an interface for parsering markup file to HTML

Jump to

Keyboard shortcuts

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