4Copyright (c) 2017 Albert Krewinkel
6Permission to use, copy, modify, and/or distribute this software for any purpose
7with or without fee is hereby granted, provided that the above copyright notice
8and this permission notice appear in all copies.
10THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
12FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
14OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
24--- Create a new set of attributes (Attr).
25function M.Attributes(id, classes, key_values)
26 return {id, classes, key_values}
30--- Create a new element subtype
31function Element:make_subtype(o)
37--- Create a new element given its tag and arguments
38function Element:new(tag, ...)
39 local element = { t = tag }
41 -- special case for unary constructors
43 element.c = content[1]
44 -- Don't set 'c' field if no further arguments were given. This is important
45 -- for nullary constructors like `Space` and `HorizontalRule`.
46 elseif #content > 0 then
49 setmetatable(element, self)
54local function Doc(blocks, meta)
58 ["pandoc-api-version"] = {1,17,0,5},
62local Inline = Element:make_subtype{}
63local Block = Element:make_subtype{}
109for _, block_type in pairs(M.block_types) do
110 M[block_type] = function(...)
111 return Block:new(block_type, ...)
115for _, inline_type in pairs(M.inline_types) do
116 M[inline_type] = function(...)
117 return Inline:new(inline_type, ...)
121--- Arrays to provide fast lookup of element types
122local set_of_inline_types = {}
123local set_of_block_types = {}
125for i = 1, #M.inline_types do
126 set_of_inline_types[M.inline_types[i]] = true
128for i = 1, #M.block_types do
129 set_of_block_types[M.block_types[i]] = true
132function M.global_filter()
134 for k, v in pairs(_G) do
135 if set_of_inline_types[k] or set_of_block_types[k] or k == "Doc" then
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list