Skip to content

Commit 856a5e8

Browse files
christopher-hakkaartbentsherman
authored andcommitted
Add copy button selector to docs (nextflow-io#5663)
Signed-off-by: Christopher Hakkaart <[email protected]> Signed-off-by: Chris Hakkaart <[email protected]> Co-authored-by: Ben Sherman <[email protected]> Signed-off-by: Jonathan Manning <[email protected]>
1 parent 4378fc5 commit 856a5e8

File tree

3 files changed

+38
-20
lines changed

3 files changed

+38
-20
lines changed

docs/conf.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
'sphinxext.rediraffe',
3636
'sphinx_rtd_theme',
3737
'myst_parser',
38-
'sphinx_tabs.tabs'
38+
'sphinx_tabs.tabs',
39+
'sphinx_copybutton'
3940
]
4041

4142
myst_enable_extensions = ['colon_fence', 'deflist', 'dollarmath']
@@ -130,6 +131,8 @@
130131
# A list of ignored prefixes for module index sorting.
131132
#modindex_common_prefix = []
132133

134+
# Add copyable selector
135+
copybutton_selector = ".copyable pre"
133136

134137
# -- Options for HTML output ---------------------------------------------------
135138

docs/install.md

+32-18
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
Nextflow can be used on any POSIX-compatible system (Linux, macOS, etc), and on Windows through [WSL](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux). It requires Bash 3.2 (or later) and [Java 17 (or later, up to 23)](http://www.oracle.com/technetwork/java/javase/downloads/index.html) to be installed. You can see which version you have using the following command:
1010

11-
```bash
11+
```{code-block} bash
12+
:class: copyable
1213
java -version
1314
```
1415

@@ -22,21 +23,24 @@ To install Java with SDKMAN:
2223

2324
1. [Install SDKMAN](https://sdkman.io/install):
2425

25-
```bash
26+
```{code-block} bash
27+
:class: copyable
2628
curl -s https://get.sdkman.io | bash
2729
```
2830
2931
2. Open a new terminal.
3032
3133
3. Install Java:
3234
33-
```bash
35+
```{code-block} bash
36+
:class: copyable
3437
sdk install java 17.0.10-tem
3538
```
3639
3740
4. Confirm that Java is installed correctly:
3841
39-
```bash
42+
```{code-block} bash
43+
:class: copyable
4044
java -version
4145
```
4246
@@ -48,25 +52,28 @@ Nextflow is distributed as a self-installing package, in order to make the insta
4852
4953
1. Install Nextflow:
5054
51-
```bash
55+
```{code-block} bash
56+
:class: copyable
5257
curl -s https://get.nextflow.io | bash
5358
```
5459
5560
This will create the `nextflow` executable in the current directory.
5661
5762
:::{tip}
58-
You can set `export CAPSULE_LOG=none` to make the installation logs less verbose.
63+
Set `export CAPSULE_LOG=none` to make the installation logs less verbose.
5964
:::
6065
6166
2. Make Nextflow executable:
6267
63-
```bash
68+
```{code-block} bash
69+
:class: copyable
6470
chmod +x nextflow
6571
```
6672
6773
3. Move Nextflow into an executable path. For example:
6874
69-
```bash
75+
```{code-block} bash
76+
:class: copyable
7077
mkdir -p $HOME/.local/bin/
7178
mv nextflow $HOME/.local/bin/
7279
```
@@ -81,21 +88,24 @@ Nextflow is distributed as a self-installing package, in order to make the insta
8188
8289
4. Confirm that Nextflow is installed correctly:
8390
84-
```bash
91+
```{code-block} bash
92+
:class: copyable
8593
nextflow info
8694
```
8795
8896
## Updates
8997
9098
With Nextflow installed in your environment, you can update to the latest version using the following command:
9199
92-
```bash
100+
```{code-block} bash
101+
:class: copyable
93102
nextflow self-update
94103
```
95104

96105
You can also temporarily switch to a specific version of Nextflow with the `NXF_VER` environment variable. For example:
97106

98-
```bash
107+
```{code-block} bash
108+
:class: copyable
99109
NXF_VER=23.10.0 nextflow info
100110
```
101111

@@ -107,13 +117,15 @@ Additionally, an *edge* version is released on a monthly basis. The edge release
107117

108118
To use the latest edge release, set `NXF_EDGE=1` when updating:
109119

110-
```bash
120+
```{code-block} bash
121+
:class: copyable
111122
NXF_EDGE=1 nextflow self-update
112123
```
113124

114125
You can also use `NXF_VER` to temporarily switch to any edge release. For example:
115126

116-
```bash
127+
```{code-block} bash
128+
:class: copyable
117129
NXF_VER=24.06.0-edge nextflow info
118130
```
119131

@@ -128,16 +140,18 @@ of the corresponding Nextflow plugins.
128140

129141
To use the standalone distribution:
130142

131-
1. Download it from the [GitHub releases page](https://github.com/nextflow-io/nextflow/releases), under the "Assets" section for a specific
143+
1. Download the standalone distribution from Assets section of the [GitHub releases page](https://github.com/nextflow-io/nextflow/releases).
132144

133-
2. Grant execution permissions to the downloaded file e.g.
145+
2. Grant execution permissions to the downloaded file. For example:
134146

135-
```
147+
```{code-block} bash
148+
:class: copyable
136149
chmod -x nextflow-24.10.1-dist
137150
```
138151
139-
3. Then you can use it as a drop-in replacement for `nextflow` command. For example:
152+
3. Use it as a drop-in replacement for `nextflow` command. For example:
140153
141-
```
154+
```{code-block} bash
155+
:class: copyable
142156
./nextflow-24.10.1-dist run hello
143157
```

docs/requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ sphinx==5.3.0
33
sphinx-rtd-theme==1.1.1
44
sphinxcontrib-mermaid==0.9.2
55
sphinxext-rediraffe==0.2.7
6-
sphinx-tabs==3.4.5
6+
sphinx-tabs==3.4.5
7+
sphinx-copybutton==0.5.2

0 commit comments

Comments
 (0)