Inline Admonitions

by Scott Tomaszewski
5
4
3
2
1
Score: 56/100

Description

Category: Note Enhancements

The Inline Admonitions plugin is a game-changer for Obsidian users who want to add visual flair to their inline codeblocks. With this plugin, you can create custom alerts and highlights that grab attention without disrupting the flow of your writing. By defining triggers such as prefixes, suffixes, or contains text, you can turn specific codeblocks into stand-out elements on the page. The plugin offers a range of customization options, from background colors to text colors, allowing you to tailor the appearance to fit your personal style. Whether you're highlighting important notes, warning about potential errors, or simply adding visual interest, Inline Admonitions makes it easy to bring your writing to life.

Reviews

No reviews yet.

Stats

37
stars
9,586
downloads
0
forks
802
days
45
days
45
days
5
total PRs
0
open PRs
0
closed PRs
5
merged PRs
17
total issues
6
open issues
11
closed issues
62
commits

Latest Version

a month ago

Changelog

1.7.0

  • Adds support for Regex Inline Admonitions

README file from

Github

Inline Admonitions for Obsidian

This plugin will allow you to format inline codeblocks to better stand out on the page. For example, you may want to have all inline codeblocks that start with "IMPORTANT" to have a red background like this.

img.png

inlineAdmonition_1.2.0.webm

Usage

To add an Inline Admonition to your note, first [create a new Inline Admonition](#Creating a new Inline Admonition) of the desired type.

Then add an inline codeblock with the appropriate trigger text. For example, a [Prefix Inline Admonition](#Prefix Type) with a prefix of IMPORTANT will trigger when an inline codeblock starts with "IMPORTANT", like this:

Normal text `IMPORTANT - dont forget the milk!` and some more normal text

Creating a new Inline Admonition

Open the "Inline Admonition" settings and click "Create New Inline Admonition" at the top to bring up a Modal to configure a new Inline Admonition.

admonition-modal.png

Common settings:

  • Background Color is the color of the Inline Admonition "bubble"
  • Background Opacity supports transparency of the background
  • Hide Background allows the background (including spacing) to be hidden
  • Text Color is the text color
  • Text Opacity supports transparency of the text
  • Type defines how an Inline Admonition is triggered. See the types documentation for more details.
  • Prefix Icon allows you to select an icon to include at the beginning of the inline admonition.
    • Note: Prefix Icons are not supported in Live Preview mode because it causes cursor navigation issues.
  • Suffix Icon allows you to select an icon to include at the end of the inline admonition.
    • Note: Suffix Icons are not supported in Live Preview mode because it causes cursor navigation issues.
  • Font allows selection of the font

Types

The Inline Admonition "Type" defines what triggers the codeblock to convert into an Inline Admonition. Current supported Types are:

Prefix Type

Prefix Inline Admonitions trigger when a codeblock starts with specific text.

Settings

  • Prefix defines the text at the start of the codeblock to trigger the Inline Admonition.
  • Hide prefix text - if enabled, the triggering prefix text will not show in the Inline Admonition.

Suffix Type

Suffix Inline Admonitions trigger when a codeblock ends with specific text.

Settings

  • Suffix defines the text at the end of the codeblock to trigger the Inline Admonition.
  • Hide suffix text - if enabled, the triggering suffix text will not show in the Inline Admonition.

Contains Type

Contains Inline Admonitions trigger when a codeblock contains specific text anywhere within it.

Settings

  • contains defines the text within the codeblock to trigger the Inline Admonition.

Regex Type

Regex Inline Admonitions trigger when a codeblock matches a specific regular expression.

Settings

  • Regex defines the regular expression to match against the codeblock content to trigger the Inline Admonition.
  • Sample Input is used to help test your regex and also helps the settings display the sample.

Notes

  • The CSS of the Inline Admonitions rides on Obsidian's Tag css. I'll clean this up in a future release.
  • Saving settings will trigger a re-render of the markdown views. Its possible to avoid this and is planned for a future release
  • Similar to Contexual Typography this plugin will give you some css classes that you can manually manipulate

Future work

  • Additional admonitions styles (rounded corners, etc)
  • More comprehensive CSS editing in the settings UI

Known Issues

  • Newly created inline admonitions might not render in Live Preview. Reload the app as a workaround

Development

See the changelog for changes

Build

  • npm i to install deps
  • npm run dev to build and watch

Release

Upload the files manifest.json, main.js, styles.css as binary attachments

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Admonition
5 years ago by Jeremy Valentine
Adds admonition block-styled content to Obsidian.md
Callout Manager
3 years ago by eth-p
An Obsidian.md plugin that makes creating and configuring callouts easy.
List Callouts
4 years ago by mgmeyers
Create callouts in lists in Obsidian.
Obsidian Columns
4 years ago by Trevor Nichols
Callout menu
2 years ago by Anareaty
Callout Integrator
3 years ago by
A plugin for Obsidian to allow the integration of long blocks of text into callouts.
Callout Suggestions
2 years ago by Casey Fryer
Obsidian Plugin for autocompleting callouts.
Better Math in Callouts & Blockquotes
2 years ago by Ryota Ushio
An Obsidian plugin to add better Live Preview support for math rendering inside callouts & blockquotes.
Better Inline Fields
4 years ago by David Sarman
Obsidian plugin to enhance Dataview style inline fields
Image Inline
2 years ago by Zackary W
convert images into base64 encoded strings and embed them directly within your notes
Mini Toolbar
3 years ago by AidenLx & Boninall
mini context toolbar in editor for Obsidian
Old Note Admonitor
3 years ago by tadashi-aikawa
Blockier
2 years ago by blorbb
An Obsidian.md plugin for easier block editing.
Callout Toggles
2 years ago by Aly Thobani
An Obsidian plugin to quickly add, change, or remove callout wrappers in your notes.
Fill in the Blank (FITB)
3 years ago by Shawn McGee
Callout Copy Buttons
a year ago by Aly Thobani
An Obsidian plugin that adds copy buttons to callout blocks in your notes.
Comments
a year ago by Jasper Surmont
Translate Inline
2 years ago by Lucas Langholf
An Obsidian Plugin that lets you translate between languages without moving you fingers away from the keyboard.
CalloutX
a year ago by br4in
An Obsidian plugin that allows you to view, manage, and customise callout icons in your vault.
Inline Code Copy
a year ago by Hongchen Lin
Citation Callouts
9 months ago by Michael Marvive
Obsidian Plugin that formats a quote with a citation in a custom callout