From 44de7a23dfb6c189d2457fc9d90e03086a117fa5 Mon Sep 17 00:00:00 2001 From: Aire-One Date: Sun, 29 Jan 2023 19:22:19 +0100 Subject: [PATCH] run: some play with the entrypoint --- src/awesomewm.d.tl/init.tl | 152 ++++++++++++++++++++----------------- 1 file changed, 81 insertions(+), 71 deletions(-) diff --git a/src/awesomewm.d.tl/init.tl b/src/awesomewm.d.tl/init.tl index b508aab..5f228eb 100644 --- a/src/awesomewm.d.tl/init.tl +++ b/src/awesomewm.d.tl/init.tl @@ -65,78 +65,88 @@ local function modules_tree(modules: List): Map = List() +-- for module in global_module_infos:iter() do +-- if module.name:gmatch(".*%sand%s.*") then +-- do_one_file( +-- property.base_url .. "/" .. module.uri, +-- module.name, +-- property.out_directory .. "/" .. module.name:gsub(".*%sand%s", ""):gsub("%.", "/") .. ".d.tl" +-- ) +-- end + +-- local html = crawler.fetch(property.base_url .. "/" .. module.uri) +-- local module_doc = scraper.module_doc.get_doc_from_page(html, (module.name:gsub("%sand%s.*", ""))) +-- module_doc:fixup() +-- module_doc.record_name = utils.lowercase(module_doc.record_name) +-- global_env_def:append(module_doc) +-- end +-- filesystem.file_writer.write( +-- generator.global_env_def.generate_teal(global_env_def), +-- property.out_directory .. "/global_env.d.tl" +-- ) + +-- for module, children in tree:iter() do +-- -- TODO : this map should be coupled with the all_module_infos list +-- local requires: Map = Map() +-- for child in children:iter() do +-- local name = child:gmatch(".*%.(.*)$")() +-- requires:set(name, child) +-- end +-- filesystem.file_writer.write( +-- generator.module_init_definition.generate_teal(requires), +-- property.out_directory .. "/" .. stringx.split(module, "."):slice(1, -1):join("/") .. "/init.d.tl" +-- ) +-- end + +local module_ast, other_nodes = scraper.module_doc.get_doc_from_page( + crawler.fetch(property.base_url .. "/widgets/wibox.widget.imagebox.html"), + "awful.tag" ) -for module in module_infos:iter() do - do_one_file( - property.base_url .. "/" .. module.uri, - module.name, - property.out_directory .. "/" .. module.name:gsub("%.", "/") .. ".d.tl" - ) -end - -local global_env_def: List = List() -for module in global_module_infos:iter() do - if module.name:gmatch(".*%sand%s.*") then - do_one_file( - property.base_url .. "/" .. module.uri, - module.name, - property.out_directory .. "/" .. module.name:gsub(".*%sand%s", ""):gsub("%.", "/") .. ".d.tl" - ) - end - - local html = crawler.fetch(property.base_url .. "/" .. module.uri) - local module_doc = scraper.module_doc.get_doc_from_page(html, (module.name:gsub("%sand%s.*", ""))) - module_doc:fixup() - module_doc.record_name = utils.lowercase(module_doc.record_name) - global_env_def:append(module_doc) -end -filesystem.file_writer.write( - generator.global_env_def.generate_teal(global_env_def), - property.out_directory .. "/global_env.d.tl" -) - -for module, children in tree:iter() do - -- TODO : this map should be coupled with the all_module_infos list - local requires: Map = Map() - for child in children:iter() do - local name = child:gmatch(".*%.(.*)$")() - requires:set(name, child) - end - filesystem.file_writer.write( - generator.module_init_definition.generate_teal(requires), - property.out_directory .. "/" .. stringx.split(module, "."):slice(1, -1):join("/") .. "/init.d.tl" - ) -end +log:info(logger.message_with_metadata("Finished", { + module_ast = module_ast, + other_nodes = other_nodes, +}))