From c054da6b0f8262c6c2b68e7ee1e48f9ec53a1bad Mon Sep 17 00:00:00 2001 From: chuaxr <30007270+chuaxr@users.noreply.github.com> Date: Sun, 29 Oct 2017 18:28:47 -0400 Subject: [PATCH] Updated README for snippets Adds more detail on adding a snippet to the snippets extension. --- .../nbextensions/snippets/README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/jupyter_contrib_nbextensions/nbextensions/snippets/README.md b/src/jupyter_contrib_nbextensions/nbextensions/snippets/README.md index 9f43507..4f62a53 100644 --- a/src/jupyter_contrib_nbextensions/nbextensions/snippets/README.md +++ b/src/jupyter_contrib_nbextensions/nbextensions/snippets/README.md @@ -13,7 +13,7 @@ example snippet is included with this extension. Adding new snippets ------------------- -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: +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: ```json { @@ -23,8 +23,8 @@ Snippets are specified by adding a new JSON block to the list of existing snippe "code" : [ "# This is an example snippet!", "# To create your own, add a new snippet block to the", - "# snippets.json file in your jupyter nbextensions directory:", - "# /nbextensions/snippets/snippets.json", + "# snippets.json file in your jupyter data directory under nbextensions:", + "# $(jupyter --data-dir)/nbextensions/snippets/snippets.json", "import this" ] } @@ -42,8 +42,8 @@ to this: "code" : [ "# This is an example snippet!", "# To create your own, add a new snippet block to the", - "# snippets.json file in your jupyter nbextensions directory:", - "# /nbextensions/snippets/snippets.json", + "# snippets.json file in your jupyter data directory under nbextensions:", + "# $(jupyter --data-dir)/nbextensions/snippets/snippets.json", "import this" ] }, @@ -58,3 +58,4 @@ to this: ] } ``` +You may need to restart your notebook for the changes to take effect.