Skip to content

Feat/callout partial #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 17, 2025
Merged

Feat/callout partial #223

merged 2 commits into from
Apr 17, 2025

Conversation

nginx-jack
Copy link
Collaborator

@nginx-jack nginx-jack commented Apr 15, 2025

Proposed changes

This is pretty much a full rewrite of how callouts work.
All callouts now use the small underlying partial (callout.html) to render.

There are two code paths;

  1. "Loud" callouts, which have titles that match one of "Caution" "Warning" "Deprecated" "Important" are render one set of html, to make styling and classes easier to manage
  2. "Generic" callouts are rendered using css content to render the title inside the border. This is configured using a custom attribute data-title, which appears to be the easiest non-js way to configure this outside of css directly

Only "Loud" callouts support icons right in mf, and they're predetermined by the title itself.
Will have another PR/Ticket to integrate the new icons, we might need a mapping between fa -> feather or do a refactor pass to change the icon usages to all use feather. I vote for the later!

FYI - There should be zero changes visually or in usage in oldframe.

Screenshot 2025-04-16 at 14 18 57

@nginx-jack nginx-jack force-pushed the feat/callout-partial branch from 21be1b2 to 4510f60 Compare April 16, 2025 09:50
Refactor old blockquote shortcodes to reuse partial
Treat Warning Caution Deprecated and Important as special cases
which render different HTML to simplify styling
Remove ':' from mf titles
@nginx-jack nginx-jack force-pushed the feat/callout-partial branch from 3440ed5 to 267aa23 Compare April 16, 2025 13:02
@nginx-jack nginx-jack marked this pull request as ready for review April 16, 2025 13:24
@nginx-jack nginx-jack requested a review from a team as a code owner April 16, 2025 13:24
@nginx-jack nginx-jack force-pushed the feat/callout-partial branch 2 times, most recently from 24af351 to ad559df Compare April 16, 2025 14:59
Copy link
Collaborator

@lamATnginx lamATnginx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Runs fine locally. Code looks clean + readable.

@nginx-jack nginx-jack force-pushed the feat/callout-partial branch from ad559df to dd80672 Compare April 16, 2025 15:47
@danielledeleo danielledeleo merged commit 3ff5146 into main Apr 17, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants