René's URL Explorer Experiment


Title: change: Generate mermaid diagrams at build time? · Issue #254 · mkdocstrings/python · GitHub

Open Graph Title: change: Generate mermaid diagrams at build time? · Issue #254 · mkdocstrings/python

X Title: change: Generate mermaid diagrams at build time? · Issue #254 · mkdocstrings/python

Description: Is your change request related to a problem? Please describe. Currently, inheritance diagrams are generated as Mermaid divs, which are then rendered on the client-side. They need a bit of javascript in order to set the URLs on the clicka...

Open Graph Description: Is your change request related to a problem? Please describe. Currently, inheritance diagrams are generated as Mermaid divs, which are then rendered on the client-side. They need a bit of javascrip...

X Description: Is your change request related to a problem? Please describe. Currently, inheritance diagrams are generated as Mermaid divs, which are then rendered on the client-side. They need a bit of javascrip...

Opengraph URL: https://github.com/mkdocstrings/python/issues/254

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"change: Generate mermaid diagrams at build time?","articleBody":"### Is your change request related to a problem? Please describe.\nCurrently, inheritance diagrams are generated as Mermaid divs, which are then rendered on the client-side. They need a bit of javascript in order to set the URLs on the clickable nodes. Sometimes these diagrams take a bit of time to render, leaving the ugly div / code block visible to users for one second or less. Also, such dynamic content is not supported by Material for MkDocs' instant previews, so they do not look good at all when hovering on links.\n\n### Describe the solution you'd like\nI wonder if it would be possible to generate the SVGs at build time (with a Jinja filter), keeping `\u003cautoref\u003e` elements where `\u003ca\u003e` links should appear (in the clickable nodes). This way we show all nodes, and resolvable ones will become clickable automatically when autorefs applies cross-refs. This is all done at build time, and won't require any javascript (custom or mermaid.js) on the client-side, meaning diagrams should then be displayed instantly and correctly in instant previews. CSS should work as previously.\n\n### Alternatives\nFinding a way to hide diagrams from instant previews.\n\n### Additional context\nI don't think it's a problem if we move the logic for rendering diagrams into Python code, instead of Jinja templates, since this is not something that we likely want to customize (it's really just Jinja loops to render a Mermaid flowchart). It could still be interesting to document how to override filters, in case users want to customize how the SVG is rendered. The filter can always accept options, too.","author":{"url":"https://github.com/pawamoy","@type":"Person","name":"pawamoy"},"datePublished":"2025-02-24T14:09:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/254/python/issues/254"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:439006fb-0db5-5d59-b276-6a302ba4ea8a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA724:B1425:8B6F17:B88D27:6971682C
html-safe-nonceed8c74e8b100062831ed649d3784bedad69a7f28f5c5c5115047627548f11ec4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzI0OkIxNDI1OjhCNkYxNzpCODhEMjc6Njk3MTY4MkMiLCJ2aXNpdG9yX2lkIjoiNTEzMjI2OTgyNzc5OTQ3NjI2OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac366224476ef9436ccc311155b8d33cae4d7a7a0fd6cf528b8da2aeadc5133623
hovercard-subject-tagissue:2875086504
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/mkdocstrings/python/254/issue_layout
twitter:imagehttps://opengraph.githubassets.com/08f167bb6b3c808dc7391cf31b604b3fdf6dbbef15ba88e8408379fae71cb656/mkdocstrings/python/issues/254
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/08f167bb6b3c808dc7391cf31b604b3fdf6dbbef15ba88e8408379fae71cb656/mkdocstrings/python/issues/254
og:image:altIs your change request related to a problem? Please describe. Currently, inheritance diagrams are generated as Mermaid divs, which are then rendered on the client-side. They need a bit of javascrip...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepawamoy
hostnamegithub.com
expected-hostnamegithub.com
None873364ab8c3892d45b3a7f6c012702ee84934662b47c9312d99f8b31dd9c2668
turbo-cache-controlno-preview
go-importgithub.com/mkdocstrings/python git https://github.com/mkdocstrings/python.git
octolytics-dimension-user_id75664361
octolytics-dimension-user_loginmkdocstrings
octolytics-dimension-repository_id422878404
octolytics-dimension-repository_nwomkdocstrings/python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id422878404
octolytics-dimension-repository_network_root_nwomkdocstrings/python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasefa6ed180534301da051f8e5cb00f3a1dfab789ec
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/mkdocstrings/python/issues/254#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmkdocstrings%2Fpython%2Fissues%2F254
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmkdocstrings%2Fpython%2Fissues%2F254
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=mkdocstrings%2Fpython
Reloadhttps://patch-diff.githubusercontent.com/mkdocstrings/python/issues/254
Reloadhttps://patch-diff.githubusercontent.com/mkdocstrings/python/issues/254
Reloadhttps://patch-diff.githubusercontent.com/mkdocstrings/python/issues/254
mkdocstrings https://patch-diff.githubusercontent.com/mkdocstrings
pythonhttps://patch-diff.githubusercontent.com/mkdocstrings/python
Please reload this pagehttps://patch-diff.githubusercontent.com/mkdocstrings/python/issues/254
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fmkdocstrings%2Fpython
Fork 52 https://patch-diff.githubusercontent.com/login?return_to=%2Fmkdocstrings%2Fpython
Star 260 https://patch-diff.githubusercontent.com/login?return_to=%2Fmkdocstrings%2Fpython
Code https://patch-diff.githubusercontent.com/mkdocstrings/python
Issues 10 https://patch-diff.githubusercontent.com/mkdocstrings/python/issues
Pull requests 0 https://patch-diff.githubusercontent.com/mkdocstrings/python/pulls
Discussions https://patch-diff.githubusercontent.com/mkdocstrings/python/discussions
Actions https://patch-diff.githubusercontent.com/mkdocstrings/python/actions
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/mkdocstrings/python/security
Please reload this pagehttps://patch-diff.githubusercontent.com/mkdocstrings/python/issues/254
Insights https://patch-diff.githubusercontent.com/mkdocstrings/python/pulse
Code https://patch-diff.githubusercontent.com/mkdocstrings/python
Issues https://patch-diff.githubusercontent.com/mkdocstrings/python/issues
Pull requests https://patch-diff.githubusercontent.com/mkdocstrings/python/pulls
Discussions https://patch-diff.githubusercontent.com/mkdocstrings/python/discussions
Actions https://patch-diff.githubusercontent.com/mkdocstrings/python/actions
Security https://patch-diff.githubusercontent.com/mkdocstrings/python/security
Insights https://patch-diff.githubusercontent.com/mkdocstrings/python/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/mkdocstrings/python/issues/254
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/mkdocstrings/python/issues/254
change: Generate mermaid diagrams at build time?https://patch-diff.githubusercontent.com/mkdocstrings/python/issues/254#top
https://patch-diff.githubusercontent.com/pawamoy
insidersCandidate for Insidershttps://github.com/mkdocstrings/python/issues?q=state%3Aopen%20label%3A%22insiders%22
refactorChange suggestion, not a bug nor a feature.https://github.com/mkdocstrings/python/issues?q=state%3Aopen%20label%3A%22refactor%22
https://github.com/pawamoy
https://github.com/pawamoy
pawamoyhttps://github.com/pawamoy
on Feb 24, 2025https://github.com/mkdocstrings/python/issues/254#issue-2875086504
pawamoyhttps://patch-diff.githubusercontent.com/pawamoy
insidersCandidate for Insidershttps://github.com/mkdocstrings/python/issues?q=state%3Aopen%20label%3A%22insiders%22
refactorChange suggestion, not a bug nor a feature.https://github.com/mkdocstrings/python/issues?q=state%3Aopen%20label%3A%22refactor%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.