Skip to content

Improve pdf#1151

Merged
spoorcc merged 14 commits intomainfrom
feature/improve-pdf
Apr 20, 2026
Merged

Improve pdf#1151
spoorcc merged 14 commits intomainfrom
feature/improve-pdf

Conversation

@spoorcc
Copy link
Copy Markdown
Contributor

@spoorcc spoorcc commented Apr 19, 2026

Summary by CodeRabbit

  • New Features

    • PDF styling: branded colors, redesigned headings, rounded inline code blocks, boxed per-type admonitions, and a printable CLI cheatsheet.
    • New syntax highlighting style available for code rendering.
  • Improvements

    • Improved monospace/font setup for HTML and PDF; refined table spacing, colors, and borders.
  • Maintenance

    • Updated font fetch/extraction rules and metadata to exclude specific variants and adjust extracted paths.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 19, 2026

Warning

Rate limit exceeded

@spoorcc has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 12 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 17 minutes and 12 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: cee7859e-2e53-4550-92df-4c24f52fd3fe

📥 Commits

Reviewing files that changed from the base of the PR and between 51604c0 and 97e1226.

📒 Files selected for processing (9)
  • doc/conf.py
  • doc/dfetch_preamble.inc
  • doc/explanation/vendoring.rst
  • doc/howto/patching.rst
  • doc/index.rst
  • doc/reference/cli_cheatsheet.rst
  • doc/reference/commands.rst
  • doc/reference/glossary.rst
  • doc/tutorials/getting_started.rst

Walkthrough

Moved Sphinx LaTeX preamble into a new include, added extensive LaTeX styling/macros (tcolorbox-based admonitions, table/heading styles, colors), registered a local Pygments style, adjusted JetBrains Mono font paths and LaTeX packaging, updated dfetch manifest/metadata and CSS font URLs, and added a printable CLI cheatsheet LaTeX block.

Changes

Cohort / File(s) Summary
Font manifest & metadata
dfetch.yaml, doc/static/fonts/jetbrains-mono/.dfetch_data.yaml
Changed extraction source path from fonts/webfonts/fonts/; added JetBrainsMonoNL* to ignore; regenerated dfetch metadata (hash, last_fetch, revisionsha256:).
LaTeX preamble & Sphinx config
doc/dfetch_preamble.inc, doc/conf.py
Added doc/dfetch_preamble.inc with colors, Unicode mappings, heading/table/admonition/tcolorbox rules and CLI macros; moved inline latex_elements['preamble'] into that file; updated LaTeX font settings and latex_additional_files; prepended doc/_ext to sys.path and import/registered Pygments style.
Pygments style extension
doc/_ext/dfetch_style.py
Added DfetchStyle (Pygments style) and register() to inject "dfetch" into pygments.styles mapping.
CSS font references
doc/static/css/custom.css
Updated @font-face src URLs for JetBrains Mono weights 400/500 to point to ../fonts/jetbrains-mono/webfonts/.
Documentation content
doc/reference/cli_cheatsheet.rst
Appended a printable LaTeX tcolorbox cheatsheet block (two-column layout, legend, subcommand groups) via .. raw:: latex.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

documentation

