Skip to content

fix: add markdown extensions for PDF tab rendering - #231

Open
jackgdsf wants to merge 1 commit into
gdsfactory:mainfrom
jackgdsf:fix/pdf-tab-rendering
Open

fix: add markdown extensions for PDF tab rendering#231
jackgdsf wants to merge 1 commit into
gdsfactory:mainfrom
jackgdsf:fix/pdf-tab-rendering

Conversation

@jackgdsf

@jackgdsf jackgdsf commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Add pymdownx.tabbed, pymdownx.superfences, and admonition markdown extensions to mkdocs-pdf.yml so content tabs and warning blocks render correctly in the release PDF.

Without these extensions, the PDF shows literal tab syntax and raw admonition markup instead of rendered content.

Same fix as doplaydo/tps45#296.

Changes

  • mkdocs-pdf.yml: Add markdown_extensions section

Test plan

  • Verify mkdocs build -f mkdocs-pdf.yml succeeds

Closes #230

Summary by Sourcery

Build:

  • Add required markdown extensions to mkdocs-pdf.yml for proper rendering of tabs and admonitions in PDF builds.

Add pymdownx.tabbed, pymdownx.superfences, and admonition so content tabs
and warning blocks render correctly in the release PDF.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@sourcery-ai

sourcery-ai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Configures MkDocs PDF build to properly render tabbed content and admonition blocks by enabling the corresponding markdown extensions in mkdocs-pdf.yml.

Flow diagram for MkDocs PDF build with new markdown extensions

flowchart TD
    A[MkDocs PDF build
mkdocs build -f mkdocs-pdf.yml] --> B[Load mkdocs-pdf.yml]
    B --> C[Enable markdown_extensions]
    C --> C1[pymdownx.tabbed
alternate_style true]
    C --> C2[pymdownx.superfences]
    C --> C3[admonition]
    C1 --> D[Render markdown
with tabs]
    C2 --> D
    C3 --> E[Render markdown
with admonitions]
    D --> F[Generate PDF
with rendered tabs]
    E --> F
Loading

File-Level Changes

Change Details Files
Enable tabbed content and admonition rendering for the PDF build by configuring markdown extensions in the MkDocs PDF config.
  • Add a markdown_extensions section to the MkDocs PDF configuration
  • Enable pymdownx.tabbed with alternate_style set to true to support tabbed content syntax
  • Enable pymdownx.superfences to correctly render fenced content used by tabs
  • Enable admonition extension to render admonition/warning/info blocks instead of showing raw markup
mkdocs-pdf.yml

Assessment against linked issues

Issue Objective Addressed Explanation
#230 Add the markdown extensions pymdownx.tabbed, pymdownx.superfences, and admonition to mkdocs-pdf.yml so that content tabs and warning/admonition blocks render correctly in the generated PDF.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • To avoid the PDF build rendering differently from the main site, consider mirroring the full markdown_extensions configuration from your primary mkdocs.yml (not just the three newly added ones) so both builds stay in sync.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- To avoid the PDF build rendering differently from the main site, consider mirroring the full `markdown_extensions` configuration from your primary `mkdocs.yml` (not just the three newly added ones) so both builds stay in sync.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@das-dias das-dias self-assigned this Jul 28, 2026
@das-dias das-dias added the dependencies Pull requests that update a dependency file label Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: add markdown extensions to mkdocs-pdf.yml

2 participants