structAll

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilePathToWebPath

func FilePathToWebPath(filePath string) string

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

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 {
	Name string
	// 文件绝对路径
	Path string
	// 相对源目录的路径
	RelativePath string
	// 最终要在浏览器中可以访问的路径
	VirtualPath    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 目录的路径

type FindFileEntityFromID

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

FindFileEntityFromID 通过 id 返回对应实体

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