run: make the program try multiple modules
ci/woodpecker/pr/lint Pipeline was successful Details
ci/woodpecker/pr/build Pipeline was successful Details

This commit is contained in:
Aire-One 2022-10-31 19:17:08 +01:00
parent 9c06b7ecad
commit 988dbc5665
1 changed files with 29 additions and 9 deletions

View File

@ -24,15 +24,35 @@ log:info("Finished Module List scrapping, found " .. #module_infos .. " modules"
-- log:info(inspect { items })
-- end
local html =
crawler.fetch(property.base_url .. "/widgets/wibox.widget.textbox.html")
local module_doc = scraper.module_doc.get_doc_from_page(html, "wibox.widget.textbox")
-- log:info(inspect { module_doc = module_doc })
local function do_one_file(url: string, module_name: string, output: string)
local html = crawler.fetch(url)
local module_doc = scraper.module_doc.get_doc_from_page(html, module_name)
filesystem.file_writer.write(
generator.teal_type_definitions.generate_teal(module_doc),
output
)
end
-- -- local items = scraper.get_doc_from_page(page)
-- -- log:info(inspect { items })
filesystem.file_writer.write(
generator.teal_type_definitions.generate_teal(module_doc),
do_one_file(
property.base_url .. "/widgets/wibox.widget.textbox.html",
"wibox.widget.textbox",
property.out_directory .. "/textbox.d.tl"
)
do_one_file(
property.base_url .. "/popups_and_bars/wibox.html",
"wibox",
property.out_directory .. "/wibox.d.tl"
)
do_one_file(
property.base_url .. "/widget_layouts/wibox.layout.fixed.html",
"wibox.layout.fixed",
property.out_directory .. "/fixed.d.tl"
)
do_one_file(
property.base_url .. "/core_components/client.html",
"client",
property.out_directory .. "/client.d.tl"
)