Skip to content

Commit

Permalink
chore: bump version to 0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
OrangeX4 committed Mar 7, 2024
1 parent 03da481 commit e7aa185
Show file tree
Hide file tree
Showing 38 changed files with 125 additions and 100 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Before you begin, make sure you have installed the Typst environment. If not, yo
To use Touying, you only need to include the following code in your document:

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#let s = themes.simple.register(s)
#let (init, slides) = utils.methods(s)
Expand All @@ -92,13 +92,15 @@ Hello, Typst!

It's simple. Congratulations on creating your first Touying slide! 🎉

**Warning:** The comma in `#let (slide,) = utils.slides(s)` is necessary for the unpacking syntax.


## More Complex Examples

In fact, Touying provides various styles for writing slides. For example, the above example uses first-level and second-level titles to create new slides. However, you can also use the `#slide[..]` format to access more powerful features provided by Touying.

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#import "@preview/cetz:0.2.1"
#import "@preview/fletcher:0.4.2" as fletcher: node, edge
Expand Down
14 changes: 7 additions & 7 deletions docs/docs/build-your-own-theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sidebar_position: 10
如果只是你自己使用,你可以直接导入 Touying:

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
```

如果你希望这个主题作为 Touying 的一部分,放置在 Touying `themes` 目录下,那你应该将上面的导入语句改为
Expand All @@ -52,7 +52,7 @@ sidebar_position: 10

```typst
// bamboo.typ
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#let register(
aspect-ratio: "16-9",
Expand All @@ -69,7 +69,7 @@ sidebar_position: 10
}
// main.typ
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#import "bamboo.typ"
#let s = bamboo.register(s, aspect-ratio: "16-9")
Expand Down Expand Up @@ -176,7 +176,7 @@ self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)

