models

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2015 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HTMLRoot = "data/html"
)
View Source
var (
	Protector = &protector{
		Users:     make(map[string]string),
		Resources: make(map[string]map[string]bool),
	}
)
View Source
var (
	Tocs map[string]*Toc
)

Functions

func HTML2JS

func HTML2JS(data []byte) []byte

HTML2JS converts []byte type of HTML content into JS format.

func NewContext

func NewContext()

func ReloadDocs

func ReloadDocs() error

Types

type MarkdownRender

type MarkdownRender struct {
	blackfriday.Renderer
}

func (*MarkdownRender) BlockCode

func (mr *MarkdownRender) BlockCode(out *bytes.Buffer, text []byte, lang string)

type Node

type Node struct {
	Name  string // Name in TOC
	Title string // Name in given language

	Plain         bool // Root node without content
	DocumentPath  string
	FileName      string // Full path with .md extension
	Nodes         []*Node
	LastBuildTime int64
	// contains filtered or unexported fields
}

func (*Node) GenHTML

func (n *Node) GenHTML(data []byte) error

func (*Node) ReloadContent

func (n *Node) ReloadContent() error

func (*Node) SetText

func (n *Node) SetText(text []byte)

func (*Node) Text

func (n *Node) Text() []byte

type SearchResult

type SearchResult struct {
	Title string
	Path  string
	Match string
}

type Toc

type Toc struct {
	RootPath string
	Lang     string
	Nodes    []*Node
	Pages    []*Node
}

Toc represents table of content in a specific language.

func (*Toc) GetDoc

func (t *Toc) GetDoc(name string) (*Node, bool)

GetDoc should only be called by top level toc.

func (*Toc) Search

func (t *Toc) Search(q string) []*SearchResult

Jump to

Keyboard shortcuts

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