structAll

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoteStore = DirToStructRes{}

来自 main.go 的生成

Functions

func FilePathToWebPath

func FilePathToWebPath(filePath string) string

FilePathToWebPath 将相对文件路径转为 web路径,主要是去除文件中的id 以及添加 .html

func PathResolve added in v0.5.2

func PathResolve(path string) string

PathResolve 处理不同模式下路径的变换

Types

type BlockRefInfo

type BlockRefInfo struct {
	ABlockRefInfo int
	Title         interface{}
	Src           string
}

BlockRefInfo 块引用所需信息

type DirToStructRes

type DirToStructRes struct {
	StructList           []FileEntity
	FindFileEntityFromID FindFileEntityFromID
}

DirToStructRes DirToStruct 的返回值定义

type EmbeddedBlockInfo

type EmbeddedBlockInfo struct {
	AEmbeddedBlockInfo int
	Title              interface{}
	Src                string
	Content            interface{}
}

EmbeddedBlockInfo 嵌入块所需信息

type FileEntity

type FileEntity struct {
	// 文档名 title
	Name string
	// 文件绝对路径
	Path string
	// 相对源目录的路径
	RelativePath   string
	NotesCode      string
	Info           os.FileInfo
	StructInfoList []StructInfo
	Tree           *parse.Tree
	Output         func() (html string, xml string)
}

FileEntity md 文件被解析后的结构

func (*FileEntity) FileEntityRelativePath

func (r *FileEntity) FileEntityRelativePath(target FileEntity, id string) string

func (*FileEntity) RootPath

func (r *FileEntity) RootPath() string

RootPath 获取当前对象相对于 root 目录的路径

func (*FileEntity) VirtualPath

func (r *FileEntity) VirtualPath() (path string)

VirtualPath 是最终要在浏览器中可以访问的路径

type FindFileEntityFromID

type FindFileEntityFromID func(id string) (FileEntity, StructInfo, error)

FindFileEntityFromID 通过 id 返回对应实体

type RedirectInfo added in v0.5.2

type RedirectInfo struct {
	RedirectPath string
	Title        string
}

RedirectInfo 重定向模板所需信息

type RssInfo

type RssInfo struct {
	ARssInfo      int
	LastBuildDate string
	List          []RssItem
}

RssInfo 块引用所需信息

type RssItem

type RssItem struct {
	Guid          string
	Title         string
	Link          string
	Published     string
	Updated       string
	Created       string
	LastBuildDate string
	Description   string
	ContentBase   string
	ContentHTML   string
}

type StructInfo

type StructInfo struct {
	BlockID    string
	BlockType  string
	Node       *ast.Node
	FileEntity *FileEntity
}

StructInfo md 结构信息

func (*StructInfo) GetCreated

func (r *StructInfo) GetCreated() time.Time

func (*StructInfo) GetUpdate

func (r *StructInfo) GetUpdate() time.Time

Jump to

Keyboard shortcuts

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