```typst
// bamboo.typ
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#let slide(self: none, title: auto, ..args) = {
if title != auto {
Expand Down Expand Up @@ -238,7 +238,7 @@ self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)
// main.typ
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#import "bamboo.typ"
#let s = bamboo.register(s, aspect-ratio: "16-9", footer: self => self.info.institution)
Expand Down Expand Up @@ -276,7 +276,7 @@ self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)

```
// bamboo.typ
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#let slide(self: none, title: auto, ..args) = {
if title != auto {
Expand Down Expand Up @@ -393,7 +393,7 @@ self.methods.alert = (self: none, it) => text(fill: self.colors.primary, it)
// main.typ
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#import "bamboo.typ"
#let s = bamboo.register(s, aspect-ratio: "16-9", footer: self => self.info.institution)
Expand Down
7 changes: 7 additions & 0 deletions docs/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ sidebar_position: 14

# Changelog

## v0.3.1

- fix some typos
- fix slide-level bug
- fix bug of pdfpc label


## v0.3.0

### Features
Expand Down
10 changes: 5 additions & 5 deletions docs/docs/code-styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sidebar_position: 4
如果我们只是需要简单使用,我们可以直接在标题下输入内容,就像是在编写正常 Typst 文档一样。这里的标题有着分割页面的作用,同时我们也能正常地使用 `#pause` 等命令实现动画效果。

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#let s = themes.simple.register(s)
#let (init, slides) = utils.methods(s)
Expand Down Expand Up @@ -43,7 +43,7 @@ PS:我们可以使用 `#slides-end` 记号来标志 `#show: slides` 的结束
例如上面的例子就可以改造成

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#let s = themes.simple.register(s)
#let (init, slides) = utils.methods(s)
Expand Down Expand Up @@ -80,7 +80,7 @@ PS:我们可以使用 `#slides-end` 记号来标志 `#show: slides` 的结束
如果我们不希望它自动创建这样一个 section slide,我们可以将这个方法删除:

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#let s = themes.simple.register(s)
#(s.methods.touying-new-section-slide = none)
Expand Down Expand Up @@ -108,7 +108,7 @@ Hello, Typst!
同理,我们也可以注册一个新的 section slide:

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#let s = themes.simple.register(s)
#(s.methods.touying-new-section-slide = (self: none, section, ..args) => {
Expand Down Expand Up @@ -149,7 +149,7 @@ Hello, Typst!
实际上,你也可以不使用 `#show: slides``utils.slides(s)`,而是只使用 `utils.methods(s)`,例如

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#let s = themes.simple.register(s)
#let (init, touying-outline, slide) = utils.methods(s)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/dynamic/other.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Touying also provides `touying-reducer`, which adds `pause` and `meanwhile` anim
Here's an example:

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#import "@preview/cetz:0.2.1"
#import "@preview/fletcher:0.4.2" as fletcher: node, edge
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/external/pdfpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ typst query --root . ./example.typ --field value --one "<pdfpc-file>" > ./exampl
With the compatibility of Touying and Polylux, you can make Polylux also support direct export by adding the following code:

```typst
#import "@preview/touying:0.3.0"
#import "@preview/touying:0.3.1"
#locate(loc => touying.pdfpc.pdfpc-file(loc))
```
2 changes: 1 addition & 1 deletion docs/docs/global-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Title is #s.info.title
一般而言,上面的两种方式就已经足够用于加入全局设置了,但是仍然会有部分情况,我们需要初始化 counters 或 states。如果将这些代码放在 `#show: slides` 之前,就会创建一个空白页,这是我们不想看见的,因此这时候我们就可以使用 `s.methods.append-preamble` 方法。例如在使用 codly 包的时候:

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#import "@preview/codly:0.2.0": *
#let s = themes.simple.register(s, aspect-ratio: "16-9")
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/integration/cetz.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Touying 提供了 `touying-reducer`,它能为 cetz 与 fletcher 加入 `pause`
一个例子:

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#import "@preview/cetz:0.2.1"
#import "@preview/fletcher:0.4.2" as fletcher: node, edge
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/integration/codly.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_position: 4
在使用 codly 的时候,我们应该使用 `s.methods.append-preamble` 方法进行初始化。

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#import "@preview/codly:0.2.0": *
#let s = themes.simple.register(s, aspect-ratio: "16-9")
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/integration/fletcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Touying 提供了 `touying-reducer`,它能为 fletcher 加入 `pause` 和 `mea
一个例子:

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#import "@preview/cetz:0.2.1"
#import "@preview/fletcher:0.4.2" as fletcher: node, edge
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/integration/pinit.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ A simple #pin(1)highlighted text#pin(2).
一个与 Touying 共同使用的示例:

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#import "@preview/pinit:0.1.3": *
#(s.page-args.paper = "presentation-4-3")
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/integration/polylux.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_position: 5
借助 Touying 与 Polylux 的兼容性,你可以让 Polylux 也支持直接导出,只需要在你的 Polylux 源代码中加入下面的代码即可。

```
#import "@preview/touying:0.3.0"
#import "@preview/touying:0.3.1"
#locate(loc => touying.pdfpc.pdfpc-file(loc))
```
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ sidebar_position: 5
例如,我们决定给 metropolis 主题加入 GitHub 的图标,我们可以这样实现:

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#import "@preview/octique:0.1.0": *
#let s = themes.metropolis.register(s, aspect-ratio: "16-9")
Expand Down
31 changes: 15 additions & 16 deletions docs/docs/sections.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
sidebar_position: 3
---

# 节与小节
# Sections and Subsections

## 结构
## Structure

Beamer 相同,Touying 同样有着 section 和 subsection 的概念。
Similar to Beamer, Touying also has the concept of sections and subsections.

一般而言,1 级、2 级和 3 级标题分别用来对应 sectionsubsection title,例如 dewdrop 主题。
Generally, level 1, level 2, and level 3 headings correspond to section, subsection, and title, respectively, as in the dewdrop theme.

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#let s = themes.dewdrop.register(s)
#let (init, slides) = utils.methods(s)
Expand All @@ -31,10 +31,10 @@ Hello, Touying!

![image](https://github.com/touying-typ/touying/assets/34951714/1574e74d-25c1-418f-a84f-b974f42edae5)

但是很多时候我们并不需要 subsection,因此也会使用 1 级和 2 级标题来分别对应 section title,例如 university 主题。
However, often we don't need subsections, and we can use level 1 and level 2 headings to correspond to section and title, as in the university theme.

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#let s = themes.university.register(s)
#let (init, slides) = utils.methods(s)
Expand All @@ -52,15 +52,14 @@ Hello, Touying!

![image](https://github.com/touying-typ/touying/assets/34951714/9dd77c98-9c08-4811-872e-092bbdebf394)

实际上,我们可以通过 `slides` 函数的 `slide-level` 参数来控制这里的行为。`slide-level` 代表着嵌套结构的复杂度,从 0 开始计算。例如 `#show: slides.with(slide-level: 2)` 等价于 `section``subsection``title` 结构;而 `#show: slides.with(slide-level: 1)` 等价于 `section``title` 结构。
In fact, we can control this behavior through the `slide-level` parameter of the `slides` function. `slide-level` represents the complexity of the nested structure, starting from 0. For example, `#show: slides.with(slide-level: 2)` is equivalent to the section, subsection, and title structure; while `#show: slides.with(slide-level: 1)` is equivalent to the section and title structure.

## Table of Contents

## 目录

在 Touying 中显示目录很简单:
Displaying a table of contents in Touying is straightforward:

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#let (init, slides, alert, touying-outline) = utils.methods(s)
#show: init
Expand All @@ -81,18 +80,18 @@ Hello, Touying!

![image](https://github.com/touying-typ/touying/assets/34951714/3cc09550-d3cc-40c2-a315-22ca8173798f)

其中 `touying-oultine()` 的定义为:
Where the definition of `touying-outline()` is:

```typst
#let touying-outline(enum-args: (:), padding: 0pt) = { .. }
```

你可以通过 `enum-args` 修改内部 enum 的参数。
You can modify the parameters of the internal enum through `enum-args`.

如果你对目录有着复杂的自定义需求,你可以使用
If you have complex custom requirements for the table of contents, you can use:

```typst
#states.touying-final-sections(sections => ..)
```

正如 dewdrop 主题所做的那样。
As done in the dewdrop theme.
30 changes: 20 additions & 10 deletions docs/docs/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
sidebar_position: 2
---

# 开始
# Getting Started

在开始之前,请确保您已经安装了 Typst 环境,如果没有,可以使用 [Web App](https://typst.app/) 或 VS Code 的 [Typst LSP](https://marketplace.visualstudio.com/items?itemName=nvarner.typst-lsp) [Typst Preview](https://marketplace.visualstudio.com/items?itemName=mgt19937.typst-preview) 插件。
Before you begin, make sure you have the Typst environment installed. If not, you can use the [Web App](https://typst.app/) or install the [Typst LSP](https://marketplace.visualstudio.com/items?itemName=nvarner.typst-lsp) and [Typst Preview](https://marketplace.visualstudio.com/items?itemName=mgt19937.typst-preview) plugins for VS Code.

要使用 Touying,您只需要在文档里加入
To use Touying, you just need to include the following in your document:

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#let s = themes.simple.register(s)
#let (init, slides) = utils.methods(s)
Expand All @@ -31,14 +31,24 @@ Hello, Typst!

![image](https://github.com/touying-typ/touying/assets/34951714/f5bdbf8f-7bf9-45fd-9923-0fa5d66450b2)

这很简单,您创建了您的第一个 Touying slides,恭喜!🎉
It's that simple! You've created your first Touying slides. Congratulations! 🎉

## 更复杂的例子
## More Complex Examples

事实上,Touying 提供了多种 slides 编写风格,实际上您也可以使用 `#slide[..]` 的写法,以获得 Touying 提供的更多更强大的功能。
In fact, Touying provides various styles for slide writing. You can also use the `#slide[..]` syntax to access more powerful features provided by Touying.

![image](https://github.com/touying-typ/touying/assets/34951714/fcecb505-d2d1-4e36-945a-225f4661a694)

Touying offers many built-in themes to easily create beautiful slides. For example, in this case:

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

you can use the university theme. For more detailed tutorials on themes, you can refer to the following sections.

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#import "@preview/cetz:0.2.1"
#import "@preview/fletcher:0.4.2" as fletcher: node, edge
Expand Down Expand Up @@ -222,10 +232,10 @@ Hello, Typst!

![image](https://github.com/touying-typ/touying/assets/34951714/fcecb505-d2d1-4e36-945a-225f4661a694)

Touying 提供了很多内置的主题,能够简单地编写精美的 slides,例如此处的
Touying offers many built-in themes to easily create beautiful slides. For example, in this case:

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

可以使用 university 主题。关于主题更详细的教程,您可以参阅后面的章节。
you can use the university theme. For more detailed tutorials on themes, you can refer to the following sections.
6 changes: 3 additions & 3 deletions docs/docs/themes/dewdrop.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sidebar_position: 3
你可以通过下面的代码来初始化:

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#let s = themes.dewdrop.register(
s,
Expand Down Expand Up @@ -151,7 +151,7 @@ Dewdrop 主题提供了一系列自定义 slide 函数:
PS: 其中 outline title 可以通过 `#(s.outline-title = [Outline])` 的方式修改。

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#let s = themes.dewdrop.register(s, aspect-ratio: "16-9", footer: [Dewdrop])
#let s = (s.methods.info)(
Expand Down Expand Up @@ -187,7 +187,7 @@ Hello, Typst!
## 示例

```typst
#import "@preview/touying:0.3.0": *
#import "@preview/touying:0.3.1": *
#let s = themes.dewdrop.register(
s,
Expand Down
Loading

0 comments on commit e7aa185

Please sign in to comment.