Skip to content

Commit 89f2aff

Browse files
authored
Merge pull request #1150 from chuaxr/chuaxr-patch-1
Updated README for snippets
2 parents 8f2c1d2 + c054da6 commit 89f2aff

File tree

1 file changed

+6
-5
lines changed
  • src/jupyter_contrib_nbextensions/nbextensions/snippets

1 file changed

+6
-5
lines changed

src/jupyter_contrib_nbextensions/nbextensions/snippets/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ example snippet is included with this extension.
1313
Adding new snippets
1414
-------------------
1515

16-
Snippets are specified by adding a new JSON block to the list of existing snippets in `nbextensions/snippets/snippets.json`. For example, to add a new snippet that imports numpy, matplotlib, and a print statement, the JSON file should be modified from:
16+
Snippets are specified by adding a new JSON block to the list of existing snippets in `$(jupyter --data-dir)/nbextensions/snippets/snippets.json`. For example, to add a new snippet that imports numpy, matplotlib, and a print statement, the JSON file should be modified from:
1717

1818
```json
1919
{
@@ -23,8 +23,8 @@ Snippets are specified by adding a new JSON block to the list of existing snippe
2323
"code" : [
2424
"# This is an example snippet!",
2525
"# To create your own, add a new snippet block to the",
26-
"# snippets.json file in your jupyter nbextensions directory:",
27-
"# /nbextensions/snippets/snippets.json",
26+
"# snippets.json file in your jupyter data directory under nbextensions:",
27+
"# $(jupyter --data-dir)/nbextensions/snippets/snippets.json",
2828
"import this"
2929
]
3030
}
@@ -42,8 +42,8 @@ to this:
4242
"code" : [
4343
"# This is an example snippet!",
4444
"# To create your own, add a new snippet block to the",
45-
"# snippets.json file in your jupyter nbextensions directory:",
46-
"# /nbextensions/snippets/snippets.json",
45+
"# snippets.json file in your jupyter data directory under nbextensions:",
46+
"# $(jupyter --data-dir)/nbextensions/snippets/snippets.json",
4747
"import this"
4848
]
4949
},
@@ -58,3 +58,4 @@ to this:
5858
]
5959
}
6060
```
61+
You may need to restart your notebook for the changes to take effect.

0 commit comments

Comments
 (0)