Skip to content

Commit d8a86c4

Browse files
committed
Added search documentation and modified script.
1 parent f2e96c6 commit d8a86c4

File tree

6 files changed

+31
-2
lines changed

6 files changed

+31
-2
lines changed

Design/langAndSnippetTag.png

76.6 KB
Loading

Design/languageTagsSelected.png

89.6 KB
Loading

Design/pythonTagOnly.png

84 KB
Loading

Design/snippetTagsSelected.png

88.2 KB
Loading

Design/unselectedTags.png

90.5 KB
Loading

docs/user/transition.rst

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ One side effect of this change is that snippets created in the previous version
88
this extension will not be supported. The /snippets folder will continue to be available
99
if previously created in a project folder.
1010

11+
In addition, the searching/tag feature has been expanded as well.
12+
1113

1214
Transferring Single Snippets
1315
----------------------------
@@ -78,15 +80,42 @@ script to help with the transition:
7880
counter+=1
7981
8082
snippets.sort(key=extract_id)
83+
print('{"snippets": [\n')
8184
for snip in snippets:
8285
if not('tags' in snip):
8386
snip["tags"] = []
8487
if snippets.index(snip) == len(snippets)-1:
85-
print(snip)
88+
print(json.dumps(snip, indent=4, sort_keys=True))
8689
else:
87-
print(snip, end=",\n")
90+
print(json.dumps(snip, indent=4, sort_keys=True), end=",\n")
91+
print("]\n}\n")
8892
8993
9094
This script will concatenate and print out all of the json objects in a /snippets folder
9195
in a project. After running the script, copy the output and paste into the User Preferences
9296
panel in settings, similar to the single snippet upload.
97+
98+
99+
Search and Tag Update
100+
---------------------
101+
.. image:: ../Design/unselectedTags.png
102+
:align: center
103+
104+
NOTE: Snippet tags function on an OR basis, as in when the "data analytics" tag and the "import statements" tag are selected together,
105+
the panel displays any tags that are tagged as import statements OR tagged as "data analytics."
106+
ex) Snippet tags selected together:
107+
.. image:: ../Design/snippetTagsSelected.png
108+
:align: center
109+
110+
ex) Language tags selected together:
111+
.. image:: ../Design/languageTagsSelected.png
112+
:align: center
113+
114+
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,
115+
only snippets that are both in the language Python AND tagged as data analytics will appear.
116+
.. image:: ../Design/langAndSnippetTag.png
117+
:align: center
118+
119+
NOTE 3: When language tags are selected, only snippet tags in that language will appear for ease of selection.
120+
.. image:: ../Design/pythonTagOnly.png
121+
:align: center

0 commit comments

Comments
 (0)