Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/preview/tieffiction/0.2.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- English US
- English UK
- Deutsch DE
- Português BR

As TiefFiction uses TiefLang (obviously), selecting a language can either be done by passing the `language` parameter to `setup` or `book` (see below), or using TiefLang directly. Look at [TiefLang](https://github.com/Tiefseetauchner/TiefLang) for more information.

Expand All @@ -45,7 +46,7 @@
3. The Table of Content (ToC) `table-of-content`
4. The Blurb `blurb-block`

These components can be seperately inserted into your design, or automatically inserted using the [`book`](#book) function. `book` is a simple starting point, with opinionated defaults. See [examples/fiction](examples/fiction.pdf) for that.

Check failure on line 49 in packages/preview/tieffiction/0.2.0/README.md

View check run for this annotation

Typst package check / @preview/tieffiction:0.2.0

packages/preview/tieffiction/0.2.0/README.md#L49

Linked file not found: `/examples/fiction.pdf`. Make sure to commit all linked files and possibly add them to the `exclude` list. More details: https://github.com/typst/packages/blob/main/docs/tips.md#what-to-commit-what-to-exclude

For manually building your layout, use the [`setup`](#setup) function. You can then start and end sections of the book ([preamble](#start-preamble), [before-main](#start-before-main), [main](#start-main), [after-main](#start-after-main)) and insert the components as you wish.

Expand Down
39 changes: 39 additions & 0 deletions packages/preview/tieffiction/0.2.0/core/i18n.typ
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
english-us: "en-us",
english-uk: "en-uk",
deutsch-de: "de-de",
portuguese-br: "pt-br"
)

#let ordinal-en = number => {
Expand All @@ -27,6 +28,8 @@

#let ordinal-de = number => [#number.]

#let ordinal-br = number => [#number.]

#let copyright-line = (holder, year) => {
if holder != none and year != none {
[Copyright (c) #year #holder]
Expand Down Expand Up @@ -145,11 +148,47 @@
ordinal: ordinal-de,
)

#let i18n-pt-br = (
copyright-page: (holder, publisher, year, isbn, edition, license, extra) => (
copyright-line(holder, year),
if edition != none {
[Edição #ordinal-br(edition)]
},
if publisher != none and year != none {
[Publicado por #publisher em #year.]
} else if publisher != none {
[Publicado por #publisher.]
} else if year != none {
[Publicado em #year.]
} else {
none
},
[Todos os direitos reservados.],
..extra,
..if license != none {
(
v(20pt),
[Esta obra é licenciada sob uma #link(cc-url(license), [licença Creative Commons '#license']).\
#ccicon(license + "-badge", scale: 3)],
v(20pt),
)
},
if isbn != none {
[ISBN: #isbn\
#render-isbn(isbn)]
},
),
chapter: chapter-number => [Capítulo #chapter-number],
table-of-content: [Sumário],
ordinal: ordinal-br,
)

#let setup-i18n = () => configure-translations(
(
en-us: i18n-en-us,
en-uk: i18n-en-uk,
de-de: i18n-de-de,
pt-br: i18n-pt-br,
),
strict: true,
default: "en-us",
Expand Down
Loading