Skip to content

Conversation

@lrnv
Copy link

@lrnv lrnv commented Sep 28, 2025

This PR simply allow admonitions that are not in the vitepress list to be passed through, and let vitepress handle them.

Should help with #95 and #288.

@gemini-code-assist
Copy link

Summary of Changes

Hello @lrnv, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines the processing of admonitions by removing a restrictive check that previously converted non-standard admonition types to a default "tip" category. The primary goal is to enhance flexibility and ensure that external rendering engines, such as VitePress, can correctly interpret and display a broader range of admonition styles without interference from the internal processing logic.

Highlights

  • Admonition Handling: Removed the internal enforcement that restricted admonition types to a predefined list (tip, warning, danger, caution). Unrecognized admonition types will now be passed through directly without modification.
  • External Tool Compatibility: This change improves compatibility with external rendering tools like VitePress, allowing them to handle a wider variety of admonition types as originally specified in the markdown.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request removes the logic that was forcing unknown admonition types to be rendered as 'tip'. By removing this restriction, any admonition category can be passed through to VitePress, allowing it to handle rendering. This change correctly implements the intended feature and also removes what appears to be a bug in the old code where the admonition title was not being correctly updated. The change is clean and improves flexibility. I have no further suggestions.

@asinghvi17
Copy link
Collaborator

asinghvi17 commented Sep 28, 2025

I think we might need some css magic to catch unknown admonitions and make sure they render in a neutral way. But otherwise this looks good! Could also use a "test" i.e. putting this in the markdown page of the docs.

@codecov
Copy link

codecov bot commented Sep 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 7.77%. Comparing base (fed5b13) to head (7934597).

Additional details and impacted files
@@            Coverage Diff            @@
##           master    #289      +/-   ##
=========================================
+ Coverage    7.73%   7.77%   +0.03%     
=========================================
  Files           6       6              
  Lines         892     888       -4     
=========================================
  Hits           69      69              
+ Misses        823     819       -4     

☔ View full report in Codecov by Sentry.
📢 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.

@lazarusA
Copy link
Member

We need examples in the docs, to see that this actually works. I don't think it does at the moment.

@lrnv
Copy link
Author

lrnv commented Sep 28, 2025

I am doing experiments there : lrnv/Copulas.jl#304, but i have trouble adjusting the CSS.

I am not sure this will work without the patch to the config.mts that i did (same pr), but this should at least "let things go to vitepress", and Vitepress might yell at you if it sees unknown containers (did not test that).

If you want DocumenterVitepress.jl to handle this for the user, we could also port here the modification si did to my config.mts (same PR) and the CSS (still ongoing)

@lazarusA
Copy link
Member

any updates here?

@lrnv
Copy link
Author

lrnv commented Oct 29, 2025

The end of our previous discussion is unclear to me: what would be necessary for this to get merged / Which directions do you want to take ?

category = "tip"
end
title = admonition.title
if !(category ("tip", "warning", "danger", "caution"))
Copy link
Member

@lazarusA lazarusA Oct 29, 2025

Choose a reason for hiding this comment

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

we still want the old categories right? and a default one, as is, but we want to render a new if a different name category is provided.

@lazarusA
Copy link
Member

lazarusA commented Oct 29, 2025

some examples in the docs, with steps on how to incorporate the new css for those. Don't know exactly what is your workflow for that to work.

see (similar to):

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.

3 participants