Download the PHP package daun/statamic-bard-mutators without Composer
On this page you can find all versions of the php package daun/statamic-bard-mutators. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download daun/statamic-bard-mutators
More information about daun/statamic-bard-mutators
Files in daun/statamic-bard-mutators
Package statamic-bard-mutators
Short Description A collection of plugins for the Statamic Bard Mutator addon
License MIT
Homepage https://github.com/daun/statamic-bard-mutators
Informations about the package statamic-bard-mutators
π§± Β Statamic Bard Mutators
A collection of mutators for transforming Statamic Bard content.
Mutators are implemented as plugins for Jack Sleight's Bard Mutator Addon.
Mutators
- Lazy Load Images β add
loading=lazyanddecoding=asyncto images - Generate Heading IDs β add
idto headings - Insert Heading Permalinks β insert permalinks into headings
- Normalize Heading Levels β close gaps in the heading hierarchy
- Shift Heading Levels β shift or clamp heading levels
- Mark External Links β add
targetandrelto external links - Mark Asset Links β add
downloadto asset links - Semantic Blockquotes β wrap blockquotes in
figurewithfigcaption - Wrap Tables β move tables into a horizontally scrollable container
- Remove List Item Paragraphs β remove
pwrappers aroundlitext
See the full list of mutators β
Installation
Install the package via composer:
Registration
Register any mutators you want to use from the Mutator facade. Options can be passed as arguments
to the constructor. You can read more about
class-based mutator plugins
in the addon readme.
All Mutators
Mark External Links
Mark external links with target="_blank" and rel="external".
Mark Asset Links
Mark links to assets with download="filename.ext".
Generate Heading IDs
Adds an id attribute to headings based on their content.
Insert Heading Permalinks
Insert a permalink inside each heading pointing to its own id. Permalinks are
only added to headings that already have an id β register GenerateHeadingIds
beforehand if you want every heading to get a permalink.
The icon is wrapped in <span aria-hidden="true"> so a screen reader announces
only the link's aria-label, not the icon.
Semantic Blockquotes
Wraps blockquotes in a figure element and moves the author/source into a figcaption element.
Wrap Tables
Wraps tables in a div element to allow for horizontal scrolling on smaller screens.
Normalize Heading Levels
Close skip-level gaps in the heading hierarchy by pulling deep headings up
(e.g. <h2> followed by <h4> becomes <h2> followed by <h3>). The first
heading is left at whatever level it starts, and going back up to a shallower
level is always allowed.
This pairs naturally with ShiftHeadingLevels β register NormalizeHeadingLevels
first to clean the hierarchy, then ShiftHeadingLevels to position the cleaned
tree (e.g. min: 2 to keep <h1> reserved for the page title).
Shift Heading Levels
Shift heading levels up or down. Useful when a Bard field is rendered under a page
<h1> and headings inside the field should start lower in the outline.
Lazy Load Images
Add loading="lazy" and decoding="async" to images for better page performance.
Remove List Item Paragraphs
Remove the paragraphs that tiptap automatically adds inside list items.
License
All versions of statamic-bard-mutators with dependencies
jacksleight/statamic-bard-mutator Version ^3.0
statamic/cms Version ^5.0 || ^6.0