Skip to content

Commit 9d59a92

Browse files
committed
Update golden native files for pandoc 2.16.1
Pandoc's 'native' output changed.
1 parent c50addc commit 9d59a92

12 files changed

+3198
-183
lines changed

author-info-blocks/expected.native

+95-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,95 @@
1-
Pandoc (Meta {unMeta = fromList [("author",MetaInlines [Str "Jane",Space,Str "Doe",Superscript [Str "*",Str ",",Str "1",Str ",",Str "\9993"],Str ",",Space,Str "John",Space,Str "Q.",Space,Str "Doe",Superscript [Str "*",Str ",",Str "1",Str ",",Str "2"],Str ",",Space,Str "and",Space,Str "Juan",Space,Str "P\233rez",Superscript [Str "2"]]),("title",MetaInlines [Str "Affiliation",Space,Str "Blocks",Space,Str "Example"])]})
2-
[Para [Superscript [Str "*"],Space,Str "These authors contributed equally to this work."]
3-
,Para [Superscript [Str "1"],Space,Str "Federation",Space,Str "of",Space,Str "Planets",LineBreak,Superscript [Str "2"],Space,Str "Acme",Space,Str "Corporation"]
4-
,Para [Superscript [Str "\9993"],Space,Str "Correspondence:",Space,Link ("",[],[]) [Str "Jane",Space,Str "Doe",Space,Str "<",Str "[email protected]",Str ">"] ("mailto:[email protected]","")]
5-
,Para [Str "Lorem",Space,Str "ipsum",Space,Str "dolor",Space,Str "sit",Space,Str "amet."]]
1+
Pandoc
2+
Meta
3+
{ unMeta =
4+
fromList
5+
[ ( "author"
6+
, MetaInlines
7+
[ Str "Jane"
8+
, Space
9+
, Str "Doe"
10+
, Superscript
11+
[ Str "*"
12+
, Str ","
13+
, Str "1"
14+
, Str ","
15+
, Str "\9993"
16+
]
17+
, Str ","
18+
, Space
19+
, Str "John"
20+
, Space
21+
, Str "Q."
22+
, Space
23+
, Str "Doe"
24+
, Superscript
25+
[ Str "*" , Str "," , Str "1" , Str "," , Str "2" ]
26+
, Str ","
27+
, Space
28+
, Str "and"
29+
, Space
30+
, Str "Juan"
31+
, Space
32+
, Str "P\233rez"
33+
, Superscript [ Str "2" ]
34+
]
35+
)
36+
, ( "title"
37+
, MetaInlines
38+
[ Str "Affiliation"
39+
, Space
40+
, Str "Blocks"
41+
, Space
42+
, Str "Example"
43+
]
44+
)
45+
]
46+
}
47+
[ Para
48+
[ Superscript [ Str "*" ]
49+
, Space
50+
, Str "These authors contributed equally to this work."
51+
]
52+
, Para
53+
[ Superscript [ Str "1" ]
54+
, Space
55+
, Str "Federation"
56+
, Space
57+
, Str "of"
58+
, Space
59+
, Str "Planets"
60+
, LineBreak
61+
, Superscript [ Str "2" ]
62+
, Space
63+
, Str "Acme"
64+
, Space
65+
, Str "Corporation"
66+
]
67+
, Para
68+
[ Superscript [ Str "\9993" ]
69+
, Space
70+
, Str "Correspondence:"
71+
, Space
72+
, Link
73+
( "" , [] , [] )
74+
[ Str "Jane"
75+
, Space
76+
, Str "Doe"
77+
, Space
78+
, Str "<"
79+
80+
, Str ">"
81+
]
82+
( "mailto:[email protected]" , "" )
83+
]
84+
, Para
85+
[ Str "Lorem"
86+
, Space
87+
, Str "ipsum"
88+
, Space
89+
, Str "dolor"
90+
, Space
91+
, Str "sit"
92+
, Space
93+
, Str "amet."
94+
]
95+
]

include-code-files/expected.native

