2018-10-07 07:29:41 +02:00
|
|
|
#! /usr/bin/lua
|
|
|
|
local args = {...}
|
2019-08-18 22:37:17 +02:00
|
|
|
local typename = args[2]
|
2018-10-07 07:29:41 +02:00
|
|
|
local parser = require("docs._parser")
|
|
|
|
|
2019-08-18 22:37:17 +02:00
|
|
|
assert(typename)
|
|
|
|
|
|
|
|
local files = {
|
|
|
|
"./objects/"..typename..".c",
|
|
|
|
"./lib/awful/"..typename..".lua",
|
|
|
|
"./lib/naughty/"..typename..".lua"
|
|
|
|
}
|
|
|
|
|
2018-10-07 07:29:41 +02:00
|
|
|
local matcher, matcher2 = "(.*)", ".*"
|
|
|
|
|
|
|
|
-- The client function comes from 5 different files, but all of those are
|
|
|
|
-- merged into one documentation page (aka, awful.client doesn't have content
|
|
|
|
-- anymore). This override the path so the parser doesn't have to be aware of it
|
|
|
|
function parser.path_to_html()
|
2019-08-18 22:37:17 +02:00
|
|
|
return "../core_components/"..typename..".html#"
|
2018-10-07 07:29:41 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
local clientruleproperty = parser.parse_files(files, "clientruleproperty", matcher, matcher2)
|
|
|
|
|
|
|
|
for _, prop in ipairs(parser.parse_files(files, "property", matcher, matcher2)) do
|
|
|
|
table.insert(clientruleproperty, prop)
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Create the file
|
|
|
|
local filename = args[1]
|
|
|
|
|
|
|
|
local f = io.open(filename, "w")
|
|
|
|
|
|
|
|
f:write(parser.create_table(clientruleproperty, {"link", "desc"}, "-- "))
|
|
|
|
|
|
|
|
f:close()
|
|
|
|
|
|
|
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|