Skip to content

Commit 4dcf0da

Browse files
authored
[skip changelog] Document filter setting capability of Library/Boards Manager links (#1958)
Arduino IDE allows opening searches in Library Manager and Boards Manager by clicking a link with a special format in a comment of the sketch. During the initial implementation in Arduino IDE 1.x, support for setting the "Type" filter via the URI in addition to specifying search keywords was attempted and claimed to work, but never did work. For this reason, it was not previously mentioned in the sketch specification. During the reimplementation of the Library/Boards Manager link feature for Arduino IDE 2.x, the "Type" filter setting capability was finally truly implemented, and expanded to also support setting the "Topic" filter in Library Manager via the same mechanism. Now that support for the filter setting capability has been released in Arduino IDE 2.0.1, it should be documented in the sketch specification.
1 parent 5a4ffe0 commit 4dcf0da

File tree

1 file changed

+40
-8
lines changed

1 file changed

+40
-8
lines changed

Diff for: docs/sketch-specification.md

+40-8
Original file line numberDiff line numberDiff line change
@@ -140,28 +140,60 @@ no requirement to store sketches in the sketchbook folder.
140140

141141
## Library/Boards Manager links
142142

143-
A URI in a comment in the form `http://librarymanager#SEARCH_TERM` will open a search for SEARCH_TERM in
143+
**(available in Arduino IDE >=1.6.9 <2.x || >=2.0.1)**
144+
145+
A URI in a comment in the form:
146+
147+
```text
148+
http://librarymanager[/TYPE_FILTER[/TOPIC_FILTER]][#SEARCH_KEYWORDS]
149+
```
150+
151+
will open a search in
144152
[Library Manager](https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries#using-the-library-manager) when
145153
clicked in the Arduino IDE.
146154

147-
A URI in a comment in the form `http://boardsmanager#SEARCH_TERM` will open a search for SEARCH_TERM in
148-
[Boards Manager](https://docs.arduino.cc/learn/starting-guide/cores) when clicked in the Arduino IDE.
155+
A URI in a comment in the form:
156+
157+
```text
158+
http://boardsmanager[/TYPE_FILTER][#SEARCH_KEYWORDS]
159+
```
160+
161+
will open a search in [Boards Manager](https://docs.arduino.cc/learn/starting-guide/cores) when clicked in the Arduino
162+
IDE.
163+
164+
These links can be used to offer the user an easy way to install dependencies of the sketch.
149165

150-
This can be used to offer the user an easy way to install dependencies of the sketch.
166+
The search field will be populated with the `SEARCH_KEYWORDS` fragment component of the URI. Any characters other than
167+
`A`-`Z`, `a`-`z`, `0`-`9`, and `:` are treated as spaces by the search algorithm, which allows multiple keywords to be
168+
specified via the URI.
169+
170+
---
171+
172+
**(available in Arduino IDE >=2.0.1)**
173+
174+
The "**Type**" filter will be set to the optional `TYPE_FILTER` path component of the URI.
175+
176+
The Library Manager "**Topic**" filter will be set to the optional `TOPIC_FILTER` path component of the URI.
177+
178+
Unlike the `SEARCH_KEYWORDS` fragment, spaces and reserved characters in these components must be
179+
[percent-encoded](https://en.wikipedia.org/wiki/Percent-encoding) (e.g., `Signal%20Input%2FOutput`).
180+
181+
Although the filter setting is not supported by previous IDE versions, URIs containing these path components still
182+
function in all other respects.
183+
184+
---
151185

152186
This feature is only available when using the Arduino IDE, so be sure to provide supplementary documentation to help the
153187
users of other development software install the sketch dependencies.
154188

155-
This feature was added in Arduino IDE 1.6.9.
156-
157189
### Example
158190

159191
```c++
160192
// install the Arduino SAMD Boards platform to add support for your MKR WiFi 1010 board
161-
// if using the Arduino IDE, click here: http://boardsmanager#SAMD
193+
// if using the Arduino IDE, click here: http://boardsmanager/Arduino#SAMD
162194

163195
// install the WiFiNINA library via Library Manager
164-
// if using the Arduino IDE, click here: http://librarymanager#WiFiNINA
196+
// if using the Arduino IDE, click here: http://librarymanager/Arduino/Communication#WiFiNINA
165197
#include <WiFiNINA.h>
166198
```
167199

0 commit comments

Comments
 (0)