+60-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,60 @@
1-
[Header 1 ("inclusion",[],[]) [Str "Inclusion"]
2-
,CodeBlock ("",["lua","numberLines"],[]) "--- include-code-files.lua \8211 filter to include code from source files\n---\n--- Copyright: \169 2020 Bruno BEAUFILS\n--- License: MIT \8211 see LICENSE file for details\n\n--- Dedent a line\nlocal function dedent (line, n)\n return line:sub(1,n):gsub(\" \",\"\") .. line:sub(n+1)\nend\n\n--- Filter function for code blocks\nlocal function transclude (cb)\n if cb.attributes.include then\n local content = \"\"\n local fh = io.open(cb.attributes.include)\n if not fh then\n io.stderr:write(\"Cannot open file \" .. cb.attributes.include .. \" | Skipping includes\\n\")\n else\n local number = 1\n local start = 1\n\n -- change hyphenated attributes to PascalCase\n for i,pascal in pairs({\"startLine\", \"endLine\"})\n do\n local hyphen = pascal:gsub(\"%u\", \"-%0\"):lower()\n if cb.attributes[hyphen] then\n cb.attributes[pascal] = cb.attributes[hyphen]\n cb.attributes[hyphen] = nil\n end\n end\n\n if cb.attributes.startLine then\n cb.attributes.startFrom = cb.attributes.startLine\n start = tonumber(cb.attributes.startLine)\n end\n for line in fh:lines (\"L\")\n do\n if cb.attributes.dedent then\n line = dedent(line, cb.attributes.dedent)\n end\n if number >= start then\n if not cb.attributes.endLine or number <= tonumber(cb.attributes.endLine) then\n content = content .. line\n end\n end\n number = number + 1\n end \n fh:close()\n end \n -- remove key-value pair for used keys\n cb.attributes.include = nil\n cb.attributes.startLine = nil\n cb.attributes.endLine = nil\n cb.attributes.dedent = nil\n -- return final code block\n return pandoc.CodeBlock(content, cb.attr)\n end\nend\n\nreturn {\n { CodeBlock = transclude }\n}\n"
3-
,Header 1 ("ranges",[],[]) [Str "Ranges"]
4-
,CodeBlock ("",["lua","numberLines"],[("startFrom","7")]) "local function dedent (line, n)\n return line:sub(1,n):gsub(\" \",\"\") .. line:sub(n+1)\nend\n"
5-
,CodeBlock ("",["lua","numberLines"],[("startFrom","7")]) "local function dedent (line, n)\n return line:sub(1,n):gsub(\" \",\"\") .. line:sub(n+1)\nend\n"
6-
,Header 1 ("detent",[],[]) [Str "Detent"]
7-
,Para [Code ("",[],[]) "detent",Space,Str "removes",Space,Str "specified",Space,Str "number",Space,Str "of",Space,Str "whitespaces",Space,Str "(and",Space,Str "only",SoftBreak,Str "whitespaces)",Space,Str "from",Space,Str "beginning",Space,Str "of",Space,Str "each",Space,Str "line"]
8-
,CodeBlock ("",["lua","bash","numberLines"],[("startFrom","8")]) "return line:sub(1,n):gsub(\" \",\"\") .. line:sub(n+1)\n"
9-
,CodeBlock ("",["lua","numberLines"],[("startFrom","61")]) "{CodeBlock = transclude }\n"]
1+
[ Header 1 ( "inclusion" , [] , [] ) [ Str "Inclusion" ]
2+
, CodeBlock
3+
( "" , [ "lua" , "numberLines" ] , [] )
4+
"--- include-code-files.lua \8211 filter to include code from source files\n---\n--- Copyright: \169 2020 Bruno BEAUFILS\n--- License: MIT \8211 see LICENSE file for details\n\n--- Dedent a line\nlocal function dedent (line, n)\n return line:sub(1,n):gsub(\" \",\"\") .. line:sub(n+1)\nend\n\n--- Filter function for code blocks\nlocal function transclude (cb)\n if cb.attributes.include then\n local content = \"\"\n local fh = io.open(cb.attributes.include)\n if not fh then\n io.stderr:write(\"Cannot open file \" .. cb.attributes.include .. \" | Skipping includes\\n\")\n else\n local number = 1\n local start = 1\n\n -- change hyphenated attributes to PascalCase\n for i,pascal in pairs({\"startLine\", \"endLine\"})\n do\n local hyphen = pascal:gsub(\"%u\", \"-%0\"):lower()\n if cb.attributes[hyphen] then\n cb.attributes[pascal] = cb.attributes[hyphen]\n cb.attributes[hyphen] = nil\n end\n end\n\n if cb.attributes.startLine then\n cb.attributes.startFrom = cb.attributes.startLine\n start = tonumber(cb.attributes.startLine)\n end\n for line in fh:lines (\"L\")\n do\n if cb.attributes.dedent then\n line = dedent(line, cb.attributes.dedent)\n end\n if number >= start then\n if not cb.attributes.endLine or number <= tonumber(cb.attributes.endLine) then\n content = content .. line\n end\n end\n number = number + 1\n end \n fh:close()\n end \n -- remove key-value pair for used keys\n cb.attributes.include = nil\n cb.attributes.startLine = nil\n cb.attributes.endLine = nil\n cb.attributes.dedent = nil\n -- return final code block\n return pandoc.CodeBlock(content, cb.attr)\n end\nend\n\nreturn {\n { CodeBlock = transclude }\n}\n"
5+
, Header 1 ( "ranges" , [] , [] ) [ Str "Ranges" ]
6+
, CodeBlock
7+
( ""
8+
, [ "lua" , "numberLines" ]
9+
, [ ( "startFrom" , "7" ) ]
10+
)
11+
"local function dedent (line, n)\n return line:sub(1,n):gsub(\" \",\"\") .. line:sub(n+1)\nend\n"
12+
, CodeBlock
13+
( ""
14+
, [ "lua" , "numberLines" ]
15+
, [ ( "startFrom" , "7" ) ]
16+
)
17+
"local function dedent (line, n)\n return line:sub(1,n):gsub(\" \",\"\") .. line:sub(n+1)\nend\n"
18+
, Header 1 ( "detent" , [] , [] ) [ Str "Detent" ]
19+
, Para
20+
[ Code ( "" , [] , [] ) "detent"
21+
, Space
22+
, Str "removes"
23+
, Space
24+
, Str "specified"
25+
, Space
26+
, Str "number"
27+
, Space
28+
, Str "of"
29+
, Space
30+
, Str "whitespaces"
31+
, Space
32+
, Str "(and"
33+
, Space
34+
, Str "only"
35+
, SoftBreak
36+
, Str "whitespaces)"
37+
, Space
38+
, Str "from"
39+
, Space
40+
, Str "beginning"
41+
, Space
42+
, Str "of"
43+
, Space
44+
, Str "each"
45+
, Space
46+
, Str "line"
47+
]
48+
, CodeBlock
49+
( ""
50+
, [ "lua" , "bash" , "numberLines" ]
51+
, [ ( "startFrom" , "8" ) ]
52+
)
53+
"return line:sub(1,n):gsub(\" \",\"\") .. line:sub(n+1)\n"
54+
, CodeBlock
55+
( ""
56+
, [ "lua" , "numberLines" ]
57+
, [ ( "startFrom" , "61" ) ]
58+
)
59+
"{CodeBlock = transclude }\n"
60+
]

