-
Notifications
You must be signed in to change notification settings - Fork 935
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(dev): add copy button for code blocks #15746
base: main
Are you sure you want to change the base?
Conversation
git checkout -b update_dev_db_dump | ||
git add dev/example.sql.xz | ||
git commit -m "Update development database dump" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These multi-line command blocks don't really copy correctly, we might want to break them into separate blocks instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what you mean? I tested the copy button, and my clipboard contents have:
git checkout -b update_dev_db_dump
git add dev/example.sql.xz
git commit -m "Update development database dump"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since copy/pasting this into a terminal would result in the first two lines immediately being executed due to the newlines, I would expect this to either be:
git checkout -b update_dev_db_dump
git add dev/example.sql.xz
git commit -m "Update development database dump"
or:
git checkout -b update_dev_db_dump; \
git add dev/example.sql.xz; \
git commit -m "Update development database dump"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(fwiw, I think I prefer the former)
To make it easier to copy code from the docs and paste into a terminal, add `sphinx-copybutton` which Furo theme already supports. Refs: https://pypi.org/project/sphinx-copybutton/ Remove leading `$` signs for commands, since they should not be copied. Signed-off-by: Mike Fiedler <miketheman@gmail.com>
5873382
to
35be698
Compare
To make it easier to copy code from the docs and paste into a terminal, add
sphinx-copybutton
which Furo theme already supports. Refs: https://pypi.org/project/sphinx-copybutton/Remove leading
$
signs for commands, since they should not be copied.