Skip to content

Commit aa95770

Browse files
committed
Typst writer: use quote for block quotes.
Remove custom definitiion of blockquote in default template.
1 parent d8b5541 commit aa95770

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

data/templates/definitions.typst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
// Some definitions presupposed by pandoc's typst output.
2-
#let blockquote(body) = [
3-
#set text( size: 0.92em )
4-
#block(inset: (left: 1.5em, top: 0.2em, bottom: 0.2em))[#body]
5-
]
6-
72
#let horizontalrule = [
83
#line(start: (25%,0%), end: (75%,0%))
94
]

src/Text/Pandoc/Writers/Typst.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ blockToTypst block =
124124
return $ contents <> blankline
125125
BlockQuote blocks -> do
126126
contents <- blocksToTypst blocks
127-
return $ "#blockquote[" $$ chomp contents $$ "]" $$ blankline
127+
return $ "#quote(block: true)[" $$ chomp contents $$ "]" $$ blankline
128128
HorizontalRule ->
129129
return $ blankline <> "#horizontalrule" <> blankline
130130
OrderedList attribs items -> do

test/writer.typst

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
// Some definitions presupposed by pandoc's typst output.
2-
#let blockquote(body) = [
3-
#set text( size: 0.92em )
4-
#block(inset: (left: 1.5em, top: 0.2em, bottom: 0.2em))[#body]
5-
]
6-
72
#let horizontalrule = [
83
#line(start: (25%,0%), end: (75%,0%))
94
]
@@ -151,11 +146,11 @@ here.
151146
<block-quotes>
152147
E-mail style:
153148

154-
#blockquote[
149+
#quote(block: true)[
155150
This is a block quote. It is pretty short.
156151
]
157152

158-
#blockquote[
153+
#quote(block: true)[
159154
Code in a block quote:
160155

161156
```
@@ -171,11 +166,11 @@ A list:
171166

172167
Nested block quotes:
173168

174-
#blockquote[
169+
#quote(block: true)[
175170
nested
176171
]
177172

178-
#blockquote[
173+
#quote(block: true)[
179174
nested
180175
]
181176
]
@@ -447,7 +442,7 @@ orange fruit
447442
{ orange code block }
448443
```
449444

450-
#blockquote[
445+
#quote(block: true)[
451446
orange block quote
452447
]
453448
]
@@ -763,7 +758,7 @@ With an ampersand: #link("http://example.com/?foo=1&bar=2")
763758

764759
An e-mail address: #link("mailto:[email protected]")[nobody\@nowhere.net]
765760

766-
#blockquote[
761+
#quote(block: true)[
767762
Blockquoted: #link("http://example.com/")
768763
]
769764

@@ -809,7 +804,7 @@ is #emph[easier] to type. Inline notes may contain
809804
#link("http://google.com")[links] and `]` verbatim characters, as well as
810805
\[bracketed text\].]
811806

812-
#blockquote[
807+
#quote(block: true)[
813808
Notes can go in quotes.#footnote[In quote.]
814809
]
815810

0 commit comments

Comments
 (0)