include-files/expected-auto.native

+173-30
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,173 @@
1-
[Header 1 ("section-1",[],[]) [Str "Section",Space,Str "1"]
2-
,Para [Str "Thanks",Space,Str "everyone!"]
3-
,Header 2 ("title-of-file-a",[],[]) [Str "Title",Space,Str "of",Space,Str "file-a"]
4-
,Para [Str "This",Space,Str "is",Space,Code ("",[],[]) "file-a.md",Str "."]
5-
,Header 2 ("file-b",[],[]) [Str "File",Space,Str "b"]
6-
,Para [Str "This",Space,Str "is",Space,Code ("",[],[]) "file-b.md",Str "."]
7-
,Para [Str "It",Space,Str "has",Space,Str "two",Space,Str "paragraphs",Space,Str "and",Space,Str "a",Space,Str "header."]
8-
,Header 1 ("different-format",[],[]) [Str "Different",Space,Str "format"]
9-
,Header 2 ("org-header",[],[]) [Str "Org",Space,Str "header"]
10-
,Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str "."]
11-
,Header 1 ("recursive-transclusion",[],[]) [Str "Recursive",Space,Str "transclusion"]
12-
,Header 2 ("title-f",[],[]) [Str "Title",Space,Str "f"]
13-
,Para [Str "This",Space,Str "is",Space,Code ("",[],[]) "file-f.md",Str "."]
14-
,Header 3 ("subtitle-f",[],[]) [Str "Subtitle",Space,Str "f"]
15-
,Header 4 ("title-of-file-a",[],[]) [Str "Title",Space,Str "of",Space,Str "file-a"]
16-
,Para [Str "This",Space,Str "is",Space,Code ("",[],[]) "file-a.md",Str "."]
17-
,Header 3 ("title-of-file-a",[],[]) [Str "Title",Space,Str "of",Space,Str "file-a"]
18-
,Para [Str "This",Space,Str "is",Space,Code ("",[],[]) "file-a.md",Str "."]
19-
,Header 1 ("subdirectories",[],[]) [Str "Subdirectories"]
20-
,Header 2 ("image-include",[],[]) [Str "Image",Space,Str "include"]
21-
,Para [Str "Image",Space,Str "relative",Space,Str "path",Space,Str "will",Space,Str "be",Space,Str "updated."]
22-
,Para [Image ("",[],[]) [Str "Image",Space,Str "title"] ("subdir/someimage.png","fig:")]
23-
,Header 2 ("source-include",[],[]) [Str "Source",Space,Str "include"]
24-
,Para [Str "File",Space,Str "inclusion",Space,Str "codeblocks",Space,Str "for",Space,Str "use",Space,Str "with",Space,Str "include-code-files",Space,Str "will",Space,Str "be",SoftBreak,Str "updated",Space,Str "too."]
25-
,CodeBlock ("",["c"],[("include","subdir/somecode.c")]) ""
26-
,Header 1 ("appendix",[],[]) [Str "Appendix"]
27-
,Para [Str "More",Space,Str "info",Space,Str "goes",Space,Str "here."]
28-
,Header 2 ("questionaire",[],[]) [Str "Questionaire"]
29-
,BulletList
30-
[[Plain [Str "Is",Space,Str "this",Space,Str "good?"]]]]
1+
[ Header
2+
1
3+
( "section-1" , [] , [] )
4+
[ Str "Section" , Space , Str "1" ]
5+
, Para [ Str "Thanks" , Space , Str "everyone!" ]
6+
, Header
7+
2
8+
( "title-of-file-a" , [] , [] )
9+
[ Str "Title" , Space , Str "of" , Space , Str "file-a" ]
10+
, Para
11+
[ Str "This"
12+
, Space
13+
, Str "is"
14+
, Space
15+
, Code ( "" , [] , [] ) "file-a.md"
16+
, Str "."
17+
]
18+
, Header
19+
2 ( "file-b" , [] , [] ) [ Str "File" , Space , Str "b" ]
20+
, Para
21+
[ Str "This"
22+
, Space
23+
, Str "is"
24+
, Space
25+
, Code ( "" , [] , [] ) "file-b.md"
26+
, Str "."
27+
]
28+
, Para
29+
[ Str "It"
30+
, Space
31+
, Str "has"
32+
, Space
33+
, Str "two"
34+
, Space
35+
, Str "paragraphs"
36+
, Space
37+
, Str "and"
38+
, Space
39+
, Str "a"
40+
, Space
41+
, Str "header."
42+
]
43+
, Header
44+
1
45+
( "different-format" , [] , [] )
46+
[ Str "Different" , Space , Str "format" ]
47+
, Header
48+
2
49+
( "org-header" , [] , [] )
50+
[ Str "Org" , Space , Str "header" ]
51+
, Para
52+
[ Str "This"
53+
, Space
54+
, Str "is"
55+
, Space
56+
, Emph [ Str "emphasized" ]
57+
, Str "."
58+
]
59+
, Header
60+
1
61+
( "recursive-transclusion" , [] , [] )
62+
[ Str "Recursive" , Space , Str "transclusion" ]
63+
, Header
64+
2 ( "title-f" , [] , [] ) [ Str "Title" , Space , Str "f" ]
65+
, Para
66+
[ Str "This"
67+
, Space
68+
, Str "is"
69+
, Space
70+
, Code ( "" , [] , [] ) "file-f.md"
71+
, Str "."
72+
]
73+
, Header
74+
3
75+
( "subtitle-f" , [] , [] )
76+
[ Str "Subtitle" , Space , Str "f" ]
77+
, Header
78+
4
79+
( "title-of-file-a" , [] , [] )
80+
[ Str "Title" , Space , Str "of" , Space , Str "file-a" ]
81+
, Para
82+
[ Str "This"
83+
, Space
84+
, Str "is"
85+
, Space
86+
, Code ( "" , [] , [] ) "file-a.md"
87+
, Str "."
88+
]
89+
, Header
90+
3
91+
( "title-of-file-a" , [] , [] )
92+
[ Str "Title" , Space , Str "of" , Space , Str "file-a" ]
93+
, Para
94+
[ Str "This"
95+
, Space
96+
, Str "is"
97+
, Space
98+
, Code ( "" , [] , [] ) "file-a.md"
99+
, Str "."
100+
]
101+
, Header
102+
1 ( "subdirectories" , [] , [] ) [ Str "Subdirectories" ]
103+
, Header
104+
2
105+
( "image-include" , [] , [] )
106+
[ Str "Image" , Space , Str "include" ]
107+
, Para
108+
[ Str "Image"
109+
, Space
110+
, Str "relative"
111+
, Space
112+
, Str "path"
113+
, Space
114+
, Str "will"
115+
, Space
116+
, Str "be"
117+
, Space
118+
, Str "updated."
119+
]
120+
, Para
121+
[ Image
122+
( "" , [] , [] )
123+
[ Str "Image" , Space , Str "title" ]
124+
( "subdir/someimage.png" , "fig:" )
125+
]
126+
, Header
127+
2
128+
( "source-include" , [] , [] )
129+
[ Str "Source" , Space , Str "include" ]
130+
, Para
131+
[ Str "File"
132+
, Space
133+
, Str "inclusion"
134+
, Space
135+
, Str "codeblocks"
136+
, Space
137+
, Str "for"
138+
, Space
139+
, Str "use"
140+
, Space
141+
, Str "with"
142+
, Space
143+
, Str "include-code-files"
144+
, Space
145+
, Str "will"
146+
, Space
147+
, Str "be"
148+
, SoftBreak
149+
, Str "updated"
150+
, Space
151+
, Str "too."
152+
]
153+
, CodeBlock
154+
( "" , [ "c" ] , [ ( "include" , "subdir/somecode.c" ) ] )
155+
""
156+
, Header 1 ( "appendix" , [] , [] ) [ Str "Appendix" ]
157+
, Para
158+
[ Str "More"
159+
, Space
160+
, Str "info"
161+
, Space
162+
, Str "goes"
163+
, Space
164+
, Str "here."
165+
]
166+
, Header
167+
2 ( "questionaire" , [] , [] ) [ Str "Questionaire" ]
168+
, BulletList
169+
[ [ Plain
170+
[ Str "Is" , Space , Str "this" , Space , Str "good?" ]
171+
]
172+
]
173+
]

0 commit comments

Comments
 (0)