Skip to content

Commit a72d84d

Browse files
committed
Update features section in documentation
1 parent f81c30e commit a72d84d

File tree

9 files changed

+63
-32
lines changed

9 files changed

+63
-32
lines changed
163 KB
Loading

Design/Code Snippet Menu.png

107 KB
Loading

Design/code_snippet_menu.png

-23.7 KB
Binary file not shown.

Design/copy_snippet.png

10.5 KB
Loading

Design/delete snippet.png

25.7 KB
Loading

Design/download_snippets.png

11 KB
Loading

Design/download_snippets_box.png

28.9 KB
Loading

docs/user/features.rst

Lines changed: 53 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,73 @@
11
Features
22
========
33

4+
Code Snippet Explorer
5+
---------------------
6+
7+
On the left side bar of the JupyterLab, you can click the snippet icon (</>) to open/close the code snippet explorer that contains all the saved snippets as below.
8+
You can scroll/resize code snippet explorer, order the snippets with drag and drop, and manage and search the snippets efficiently.
9+
.. image:: ../../Design/Code Snippet Extension Panel.png
10+
:align: center
11+
412
Creation of a New Snippet
513
-------------------------
614

15+
There are several ways to create a new snippet.
16+
1. Highlight lines of code and right click (or use keyboard shortcut (cmd-shift-A or ctrl-shift-A)) to save the code as a snippet. Or, you can select cell(s) and right click (or use keyboard shortcut (cmd-shift-A or ctrl-shift-A)) to save content as a snippet. Then, you will see the "Save As Code Snippet" option in JupyterLab context menu as below:
717
.. image:: ../../Design/right_click.png
18+
:align: center
19+
Then, clicking the option will open the dialog as below where you can input name, description, language, tags, and codes of a snippet.
820
.. image:: ../../Design/code_snippet_input_dialog.png
9-
10-
- Right click (or use keyboard shortcut (cmd-shift-A or ctrl-shift-A)) and save highlighted lines of code
11-
- Drag cell into panel to save
12-
- Select cell(s) and right click to save content as snippet
13-
- Select cell(s) and use keyboard shortcut (cmd-shift-A or ctrl-shift-A) to save content as snippet
14-
21+
:align:center
22+
2. More easily, just drag notebook cell(s) to the code snippet explorer on the left to create a new snippet. It will also open the dialog as above for your inputs.
1523
.. image:: ../../Design/create_from_scratch.png
16-
- Plus button to create a new snippet from scratch
24+
:align:center
25+
26+
3. Hit the plus button next to the search bar (refer to `Search of Code Snippets`_) to create a new snippet if you want to create a snippet not from the notebook cell.
1727

1828
Use of Code Snippets
1929
--------------------
2030

21-
.. image:: ../../Design/code_snippet_menu.png
22-
- Copy, Insert, Edit, Download, Delete snippet
23-
- Drag snippet into any JupyterLab workspace
31+
Click the three dots or right click anywhere on the snippet you want to use. It will open code snippet menu as below to insert, copy, edit, download, or delete the snippet.
32+
.. image:: ../../Design/Code Snippet Menu.png
33+
:align:center
34+
35+
Insert
36+
^^^^^^
37+
Click the insert option to insert. It will warn you if the language is different from the kernel langauge.
38+
Additionally, on hover with six dots on the left (refer to `Search of Code Snippets`_), drag snippet into any JupyterLab workspace to insert the snippet!
39+
40+
Copy
41+
^^^^
42+
Click the copy option to copy. It will create a message on the bottom right corner as below.
43+
.. image:: ../../Design/copy_snippet.png
44+
:align:center
45+
46+
Edit
47+
^^^^
48+
Edit the saved snippets by clicking the edit option. It will open a code snippet editor as below.
49+
.. image:: ../../Design/code_snippet_edit.png
50+
:align:center
51+
52+
Download
53+
^^^^^^^^
54+
Download snippets and share them with others by clicking the download option. It will open a box as below to input **relative path** to download the snippets.
55+
.. image:: ../../Design/download_snippets_box.png
56+
:align:center
57+
58+
Delete
59+
^^^^^^
60+
Delete snippets by clicking delete option. It will open a warning box as below.
61+
.. image:: ../../Design/delete snippet.png
62+
:align:center
2463

