Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically hide long definitions using admonitions #2

Open
fizruk opened this issue Sep 21, 2023 · 0 comments
Open

Automatically hide long definitions using admonitions #2

fizruk opened this issue Sep 21, 2023 · 0 comments

Comments

@fizruk
Copy link
Member

fizruk commented Sep 21, 2023

The idea is to automatically hide definitions when they are "too large" (which can be configurable based on the number of lines). For example, here is what it might look like for is-natural-in-family-yon:

Screenshot 2023-09-21 at 13 39 29

The change should be purely text-based: separating a part of a block that starts with a line that contains a single := and ends either with an end of a code block, or a non-empty line that is not indented. I think that should be enough.

Then, in mkdocs.yml we could have something like

plugins:
  - rzk:
      collapse-large-definitions:
        min-lines: 4  # auto-collapse rendered definitions with 4+ lines (keeping statements/type signatures)
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

No branches or pull requests

1 participant