Documentation
¶
Index ¶
- func CheckFileCanHexoPre(fileName string) bool
- func CheckFileHasFirmCode(fileName string, content []string, firmCode []string) error
- func GetAllMarkDownPage(dir string) ([]string, error)
- func GetAllPage(dir string, ignoreLine []string) ([]string, error)
- func NewCommand() command.Command
- func Run(ctx context.Context, dir string, targetDir string, firmCode []string, ...) error
- type CheckFileCanHexoResult
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckFileCanHexoPre ¶
CheckFileCanHexoPre 检测是否可能是 hexo文件,防止遍历全文.
func CheckFileHasFirmCode ¶
CheckFileHasFirmCode 检测是否有公司代码.
func GetAllMarkDownPage ¶
func NewCommand ¶
Types ¶
type CheckFileCanHexoResult ¶
type CheckFileCanHexoResult struct {
CanHexo bool
HasAbstract bool
Content []string
Config *Config
FileInfo os.FileInfo
FileName string // 源文件
WriteFilePath string // 写入的目录
NeedWrite bool // 是否需要重新写入
ContentData []byte
}
func CheckFileCanHexo ¶
func CheckFileCanHexo(fileName string, fileParentPath string) (*CheckFileCanHexoResult, error)
CheckFileCanHexo 检测文件是否可以转换为hexo文件.
func (*CheckFileCanHexoResult) WriteFile ¶
func (c *CheckFileCanHexoResult) WriteFile() error
WriteFile 1. 生成文件内容 2. 同时格式化源文件.
type Config ¶
type Config struct {
Title string `yaml:"title"` // 标题(如果没有设置,为源文件的名称)
TargetFile string `yaml:"target_file"` // 目标文件,值得是生成的文件
OriginFile string `yaml:"origin_file"` // 原文件,指的是我们写的文件
Date string `yaml:"date"` // 日期(为文件的修改日期)
Tags []string `yaml:"tags,omitempty"`
Categories []string `yaml:"categories,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.