From 76b10cf2b014f7d2acbc32dd3b4632fa0557e786 Mon Sep 17 00:00:00 2001 From: Aire-One Date: Sat, 22 Oct 2022 19:37:26 +0200 Subject: [PATCH 1/2] chore: rename `entities` -> `entity` --- src/awesomewm.d.tl/{entities => entity}/Function_Info.tl | 0 src/awesomewm.d.tl/{entities => entity}/Module_Doc.tl | 2 +- src/awesomewm.d.tl/{entities => entity}/Module_Info.tl | 0 src/awesomewm.d.tl/generator/snippets.tl | 2 +- src/awesomewm.d.tl/generator/teal_type_definitions.tl | 2 +- src/awesomewm.d.tl/scraper/module_doc.tl | 4 ++-- src/awesomewm.d.tl/scraper/module_info_list.tl | 2 +- 7 files changed, 6 insertions(+), 6 deletions(-) rename src/awesomewm.d.tl/{entities => entity}/Function_Info.tl (100%) rename src/awesomewm.d.tl/{entities => entity}/Module_Doc.tl (89%) rename src/awesomewm.d.tl/{entities => entity}/Module_Info.tl (100%) diff --git a/src/awesomewm.d.tl/entities/Function_Info.tl b/src/awesomewm.d.tl/entity/Function_Info.tl similarity index 100% rename from src/awesomewm.d.tl/entities/Function_Info.tl rename to src/awesomewm.d.tl/entity/Function_Info.tl diff --git a/src/awesomewm.d.tl/entities/Module_Doc.tl b/src/awesomewm.d.tl/entity/Module_Doc.tl similarity index 89% rename from src/awesomewm.d.tl/entities/Module_Doc.tl rename to src/awesomewm.d.tl/entity/Module_Doc.tl index 28df225..a3efb86 100644 --- a/src/awesomewm.d.tl/entities/Module_Doc.tl +++ b/src/awesomewm.d.tl/entity/Module_Doc.tl @@ -1,4 +1,4 @@ -local Function_Info = require "entities.Function_Info" +local Function_Info = require "entity.Function_Info" local List = require "pl.List" local record Module_Doc diff --git a/src/awesomewm.d.tl/entities/Module_Info.tl b/src/awesomewm.d.tl/entity/Module_Info.tl similarity index 100% rename from src/awesomewm.d.tl/entities/Module_Info.tl rename to src/awesomewm.d.tl/entity/Module_Info.tl diff --git a/src/awesomewm.d.tl/generator/snippets.tl b/src/awesomewm.d.tl/generator/snippets.tl index ccd4084..ee98b22 100644 --- a/src/awesomewm.d.tl/generator/snippets.tl +++ b/src/awesomewm.d.tl/generator/snippets.tl @@ -1,4 +1,4 @@ -local Function_Info = require "entities.Function_Info" +local Function_Info = require "entity.Function_Info" local List = require "pl.List" local utils = require "utils" local template = require "pl.template" diff --git a/src/awesomewm.d.tl/generator/teal_type_definitions.tl b/src/awesomewm.d.tl/generator/teal_type_definitions.tl index 14568b1..9c36f77 100644 --- a/src/awesomewm.d.tl/generator/teal_type_definitions.tl +++ b/src/awesomewm.d.tl/generator/teal_type_definitions.tl @@ -1,4 +1,4 @@ -local Module_Doc = require "entities.Module_Doc" +local Module_Doc = require "entity.Module_Doc" local template = require "pl.template" local utils = require "utils" local snippets = require "generator.snippets" diff --git a/src/awesomewm.d.tl/scraper/module_doc.tl b/src/awesomewm.d.tl/scraper/module_doc.tl index 75df5fe..8833020 100644 --- a/src/awesomewm.d.tl/scraper/module_doc.tl +++ b/src/awesomewm.d.tl/scraper/module_doc.tl @@ -1,7 +1,7 @@ -local Function_Info = require "entities.Function_Info" +local Function_Info = require "entity.Function_Info" local List = require "pl.List" local logger = require "logger" -local Module_Doc = require "entities.Module_Doc" +local Module_Doc = require "entity.Module_Doc" local scan = require "web_sanitize.query.scan_html" local scraper_utils = require "scraper.utils" local utils = require "utils" diff --git a/src/awesomewm.d.tl/scraper/module_info_list.tl b/src/awesomewm.d.tl/scraper/module_info_list.tl index 21ecda9..70448e0 100644 --- a/src/awesomewm.d.tl/scraper/module_info_list.tl +++ b/src/awesomewm.d.tl/scraper/module_info_list.tl @@ -1,4 +1,4 @@ -local Module_Info = require "entities.Module_Info" +local Module_Info = require "entity.Module_Info" local scan = require "web_sanitize.query.scan_html" local scraper_utils = require "scraper.utils" local utils = require "utils" From 065ee514a7afc2d60461a6345fa40697b35592a9 Mon Sep 17 00:00:00 2001 From: Aire-One Date: Sat, 22 Oct 2022 19:38:16 +0200 Subject: [PATCH 2/2] chore: rename `properties` -> `property` --- src/awesomewm.d.tl/init.tl | 14 +++++++------- src/awesomewm.d.tl/{properties.tl => property.tl} | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) rename src/awesomewm.d.tl/{properties.tl => property.tl} (95%) diff --git a/src/awesomewm.d.tl/init.tl b/src/awesomewm.d.tl/init.tl index 5266dc6..3f61763 100644 --- a/src/awesomewm.d.tl/init.tl +++ b/src/awesomewm.d.tl/init.tl @@ -1,31 +1,31 @@ local crawler = require "crawler" local filesystem = require "filesystem" local logger = require "logger" -local properties = require "properties" +local property = require "property" local scraper = require "scraper" local generator = require "generator" local log = logger.log("main") -log:info(logger.message_with_metadata("Start", { properties = properties })) +log:info(logger.message_with_metadata("Start", { property = property })) -local index = crawler.fetch(properties.base_url .. properties.index_uri) +local index = crawler.fetch(property.base_url .. property.index_uri) -- local modules = --- scraper.get_modules_from_index(index, properties.ignored_modules) +-- scraper.get_modules_from_index(index, property.ignored_modules) local module_infos = scraper.module_info_list.get_modules_from_index(index) log:info("Finished Module List scrapping, found " .. #module_infos .. " modules") -- for i = 1, 1 do -- #modules do -- local m = modules[i] -- log:info(inspect { try = m }) --- local page = crawler.fetch(properties.base_url .. "/" .. m.uri) +-- local page = crawler.fetch(property.base_url .. "/" .. m.uri) -- local items = scraper.get_doc_from_page(page) -- log:info(inspect { items }) -- end local html = - crawler.fetch(properties.base_url .. "/widgets/wibox.widget.textbox.html") + crawler.fetch(property.base_url .. "/widgets/wibox.widget.textbox.html") local module_doc = scraper.module_doc.get_doc_from_page(html) -- log:info(inspect { module_doc = module_doc }) @@ -35,5 +35,5 @@ local module_doc = scraper.module_doc.get_doc_from_page(html) local mod = "textbox" filesystem.file_writer.write( generator.teal_type_definitions.generate_teal(mod, module_doc), - properties.out_directory .. "/" .. mod .. ".d.tl" + property.out_directory .. "/" .. mod .. ".d.tl" ) diff --git a/src/awesomewm.d.tl/properties.tl b/src/awesomewm.d.tl/property.tl similarity index 95% rename from src/awesomewm.d.tl/properties.tl rename to src/awesomewm.d.tl/property.tl index 5ce4a59..bcbc8c5 100644 --- a/src/awesomewm.d.tl/properties.tl +++ b/src/awesomewm.d.tl/property.tl @@ -1,4 +1,4 @@ -local record Properties +local record Property base_url: string index_uri: string @@ -11,7 +11,7 @@ local record Properties ignored_modules: { string } end -local properties: Properties = { +local property: Property = { -- base_url = "https://awesomewm.org/apidoc", base_url = "file:///usr/share/doc/awesome/doc", index_uri = "/index.html", @@ -69,4 +69,4 @@ local properties: Properties = { } } -return properties +return property