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

docs: collapse code #926

Merged
merged 7 commits into from
May 20, 2023
Merged

docs: collapse code #926

merged 7 commits into from
May 20, 2023

Conversation

holic
Copy link
Member

@holic holic commented May 20, 2023

Adds a component to wrap docs code snippets so that we can collapse lines that are far away from highlighted lines.

  • code blocks start collapsed, but can individually be expanded
  • adds a faint dotted line between snipped lines to make it clear they're in different sections of the file
  • "copy" button will still copy the entire code block (including hidden lines)

collapsed:
image

collapsed hover:
image

expanded (and what it looks like prior to this change):
image

@holic holic requested a review from alvrs as a code owner May 20, 2023 04:46
@holic
Copy link
Member Author

holic commented May 20, 2023

alvrs
alvrs previously approved these changes May 20, 2023
Copy link
Member

@alvrs alvrs left a comment

Choose a reason for hiding this comment

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

This is very cool! Small nit: the dotted line is very hard to see on the dark theme:
CleanShot 2023-05-20 at 10 57 26@2x

Not blocking though!

@holic holic merged commit df25b71 into main May 20, 2023
@holic holic deleted the holic/docs-collapse-code branch May 20, 2023 15:03
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.

2 participants