Skip to content

Commit a635d58

Browse files
authored
Merge pull request #192 from jahn96/documentation
Update documentation
2 parents b25558e + e5889f7 commit a635d58

16 files changed

+38
-30
lines changed

Design/add_custom_snippet.png

-56 KB
Binary file not shown.

Design/add_snippet.png

-43.6 KB
Binary file not shown.

Design/codeSnippetEditor.png

-75.7 KB
Binary file not shown.

Design/code_snippet_edit.png

150 KB
Loading

Design/code_snippet_filter_box.png

47.8 KB
Loading

Design/code_snippet_input_dialog.png

96.1 KB
Loading

Design/code_snippet_menu.png

23.7 KB
Loading

Design/code_snippet_preview.png

37.4 KB
Loading

Design/create_from_scratch.png

129 KB
Loading

Design/options.png

-19 KB
Binary file not shown.

Design/right_click.png

211 KB
Loading

Design/search_filter.png

-20.5 KB
Binary file not shown.

docs/contributor/codebase.rst

+14-19
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Directories
77
Code Snippets: ``snippets/``
88
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
99

10-
This comprises the predefined code snippets for the extension. Refer to
10+
This comprises the sample code snippets for the extension. Refer to
1111
`Code Snippet Metadata`_ to learn more about the content of each code
1212
snippet.
1313

@@ -16,11 +16,11 @@ Binder setup: ``binder/``
1616
This contains an environment specification for ``repo2docker`` which
1717
allows the repository to be tested on `mybinder.org`_. This
1818
specification is developer focused. For a more user-focused binder see
19-
the `JupyterLab demo`_
19+
the `JupyterLab demo`_.
2020

21-
Test: ``test/``
22-
^^^^^^^^^^^^^^^
23-
This contains test scripts that test our codebase using jest.
21+
Test: ``test/`` ``cypress/``
22+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23+
``test/`` contains unit test scripts using jest. And, ``cypress/`` contains integration test scripts using Cypress.
2424

2525
Design: ``design/``
2626
^^^^^^^^^^^^^^^^^^^
@@ -41,30 +41,25 @@ Description of each file in ``src/``
4141

4242
- CodeSnippetContentsService.ts: this contains a wrapper class that
4343
uses the functions defined in @jupyterlab/contentsSerivce.
44-
- CodeSnippetDisplay.tsx: this contains a React component that renders
44+
- CodeSnippetDisplay.tsx: this contains a major React component that defines key code snippets UI and renders
4545
code snippets.
4646
- CodeSnippetEditor.tsx : this contains a React component that creates
4747
an editor for each code snippet.
4848
- CodeSnippetEditorTags.tsx: this contains a React component that
4949
renders code snippet tags in code snippet editor.
50-
- CodeSnippetForm.tsx: this contains a Lumino widget that creates a
51-
input form to create a new code snippet as a modal window.
52-
- CodeSnippetInputDialog.ts: this contains a Lumino widget that defines
50+
- CodeSnippetFilterTools.tsx: this contains a react component that renders a
51+
search bar and filter box.
52+
- CodeSnippetInputDialog.ts: this contains a class that defines
5353
the content of the custom code snippet form.
5454
- CodeSnippetLanguages.ts: this contains a list of supported languages
5555
and their corresponding icons.
56-
- CodeSnippetWidget.tsx: this contains a Lumino react widget that acts
57-
as a container of code snippets.
58-
- CodeSnippetWidgetModel.ts: this contains a code snippet model that
59-
keeps track of a list of code snippets being used in the extension.
60-
- ConfirmMessage.ts: this contains a luminio widget that creates
61-
confirmation dialog as a modal window after snippet creation.
62-
- FilterTools.tsx: this contains a react component that renders a
63-
search bar and filter box.
6456
- CodeSnippetMenu.ts: this contains a lumino widget that creates dropdown
6557
dialog when three dots icon is clicked.
66-
- PreviewSnippet.ts: this contains a lumino widget used to create
67-
preview minimap.
58+
- CodeSnippetMessage.ts: this contains a class that creates a message as a modal window after creating, copying, or downloading snippet.
59+
- CodeSnippetPreview.ts: this contains a lumino widget that creates a preview minimap.
60+
- CodeSnippetService.ts: this contains a wrapper class that handles the backend storage of the code snippets in JupyterLab Settings API.
61+
- CodeSnippetUtilities.ts: this contains a few utility functions that are used across the codebase.
62+
- CodeSnippetWidget.tsx: this contains a Lumino react widget that acts as a container of code snippets.
6863
- index.ts: this contains the activation of our extension.
6964

