Skip to content

Commit

Permalink
doc: add button to copy code blocks in Dune manual (ocaml#6428)
Browse files Browse the repository at this point in the history
Uses sphinx-copybutton <https://sphinx-copybutton.readthedocs.io/en/latest/>.

Signed-off-by: Antonin Décimo <[email protected]>
  • Loading branch information
MisterDA authored Nov 15, 2022
1 parent 994f684 commit d17049f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2

build:
os: "ubuntu-22.04"
tools:
python: "3.10"

sphinx:
configuration: doc/conf.py

python:
install:
- requirements: doc/requirements.txt
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ distclean: clean
doc:
sphinx-build -W doc doc/_build

# livedoc-deps: you may need to [pip3 install sphinx-autobuild] and [pip3 install sphinx-rtd-theme]
# livedoc-deps: you may need to [pip3 install sphinx-autobuild] and [pip3 install -r doc/requirements.txt]
livedoc:
cd doc && sphinx-autobuild . _build --port 8888 -q --re-ignore '\.#.*'

Expand Down
4 changes: 3 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,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'
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down
3 changes: 3 additions & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sphinx >= 4.5.0
sphinx_rtd_theme >= 1.0.0
sphinx-copybutton >= 0.5.0
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
[
sphinx
sphinx-autobuild
python310Packages.sphinx-copybutton
python310Packages.sphinx-rtd-theme
]
);
Expand Down

0 comments on commit d17049f

Please sign in to comment.