mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-23 21:04:07 -06:00
2.4 KiB
2.4 KiB
| title | tags | |
|---|---|---|
| InlineBadges |
|
This plugin allows the user to create multipurpose badges that can be used within inline text.
Note
For information on how to add, remove or configure plugins, see the configuration#Plugins page.
Syntax
A badge may be used in line with the following syntax, within an inline code block:
`[!!KEY:TEXT]` -> Normal badges
`[!!|ghs>SUBTEXT:TEXT]` -> Github Success
`[!!|ghb>SUBTEXT:TEXT]` -> Github Blue
`[!!|KEY:TEXT]` -> Plaintext
`[!!|ICON|ARIA:TEXT|COLOR-RGB]` -> Custom icon. Color can be a CSS Variable, eg. `var(--color-red-rgb)`
KEYdefines the name of the preset to be used, which are equal to the obsidian callout types.TEXTandSUBTEXTcan be any text of your choosing. They cannot contain the|character as it is the main delimiter.ICONis the name of the lucide icon to be used.1ARIAdefines the name of the aria label used for the badge (Not visible to the end user).COLOR-RGBis a HTML color, such as256, 12, 32.ghsandghbshould not be changed, as they define what colour is to be used.
Examples:
`[!!note:There is no such thing as genuine questions]`
`[!!|ghs>checks:success]`
`[!!|ghb>contributors:52]`
`[!!|warning:Don't say that I didn't tell you.]`
`[!!|menu|menu-item:Go to Settings > Delete Account|140, 200, 110]`
What is `[!!danger:love]`?
Configuration
This plugin accepts the following configuration options:
customBadges, an array of objects that defines custom badge types, along with their colours and icon.
Badge Object
A badge object is defined like so:
{
name: "foobar",
icon: "icon_name",
color: [10, 10, 10, 1],
textOpacity: 0.117,
}
Where foobar is the name of the badge, icon is the name of the lucide icon1 to be used, color is an array defining the background colour in the format [RED, GREEN, BLUE, ALPHA]2
These custom badges can now be used with the syntax
`[!!foobar:text-here]`
API
- Category: Transformer
- Function name:
Plugin.InlineBadges() - Source: N/A