diff --git a/cli/hero.v b/cli/hero.v index 948be647..e47b3a3f 100644 --- a/cli/hero.v +++ b/cli/hero.v @@ -101,7 +101,7 @@ fn do() ! { // herocmds.cmd_juggler(mut cmd) herocmds.cmd_generator(mut cmd) herocmds.cmd_docusaurus(mut cmd) - herocmds.cmd_starlight(mut cmd) + // herocmds.cmd_starlight(mut cmd) // herocmds.cmd_docsorter(mut cmd) // cmd.add_command(publishing.cmd_publisher(pre_func)) cmd.setup() diff --git a/lib/core/herocmds/starlight.v b/lib/core/herocmds/starlight.v index ec6b01bf..2bf42ac4 100644 --- a/lib/core/herocmds/starlight.v +++ b/lib/core/herocmds/starlight.v @@ -1,143 +1,143 @@ module herocmds -import freeflowuniverse.herolib.web.starlight +// import freeflowuniverse.herolib.web.starlight import os import cli { Command, Flag } -pub fn cmd_starlight(mut cmdroot Command) { - mut cmd_run := Command{ - name: 'starlight' - description: 'Generate, build, run starlight sites.' - required_args: 0 - execute: cmd_starlight_execute - } +// pub fn cmd_starlight(mut cmdroot Command) { +// mut cmd_run := Command{ +// name: 'starlight' +// description: 'Generate, build, run starlight sites.' +// required_args: 0 +// execute: cmd_starlight_execute +// } - // cmd_run.add_flag(Flag{ - // flag: .bool - // required: false - // name: 'reset' - // abbrev: 'r' - // description: 'will reset.' - // }) +// // cmd_run.add_flag(Flag{ +// // flag: .bool +// // required: false +// // name: 'reset' +// // abbrev: 'r' +// // description: 'will reset.' +// // }) - cmd_run.add_flag(Flag{ - flag: .string - required: false - name: 'url' - abbrev: 'u' - // default: '' - description: 'Url where starlight source is.' - }) +// cmd_run.add_flag(Flag{ +// flag: .string +// required: false +// name: 'url' +// abbrev: 'u' +// // default: '' +// description: 'Url where starlight source is.' +// }) - cmd_run.add_flag(Flag{ - flag: .string - required: false - name: 'path' - abbrev: 'p' - // default: '' - description: 'Path where starlight source is.' - }) +// cmd_run.add_flag(Flag{ +// flag: .string +// required: false +// name: 'path' +// abbrev: 'p' +// // default: '' +// description: 'Path where starlight source is.' +// }) - cmd_run.add_flag(Flag{ - flag: .string - required: false - name: 'deploykey' - abbrev: 'dk' - // default: '' - description: 'Path of SSH Key used to deploy.' - }) +// cmd_run.add_flag(Flag{ +// flag: .string +// required: false +// name: 'deploykey' +// abbrev: 'dk' +// // default: '' +// description: 'Path of SSH Key used to deploy.' +// }) - cmd_run.add_flag(Flag{ - flag: .string - required: false - name: 'publish' - // default: '' - description: 'Path where to publish.' - }) +// cmd_run.add_flag(Flag{ +// flag: .string +// required: false +// name: 'publish' +// // default: '' +// description: 'Path where to publish.' +// }) - cmd_run.add_flag(Flag{ - flag: .bool - required: false - name: 'buildpublish' - abbrev: 'bp' - description: 'build and publish.' - }) +// cmd_run.add_flag(Flag{ +// flag: .bool +// required: false +// name: 'buildpublish' +// abbrev: 'bp' +// description: 'build and publish.' +// }) - cmd_run.add_flag(Flag{ - flag: .bool - required: false - name: 'builddevpublish' - abbrev: 'bpd' - description: 'build dev version and publish.' - }) +// cmd_run.add_flag(Flag{ +// flag: .bool +// required: false +// name: 'builddevpublish' +// abbrev: 'bpd' +// description: 'build dev version and publish.' +// }) - cmd_run.add_flag(Flag{ - flag: .bool - required: false - name: 'update' - description: 'update your environment the template and the repo you are working on (git pull).' - }) +// cmd_run.add_flag(Flag{ +// flag: .bool +// required: false +// name: 'update' +// description: 'update your environment the template and the repo you are working on (git pull).' +// }) - cmd_run.add_flag(Flag{ - flag: .bool - required: false - name: 'dev' - abbrev: 'd' - description: 'Run your dev environment on local browser.' - }) +// cmd_run.add_flag(Flag{ +// flag: .bool +// required: false +// name: 'dev' +// abbrev: 'd' +// description: 'Run your dev environment on local browser.' +// }) - cmd_run.add_flag(Flag{ - flag: .bool - required: false - name: 'new' - abbrev: 'n' - description: 'create a new starlight site.' - }) +// cmd_run.add_flag(Flag{ +// flag: .bool +// required: false +// name: 'new' +// abbrev: 'n' +// description: 'create a new starlight site.' +// }) - cmdroot.add_command(cmd_run) -} +// cmdroot.add_command(cmd_run) +// } -fn cmd_starlight_execute(cmd Command) ! { - mut update := cmd.flags.get_bool('update') or { false } - mut init := cmd.flags.get_bool('new') or { false } - mut url := cmd.flags.get_string('url') or { '' } - mut publish_path := cmd.flags.get_string('publish') or { '' } - mut deploykey := cmd.flags.get_string('deploykey') or { '' } +// fn cmd_starlight_execute(cmd Command) ! { +// mut update := cmd.flags.get_bool('update') or { false } +// mut init := cmd.flags.get_bool('new') or { false } +// mut url := cmd.flags.get_string('url') or { '' } +// mut publish_path := cmd.flags.get_string('publish') or { '' } +// mut deploykey := cmd.flags.get_string('deploykey') or { '' } - mut path := cmd.flags.get_string('path') or { '' } +// mut path := cmd.flags.get_string('path') or { '' } - mut buildpublish := cmd.flags.get_bool('buildpublish') or { false } - mut builddevpublish := cmd.flags.get_bool('builddevpublish') or { false } - mut dev := cmd.flags.get_bool('dev') or { false } +// mut buildpublish := cmd.flags.get_bool('buildpublish') or { false } +// mut builddevpublish := cmd.flags.get_bool('builddevpublish') or { false } +// mut dev := cmd.flags.get_bool('dev') or { false } - // if build== false && build== false && build== false { - // eprintln("specify build, builddev or dev") - // exit(1) - // } +// // if build== false && build== false && build== false { +// // eprintln("specify build, builddev or dev") +// // exit(1) +// // } - mut docs := starlight.new(update: update)! - mut site := docs.get( - url: url - path: path - update: update - publish_path: publish_path - deploykey: deploykey - init: init - )! +// mut docs := starlight.new(update: update)! +// mut site := docs.get( +// url: url +// path: path +// update: update +// publish_path: publish_path +// deploykey: deploykey +// init: init +// )! - if publish_path.len > 0 { - site.build()! - } +// if publish_path.len > 0 { +// site.build()! +// } - if buildpublish { - site.build_publish()! - } +// if buildpublish { +// site.build_publish()! +// } - if builddevpublish { - site.build_dev_publish()! - } +// if builddevpublish { +// site.build_dev_publish()! +// } - if dev { - site.dev(host: 'localhost', port: 3000)! - } -} +// if dev { +// site.dev(host: 'localhost', port: 3000)! +// } +// } diff --git a/lib/web/docusaurus/dsite_generate.v b/lib/web/docusaurus/dsite_generate.v index 720303b9..6fff7980 100644 --- a/lib/web/docusaurus/dsite_generate.v +++ b/lib/web/docusaurus/dsite_generate.v @@ -46,8 +46,12 @@ pub fn (mut site DocSite) generate() ! { mut footer_file := pathlib.get_file(path: '${cfg_path}/footer.json', create: true)! footer_file.write(json.encode_pretty(site.config.footer))! - mut aa := site.path_src.dir_get('docs')! - aa.copy(dest: '${site.factory.path_build.path}/docs', delete: true)! + osal.rm("${site.factory.path_build.path}/docs")! + + if os.exists("${site.path_src.path}/docs"){ + mut aa := site.path_src.dir_get('docs')! + aa.copy(dest: '${site.factory.path_build.path}/docs', delete: true)! + } // now we need to process the pages, call the sitegen module, which will look for statements like // !!site.page sitename:'atest' diff --git a/lib/web/docusaurus/play.v b/lib/web/docusaurus/play.v index dc8b4432..af6fe0c3 100644 --- a/lib/web/docusaurus/play.v +++ b/lib/web/docusaurus/play.v @@ -20,6 +20,7 @@ pub fn play(args_ PlayArgs) ! { mut ds := new()! + if plbook.exists_once(filter: 'docusaurus.define') { mut action := plbook.action_get(actor: 'docusaurus', name: 'define')! diff --git a/lib/web/starlight/clean.v b/libarchive/starlight/clean.v similarity index 100% rename from lib/web/starlight/clean.v rename to libarchive/starlight/clean.v diff --git a/lib/web/starlight/config.v b/libarchive/starlight/config.v similarity index 100% rename from lib/web/starlight/config.v rename to libarchive/starlight/config.v diff --git a/lib/web/starlight/factory.v b/libarchive/starlight/factory.v similarity index 100% rename from lib/web/starlight/factory.v rename to libarchive/starlight/factory.v diff --git a/lib/web/starlight/model.v b/libarchive/starlight/model.v similarity index 100% rename from lib/web/starlight/model.v rename to libarchive/starlight/model.v diff --git a/lib/web/starlight/site.v b/libarchive/starlight/site.v similarity index 100% rename from lib/web/starlight/site.v rename to libarchive/starlight/site.v diff --git a/lib/web/starlight/site_get.v b/libarchive/starlight/site_get.v similarity index 100% rename from lib/web/starlight/site_get.v rename to libarchive/starlight/site_get.v diff --git a/lib/web/starlight/template.v b/libarchive/starlight/template.v similarity index 100% rename from lib/web/starlight/template.v rename to libarchive/starlight/template.v diff --git a/lib/web/starlight/templates/build.sh b/libarchive/starlight/templates/build.sh similarity index 100% rename from lib/web/starlight/templates/build.sh rename to libarchive/starlight/templates/build.sh diff --git a/lib/web/starlight/templates/build_dev_publish.sh b/libarchive/starlight/templates/build_dev_publish.sh similarity index 100% rename from lib/web/starlight/templates/build_dev_publish.sh rename to libarchive/starlight/templates/build_dev_publish.sh diff --git a/lib/web/starlight/templates/build_publish.sh b/libarchive/starlight/templates/build_publish.sh similarity index 100% rename from lib/web/starlight/templates/build_publish.sh rename to libarchive/starlight/templates/build_publish.sh diff --git a/lib/web/starlight/templates/develop.sh b/libarchive/starlight/templates/develop.sh similarity index 100% rename from lib/web/starlight/templates/develop.sh rename to libarchive/starlight/templates/develop.sh diff --git a/lib/web/starlight/watcher.v b/libarchive/starlight/watcher.v similarity index 100% rename from lib/web/starlight/watcher.v rename to libarchive/starlight/watcher.v