markup

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2017 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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