Code Monkey home page Code Monkey logo

typst-gentle-clues's Introduction

gentle-clues

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

Inspired from mdbook-admonish.

Usage

Import the package

#import "@preview/gentle-clues:0.8.0": *

if needed you can change the default settings. See the docs.pdf for all options

Use predefined clues

// 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

abstract, info, question, memo, task, idea, tip, quote, success, warning, error, example.

Language support

This package does use 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.

#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.

// 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

Changelog

See CHANGELOG.md

typst-gentle-clues's People

Contributors

jomaway avatar mrmugame avatar maxigaz avatar caemor avatar hgruniaux avatar raenye avatar urimtzf avatar ivaquero avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.