aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-06-29 17:08:59 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-06-29 17:08:59 +0200
commit0f658eb46ce3630886b733e8c8ed1086af9b3510 (patch)
treefa82d125f5f28d7ab68a730ef81956031cbdbdcd
parentcb25326fa313690c3c67caa2a8b44642409fd24c (diff)
downloadpandoc-0f658eb46ce3630886b733e8c8ed1086af9b3510.tar.gz
data/pandoc.lua: regularize constructors.
We now use Pandoc instead of Doc (though Doc remains a deprecated Synonym), and we deprecate DoubleQuoted, SingleQuoted, InlineMath, and DisplayMath.
-rw-r--r--data/pandoc.lua21
-rw-r--r--test/lua/hello-world-doc.lua4
-rw-r--r--test/lua/implicit-doc-filter.lua2
3 files changed, 13 insertions, 14 deletions
diff --git a/data/pandoc.lua b/data/pandoc.lua
index 7dcd179e8..138d8b59b 100644
--- a/data/pandoc.lua
+++ b/data/pandoc.lua
@@ -23,7 +23,7 @@ THIS SOFTWARE.
-- @copyright © 2017 Albert Krewinkel
-- @license MIT
local M = {
- _VERSION = "0.2.0"
+ _VERSION = "0.3.0"
}
------------------------------------------------------------------------
@@ -137,7 +137,7 @@ end
-- @function Doc
-- @tparam {Block,...} blocks document content
-- @tparam[opt] Meta meta document meta data
-function M.Doc(blocks, meta)
+function M.Pandoc(blocks, meta)
meta = meta or {}
return {
["blocks"] = blocks,
@@ -146,6 +146,8 @@ function M.Doc(blocks, meta)
}
end
+-- DEPRECATED synonym:
+M.Doc = M.Pandoc
------------------------------------------------------------------------
-- MetaValue
@@ -449,8 +451,7 @@ M.Link = M.Inline:create_constructor(
{"attributes", "content", {"target", "title"}}
)
---- Creates a Math element, either inline or displayed. It is usually simpler to
--- use one of the specialized functions @{InlineMath} or @{DisplayMath} instead.
+--- Creates a Math element, either inline or displayed.
-- @function Math
-- @tparam "InlineMath"|"DisplayMath" mathtype rendering specifier
-- @tparam string text Math content
@@ -462,7 +463,7 @@ M.Math = M.Inline:create_constructor(
end,
{"mathtype", "text"}
)
---- Creates a DisplayMath element.
+--- Creates a DisplayMath element (DEPRECATED).
-- @function DisplayMath
-- @tparam string text Math content
-- @treturn Inline Math element
@@ -471,7 +472,7 @@ M.DisplayMath = M.Inline:create_constructor(
function(text) return M.Math("DisplayMath", text) end,
{"mathtype", "text"}
)
---- Creates an InlineMath inline element.
+--- Creates an InlineMath inline element (DEPRECATED).
-- @function InlineMath
-- @tparam string text Math content
-- @treturn Inline Math element
@@ -490,9 +491,7 @@ M.Note = M.Inline:create_constructor(
"content"
)
---- Creates a Quoted inline element given the quote type and quoted content. It
--- is usually simpler to use one of the specialized functions @{SingleQuoted} or
--- @{DoubleQuoted} instead.
+--- Creates a Quoted inline element given the quote type and quoted content.
-- @function Quoted
-- @tparam "DoubleQuote"|"SingleQuote" quotetype type of quotes to be used
-- @tparam {Inline,..} content inline content
@@ -502,7 +501,7 @@ M.Quoted = M.Inline:create_constructor(
function(quotetype, content) return {c = {quotetype, content}} end,
{"quotetype", "content"}
)
---- Creates a single-quoted inline element.
+--- Creates a single-quoted inline element (DEPRECATED).
-- @function SingleQuoted
-- @tparam {Inline,..} content inline content
-- @treturn Inline quoted element
@@ -512,7 +511,7 @@ M.SingleQuoted = M.Inline:create_constructor(
function(content) return M.Quoted(M.SingleQuote, content) end,
{"quotetype", "content"}
)
---- Creates a single-quoted inline element.
+--- Creates a single-quoted inline element (DEPRECATED).
-- @function DoubleQuoted
-- @tparam {Inline,..} content inline content
-- @treturn Inline quoted element
diff --git a/test/lua/hello-world-doc.lua b/test/lua/hello-world-doc.lua
index 221321a60..62236584e 100644
--- a/test/lua/hello-world-doc.lua
+++ b/test/lua/hello-world-doc.lua
@@ -1,10 +1,10 @@
return {
{
- Doc = function(doc)
+ Pandoc = function(doc)
local meta = {}
local hello = { pandoc.Str "Hello,", pandoc.Space(), pandoc.Str "World!" }
local blocks = { pandoc.Para(hello) }
- return pandoc.Doc(blocks, meta)
+ return pandoc.Pandoc(blocks, meta)
end
}
}
diff --git a/test/lua/implicit-doc-filter.lua b/test/lua/implicit-doc-filter.lua
index 320d22105..253462d1c 100644
--- a/test/lua/implicit-doc-filter.lua
+++ b/test/lua/implicit-doc-filter.lua
@@ -2,5 +2,5 @@ function Doc (doc)
local meta = {}
local hello = { pandoc.Str "Hello,", pandoc.Space(), pandoc.Str "World!" }
local blocks = { pandoc.Para(hello) }
- return pandoc.Doc(blocks, meta)
+ return pandoc.Pandoc(blocks, meta)
end