Skip to content

Commit

Permalink
feat: fix merging conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
OrangeX4 committed Mar 15, 2024
1 parent 314dd2b commit f6903c6
Show file tree
Hide file tree
Showing 18 changed files with 85 additions and 45 deletions.
2 changes: 1 addition & 1 deletion examples/aqua-zh.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "../lib.typ": *

#let s = themes.aqua.register(s, aspect-ratio: "16-9", lang: "zh")
#let s = themes.aqua.register(aspect-ratio: "16-9", lang: "zh")

#let s = (s.methods.info)(
self: s,
Expand Down
2 changes: 1 addition & 1 deletion examples/aqua.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "../lib.typ": *

#let s = themes.aqua.register(s, aspect-ratio: "16-9")
#let s = themes.aqua.register(aspect-ratio: "16-9")

#let s = (s.methods.info)(
self: s,
Expand Down
1 change: 0 additions & 1 deletion examples/dewdrop.typ
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#import "../lib.typ": *

#let s = themes.dewdrop.register(
s,
aspect-ratio: "16-9",
footer: [Dewdrop],
navigation: "mini-slides",
Expand Down
2 changes: 1 addition & 1 deletion examples/example.typ
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// Register university theme
// You can remove the theme registration or replace other themes
// it can still work normally
#let s = themes.university.register(s, aspect-ratio: "16-9")
#let s = themes.university.register(aspect-ratio: "16-9")

// Global information configuration
#let s = (s.methods.info)(
Expand Down
2 changes: 1 addition & 1 deletion examples/metropolis.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "../lib.typ": *

#let s = themes.metropolis.register(s, aspect-ratio: "16-9", footer: self => self.info.institution)
#let s = themes.metropolis.register(aspect-ratio: "16-9", footer: self => self.info.institution)
#let s = (s.methods.info)(
self: s,
title: [Title],
Expand Down
2 changes: 1 addition & 1 deletion examples/simple.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "../lib.typ": *

#let s = themes.simple.register(s, aspect-ratio: "16-9", footer: [Simple slides])
#let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])
#let (init, slides) = utils.methods(s)
#show: init

Expand Down
7 changes: 4 additions & 3 deletions examples/slides.typ
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#import "../lib.typ": *

// #let s = themes.simple.register(s, aspect-ratio: "16-9", footer: [Simple slides])
// #let s = themes.metropolis.register(s, aspect-ratio: "16-9", footer: [Custom footer])
// #let s = themes.dewdrop.register(s, aspect-ratio: "16-9", footer: [Dewdrop])
#let s = themes.default.register(aspect-ratio: "16-9")
// #let s = themes.simple.register(aspect-ratio: "16-9", footer: [Simple slides])
// #let s = themes.metropolis.register(aspect-ratio: "16-9", footer: [Custom footer])
// #let s = themes.dewdrop.register(aspect-ratio: "16-9", footer: [Dewdrop])
#let s = (s.methods.info)(
self: s,
title: [Title],
Expand Down
2 changes: 1 addition & 1 deletion examples/university.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "../lib.typ": *

