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

feat: Add copy button to code elements #664

Merged
merged 2 commits into from
Apr 6, 2023

Conversation

michael-wisely-gravwell
Copy link
Contributor

This PR addresses #655

This PR proposes adding a "copy" button to...

  • the <pre> command blocks on ingester pages that show install instructions
  • all other code blocks

The relevant issue requests that the command work on the command blocks, but I figured it might not hurt to expand the scope to other config stuff as well. It's pretty convenient to just click-to-copy config chunks.

::: {parsed-literal}
bash {{standalone}}_installer_X.X.X.sh
:::
:::::
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Due to how the copy button is placed, I added a colon-code-fence around the existing colon-code-fence in order to create a div


div.docutils button.copybtn:active {
background-color: rgb(187, 187, 187);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The copybutton plugin looks for div.highlight and .highlight specifically. I added the styles here, so that the ingester install commands would show the button on hover as well.

Copy link
Contributor

@kris-watts-gravwell kris-watts-gravwell left a comment

Choose a reason for hiding this comment

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

LGTM, i GROK

@kris-watts-gravwell kris-watts-gravwell merged commit 52f3c00 into gravwell:dev Apr 6, 2023
@kris-watts-gravwell kris-watts-gravwell deleted the feat/655 branch April 6, 2023 19:23
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