git.iko.soy/typeable/pandoc
on ca71298 help sign in
typeable/pandoc/data/pandoc.lua
876 lines 25 kB history raw
1--[[
2pandoc.lua
4Copyright © 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
16THIS SOFTWARE.
17]]
19---
20-- Lua functions for pandoc scripts.
21--
22-- @author Albert Krewinkel
23-- @copyright © 2017 Albert Krewinkel
24-- @license MIT
25local M = {
26 _VERSION = "0.4.0"
29local List = require 'pandoc.List'
31------------------------------------------------------------------------
32-- The base class for pandoc's AST elements.
33-- @type Element
34-- @local
35local Element = {}
37--- Create a new element subtype
38-- @local
39function Element:make_subtype(o)
40 o = o or {}
41 setmetatable(o, self)
42 self.__index = self
43 return o
44end
46--- Create a new element given its tag and arguments
47-- @local
48function Element:new(tag, ...)
49 local element = { t = tag }
50 local content = {...}
51 -- special case for unary constructors
52 if #content == 1 then
53 element.c = content[1]
54 -- Don't set 'c' field if no further arguments were given. This is important
55 -- for nullary constructors like `Space` and `HorizontalRule`.
56 elseif #content > 0 then
57 element.c = content
58 end
59 setmetatable(element, self)
60 self.__index = self
61 return element
62end
64--- Create a new constructor
65-- @local
66-- @param tag Tag used to identify the constructor
67-- @param fn Function to be called when constructing a new element
68-- @param accessors names to use as accessors for numerical fields
69-- @return function that constructs a new element
70function Element:create_constructor(tag, fn, accessors)
71 local constr = self:make_subtype({tag = tag, getters = {}, setters = {}})
73 -- Add accessors to the metatable
74 if type(accessors) == "string" then
75 constr.getters[accessors] = function(elem)
76 return elem.c
77 end
78 constr.setters[accessors] = function(elem, v)
79 elem.c = v
80 end
81 else
82 for i = 1, #(accessors or {}) do
83 if type(accessors[i]) == "string" then
84 constr.getters[accessors[i]] = function(elem)
85 return elem.c[i]
86 end
87 constr.setters[accessors[i]] = function(elem, v)
88 elem.c[i] = v
89 end
90 else -- only two levels of nesting are supported
91 for k, v in ipairs(accessors[i]) do
92 constr.getters[v] = function(elem)
93 return elem.c[i][k]
94 end
95 constr.setters[v] = function(elem, v)
96 elem.c[i][k] = v
97 end
98 end
99 end
100 end
101 end
103 function constr:new(...)
104 local obj = fn(...)
105 setmetatable(obj, self)
106 self.__index = function(t, k)
107 if getmetatable(t).getters[k] then
108 return getmetatable(t).getters[k](t)
109 elseif k == "t" then
110 return getmetatable(t)["tag"]
111 else
112 return getmetatable(t)[k]
113 end
114 end
115 self.__newindex = function(t, k, v)
116 if getmetatable(t).setters[k] then
117 getmetatable(t).setters[k](t, v)
118 else
119 rawset(t, k, v)
120 end
121 end
122 return obj
123 end
124 self.constructor = self.constructor or {}
125 self.constructor[tag] = constr
126 return constr
127end
129--- Calls the constructor, creating a new element.
130-- @local
131function Element.__call(t, ...)
132 return t:new(...)
133end
135------------------------------------------------------------------------
136--- Pandoc Document
137-- @section document
139--- A complete pandoc document
140-- @function Pandoc
141-- @tparam {Block,...} blocks document content
142-- @tparam[opt] Meta meta document meta data
143function M.Pandoc(blocks, meta)
144 meta = meta or {}
145 return {
146 ["blocks"] = List:new(blocks),
147 ["meta"] = meta,
148 ["pandoc-api-version"] = {1,17,0,5},
149 }
150end
152-- DEPRECATED synonym:
153M.Doc = M.Pandoc
155------------------------------------------------------------------------
156-- Meta
157-- @section Meta
159--- Create a new Meta object. It sets the metatable of the given table to
160--- `Meta`.
161-- @function Meta
162-- @tparam meta table table containing document meta information
163M.Meta = {}
164M.Meta.__call = function(t, meta)
165 return setmetatable(meta, t)
166end
167setmetatable(M.Meta, M.Meta)
170------------------------------------------------------------------------
171-- MetaValue
172-- @section MetaValue
173M.MetaValue = Element:make_subtype{}
174M.MetaValue.__call = function(t, ...)
175 return t:new(...)
176end
177--- Meta blocks
178-- @function MetaBlocks
179-- @tparam {Block,...} blocks blocks
181--- Meta inlines
182-- @function MetaInlines
183-- @tparam {Inline,...} inlines inlines
185--- Meta list
186-- @function MetaList
187-- @tparam {MetaValue,...} meta_values list of meta values
188M.meta_value_list_types = {
189 "MetaBlocks",
190 "MetaInlines",
191 "MetaList",
193for i = 1, #M.meta_value_list_types do
194 M[M.meta_value_list_types[i]] = M.MetaValue:create_constructor(
195 M.meta_value_list_types[i],
196 function(content)
197 return List:new(content)
198 end
199 )
200end
202--- Meta map
203-- @function MetaMap
204-- @tparam table key_value_map a string-indexed map of meta values
205M.MetaMap = M.MetaValue:create_constructor(
206 "MetaMap",
207 function (mm) return mm end
210--- Creates string to be used in meta data.
211-- Does nothing, lua strings are meta strings.
212-- @function MetaString
213-- @tparam string str string value
214function M.MetaString(str)
215 return str
216end
218--- Creates boolean to be used in meta data.
219-- Does nothing, lua booleans are meta booleans.
220-- @function MetaBool
221-- @tparam boolean bool boolean value
222function M.MetaBool(bool)
223 return bool
224end
226------------------------------------------------------------------------
227-- Blocks
228-- @section Block
230--- Block elements
231M.Block = Element:make_subtype{}
232M.Block.__call = function (t, ...)
233 return t:new(...)
234end
236--- Creates a block quote element
237-- @function BlockQuote
238-- @tparam {Block,...} content block content
239-- @treturn Block block quote element
240M.BlockQuote = M.Block:create_constructor(
241 "BlockQuote",
242 function(content) return {c = content} end,
243 "content"
246--- Creates a bullet (i.e. unordered) list.
247-- @function BulletList
248-- @tparam {{Block,...},...} content list of items
249-- @treturn Block bullet list element
250M.BulletList = M.Block:create_constructor(
251 "BulletList",
252 function(content) return {c = content} end,
253 "content"
256--- Creates a code block element
257-- @function CodeBlock
258-- @tparam string text code string
259-- @tparam[opt] Attr attr element attributes
260-- @treturn Block code block element
261M.CodeBlock = M.Block:create_constructor(
262 "CodeBlock",
263 function(text, attr) return {c = {attr or M.Attr(), text}} end,
264 {{"identifier", "classes", "attributes"}, "text"}
267--- Creates a definition list, containing terms and their explanation.
268-- @function DefinitionList
269-- @tparam {{{Inline,...},{Block,...}},...} content list of items
270-- @treturn Block definition list element
271M.DefinitionList = M.Block:create_constructor(
272 "DefinitionList",
273 function(content) return {c = List:new(content)} end,
274 "content"
277--- Creates a div element
278-- @function Div
279-- @tparam {Block,...} content block content
280-- @tparam[opt] Attr attr element attributes
281-- @treturn Block div element
282M.Div = M.Block:create_constructor(
283 "Div",
284 function(content, attr)
285 return {c = {attr or M.Attr(), List:new(content)}}
286 end,
287 {{"identifier", "classes", "attributes"}, "content"}
290--- Creates a header element.
291-- @function Header
292-- @tparam int level header level
293-- @tparam {Inline,...} content inline content
294-- @tparam[opt] Attr attr element attributes
295-- @treturn Block header element
296M.Header = M.Block:create_constructor(
297 "Header",
298 function(level, content, attr)
299 return {c = {level, attr or M.Attr(), content}}
300 end,
301 {"level", {"identifier", "classes", "attributes"}, "content"}
304--- Creates a horizontal rule.
305-- @function HorizontalRule
306-- @treturn Block horizontal rule
307M.HorizontalRule = M.Block:create_constructor(
308 "HorizontalRule",
309 function() return {} end
312--- Creates a line block element.
313-- @function LineBlock
314-- @tparam {{Inline,...},...} content inline content
315-- @treturn Block line block element
316M.LineBlock = M.Block:create_constructor(
317 "LineBlock",
318 function(content) return {c = List:new(content)} end,
319 "content"
322--- Creates a null element.
323-- @function Null
324-- @treturn Block null element
325M.Null = M.Block:create_constructor(
326 "Null",
327 function() return {} end
330--- Creates an ordered list.
331-- @function OrderedList
332-- @tparam {{Block,...},...} items list items
333-- @param[opt] listAttributes list parameters
334-- @treturn Block ordered list element
335M.OrderedList = M.Block:create_constructor(
336 "OrderedList",
337 function(items, listAttributes)
338 listAttributes = listAttributes or {1, M.DefaultStyle, M.DefaultDelim}
339 return {c = {listAttributes, List:new(items)}}
340 end,
341 {{"start", "style", "delimiter"}, "content"}
344--- Creates a para element.
345-- @function Para
346-- @tparam {Inline,...} content inline content
347-- @treturn Block paragraph element
348M.Para = M.Block:create_constructor(
349 "Para",
350 function(content) return {c = List:new(content)} end,
351 "content"
354--- Creates a plain element.
355-- @function Plain
356-- @tparam {Inline,...} content inline content
357-- @treturn Block plain element
358M.Plain = M.Block:create_constructor(
359 "Plain",
360 function(content) return {c = List:new(content)} end,
361 "content"
364--- Creates a raw content block of the specified format.
365-- @function RawBlock
366-- @tparam string format format of content
367-- @tparam string text string content
368-- @treturn Block raw block element
369M.RawBlock = M.Block:create_constructor(
370 "RawBlock",
371 function(format, text) return {c = {format, text}} end,
372 {"format", "text"}
375--- Creates a table element.
376-- @function Table
377-- @tparam {Inline,...} caption table caption
378-- @tparam {AlignDefault|AlignLeft|AlignRight|AlignCenter,...} aligns alignments
379-- @tparam {int,...} widths column widths
380-- @tparam {Block,...} headers header row
381-- @tparam {{Block,...}} rows table rows
382-- @treturn Block table element
383M.Table = M.Block:create_constructor(
384 "Table",
385 function(caption, aligns, widths, headers, rows)
386 return {
387 c = {
388 List:new(caption),
389 List:new(aligns),
390 List:new(widths),
391 List:new(headers),
392 List:new(rows)
393 }
394 }
395 end,
396 {"caption", "aligns", "widths", "headers", "rows"}
400------------------------------------------------------------------------
401-- Inline
402-- @section Inline
404--- Inline element class
405M.Inline = Element:make_subtype{}
406M.Inline.__call = function (t, ...)
407 return t:new(...)
408end
410--- Creates a Cite inline element
411-- @function Cite
412-- @tparam {Inline,...} content List of inlines
413-- @tparam {Citation,...} citations List of citations
414-- @treturn Inline citations element
415M.Cite = M.Inline:create_constructor(
416 "Cite",
417 function(content, citations)
418 return {c = {List:new(citations), List:new(content)}}
419 end,
420 {"citations", "content"}
423--- Creates a Code inline element
424-- @function Code
425-- @tparam string text brief image description
426-- @tparam[opt] Attr attr additional attributes
427-- @treturn Inline code element
428M.Code = M.Inline:create_constructor(
429 "Code",
430 function(text, attr) return {c = {attr or M.Attr(), text}} end,
431 {{"identifier", "classes", "attributes"}, "text"}
434--- Creates an inline element representing emphasised text.
435-- @function Emph
436-- @tparam {Inline,..} content inline content
437-- @treturn Inline emphasis element
438M.Emph = M.Inline:create_constructor(
439 "Emph",
440 function(content) return {c = List:new(content)} end,
441 "content"
444--- Creates a Image inline element
445-- @function Image
446-- @tparam {Inline,..} caption text used to describe the image
447-- @tparam string src path to the image file
448-- @tparam[opt] string title brief image description
449-- @tparam[opt] Attr attr additional attributes
450-- @treturn Inline image element
451M.Image = M.Inline:create_constructor(
452 "Image",
453 function(caption, src, title, attr)
454 title = title or ""
455 attr = attr or M.Attr()
456 return {c = {attr, List:new(caption), {src, title}}}
457 end,
458 {{"identifier", "classes", "attributes"}, "caption", {"src", "title"}}
461--- Create a LineBreak inline element
462-- @function LineBreak
463-- @treturn Inline linebreak element
464M.LineBreak = M.Inline:create_constructor(
465 "LineBreak",
466 function() return {} end
469--- Creates a link inline element, usually a hyperlink.
470-- @function Link
471-- @tparam {Inline,..} content text for this link
472-- @tparam string target the link target
473-- @tparam[opt] string title brief link description
474-- @tparam[opt] Attr attr additional attributes
475-- @treturn Inline image element
476M.Link = M.Inline:create_constructor(
477 "Link",
478 function(content, target, title, attr)
479 title = title or ""
480 attr = attr or M.Attr()
481 return {c = {attr, List:new(content), {target, title}}}
482 end,
483 {{"identifier", "classes", "attributes"}, "content", {"target", "title"}}
486--- Creates a Math element, either inline or displayed.
487-- @function Math
488-- @tparam "InlineMath"|"DisplayMath" mathtype rendering specifier
489-- @tparam string text Math content
490-- @treturn Inline Math element
491M.Math = M.Inline:create_constructor(
492 "Math",
493 function(mathtype, text)
494 return {c = {mathtype, text}}
495 end,
496 {"mathtype", "text"}
498--- Creates a DisplayMath element (DEPRECATED).
499-- @function DisplayMath
500-- @tparam string text Math content
501-- @treturn Inline Math element
502M.DisplayMath = M.Inline:create_constructor(
503 "DisplayMath",
504 function(text) return M.Math("DisplayMath", text) end,
505 {"mathtype", "text"}
507--- Creates an InlineMath inline element (DEPRECATED).
508-- @function InlineMath
509-- @tparam string text Math content
510-- @treturn Inline Math element
511M.InlineMath = M.Inline:create_constructor(
512 "InlineMath",
513 function(text) return M.Math("InlineMath", text) end,
514 {"mathtype", "text"}
517--- Creates a Note inline element
518-- @function Note
519-- @tparam {Block,...} content footnote block content
520M.Note = M.Inline:create_constructor(
521 "Note",
522 function(content) return {c = List:new(content)} end,
523 "content"
526--- Creates a Quoted inline element given the quote type and quoted content.
527-- @function Quoted
528-- @tparam "DoubleQuote"|"SingleQuote" quotetype type of quotes to be used
529-- @tparam {Inline,..} content inline content
530-- @treturn Inline quoted element
531M.Quoted = M.Inline:create_constructor(
532 "Quoted",
533 function(quotetype, content) return {c = {quotetype, List:new(content)}} end,
534 {"quotetype", "content"}
536--- Creates a single-quoted inline element (DEPRECATED).
537-- @function SingleQuoted
538-- @tparam {Inline,..} content inline content
539-- @treturn Inline quoted element
540-- @see Quoted
541M.SingleQuoted = M.Inline:create_constructor(
542 "SingleQuoted",
543 function(content) return M.Quoted(M.SingleQuote, content) end,
544 {"quotetype", "content"}
546--- Creates a single-quoted inline element (DEPRECATED).
547-- @function DoubleQuoted
548-- @tparam {Inline,..} content inline content
549-- @treturn Inline quoted element
550-- @see Quoted
551M.DoubleQuoted = M.Inline:create_constructor(
552 "DoubleQuoted",
553 function(content) return M.Quoted("DoubleQuote", content) end,
554 {"quotetype", "content"}
557--- Creates a RawInline inline element
558-- @function RawInline
559-- @tparam string format format of the contents
560-- @tparam string text string content
561-- @treturn Inline raw inline element
562M.RawInline = M.Inline:create_constructor(
563 "RawInline",
564 function(format, text) return {c = {format, text}} end,
565 {"format", "text"}
568--- Creates text rendered in small caps
569-- @function SmallCaps
570-- @tparam {Inline,..} content inline content
571-- @treturn Inline smallcaps element
572M.SmallCaps = M.Inline:create_constructor(
573 "SmallCaps",
574 function(content) return {c = List:new(content)} end,
575 "content"
578--- Creates a SoftBreak inline element.
579-- @function SoftBreak
580-- @treturn Inline softbreak element
581M.SoftBreak = M.Inline:create_constructor(
582 "SoftBreak",
583 function() return {} end
586--- Create a Space inline element
587-- @function Space
588-- @treturn Inline space element
589M.Space = M.Inline:create_constructor(
590 "Space",
591 function() return {} end
594--- Creates a Span inline element
595-- @function Span
596-- @tparam {Inline,..} content inline content
597-- @tparam[opt] Attr attr additional attributes
598-- @treturn Inline span element
599M.Span = M.Inline:create_constructor(
600 "Span",
601 function(content, attr)
602 return {c = {attr or M.Attr(), List:new(content)}}
603 end,
604 {{"identifier", "classes", "attributes"}, "content"}
607--- Creates a Str inline element
608-- @function Str
609-- @tparam string text content
610-- @treturn Inline string element
611M.Str = M.Inline:create_constructor(
612 "Str",
613 function(text) return {c = text} end,
614 "text"
617--- Creates text which is striked out.
618-- @function Strikeout
619-- @tparam {Inline,..} content inline content
620-- @treturn Inline strikeout element
621M.Strikeout = M.Inline:create_constructor(
622 "Strikeout",
623 function(content) return {c = List:new(content)} end,
624 "content"
627--- Creates a Strong element, whose text is usually displayed in a bold font.
628-- @function Strong
629-- @tparam {Inline,..} content inline content
630-- @treturn Inline strong element
631M.Strong = M.Inline:create_constructor(
632 "Strong",
633 function(content) return {c = List:new(content)} end,
634 "content"
637--- Creates a Subscript inline element
638-- @function Subscript
639-- @tparam {Inline,..} content inline content
640-- @treturn Inline subscript element
641M.Subscript = M.Inline:create_constructor(
642 "Subscript",
643 function(content) return {c = List:new(content)} end,
644 "content"
647--- Creates a Superscript inline element
648-- @function Superscript
649-- @tparam {Inline,..} content inline content
650-- @treturn Inline strong element
651M.Superscript = M.Inline:create_constructor(
652 "Superscript",
653 function(content) return {c = List:new(content)} end,
654 "content"
658------------------------------------------------------------------------
659-- Helpers
661local function assoc_key_equals (x)
662 return function (y) return y[1] == x end
663end
665-- Lookup a value in an associative list
666-- @function lookup
667-- @tparam {{key, value},...} alist associative list
668-- @param key key for which the associated value is to be looked up
669local function lookup(alist, key)
670 return (List.find_if(alist, assoc_key_equals(key)) or {})[2]
671end
673-- Return an iterator which returns key-value pairs of an associative list.
674-- @function apairs
675-- @tparam {{key, value},...} alist associative list
676local apairs = function (alist)
677 local i = 1
678 local cur
679 function nxt ()
680 cur = rawget(alist, i)
681 if cur then
682 i = i + 1
683 return cur[1], cur[2]
684 end
685 return nil
686 end
687 return nxt, nil, nil
688end
690-- AttributeList, a metatable to allow table-like access to attribute lists
691-- represented by associative lists.
692local AttributeList = {
693 __index = function (t, k)
694 if type(k) == "number" then
695 return rawget(t, k)
696 else
697 return lookup(t, k)
698 end
699 end,
701 __newindex = function (t, k, v)
702 local cur, idx = List.find_if(t, assoc_key_equals(k))
703 if v == nil then
704 table.remove(t, idx)
705 elseif cur then
706 cur[2] = v
707 elseif type(k) == "number" then
708 rawset(t, k, v)
709 else
710 rawset(t, #t + 1, {k, v})
711 end
712 end,
714 __pairs = apairs
717-- convert a table to an associative list. The order of key-value pairs in the
718-- alist is undefined. The table should either contain no numeric keys or
719-- already be an associative list.
720-- @tparam table associative list or table without numeric keys.
721-- @treturn table associative list
722local to_alist = function (tbl)
723 if #tbl ~= 0 or next(tbl) == nil then
724 -- probably already an alist
725 return tbl
726 end
727 local alist = {}
728 local i = 1
729 for k, v in pairs(tbl) do
730 alist[i] = {k, v}
731 i = i + 1
732 end
733 return alist
734end
736-- Attr
737M.Attr = {}
738M.Attr._field_names = {identifier = 1, classes = 2, attributes = 3}
739--- Create a new set of attributes (Attr).
740-- @function Attr
741-- @tparam[opt] string identifier element identifier
742-- @tparam[opt] {string,...} classes element classes
743-- @tparam[opt] table attributes table containing string keys and values
744-- @return element attributes
745M.Attr.__call = function(t, identifier, classes, attributes)
746 identifier = identifier or ''
747 classes = List:new(classes or {})
748 attributes = setmetatable(to_alist(attributes or {}), AttributeList)
749 local attr = {identifier, classes, attributes}
750 setmetatable(attr, t)
751 return attr
752end
753M.Attr.__index = function(t, k)
754 return rawget(t, k) or
755 rawget(t, M.Attr._field_names[k]) or
756 rawget(getmetatable(t), k)
757end
758M.Attr.__newindex = function(t, k, v)
759 if M.Attr._field_names[k] then
760 rawset(t, M.Attr._field_names[k], v)
761 else
762 rawset(t, k, v)
763 end
764end
765setmetatable(M.Attr, M.Attr)
768--- Creates a single citation.
769-- @function Citation
770-- @tparam string id citation identifier (like a bibtex key)
771-- @tparam AuthorInText|SuppressAuthor|NormalCitation mode citation mode
772-- @tparam[opt] {Inline,...} prefix citation prefix
773-- @tparam[opt] {Inline,...} suffix citation suffix
774-- @tparam[opt] int note_num note number
775-- @tparam[opt] int hash hash number
776M.Citation = function(id, mode, prefix, suffix, note_num, hash)
777 prefix = prefix or {}
778 suffix = suffix or {}
779 note_num = note_num or 0
780 hash = hash or 0
781 return {
782 citationId = id,
783 citationPrefix = prefix,
784 citationSuffix = suffix,
785 citationMode = mode,
786 citationNoteNum = note_num,
787 citationHash = hash,
788 }
789end
792------------------------------------------------------------------------
793-- Constants
794-- @section constants
796--- Author name is mentioned in the text.
797-- @see Citation
798-- @see Cite
799M.AuthorInText = "AuthorInText"
801--- Author name is suppressed.
802-- @see Citation
803-- @see Cite
804M.SuppressAuthor = "SuppressAuthor"
806--- Default citation style is used.
807-- @see Citation
808-- @see Cite
809M.NormalCitation = "NormalCitation"
811--- Table cells aligned left.
812-- @see Table
813M.AlignLeft = "AlignLeft"
815--- Table cells right-aligned.
816-- @see Table
817M.AlignRight = "AlignRight"
819--- Table cell content is centered.
820-- @see Table
821M.AlignCenter = "AlignCenter"
823--- Table cells are alignment is unaltered.
824-- @see Table
825M.AlignDefault = "AlignDefault"
827--- Default list number delimiters are used.
828-- @see OrderedList
829M.DefaultDelim = "DefaultDelim"
831--- List numbers are delimited by a period.
832-- @see OrderedList
833M.Period = "Period"
835--- List numbers are delimited by a single parenthesis.
836-- @see OrderedList
837M.OneParen = "OneParen"
839--- List numbers are delimited by a double parentheses.
840-- @see OrderedList
841M.TwoParens = "TwoParens"
843--- List are numbered in the default style
844-- @see OrderedList
845M.DefaultStyle = "DefaultStyle"
847--- List items are numbered as examples.
848-- @see OrderedList
849M.Example = "Example"
851--- List are numbered using decimal integers.
852-- @see OrderedList
853M.Decimal = "Decimal"
855--- List are numbered using lower-case roman numerals.
856-- @see OrderedList
857M.LowerRoman = "LowerRoman"
859--- List are numbered using upper-case roman numerals
860-- @see OrderedList
861M.UpperRoman = "UpperRoman"
863--- List are numbered using lower-case alphabetic characters.
864-- @see OrderedList
865M.LowerAlpha = "LowerAlpha"
867--- List are numbered using upper-case alphabetic characters.
868-- @see OrderedList
869M.UpperAlpha = "UpperAlpha"
871------------------------------------------------------------------------
872-- Functions which have moved to different modules
873local utils = require 'pandoc.utils'
874M.sha1 = utils.sha1
876return M