Skip to content

Commit cf96742

Browse files
committed
Merge branch 'master' of github.com:chrisaga/lua-filters
2 parents f3ede85 + f9167f8 commit cf96742

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3333
-287
lines changed

abstract-to-meta/Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
DIFF ?= diff --strip-trailing-cr -u
2+
PANDOC ?= pandoc
23

34
test: sample1.md sample2.md abstract-to-meta.lua
4-
@pandoc --lua-filter=abstract-to-meta.lua --standalone --to=markdown \
5+
@$(PANDOC) --lua-filter=abstract-to-meta.lua --standalone --to=markdown \
56
sample1.md | $(DIFF) expected1.md -
6-
@pandoc --lua-filter=abstract-to-meta.lua --standalone --to=markdown \
7+
@$(PANDOC) --lua-filter=abstract-to-meta.lua --standalone --to=markdown \
78
sample2.md | $(DIFF) expected2.md -
89

910
expected: sample1.md expected1.md sample2.md expected2.md abstract-to-meta.lua
1011

1112
expected1.md: sample1.md abstract-to-meta.lua
12-
pandoc --lua-filter=abstract-to-meta.lua --standalone --output $@ $<
13+
$(PANDOC) --lua-filter=abstract-to-meta.lua --standalone --output $@ $<
1314

1415
expected2.md: sample2.md abstract-to-meta.lua
15-
pandoc --lua-filter=abstract-to-meta.lua --standalone --output $@ $<
16+
$(PANDOC) --lua-filter=abstract-to-meta.lua --standalone --output $@ $<
1617

1718
.PHONY: test

author-info-blocks/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
DIFF ?= diff --strip-trailing-cr -u
2+
PANDOC ?= pandoc
23

34
test: sample.md author-info-blocks.lua
4-
@pandoc --lua-filter=author-info-blocks.lua --standalone --to=native $< \
5+
@$(PANDOC) --lua-filter=author-info-blocks.lua --standalone --to=native $< \
56
| $(DIFF) expected.native -
67

78
expected.native: sample.md author-info-blocks.lua
8-
@pandoc --lua-filter=author-info-blocks.lua --standalone --output $@ $<
9+
@$(PANDOC) --lua-filter=author-info-blocks.lua --standalone --output $@ $<
910

1011
sample.pdf: sample.md author-info-blocks.lua
11-
@pandoc \
12+
@$(PANDOC) \
1213
--lua-filter=author-info-blocks.lua \
1314
--output $@ $<
1415

author-info-blocks/expected.native

Lines changed: 95 additions & 5 deletions
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+
]

bibexport/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
DIFF ?= diff --strip-trailing-cr -u
2+
PANDOC ?= pandoc
23

34
test:
4-
@pandoc --lua-filter=bibexport.lua sample.md > /dev/null
5+
@$(PANDOC) --lua-filter=bibexport.lua sample.md > /dev/null
56
@$(DIFF) bibexport.aux expected.bibexport.aux
67
@$(DIFF) bibexport.bib expected.bibexport.bib
78
@rm -f bibexport.aux bibexport.bib

cito/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
DIFF ?= diff --strip-trailing-cr -u
2+
PANDOC ?= pandoc
23

34
test:
4-
@pandoc --lua-filter=cito.lua --output=output.md --standalone sample.md
5+
@$(PANDOC) --lua-filter=cito.lua --output=output.md --standalone sample.md
56
@$(DIFF) expected.md output.md
67
@rm -f output.md
78

diagram-generator/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
PANDOC ?= pandoc
2+
13
.PHONY: test
24
test: clean sample.html
35

46
sample.html: sample.md diagram-generator.lua
5-
@pandoc --self-contained \
7+
@$(PANDOC) --self-contained \
68
--lua-filter=diagram-generator.lua \
79
--metadata=pythonPath:"python3" \
810
--metadata=title:"README" \

diagram-generator/diagram-generator.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ PANDOC_VERSION:must_be_at_least '2.7.3'
1616

1717
local system = require 'pandoc.system'
1818
local utils = require 'pandoc.utils'
19-
local stringify = utils.stringify
19+
local stringify = function (s)
20+
return type(s) == 'string' and s or utils.stringify(s)
21+
end
2022
local with_temporary_directory = system.with_temporary_directory
2123
local with_working_directory = system.with_working_directory
2224

doi2cite/Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
DIFF ?= diff --strip-trailing-cr -u
2+
PANDOC ?= pandoc
23

34
test:
4-
@pandoc --lua-filter=doi2cite.lua --wrap=preserve --output=output.md sample1.md
5+
@$(PANDOC) --lua-filter=doi2cite.lua --wrap=preserve --output=output.md sample1.md
56
@$(DIFF) expected1.md output.md
67
@rm -f output.md
78

89
expected1.md: sample1.md doi2cite.lua
9-
pandoc --lua-filter=doi2cite.lua --wrap=preserve --output $@ $<
10+
$(PANDOC) --lua-filter=doi2cite.lua --wrap=preserve --output $@ $<
1011

1112
expected1.pdf: sample1.md sample1.csl doi2cite.lua
12-
pandoc --lua-filter=doi2cite.lua --filter=pandoc-crossref --citeproc --csl=sample1.csl --output $@ $<
13+
$(PANDOC) --lua-filter=doi2cite.lua --filter=pandoc-crossref --citeproc --csl=sample1.csl --output $@ $<
1314

1415
expected2.md: sample2.md doi2cite.lua
15-
pandoc --lua-filter=doi2cite.lua --wrap=preserve --output $@ $<
16+
$(PANDOC) --lua-filter=doi2cite.lua --wrap=preserve --output $@ $<
1617

1718
clean:
1819
@rm -f expected1.md

first-line-indent/Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
DIFF ?= diff --strip-trailing-cr -u
2+
PANDOC ?= pandoc
23

34
.PHONY: test
45

56
test: test_latex test_html
67

78
test_html: sample.md expected.html first-line-indent.lua
8-
@pandoc -s --lua-filter first-line-indent.lua --to=html $< \
9+
@$(PANDOC) -s --lua-filter first-line-indent.lua --to=html $< \
910
| $(DIFF) expected.html -
1011

1112
test_latex: sample.md expected.tex first-line-indent.lua
12-
@pandoc -s --lua-filter first-line-indent.lua --to=latex $< \
13+
@$(PANDOC) -s --lua-filter first-line-indent.lua --to=latex $< \
1314
| $(DIFF) expected.tex -
1415

1516
expected.html: sample.md first-line-indent.lua
16-
pandoc -s --lua-filter first-line-indent.lua --output $@ $<
17+
$(PANDOC) -s --lua-filter first-line-indent.lua --output $@ $<
1718

1819
expected.tex: sample.md first-line-indent.lua
19-
pandoc -s --lua-filter first-line-indent.lua --output $@ $<
20+
$(PANDOC) -s --lua-filter first-line-indent.lua --output $@ $<

first-line-indent/expected.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
padding-top: 50px;
2222
padding-bottom: 50px;
2323
hyphens: auto;
24-
word-wrap: break-word;
24+
overflow-wrap: break-word;
2525
text-rendering: optimizeLegibility;
2626
font-kerning: normal;
2727
}
@@ -92,6 +92,7 @@
9292
pre code {
9393
padding: 0;
9494
overflow: visible;
95+
overflow-wrap: normal;
9596
}
9697
.sourceCode {
9798
background-color: transparent;

0 commit comments

Comments
 (0)