Run function
This commit is contained in:
parent
70d7497eda
commit
0dfe0f8142
@ -22,8 +22,6 @@ var (
|
|||||||
|
|
||||||
var log = helper.Log
|
var log = helper.Log
|
||||||
|
|
||||||
var tree = new(mark2web.TreeNode)
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
inDir := flag.String("in", "./", "input directory")
|
inDir := flag.String("in", "./", "input directory")
|
||||||
outDir := flag.String("out", "html", "output directory")
|
outDir := flag.String("out", "html", "output directory")
|
||||||
@ -127,19 +125,11 @@ func main() {
|
|||||||
Quality: 75,
|
Quality: 75,
|
||||||
}
|
}
|
||||||
|
|
||||||
tree.ReadContentDir(*inDir+"/content", *outDir, "", defaultPathConfig)
|
filtersDir := *inDir + "/templates/filters"
|
||||||
//spew.Dump(contentConfig)
|
|
||||||
|
|
||||||
//spew.Dump(navMap)
|
|
||||||
|
|
||||||
templatesDir := *inDir + "/templates"
|
|
||||||
mark2web.SetTemplateDir(templatesDir)
|
|
||||||
filtersDir := templatesDir + "/filters"
|
|
||||||
if _, err := os.Stat(filtersDir); !os.IsNotExist(err) {
|
if _, err := os.Stat(filtersDir); !os.IsNotExist(err) {
|
||||||
filter.RegisterFilters(filtersDir)
|
filter.RegisterFilters(filtersDir)
|
||||||
}
|
}
|
||||||
tree.ProcessContent()
|
|
||||||
|
|
||||||
mark2web.ProcessAssets()
|
mark2web.Run(*inDir, *outDir, defaultPathConfig)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
11
pkg/mark2web/run.go
Normal file
11
pkg/mark2web/run.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package mark2web
|
||||||
|
|
||||||
|
func Run(inDir, outDir string, defaultPathConfig *PathConfig) {
|
||||||
|
SetTemplateDir(inDir + "/templates")
|
||||||
|
|
||||||
|
tree := new(TreeNode)
|
||||||
|
tree.ReadContentDir(inDir+"/content", outDir, "", defaultPathConfig)
|
||||||
|
tree.ProcessContent()
|
||||||
|
|
||||||
|
ProcessAssets()
|
||||||
|
}
|
@ -16,5 +16,6 @@ type TreeNode struct {
|
|||||||
Config *PathConfig
|
Config *PathConfig
|
||||||
Sub []*TreeNode
|
Sub []*TreeNode
|
||||||
|
|
||||||
root *TreeNode // shows always to root of tree
|
root *TreeNode // shows always to root of tree
|
||||||
|
parent *TreeNode
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user