render

package
v0.0.0-...-b6deb6c Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2017 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMeta

func GetMeta(raw []byte) (map[string]string, error)

GetMeta 取得文章元信息 返回文章元信息

Types

type Renderer

type Renderer struct {
}

Renderer main renderer function supplier

func New

func New() *Renderer

New return a Renderer instance

func (render *Renderer) ConvertLink(raw []byte, parentDir string) ([]byte, error)

ConvertLink 将Html内容中的所有内部链接进行转换 0. 如果是内部链接则继续 1. 如果能够在ipfs网络中找到,则替换 2. 如果不能在ipfs网络中找到,则不处理

func (*Renderer) DoRender

func (render *Renderer) DoRender(raw []byte, tpl []byte, userCtx map[string]interface{}) (map[string]interface{}, []byte, error)

DoRender 进行渲染,将markdown 原始内容 和模板传入,并进行渲染 如果 raw = nil, 则仅进行 tpl + user_ctx 渲染 如果 raw != nil 则先对raw 进行markdown解析,然后把解析结果 user_ctx["content"] = parsedHtml

Jump to

Keyboard shortcuts

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