#let s = themes.university.register(s, aspect-ratio: "16-9")
#let s = themes.university.register(aspect-ratio: "16-9")
#let s = (s.methods.info)(
self: s,
title: [Title],
Expand Down
2 changes: 1 addition & 1 deletion lib.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "slide.typ": s, pause, meanwhile, slides-end, touying-equation, touying-reducer
#import "slide.typ": pause, meanwhile, slides-end, touying-equation, touying-reducer
#import "utils/utils.typ"
#import "utils/states.typ"
#import "utils/pdfpc.typ"
Expand Down
1 change: 1 addition & 0 deletions slide.typ
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@
author: none,
date: none,
institution: none,
logo: none,
),
// colors interface
colors: (
Expand Down
9 changes: 5 additions & 4 deletions themes/aqua.typ
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#import "../slide.typ": s
#import "../utils/utils.typ"
#import "../utils/states.typ"
#import "../utils/components.typ"

#let title-slide(self: none, ..args) = {
self = utils.empty-page(self)
self.page-args = self.page-args + (
self.page-args += (
margin: (top: 30%, left: 17%, right: 17%, bottom: 0%),
background: utils.call-or-display(self, self.aqua-background),
)
Expand Down Expand Up @@ -35,7 +36,7 @@

#let outline-slide(self: none, enum-args: (:), leading: 50pt) = {
self = utils.empty-page(self)
self.page-args = self.page-args + (
self.page-args += (
background: utils.call-or-display(self, self.aqua-background),
)
set text(size: 30pt, fill: self.colors.primary)
Expand Down Expand Up @@ -79,7 +80,7 @@

#let new-section-slide(self: none, section) = {
self = utils.empty-page(self)
self.page-args = self.page-args + (
self.page-args += (
margin: (left:0%, right:0%, top: 20%, bottom:0%),
background: utils.call-or-display(self, self.aqua-background),
)
Expand Down Expand Up @@ -134,9 +135,9 @@
}

#let register(
self: s,
aspect-ratio: "16-9",
lang: "en",
self,
) = {
assert(lang in ("zh", "en"), message: "lang must be 'zh' or 'en'")

Expand Down
9 changes: 9 additions & 0 deletions themes/default.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#import "../slide.typ": s

// export default self
#let register(self: s, aspect-ratio: "16-9") = {
self.page-args += (
paper: "presentation-" + aspect-ratio,
)
self
}
9 changes: 5 additions & 4 deletions themes/dewdrop.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This theme is inspired by https://github.com/zbowang/BeamerTheme
// The typst version was written by https://github.com/OrangeX4

#import "../slide.typ": s
#import "../utils/utils.typ"
#import "../utils/states.typ"

Expand All @@ -11,7 +12,7 @@
footer: auto,
..args,
) = {
self.page-args = self.page-args + (
self.page-args += (
fill: self.colors.neutral-lightest,
)
if footer != auto {
Expand Down Expand Up @@ -82,7 +83,7 @@

#let focus-slide(self: none, body) = {
self = utils.empty-page(self)
self.page-args = self.page-args + (
self.page-args += (
fill: self.colors.primary,
margin: 2em,
)
Expand Down Expand Up @@ -223,6 +224,7 @@
}

#let register(
self: s,
aspect-ratio: "16-9",
navigation: "sidebar",
sidebar: (width: 10em),
Expand All @@ -231,7 +233,6 @@
footer-right: states.slide-counter.display() + " / " + states.last-slide-number,
primary: rgb("#0c4842"),
alpha: 70%,
self,
) = {
assert(navigation in ("sidebar", "mini-slides", none), message: "navigation must be one of sidebar, mini-slides, none")
// color theme
Expand Down Expand Up @@ -268,7 +269,7 @@
h(1fr)
text(fill: self.colors.neutral-darkest.lighten(20%), utils.call-or-display(self, self.d-footer-right))
}
self.page-args = self.page-args + (
self.page-args += (
paper: "presentation-" + aspect-ratio,
fill: self.colors.neutral-lightest,
header: header,
Expand Down
9 changes: 5 additions & 4 deletions themes/metropolis.typ
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// #set strong(delta: 100)
// #set par(justify: true)

#import "../slide.typ": s
#import "../utils/utils.typ"
#import "../utils/states.typ"
#import "../utils/components.typ"
Expand All @@ -20,7 +21,7 @@
align: horizon,
..args,
) = {
self.page-args = self.page-args + (
self.page-args += (
fill: self.colors.neutral-lightest,
)
if title != auto {
Expand Down Expand Up @@ -92,7 +93,7 @@

#let focus-slide(self: none, body) = {
self = utils.empty-page(self)
self.page-args = self.page-args + (
self.page-args += (
fill: self.colors.primary-dark,
margin: 2em,
)
Expand All @@ -111,12 +112,12 @@
}

#let register(
self: s,
aspect-ratio: "16-9",
header: states.current-section-title,
footer: [],
footer-right: states.slide-counter.display() + " / " + states.last-slide-number,
footer-progress: true,
self,
) = {
// color theme
self = (self.methods.colors)(
Expand Down Expand Up @@ -160,7 +161,7 @@
place(bottom, block(height: 2pt, width: 100%, spacing: 0pt, utils.call-or-display(self, self.m-progress-bar)))
}
}
self.page-args = self.page-args + (
self.page-args += (
paper: "presentation-" + aspect-ratio,
header: header,
footer: footer,
Expand Down
5 changes: 3 additions & 2 deletions themes/simple.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This theme is from https://github.com/andreasKroepelin/polylux/blob/main/themes/simple.typ
// Author: Andreas Kröpelin

#import "../slide.typ": s
#import "../utils/utils.typ"
#import "../utils/states.typ"

Expand Down Expand Up @@ -40,13 +41,13 @@
}

#let register(
self: s,
aspect-ratio: "16-9",
footer: [],
footer-right: states.slide-counter.display() + " / " + states.last-slide-number,
background: rgb("#ffffff"),
foreground: rgb("#000000"),
primary: aqua.darken(50%),
self,
) = {
let deco-format(it) = text(size: .6em, fill: gray, it)
// color theme
Expand All @@ -67,7 +68,7 @@
deco-format(sections.last().title)
})
let footer(self) = deco-format(self.simple-footer + h(1fr) + self.simple-footer-right)
self.page-args = self.page-args + (
self.page-args += (
paper: "presentation-" + aspect-ratio,
fill: self.colors.neutral-lightest,
header: header,
Expand Down
1 change: 1 addition & 0 deletions themes/themes.typ
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#import "default.typ"
#import "simple.typ"
#import "metropolis.typ"
#import "dewdrop.typ"
Expand Down
Loading

0 comments on commit f6903c6

Please sign in to comment.