✨ FontAwesome v6 roles, CDN config, fontawesome5 LaTeX support#285
Merged
Conversation
7c47e9f to
d53f19b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #285 +/- ##
==========================================
+ Coverage 90.87% 91.58% +0.70%
==========================================
Files 13 13
Lines 1227 1271 +44
==========================================
+ Hits 1115 1164 +49
+ Misses 112 107 -5
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:
|
d53f19b to
2c7a2d2
Compare
- add v6 roles fa-solid/fa-brands/fa-regular (legacy fa/fas/fab/far kept)
- add sd_fontawesome_source ("none"|"cdn") and sd_fontawesome_cdn_url config
- sd_fontawesome_latex now accepts "none"/"fontawesome"/"fontawesome5"
(bool True/False still work identically); "fontawesome5" emits \faIcon{...}
- throttle the LaTeX / unsupported-builder icon warnings to once per build
Closes #174, #242.
2c7a2d2 to
26d9aba
Compare
chrisjsewell
added a commit
that referenced
this pull request
Jul 15, 2026
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: ```python sd_fontawesome_version = "as-named" # or "4" | "5" | "6" ``` - **`"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. - **A version value**: any role spelling becomes a pure *style* selector and emits that version's class scheme — `:fas:`rocket`` and `:fa-solid:`rocket`` both produce `fa-solid fa-rocket` under `"6"`, `fas fa-rocket` under `"5"`, `fa fa-rocket` under `"4"` (v4 had no style prefixes; bare `fa` maps 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. - **LaTeX output is fully version-independent**: the semantic style now travels on the node (`icon_style` attribute), so `fontawesome5` rendering (`\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). - Docs lead with the version-agnostic story; the icon-*name* churn caveat stays (renames across FA versions are emitted as written, HTML and LaTeX alike). ## Verification - Independent review (merge-safe): as-named byte-parity independently reproduced (identical sha256 across main / branch-default / branch-explicit, HTML and `.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 `-j4` reads consistent; invalid value warns and falls back. - LaTeX invariance now locked by a test parametrized over **all four** version values. - Full suite on pinned Sphinx 7.2.6 / 7.4.7 / 8.2.3 (246–249 passed per revision); the only fixture change is the `icon_style` attribute appearing on `fontawesome` nodes (audited). Follow-up to #285 / #174
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.
Modernizes the FontAwesome integration around three declarative config options.
Changes
fa-solid/fa-brands/fa-regular, emitting exactly those classes. Purely additive: the concisefa/fas/fab/farroles are equally supported, unchanged, with no plans to remove them — the docs present both spellings as first-class, noting thefa-*names are only required for FontAwesome v6+ setups that drop the compatibility aliases (most notably Pro kits, the FontAwesome import interfering with Pro License #174 failure mode), since the role name is emitted verbatim as the CSS class.sd_fontawesome_source("none"default /"cdn") +sd_fontawesome_cdn_url: opt-in CDN loading viaapp.add_css_file, replacing the docs' copy-pastehtml_css_filesinstruction. The docs now dogfood it.sd_fontawesome_latexgrows string values while keepingTrue/Falseworking (True≡"fontawesome", output verified byte-identical to main):"fontawesome5"loadsfontawesome5.styand emits\faIcon{name}/\faIcon[regular]{name}(brands resolve by bare name — mapping independently verified against the package's completion data). This resolves the Latex build broken in Sphinx 8 #242 class of clash: if your theme loadsfontawesome5, set the same value so both agree. The stored value stays raw (TOML-round-trippable); normalization is a computed property.once=True, verified on the 7.2 floor).Verification
rebuild="env"); absolute CDN URLs are emitted verbatim (no?v=mangling, no copy attempt) on 7.2.6 and 9.x; epub with"cdn"behaves identically to the pre-existinghtml_css_filesapproach;bool|strconfval type-checking clean across the range; no duplicate CDN link in the dogfooding docs build.sd_fontawesome_latex = Trueproduces the same\usepackage{fontawesome}+\faicon{...}output as main.tests/test_fontawesome.pycovers roles, CDN link exactly-once/absent, both LaTeX packages, and once-per-build warnings.Closes #174
Closes #242