diff --git a/src/awesomewm.d.tl/init.tl b/src/awesomewm.d.tl/init.tl index be63003..3b3b3b4 100644 --- a/src/awesomewm.d.tl/init.tl +++ b/src/awesomewm.d.tl/init.tl @@ -2,18 +2,18 @@ local crawler = require "crawler" local filesystem = require "filesystem" local inspect = require "inspect" local log = require "logger" -local properties = require "properties" +local property = require "property" local scraper = require "scraper" local generator = require "generator" log:info( - inspect { message = "Start extraction", base_url = properties.base_url } + inspect { message = "Start extraction", base_url = property.base_url } ) -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(inspect { modules_found = #module_infos }) @@ -21,13 +21,13 @@ log:info(inspect { modules_found = #module_infos }) -- 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 }) @@ -37,5 +37,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 88% rename from src/awesomewm.d.tl/properties.tl rename to src/awesomewm.d.tl/property.tl index 5ce4a59..2f1fd79 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,9 +11,10 @@ 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", + -- base_url = "file:///usr/share/doc/awesome/doc", + base_url = "file:///home/aireone/documents/prog/awesome/build/doc", index_uri = "/index.html", out_directory = "generated", ignored_modules = { @@ -48,7 +49,7 @@ local properties: Properties = { "wibox.drawable", "wibox.hierarchy", "wibox.widget.base", - "xproperties", + "xproperty", -- Documentation "Authors", @@ -69,4 +70,4 @@ local properties: Properties = { } } -return properties +return property diff --git a/src/awesomewm.d.tl/scraper/module_doc.tl b/src/awesomewm.d.tl/scraper/module_doc.tl index 994dd35..830d0b2 100644 --- a/src/awesomewm.d.tl/scraper/module_doc.tl +++ b/src/awesomewm.d.tl/scraper/module_doc.tl @@ -70,10 +70,10 @@ function module.get_doc_from_page(html: string): Module_Doc.Module_Doc module_doc.constructors = List(extract_section_functions(dl_html)) elseif section_name == "Static module functions" then module_doc.static_functions = List(extract_section_functions(dl_html)) - elseif section_name == "Object properties" then - print "Not implemented: Object properties" - elseif section_name == "Deprecated object properties" then - print "Not implemented: Deprecated object properties" + elseif section_name == "Object property" then + print "Not implemented: Object property" + elseif section_name == "Deprecated object property" then + print "Not implemented: Deprecated object property" elseif section_name == "Object methods" then module_doc.methods = List(extract_section_functions(dl_html)) elseif section_name == "Signals" then