Suggested reviewers

  • ben-edna
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The PR title 'Improve pdf' is vague and does not clearly convey the specific changes made; the actual changeset adds styling, fonts, and a cheatsheet to PDF documentation. Consider a more descriptive title that captures the main changes, such as 'Add LaTeX styling, fonts, and CLI cheatsheet to PDF documentation' or 'Enhance PDF output with custom styling and cheatsheet'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/improve-pdf

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@doc/dfetch_preamble.inc`:
- Around line 116-128: The dispatcher lacks an explicit mapping for the standard
"attention" admonition so \dfadmonbegin falls back to \dfadmonnote; add a new
command \dfadmonattention (modeled like \dfadmoncaution) immediately after
\dfadmoncaution so attention admonitions get warning-style formatting; update
the group of per-type opener commands to include
\newcommand{\dfadmonattention}[1]{...} matching the same tcolorbox/style used by
\dfadmoncaution so \dfadmonbegin{attention}{...} renders correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: bb4d5ebb-5260-4b83-8751-e9fdb1651f4c

📥 Commits

Reviewing files that changed from the base of the PR and between ac7dd04 and a239100.

⛔ Files ignored due to path filters (5)
  • doc/static/fonts/jetbrains-mono/ttf/JetBrainsMono-Medium.ttf is excluded by !**/*.ttf
  • doc/static/fonts/jetbrains-mono/ttf/JetBrainsMono-Regular.ttf is excluded by !**/*.ttf
  • doc/static/fonts/jetbrains-mono/variable/JetBrainsMono[wght].ttf is excluded by !**/*.ttf
  • doc/static/fonts/jetbrains-mono/webfonts/JetBrainsMono-Medium.woff2 is excluded by !**/*.woff2
  • doc/static/fonts/jetbrains-mono/webfonts/JetBrainsMono-Regular.woff2 is excluded by !**/*.woff2
📒 Files selected for processing (5)
  • dfetch.yaml
  • doc/conf.py
  • doc/dfetch_preamble.inc
  • doc/static/css/custom.css
  • doc/static/fonts/jetbrains-mono/.dfetch_data.yaml

Comment thread doc/dfetch_preamble.inc
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@spoorcc
Copy link
Copy Markdown
Contributor Author

spoorcc commented Apr 20, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@doc/dfetch_preamble.inc`:
- Around line 127-128: The macro \dfadmonbegin is passing the admonition title
wrapped in literal backticks (`#2`) to the dispatcher (\csuse{dfadmon#1}{`#2`}
and \dfadmonnote{`#2`}), which makes the backticks appear in the PDF; change the
calls to pass `#2` unquoted so use \csuse{dfadmon#1}{`#2`} and \dfadmonnote{`#2`}
instead, leaving all other logic in \dfadmonbegin and the \dfadmon<type> macros
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: cb83a7f2-c945-43ba-932b-1625ec157fea

📥 Commits

Reviewing files that changed from the base of the PR and between a239100 and 0d9f352.

📒 Files selected for processing (1)
  • doc/dfetch_preamble.inc

Comment thread doc/dfetch_preamble.inc Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@doc/dfetch_preamble.inc`:
- Around line 75-76: Replace the two uses of \BeforeBeginEnvironment so the
font-size change is applied inside the environment scope: change the hooks for
the environments named "tabulary" and "longtable" from \BeforeBeginEnvironment
to \AtBeginEnvironment so the size change is localized and will be restored when
the environment ends; update the occurrences referencing
\BeforeBeginEnvironment{tabulary}{\small} and
\BeforeBeginEnvironment{longtable}{\small} accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 028887b1-ff4a-401c-b880-77e53cf14eb6

📥 Commits

Reviewing files that changed from the base of the PR and between 0d9f352 and dfac457.

📒 Files selected for processing (4)
  • doc/_ext/dfetch_style.py
  • doc/conf.py
  • doc/dfetch_preamble.inc
  • doc/static/css/custom.css

Comment thread doc/dfetch_preamble.inc Outdated
@spoorcc
Copy link
Copy Markdown
Contributor Author

spoorcc commented Apr 20, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@doc/conf.py`:
- Around line 113-114: The global setting pygments_style = "dfetch" affects all
builders; instead, remove that global assignment and in the Sphinx setup
function (setup(app)) listen for the "builder-inited" event
(app.connect("builder-inited", ...)) and inside the handler check
app.builder.name == "latex" (or startswith "latex") and then set
app.config.pygments_style = "dfetch" so the custom Pygments style is applied
only for LaTeX builds; update or add the handler function name referenced in
setup and ensure the module-level pygments_style assignment is removed.

In `@doc/dfetch_preamble.inc`:
- Around line 68-76: The global \renewcommand{\vline}{} is suppressing vertical
rules for the entire document; remove that global override and instead add the
\renewcommand{\vline}{} inside the existing \AtBeginEnvironment hooks so it only
applies to tabulary and longtable (e.g. update the
\AtBeginEnvironment{tabulary}{...} and \AtBeginEnvironment{longtable}{...} to
include \renewcommand{\vline}{} alongside \small), leaving the rest of preamble
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8224f03c-c1bf-4922-a542-a9f1a9b68e51

📥 Commits

Reviewing files that changed from the base of the PR and between dfac457 and 51604c0.

📒 Files selected for processing (3)
  • doc/_ext/dfetch_style.py
  • doc/conf.py
  • doc/dfetch_preamble.inc

Comment thread doc/conf.py Outdated
Comment thread doc/dfetch_preamble.inc Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@doc/dfetch_preamble.inc`:
- Line 97: Remove the redundant duplicate \usepackage{etoolbox} entry: find the
second occurrence of the \usepackage{etoolbox} line (the one added around the
doc preamble) and delete it so only the original \usepackage{etoolbox} remains;
ensure no other changes are made to surrounding preamble content.
- Around line 121-134: The LaTeX admonition macros (\dfadmonnote,
\dfadmonimportant, \dfadmonseealso, \dfadmontip, \dfadmonhint, \dfadmonwarning,
\dfadmoncaution, \dfadmonattention, \dfadmondanger, \dfadmonerror) are
duplicated; refactor by aliasing equivalent variants using \let (e.g.
\let\dfadmonhint\dfadmontip, \let\dfadmonimportant\dfadmonnote,
\let\dfadmonseealso\dfadmonnote, \let\dfadmoncaution\dfadmonwarning,
\let\dfadmonattention\dfadmonwarning, \let\dfadmonerror\dfadmondanger) and keep
a single canonical definition for each unique style used by the dispatcher
(\dfadmonnote, \dfadmontip, \dfadmonwarning, \dfadmondanger); leave
\dfadmonbegin as-is so unknown types still fall back to \dfadmonnote.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a7f5dc4f-0165-468f-ae5e-7e5ab28c9fae

📥 Commits

Reviewing files that changed from the base of the PR and between 51604c0 and d165c4b.

📒 Files selected for processing (2)
  • doc/dfetch_preamble.inc
  • doc/reference/cli_cheatsheet.rst

Comment thread doc/dfetch_preamble.inc
Comment thread doc/dfetch_preamble.inc
@spoorcc
Copy link
Copy Markdown
Contributor Author

spoorcc commented Apr 20, 2026

@coderabbitai resume
@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

@spoorcc: Resuming automatic reviews and triggering a fresh review of this PR now.

✅ Actions performed

Reviews resumed.


Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@spoorcc spoorcc merged commit 8a918ca into main Apr 20, 2026
39 checks passed
@spoorcc spoorcc deleted the feature/improve-pdf branch April 20, 2026 19:15
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.

2 participants