Skip to content

Commit

Permalink
gentle-clues:0.5.0 (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
jomaway authored Jan 8, 2024
1 parent 12ee90e commit dd43ac7
Show file tree
Hide file tree
Showing 23 changed files with 8,999 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/preview/gentle-clues/0.5.0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 jomaway

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
120 changes: 120 additions & 0 deletions packages/preview/gentle-clues/0.5.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# gentle-clues

Simple admonitions for typst. Add predefined or define your own.

Inspired from [mdbook-admonish](https://tommilligan.github.io/mdbook-admonish/).


## Usage

`#import "@preview/gentle-clues:0.5.0": *`

Overview of the predefined clues:

![Overview of the predefined clues](gc_overview.svg)

To use the *info* one, it is as easy as writing
```typst
#info[ This is the info clue ... ]
```


### Change header title language

You can change the default language for the header titles by

```typst
#gc_header-title-lang.update("de")
```
At the moment valid options are: "en","de" and "fr"

### Available Clues

The follwing clues/admonitions (+ some aliases) are available at the moment. `abstract`, `info`, `question`, `memo`, `task`, `idea`, `tip`, `quote`, `success`, `warning`, `error`, `example`.

[See here for more Information](https://github.com/jomaway/typst-admonish/blob/main/docs.pdf)

### Define your own

But it is very easy to define your own.

```typst
//When you import the package, include clue
#import "@preview/gentle-clues:0.5.0": clue
//Define it
#let ghost-admon(..args) = clue(
title: "Buuuuh",
_color: gray,
icon: emoji.ghost,
..args
)
// Use it
#ghost-admon[Huuuuuh.]
```

The icon can be an `emoji`, `symbol` or `.svg`-file.

### Reference

Here the full reference to the admonish function.

```typst
clue(
body,
title: none, // Default: none, or string
icon: "assets/flag.svg", // can be a file or an symbol|emoji
_color: "gray", // `_` due to naming conflicts with the type color.
width: auto,
radius: 2pt, // radius of the right side. For no radius set to 0pt.
inset: 1em, // inset of the content, header-inset not yet supported
header-inset: 0.5em, // define header inset.
)
```

## License

MIT

# Changelog

## v0.5.0 (latest)

- Added option `breakable: true` to make clues breakable .
- Added spanish header titles. Use with `#gc_header-title-lang.update("es")`
- Removed aliases (breaking)

## v0.4.0

- Added french header titles. Use with `#gc_header-title-lang.update("fr")`
- Fixed minor border issues
- Added an task-counter (disable with `gc_enable-task-counter.update(false)`)

*Colors:*

- Changed default color to `navy`
- Changed border-color
- Fixed bug that it was sometimes no longer visible after `typst 0.9.0` update.
- Default is now the same as `bg-color`
- Set via color-dict `border` field.
- Added support for gradients: `#clue(_color: gradient.linear(..color.map.crest))`
- *Breaking:* Removed string color_profiles.
- Changed some predefined colors.

## v0.3.0

- renamed entry files and base template
- default `header-inset` is `0.5em` now.
- added `gc_header-title-lang` state, which defines the language of the title.
- Update with `#gc_header-title-lang.update("en")`
- Accepts `"de"` or `"en"` at the moment.
- Using new `type` checks which requires typst version `0.8.0`
- renamed Parameter `color` to `_color` due to naming conflicts with the color type.

## v0.2.0

- set header inset. `#admonish(header-inset: 0.5em)`
- custom color: `#admonish(color: (stroke: luma(150), bg: teal))`
- new example admonition: `#example[Testing]`
#example(header-inset: 0.8em)[Testing]

1 change: 1 addition & 0 deletions packages/preview/gentle-clues/0.5.0/assets/abstract.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/preview/gentle-clues/0.5.0/assets/bell.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/preview/gentle-clues/0.5.0/assets/bookmark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/preview/gentle-clues/0.5.0/assets/checkbox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions packages/preview/gentle-clues/0.5.0/assets/cleanup-script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

for f in ./*.svg;
do
echo "Processing $f file..."
svgcleaner $f $f
done
1 change: 1 addition & 0 deletions packages/preview/gentle-clues/0.5.0/assets/crossmark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/preview/gentle-clues/0.5.0/assets/danger.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/preview/gentle-clues/0.5.0/assets/example.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/preview/gentle-clues/0.5.0/assets/excl.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/preview/gentle-clues/0.5.0/assets/flag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/preview/gentle-clues/0.5.0/assets/info.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/preview/gentle-clues/0.5.0/assets/lightbulb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit dd43ac7

Please sign in to comment.