Skip to content

Commit

Permalink
Add copybutton sphinx extension for easy copy
Browse files Browse the repository at this point in the history
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
  • Loading branch information
afbjorklund committed Oct 20, 2022
1 parent 723fbb8 commit c55855e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Install Sphinx
run: |
pip install --user --upgrade --upgrade-strategy eager sphinx sphinx-rtd-theme restructuredtext_lint pygments
pip install --user --upgrade --upgrade-strategy eager sphinx sphinx-rtd-theme sphinx-copybutton restructuredtext_lint pygments
- name: Build web documentation
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

- name: Install Sphinx
run: |
pip install --user --upgrade --upgrade-strategy eager sphinx sphinx-rtd-theme restructuredtext_lint rstcheck pygments
pip install --user --upgrade --upgrade-strategy eager sphinx sphinx-rtd-theme sphinx-copybutton restructuredtext_lint rstcheck pygments
- name: Lint rst
run: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ First things first, you will need to install the following tools:
- After that then you will need to install Sphinx:

```sh
pip install -U Sphinx sphinx-rtd-theme
pip install -U Sphinx sphinx-rtd-theme sphinx-copybutton
```

You're all set! after this you will only need to use your favorite editor for
Expand Down
6 changes: 4 additions & 2 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []
extensions = ['sphinx_copybutton']

copybutton_selector = "div.copy-button pre"

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -293,4 +295,4 @@

# include replacements
sys.path.append(os.path.join(os.path.dirname(__file__), '.'))
from replacements import *
from replacements import *
1 change: 1 addition & 0 deletions installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ To use Vagrant via Homebrew:
Use ``vagrant init`` to create a new Vagrantfile, or use this example:

.. code-block:: ruby
:class: copy-button
Vagrant.configure("2") do |config|
# Choose operating system distribution
Expand Down

0 comments on commit c55855e

Please sign in to comment.