|
1 | 1 | Features |
2 | 2 | ======== |
3 | 3 |
|
| 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 | + |
4 | 12 | Creation of a New Snippet |
5 | 13 | ------------------------- |
6 | 14 |
|
| 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: |
7 | 17 | .. 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. |
8 | 20 | .. 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. |
15 | 23 | .. 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. |
17 | 27 |
|
18 | 28 | Use of Code Snippets |
19 | 29 | -------------------- |
20 | 30 |
|
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 |
24 | 63 |
|
25 | 64 | Search of Code Snippets |
26 | 65 | ----------------------- |
27 | 66 |
|
| 67 | +With the filter box as below, **search** snippets with name, language, and code with search bar or **filter** them with language/filter tags! |
28 | 68 | .. 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 |
33 | 70 |
|
| 71 | +Furthermore, hover over snippets to see the preview of each snippet. |
34 | 72 | .. 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 |
0 commit comments