File: build_rules_index.lua

package info (click to toggle)
awesome 4.3-8.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,468 kB
  • sloc: ansic: 14,508; sh: 526; makefile: 46
file content (30 lines) | stat: -rw-r--r-- 963 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /usr/bin/lua
local args = {...}
local parser = require("docs._parser")

local files = {"./objects/client.c", "./lib/awful/client.lua"}
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()
    return "../classes/client.html#client."
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