Skip to content

✨ FontAwesome v6 roles, CDN config, fontawesome5 LaTeX support#285

Open
chrisjsewell wants to merge 1 commit into
mainfrom
brief/13-fontawesome
Open

✨ FontAwesome v6 roles, CDN config, fontawesome5 LaTeX support#285
chrisjsewell wants to merge 1 commit into
mainfrom
brief/13-fontawesome

Conversation

@chrisjsewell

@chrisjsewell chrisjsewell commented Jul 14, 2026

Copy link
Copy Markdown
Member

Modernizes the FontAwesome integration around three declarative config options.

Changes

  • v6 roles: fa-solid / fa-brands / fa-regular, emitting exactly those classes. The legacy fa/fas/fab/far roles are unchanged (and documented as legacy). This is the supported path for FontAwesome Pro kits (FontAwesome import interfering with Pro License #174): load your kit, use v6 names.
  • sd_fontawesome_source ("none" default / "cdn") + sd_fontawesome_cdn_url: opt-in CDN loading via app.add_css_file, replacing the docs' copy-paste html_css_files instruction. The docs now dogfood it.
  • sd_fontawesome_latex grows string values while keeping True/False working (True"fontawesome", output verified byte-identical to main): "fontawesome5" loads fontawesome5.sty and 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 loads fontawesome5, set the same value so both agree. The stored value stays raw (TOML-round-trippable); normalization is a computed property.
  • Per-icon "not included in output" warnings now fire once per build (once=True, verified on the 7.2 floor).
  • Docs: FA section rewritten around the config, with an explicit Pro-kits subsection, a legacy-names note, the LaTeX value table, and a caveat that the LaTeX packages resolve FA5-era icon names (v6-renamed icons render in HTML but not in PDF).

Verification

  • Independent review: no correctness findings. Verified empirically: incremental rebuilds propagate config flips to unrebuilt pages (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-existing html_css_files approach; bool|str confval type-checking clean across the range; no duplicate CDN link in the dogfooding docs build.
  • Legacy parity locked by test: sd_fontawesome_latex = True produces the same \usepackage{fontawesome} + \faicon{...} output as main.
  • Full suite on pinned Sphinx 7.2.6 / 7.4.7 / 8.2.3 (184 passed each); new tests/test_fontawesome.py covers roles, CDN link exactly-once/absent, both LaTeX packages, and once-per-build warnings.

Closes #174
Closes #242

@chrisjsewell chrisjsewell force-pushed the brief/13-fontawesome branch from 7c47e9f to d53f19b Compare July 14, 2026 16:33
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.44%. Comparing base (abbf459) to head (d53f19b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #285      +/-   ##
==========================================
+ Coverage   90.72%   91.44%   +0.72%     
==========================================
  Files          13       13              
  Lines        1207     1251      +44     
==========================================
+ Hits         1095     1144      +49     
+ Misses        112      107       -5     
Flag Coverage Δ
pytests 91.44% <100.00%> (+0.72%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- 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.
@chrisjsewell chrisjsewell force-pushed the brief/13-fontawesome branch from d53f19b to 2c7a2d2 Compare July 14, 2026 22:28
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.

Latex build broken in Sphinx 8 FontAwesome import interfering with Pro License

1 participant