Skip to content

Commit cdaf98b

Browse files
feat: use zebraw 0.4.5 (#106)
1 parent 696c280 commit cdaf98b

File tree

3 files changed

+6
-619
lines changed

3 files changed

+6
-619
lines changed

contrib/typst/gh-pages.typ

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
is-pdf-target,
88
is-html-target,
99
plain-text,
10-
raw-support,
1110
shiroa-sys-target,
1211
templates,
1312
)
1413
#import templates: *
14+
#import "@preview/zebraw:0.4.5": zebraw-init, zebraw-html
1515

1616
// Metadata
1717
#let page-width = get-page-width()
@@ -139,11 +139,9 @@
139139
it => it
140140
}
141141

142-
let supports-raw = raw-support()
143-
144142
/// HTML code block supported by zebraw.
145143
show: if is-dark-theme {
146-
supports-raw.zebraw-init.with(
144+
zebraw-init.with(
147145
// should vary by theme
148146
background-color: if code-extra-colors.bg != none {
149147
(code-extra-colors.bg, code-extra-colors.bg)
@@ -154,14 +152,13 @@
154152
lang: false,
155153
)
156154
} else {
157-
supports-raw.zebraw-init.with(lang: false)
155+
zebraw-init.with(lang: false)
158156
}
159157

160158
// code block setting
161159
set raw(theme: theme-style.code-theme) if theme-style.code-theme.len() > 0
162-
show raw.where(block: false): set text(font: code-font)
160+
show raw: set text(font: code-font)
163161
show raw.where(block: true): it => context if shiroa-sys-target() == "paged" {
164-
set text(font: code-font)
165162
rect(
166163
width: 100%,
167164
inset: (x: 4pt, y: 5pt),
@@ -175,9 +172,9 @@
175172
],
176173
)
177174
} else {
178-
set text(font: code-font)
179175
set text(fill: code-extra-colors.fg) if code-extra-colors.fg != none
180-
supports-raw.zebraw-html(
176+
set par(justify: false)
177+
zebraw-html(
181178
block-width: 100%,
182179
line-width: 100%,
183180
wrap: false,

packages/shiroa/lib.typ

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131
// Part III: Supports
3232
#import "supports-link.typ" as link-support: cross-link
3333
#import "supports-text.typ" as text-support: plain-text
34-
// This is a vendored of zebraw-html, which is not the part of shiroa
35-
#let raw-support() = {
36-
import "supports-raw.typ"
37-
supports-raw
38-
}
3934
#import "media.typ"
4035
#import "utils.typ": get-book-meta, get-build-meta
4136

0 commit comments

Comments
 (0)