2564
Search of Code Snippets
2665
-----------------------
2766

67+
With the filter box as below, **search** snippets with name, language, and code with search bar or **filter** them with language/filter tags!
2868
.. image:: ../../Design/code_snippet_filter_box.png
29-
- Scrollable/resizable snippet explorer panel displaying snippets
30-
- Move snippet within snippet explorer
31-
- Search bar for snippets
32-
- Filter tags for snippets
69+
:align:center
3370

71+
Furthermore, hover over snippets to see the preview of each snippet.
3472
.. image:: ../../Design/code_snippet_preview.png
35-
- Snippet preview (on the side)
36-
37-
Edit of Existing Code Snippets
38-
------------------------------
39-
40-
.. image:: ../../Design/code_snippet_edit.png
41-
- Code Snippet Editor
73+
:align:center

docs/user/transition.rst

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ This script will concatenate and print out all of the json objects in a /snippet
9595
in a project. After running the script, copy the output and paste into the User Preferences
9696
panel in settings, similar to the single snippet upload.
9797

98-
NOTE: If adding objects to existing list of snippets in user preferences, change counter variable
99-
to n+1 where n is the ID of the last snippet stored in user preferences.
98+
**NOTE: If adding objects to existing list of snippets in user preferences, change counter variable to n+1 where n is the ID of the last snippet stored in user preferences.**
10099

101100
This script will print something like :
102101

@@ -138,17 +137,17 @@ After generating this dictionary, one can simply delete the current contents of
138137
This will delete the current snippets at the endpoint (will be default snippets if extension freshly updated)
139138
and replace them with the old snippets.
140139

141-
NOTE: If adding objects onto an existing list of objects, make sure the ID numbers are all in sequential,
142-
ascending order.
140+
**NOTE: If adding objects onto an existing list of objects, make sure the ID numbers are all in sequential,
141+
ascending order.**
143142

144143
Search and Tag Update
145144
---------------------
146145

147146
.. image:: ../../Design/smallUnselectedTags.png
148147
:align: center
149148

150-
NOTE: Snippet tags function on an OR basis, as in when the "data analytics" tag and the "import statements" tag are selected together,
151-
the panel displays any tags that are tagged as import statements OR tagged as "data analytics."
149+
**NOTE: Snippet tags function on an OR basis, as in when the "data analytics" tag and the "import statements" tag are selected together,
150+
the panel displays any tags that are tagged as import statements OR tagged as "data analytics."**
152151
ex) Snippet tags selected together:
153152

154153
.. image:: ../../Design/smallSnippetTagsSelected.png
@@ -159,17 +158,17 @@ ex) Language tags selected together:
159158
.. image:: ../../Design/smallLanguageTagsSelected.png
160159
:align: center
161160

162-
NOTE 2: Language tags and snippets tags have an AND relationship. As in when the "Python" tag and the "data analytics" tags are selected together,
163-
only snippets that are both in the language Python AND tagged as data analytics will appear.
161+
**NOTE 2: Language tags and snippets tags have an AND relationship. As in when the "Python" tag and the "data analytics" tags are selected together,
162+
only snippets that are both in the language Python AND tagged as data analytics will appear.**
164163

165164
.. image:: ../../Design/smallLangAndSnippetTag.png
166165
:align: center
167166

168-
NOTE 3: When language tags are selected, only snippet tags in that language will appear for ease of selection.
167+
**NOTE 3: When language tags are selected, only snippet tags in that language will appear for ease of selection.**
169168

170169
.. image:: ../../Design/smallPythonTagOnly.png
171170
:align: center
172171

173-
NOTE 4: If 2 of the same language tags appear in the Language Tags section this indicates that one of the snippets
172+
**NOTE 4: If 2 of the same language tags appear in the Language Tags section this indicates that one of the snippets
174173
contains a snippet tag that matches the language name. To get rid of the duplicate tag, filter through snippets and
175-
untag any snippets that have that Language in their snippet tags.
174+
untag any snippets that have that Language in their snippet tags.**

0 commit comments

Comments
 (0)