Skip to content

Fix gallery card titles and let notebooks pick their thumbnail - #913

Open
jessegrabowski wants to merge 10 commits into
pymc-devs:mainfrom
jessegrabowski:update-thumbnail-extractor
Open

jessegrabowski wants to merge 10 commits into
pymc-devs:mainfrom
jessegrabowski:update-thumbnail-extractor

Conversation

@jessegrabowski

Copy link
Copy Markdown
Member

Gallery card titles are now plain text taken from each notebook's first # heading, and the card itself is the only link. ITEM_TEMPLATE used to wrap every title in :doc:. That rendered local notebook titles as a second link inside the card, and the six cards that point into the PyMC docs showed their titles as unresolved references.

Headings with inline code or $...$ math are converted to reST before they go into gallery.rst. This affects three notebooks today: GP-MaunaLoa2, AR, and discrete_markov_chain_marginalization.

The Model Comparison and Prior and Posterior Predictive Checks cards had each other's thumbnails. They now show their own.

thumbnail_extractor.py now takes the thumbnail from the first image of a cell tagged gallery-thumbnail. Notebooks without the tag still use their last image. The extractor also skips notebooks that git doesn't track, leaves out sections with no cards, and centers the vertical crop on cy instead of cx.

Moved the pixi config from pixi.toml into pyproject.toml and added a docs environment. pixi run docs-build builds the HTML into _build/, and pixi run docs-serve builds and then serves it on 127.0.0.1:8000.

The docs environment's dependencies are copied from requirements-docs.txt. Read the Docs still installs from that file, so the two lists have to be kept in sync by hand.

The generated gallery was checked against the live site. All 150 card titles match, apart from curly quotes that Sphinx adds at render time.

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.

1 participant