...
This commit is contained in:
@@ -3,9 +3,8 @@ module docusaurus
|
||||
import freeflowuniverse.herolib.osal.screen
|
||||
import os
|
||||
import freeflowuniverse.herolib.core.pathlib
|
||||
// import freeflowuniverse.herolib.core.base
|
||||
import freeflowuniverse.herolib.web.siteconfig
|
||||
import freeflowuniverse.herolib.develop.gittools
|
||||
// import json
|
||||
import freeflowuniverse.herolib.osal
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import time
|
||||
@@ -21,6 +20,7 @@ pub mut:
|
||||
args DSiteGetArgs
|
||||
errors []SiteError
|
||||
config Configuration
|
||||
siteconfig siteconfig.SiteConfig
|
||||
factory &DocusaurusFactory @[skip; str: skip] // Reference to the parent
|
||||
}
|
||||
|
||||
|
||||
@@ -48,21 +48,20 @@ pub fn (mut site DocSite) generate() ! {
|
||||
|
||||
site.download_collections()!
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
pub fn (mut site DocSite) download_collections() ! {
|
||||
|
||||
mut gs := gittools.new()!
|
||||
for item in site.config.import_sources {
|
||||
for item in site.siteconfig.import_collections {
|
||||
mypath := gs.get_path(
|
||||
pull: false
|
||||
reset: false
|
||||
url: item.url
|
||||
)!
|
||||
mut mypatho := pathlib.get(mypath)
|
||||
println(mypatho)
|
||||
mypatho.copy(dest: '${site.factory.path_build.path}/docs/${item.dest}', delete: true)!
|
||||
println(mypath)
|
||||
// site.process_md(mut mypatho, item)!
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import os
|
||||
import freeflowuniverse.herolib.core.pathlib
|
||||
import freeflowuniverse.herolib.core.texttools
|
||||
import freeflowuniverse.herolib.develop.gittools
|
||||
import freeflowuniverse.herolib.web.siteconfig
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import freeflowuniverse.herolib.osal
|
||||
|
||||
@@ -64,6 +65,7 @@ pub fn (mut f DocusaurusFactory) get(args_ DSiteGetArgs) !&DocSite {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mut myconfig:=config_load(configpath)!
|
||||
|
||||
if myconfig.main.name.len == 0 {
|
||||
@@ -83,6 +85,8 @@ pub fn (mut f DocusaurusFactory) get(args_ DSiteGetArgs) !&DocSite {
|
||||
args.path_publish = "${f.path_publish}/${args.name}"
|
||||
}
|
||||
|
||||
mut mysiteconfig:=*siteconfig.new(configpath)!
|
||||
|
||||
mut ds := DocSite{
|
||||
name: args.name
|
||||
url: args.url
|
||||
@@ -90,6 +94,7 @@ pub fn (mut f DocusaurusFactory) get(args_ DSiteGetArgs) !&DocSite {
|
||||
path_publish: pathlib.get_dir(path:args.path_publish)!
|
||||
args: args
|
||||
config: myconfig
|
||||
siteconfig: mysiteconfig //comes from the heroconfig
|
||||
factory: &f
|
||||
}
|
||||
ds.check()!
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
module docusaurus
|
||||
|
||||
import os
|
||||
// import freeflowuniverse.herolib.data.doctree.collection
|
||||
import freeflowuniverse.herolib.core.pathlib
|
||||
// import freeflowuniverse.herolib.ui.console
|
||||
// import freeflowuniverse.herolib.core.base
|
||||
// import freeflowuniverse.herolib.develop.gittools
|
||||
// import freeflowuniverse.herolib.ui.console
|
||||
|
||||
@[heap]
|
||||
pub struct DocusaurusFactory {
|
||||
|
||||
@@ -27,6 +27,8 @@ pub mut:
|
||||
build_dest_dev []BuildDest // Development build destinations (from !!site.build_dest_dev)
|
||||
}
|
||||
|
||||
|
||||
|
||||
pub struct Page {
|
||||
pub mut:
|
||||
name string
|
||||
@@ -90,5 +92,5 @@ pub mut:
|
||||
path string
|
||||
dest string // location in the docs folder of the place where we will build docusaurus
|
||||
replace map[string]string // will replace ${NAME} in the imported content
|
||||
visible bool
|
||||
visible bool = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user