Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jomaway/typst-gentle-clues
Simple admonishment for typst
https://github.com/jomaway/typst-gentle-clues
Last synced: about 2 months ago
JSON representation
Simple admonishment for typst
- Host: GitHub
- URL: https://github.com/jomaway/typst-gentle-clues
- Owner: jomaway
- License: mit
- Created: 2023-08-14T10:24:30.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-30T23:05:27.000Z (3 months ago)
- Last Synced: 2024-07-05T01:38:14.347Z (3 months ago)
- Language: Typst
- Size: 10.3 MB
- Stars: 25
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-typst - typst-gentle-clues - A typst package to simply add admonitions. (Templates & Libraries / Formatting)
README
# gentle-clues
Simple admonitions for typst. Add predefined or define your own.
Inspired from [mdbook-admonish](https://tommilligan.github.io/mdbook-admonish/).
## Usage
Import the package
```typst
#import "@preview/gentle-clues:0.9.0": *
```
if needed you can change the default settings.
[See the docs.pdf for all options](https://github.com/jomaway/typst-admonish/blob/main/docs.pdf)### Use predefined clues
```typst
// info clue
#info[ This is the info clue ... ]// or a tip
#tip(title: "Best tip ever")[Check out this cool package]
```Overview of the predefined clues:
![Overview of the predefined clues](gc_overview.svg)
#### Language support
This package does use [linguify](https://github.com/jomaway/typst-linguify) to support multiple languages.
**Header titles:**
The language of the header titles is detected automatically from the `context text.lang`.
Currently the following languages are supported: "en", "de", "es", "fr", "zh".If an unsupported language is set it will fallback to english as default.
Feel free to open a PR with your language added to the `lang.toml` file.### Define your own clue
Just need a clue once the fastest way is to use `clue` directly:
The following example will create an orange Test clue.
```typst
#clue(title: "Test", icon: none, accent-color: orange)[We should run more tests!]
```But it is also very easy to define a clue, which you can reuse.
```typst
// Define a clue called ghost
#let ghost(title: "Buuuuuuh", icon: emoji.ghost , ..args) = clue(
accent-color: silver,
title: title,
icon: icon,
..args
)// Use it
#ghost[Huuuuuuh.]
```The icon can be an `emoji`, `symbol` or a path to an image.
## License
[MIT License](LICENSE)
## Changelog
[See CHANGELOG.md](CHANGELOG.md)