Skip to content

Commit

Permalink
adjust heading and details appearance (#43)
Browse files Browse the repository at this point in the history
Co-authored-by: megakite <[email protected]>
  • Loading branch information
Enter-tainer and megakite authored Sep 30, 2023
1 parent d6b5b48 commit e5fd73e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 21 deletions.
34 changes: 22 additions & 12 deletions oi-wiki-export-typst/oi-wiki-export.typ
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* END plugins */

/* BEGIN constants */
#let ROOT_EM = 10.5pt
#let ROOT_EM = 10pt
#let antiflash-white = (bright: cmyk(0%, 0%, 0%, 5%), dark: cmyk(0%, 0%, 0%, 20%))
/* END constants */

Expand Down Expand Up @@ -91,21 +91,26 @@
#set heading(numbering: "1.1")
#show heading: set block(spacing: 0em)
#show heading: set text(
font: ("New Computer Modern", "Noto Serif CJK SC"),
weight: 700,
font: ("New Computer Modern", "Noto Sans CJK SC"),
weight: 551,
)
#show heading.where(level: 1): set text(size: 36pt)
#show heading.where(level: 2): set text(size: 22pt)
#show heading.where(level: 3): set text(size: 18pt)
#show heading.where(level: 4): set text(size: 16pt)
#show heading.where(level: 5): set text(size: 14pt)
#show heading.where(level: 6): set text(size: 12pt)
#show heading.where(level: 1): set text(size: 25pt)
#show heading.where(level: 2): set text(size: 20pt)
#show heading.where(level: 3): set text(size: 17pt)
#show heading.where(level: 4): set text(size: 14pt)
#show heading.where(level: 5): set text(size: 12pt)
#show heading.where(level: 6): set text(size: 10pt)
#show heading: it => [
// #v(1fr, weak: true)
#v(1.8em)
#it
#v(.2em)
]
#show heading.where(level: 2): it => {
v(2em)
align(center)[#it]
v(2em)
}

#show emph: set text(
font: ("New Computer Modern", "LXGW Wenkai")
Expand All @@ -119,7 +124,7 @@
// NOTE: Default text size of raw block is 0.8rem
// So we scale it back a little (to ~9pt in body)
// issue: https://github.com/typst/typst/issues/1331
size: 1.071em,
size: 1.125em,
font: ("DejaVu Sans Mono", "LXGW Wenkai"),
)
#show raw.where(block: false): it => highlight(
Expand All @@ -138,8 +143,13 @@
#h(1fr)
]
)

#outline(indent: 2em)
#show outline.entry.where(
level: 1
): it => {
v(20pt, weak: true)
text(size: 14pt)[#strong(it)]
}
#outline(indent: auto)
/* END outline */

/* BEGIN main */
Expand Down
14 changes: 7 additions & 7 deletions oi-wiki-export-typst/oi-wiki.typ
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/* END plugins */

/* BEGIN constants */
#let ROOT_EM = 10.5pt
#let ROOT_EM = 10pt
#let VISIBLE_WIDTH = 21cm - 1in
#let VISIBLE_HEIGHT = 29.7cm - 1.5in
#let BLOCKQUOTE_CONTENT_WIDTH = VISIBLE_WIDTH - ROOT_EM * 2
Expand Down Expand Up @@ -87,9 +87,9 @@
code
) = {
let radius = if unwrapped {
(bottom: .5em)
(bottom: .1em)
} else {
.5em
.1em
}
let stroke = if unwrapped {
(
Expand Down Expand Up @@ -127,7 +127,7 @@
stroke: stroke,

{
set text(font: ("DejaVu Sans Mono", "LXGW Wenkai"), size: 0.8 * 1.071em, fill: antiflash-white.dark)
set text(font: ("DejaVu Sans Mono", "LXGW Wenkai"), size: 0.8 * 1.125em, fill: antiflash-white.dark)

for (i, line) in code.replace("\t", " ").split("\n").enumerate() {
box(width: 0pt, inset: (right: 2em), align(right, str(i + 1)))
Expand Down Expand Up @@ -156,9 +156,9 @@
// },
// inset: (x: 1em, y: .5em),
// radius: if not unwrapped {
// .5em
// .1em
// } else {
// (bottom: .5em)
// (bottom: .1em)
// }
// )
//
Expand Down Expand Up @@ -280,7 +280,7 @@
align(
center,
block(
radius: .5em,
radius: .1em,
inset: (x: .5em),
stroke: 1pt + antiflash-white.dark,
tablex(
Expand Down
4 changes: 2 additions & 2 deletions oi-wiki-export-typst/pymdownx-details.typ
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
),
below: 0em,
inset: (x: 1em, y: .5em),
radius: (top: .5em),
radius: (top: .1em),
)[
#show parbreak: []

Expand All @@ -87,7 +87,7 @@
),
above: 0em,
inset: (x: 1em, y: .5em),
radius: (bottom: .5em),
radius: (bottom: .1em),

items.at(1)
)
Expand Down

0 comments on commit e5fd73e

Please sign in to comment.