[PR #727] [MERGED] Add admonitions library and markdown pipeline adjustments #868

Closed
opened 2026-03-03 00:23:34 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BoostIO/BoostNote-App/pull/727
Author: @Komediruzecki
Created: 12/17/2020
Status: Merged
Merged: 1/2/2021
Merged by: @Rokt33r

Base: masterHead: feature/add-support-for-admonitions


📝 Commits (4)

  • c7030ae Add admonitions library and markdown pipeline adjustments
  • d0a511e Remove custom admonitions
  • 1359e5a Remove unnecessary changes
  • abe49e9 Use default tag option

📊 Changes

4 files changed (+39 additions, -4 deletions)

View changed files

📝 package-lock.json (+24 -0)
📝 package.json (+1 -0)
📝 src/components/atoms/MarkdownPreviewer.tsx (+13 -4)
📝 typings/unified.d.ts (+1 -0)

📄 Description

Add admonitions library and markdown pipeline adjustments (#474)

  • Add initial admonitions
  • Add custom admonition types
  • Add custom admonition types styling

The basic admonitions for boostnote. The icons are currently emoji since svg elements are sanitized by rehype-sanitize. We could add exceptions for svg elements but I think we are already going for emoji only things so this should be fine?

New Syntax Example

Markdown code:
TestAdmonitions.txt

Markdown Preview:
AdmonitionLatestExample

OLD Syntax

For markdown:
admonitions-test-md.txt

Classic admonitions (dark/white background):

StockAdmonitions
StockAdmonitionsWhiteTheme

Boostnote custom admonitions (dark/white background):

BoostNoteAdmonitions
BoostNoteAdmonitionsWhiteTheme

Todo:

  • Styling could be improved, I made as simplest as possible
  • Better emojis/svg/images for admonitions
  • Custom emojis/colors (another PR)
  • Add support for rendering admonition in PDF/HTML export

Test:

  • In electron Linux App (dev)
  • In electron Linux App production version (appImage)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BoostIO/BoostNote-App/pull/727 **Author:** [@Komediruzecki](https://github.com/Komediruzecki) **Created:** 12/17/2020 **Status:** ✅ Merged **Merged:** 1/2/2021 **Merged by:** [@Rokt33r](https://github.com/Rokt33r) **Base:** `master` ← **Head:** `feature/add-support-for-admonitions` --- ### 📝 Commits (4) - [`c7030ae`](https://github.com/BoostIO/BoostNote-App/commit/c7030ae2e85a2b9bce18e2c4c5a0e9bb86903f60) Add admonitions library and markdown pipeline adjustments - [`d0a511e`](https://github.com/BoostIO/BoostNote-App/commit/d0a511ed209c683fed49ac6b7f593cafedb2f0da) Remove custom admonitions - [`1359e5a`](https://github.com/BoostIO/BoostNote-App/commit/1359e5a28183f90a11bde22bf40f942cae0638b3) Remove unnecessary changes - [`abe49e9`](https://github.com/BoostIO/BoostNote-App/commit/abe49e914bc752919c6b03adca795d8cb9c423d4) Use default tag option ### 📊 Changes **4 files changed** (+39 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `package-lock.json` (+24 -0) 📝 `package.json` (+1 -0) 📝 `src/components/atoms/MarkdownPreviewer.tsx` (+13 -4) 📝 `typings/unified.d.ts` (+1 -0) </details> ### 📄 Description Add admonitions library and markdown pipeline adjustments (#474) - Add initial admonitions - Add custom admonition types - Add custom admonition types styling The basic admonitions for boostnote. The icons are currently emoji since svg elements are sanitized by rehype-sanitize. We could add exceptions for svg elements but I think we are already going for emoji only things so this should be fine? ## New Syntax Example Markdown code: [TestAdmonitions.txt](https://github.com/BoostIO/BoostNote.next/files/5761555/TestAdmonitions.txt) Markdown Preview: ![AdmonitionLatestExample](https://user-images.githubusercontent.com/18196945/103478003-2be09780-4dc4-11eb-890a-2f8ea8b38085.png) ## OLD Syntax For markdown: [admonitions-test-md.txt](https://github.com/BoostIO/BoostNote.next/files/5711616/admonitions-test-md.txt) Classic admonitions (dark/white background): ![StockAdmonitions](https://user-images.githubusercontent.com/18196945/102531893-68fa1980-40a3-11eb-88c7-507ef6df8680.png) ![StockAdmonitionsWhiteTheme](https://user-images.githubusercontent.com/18196945/102531898-6a2b4680-40a3-11eb-831c-d9c58729d8a2.png) Boostnote custom admonitions (dark/white background): ![BoostNoteAdmonitions](https://user-images.githubusercontent.com/18196945/102531900-6bf50a00-40a3-11eb-8033-e891b10be058.png) ![BoostNoteAdmonitionsWhiteTheme](https://user-images.githubusercontent.com/18196945/102531903-6d263700-40a3-11eb-9168-05fa993004ea.png) Todo: - [ ] Styling could be improved, I made as simplest as possible - [ ] Better emojis/svg/images for admonitions - [ ] Custom emojis/colors (another PR) - [ ] Add support for rendering admonition in PDF/HTML export Test: - In electron Linux App (dev) - In electron Linux App production version (appImage) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 00:23:34 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/BoostNote-App#868
No description provided.