7065
.. _Code Snippet Metadata: https://jupyterlab-code-snippets-documentation.readthedocs.io/en/latest/contributor/snippet_metadata.html

docs/getting_started/changelog.rst

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ v2.1.0
99
* Improved search : can search for code, language, and name in search bar.
1010
* Expanded tags : now can filter by language tag and by snippet tag.
1111
* Added ability to download snippets to local directory.
12+
* Made right click to open the code snippet contextMenu possible anywhere on code snippet in addition to the three dots.
13+
* Made possible to create or move a snippet while snippets are filtered.
14+
* Set the language of a new snippet as the kernel language by default.
1215
* Improved snippet creation process by making description optional and allowing uppercase and spaces in snippet names.
1316
* Made minor UI and bug fixes.
1417

docs/user/features.rst

+12-7
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,38 @@ Features
44
Creation of a New Snippet
55
-------------------------
66

7-
- Right click and save highlighted lines of code
7+
.. image:: ../../Design/right_click.png
8+
.. 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
811
- Drag cell into panel to save
912
- Select cell(s) and right click to save content as snippet
1013
- Select cell(s) and use keyboard shortcut (cmd-shift-A or ctrl-shift-A) to save content as snippet
11-
.. image:: ../../Design/add_snippet.png
1214

15+
.. image:: ../../Design/create_from_scratch.png
1316
- Plus button to create a new snippet from scratch
14-
.. image:: ../../Design/add_custom_snippet.png
1517

1618
Use of Code Snippets
1719
--------------------
18-
.. image:: ../../Design/options.png
19-
- Copy, Insert, Delete snippet
20+
21+
.. image:: ../../Design/code_snippet_menu.png
22+
- Copy, Insert, Edit, Download, Delete snippet
2023
- Drag snippet into any JupyterLab workspace
2124

2225
Search of Code Snippets
2326
-----------------------
2427

25-
.. image:: ../../Design/search_filter.png
28+
.. image:: ../../Design/code_snippet_filter_box.png
2629
- Scrollable/resizable snippet explorer panel displaying snippets
2730
- Move snippet within snippet explorer
2831
- Search bar for snippets
2932
- Filter tags for snippets
33+
34+
.. image:: ../../Design/code_snippet_preview.png
3035
- Snippet preview (on the side)
3136

3237
Edit of Existing Code Snippets
3338
------------------------------
3439

35-
.. image:: ../../Design/codeSnippetEditor.png
40+
.. image:: ../../Design/code_snippet_edit.png
3641
- Code Snippet Editor

docs/user/ux.rst

+9-4
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,22 @@ Find snippet
1919

2020
Edit snippet
2121
^^^^^^^^^^^^
22-
* Click 3 dots and select "Edit snippet" in dropdown.
22+
* Click 3 dots (or right click) and select "Edit snippet" in dropdown.
2323

2424
Use snippet
2525
^^^^^^^^^^^
2626
* Drag and drop snippet using 6 dot drag icon (visible on hover) to notebook.
2727

2828
* Will put snippet code into a cell upon insertion.
2929

30-
* Click 3 dots and select "Insert snippet" to insert snippet where cursor was on notebook.
31-
* Click 3 dots and select "Copy to clipboard" to copy snippet and paste it wherever desired.
30+
* Click 3 dots (or right click) and select "Insert snippet" to insert snippet where cursor was on notebook.
31+
* Click 3 dots (or right click) and select "Copy to clipboard" to copy snippet and paste it wherever desired.
32+
33+
Download snippet
34+
^^^^^^^^^^^^^^^^
35+
* Click 3 dots (or right click) and select "Download snippet" and input the relative path to download. If the path is not given, it downloads it to the current directory.
36+
* Easy way to share snippets with others.
3237

3338
Delete snippet
3439
^^^^^^^^^^^^^^
35-
* Click 3 dots and select "Delete snippet" and confirm delete in dialog.
40+
* Click 3 dots (or right click) and select "Delete snippet" and confirm delete in dialog.

0 commit comments

Comments
 (0)