✨ Add sd_fontawesome_version for version-agnostic icon roles#288
Merged
Conversation
The role name now acts as a pure style selector (solid/brands/regular): set sd_fontawesome_version = "4" | "5" | "6" and every role spelling emits that version's class scheme, so upgrading FontAwesome is a one-line conf.py change. The default "as-named" emits the role name verbatim, byte-identical to previous releases. LaTeX rendering is unaffected.
a6dc3f2 to
8f6796e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #288 +/- ##
==========================================
+ Coverage 92.60% 92.63% +0.03%
==========================================
Files 13 13
Lines 1365 1371 +6
==========================================
+ Hits 1264 1270 +6
Misses 101 101
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Decouples FontAwesome role names from the CSS class scheme they emit, so users never touch their documents when changing FA versions — the follow-up agreed in #285's review discussion.
Design
New TOML-representable option:
"as-named"(default): today's exact behaviour — the role name is emitted verbatim as the leading class. Byte-parity with main proven by sha256 over a build exercising all seven role spellings.:fas:rocketand `:fa-solid:`rocketboth producefa-solid fa-rocketunder"6",fas fa-rocketunder"5",fa fa-rocketunder"4"(v4 had no style prefixes; barefamaps to solid under 5/6). Upgrading FontAwesome is then a one-line conf.py change; with"6", the concise spellings also work with Pro kits.icon_styleattribute), sofontawesome5rendering (\faIcon[regular]{…}etc.) is identical for every version value — including"4", whose HTML-side style collapse no longer leaks into PDFs (a review finding, fixed by storing the style rather than re-deriving it from the emitted class).Verification
.tex); config flip verified to re-read all documents on incremental builds (rebuild="env"— parse-time class baking is safe); extra-classes microsyntax preserved under translation; nested contexts (buttons/cards/dropdowns) clean; parallel-j4reads consistent; invalid value warns and falls back.icon_styleattribute appearing onfontawesomenodes (audited).Follow-up to #285 / #174