Skip to content

Commit

Permalink
zebra style code block
Browse files Browse the repository at this point in the history
  • Loading branch information
Enter-tainer committed Dec 21, 2024
1 parent 11c688a commit a5bceb7
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions oi-wiki-export-typst/oi-wiki.typ
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,25 @@
#import "@preview/tablex:0.0.8": tablex
#import "@preview/tiaoma:0.2.0"
#import "@preview/mitex:0.2.4": mi, mitex
#import "@preview/codly:1.1.1": *
#import "@preview/codly-languages:0.1.1": *
#let sourcecode(body, highlight_color: rgb("#fffd11a1").lighten(70%)) = {
let rlines = ()
show raw.where(block: true): it => {
set par(justify: false)
block(
fill: luma(245),
stroke: 1pt + luma(245),
inset: (top: 4pt, bottom: 4pt),
radius: 4pt,
width: 100%,
stack(
..it.lines.map(raw_line => block(
inset: 3pt,
width: 100%,
fill: if rlines.contains(raw_line.number) {
highlight_color
stroke: none,
fill: if calc.rem(raw_line.number, 2) == 0 {
luma(100%)
} else {
none
},
Expand Down Expand Up @@ -151,7 +155,14 @@
set text(9pt)
set par(leading: .5em)

grid(columns: (1fr, 1cm, 1fr, 1cm, 1fr, 1cm), rows: 1cm, column-gutter: .2cm, row-gutter: .2cm, ..content)
grid(columns: (
1fr,
1cm,
1fr,
1cm,
1fr,
1cm,
), rows: 1cm, column-gutter: .2cm, row-gutter: .2cm, ..content)
}
#let links-cell(content) = block(
width: 100%,
Expand Down

0 comments on commit a5bceb7

Please sign in to comment.