-
-
Notifications
You must be signed in to change notification settings - Fork 431
Are librarymanager and boardmanager links still clickable with IDE v2? #1442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I need the spec on how this should work in IDE2. @cmaglie or @per1234, could you please link how the Update:
|
Here is the specification @kittaakos: https://arduino.github.io/arduino-cli/dev/sketch-specification/#libraryboards-manager-links So path will have a value of either I guess it should be supported in any files. Arduino IDE supports it in |
Thank you! Unfortunately, the spec does not cover @PaulZC's request:
First, Secondly, should the URL resolver support |
Hi @kittaakos (& @per1234 ), Thank you for looking at this. Something to think about, regarding the Very best wishes, |
I forgot about that. I left it out of the sketch specification because it never worked (it might appear to work from the "All" example, but that is the default selection of the menu). You can throw anything you like in that path and "All" will still be selected in Arduino IDE 1.x. But it is in use out in the wild so the URIs with path must at least be supported.
It seems like it from the
The real use case for this is to help the user to install a specific library dependency of a sketch. The problem is that the keyword search might return multiple libraries, so it helps, but still leaves some room for ambiguity. Adding Topic filtering helps with that, but doesn't solve it. For example, if I was to do something like this: // Install the Servo library via Library Manager
// if using the Arduino IDE, click here: http://librarymanager/All/Device%20Control#Servo The user is still going to get a lot of results. I think the sorting for exact match proposed in #1106 would be much more helpful for this use case than the Topic filter. I haven't seen any examples of use cases of these URIs that would benefit from the intended use of the Topic filter. For example: // If you would like to see a list of display libraries created by SparkFun or for SparkFun products, click here:
// http://librarymanager/All/Display#SparkFun Do you see a use case for being able set the Topic filter via the URI @PaulZC? |
Agreed. That's absolutely it. The user can copy a code snippet from a SF Hook-Up Guide and - with one click - install the relevant library or board package.
Sure. That would be really nice-to-have. The |
I understand the importance of backward compatibility, and I can make IDE2 resolve the links as IDE 1.x, but the specification should be improved in the long run. It has flaws.
Something like this could be better than the 1.x version:
IDE2 could help to generate such URLs. |
I agree. The old system was poorly designed.
There isn't any mapping in the link system. Those underscores end up in the search field. It is the Arduino IDE 1.x Library Manager search that is able to find the libraries even with the underscores. |
Thank you for the clarification 👍 |
Closes arduino#1442 Signed-off-by: Akos Kitta <[email protected]>
Closes #1442 Signed-off-by: Akos Kitta <[email protected]>
Hi @kittaakos , This is excellent! Thank you for working on it so quickly. But there are two gremlins I can see: Gremlin1: With the old IDE search tool, underscores were - I think - equivalent to spaces. With your fix, that's no longer true... See code and screenshots below. Dilemma! Do we (A) do it the right way and go with your changes as-is. Or do we (B) persuade you to add a nasty work-around so that the search sees underscores as equivalent to spaces, and vice-versa? I'm thinking option (A) is probably the right way to do this. Even though it means we've got to go through ALL of our code snippets in MANY places and change underscores to %20... Thoughts please? Gremlin2: Once you have selected a link that includes a Topic, the Topic 'sticks' when you go back to a plain "All" (Type All, no Topic). You have to manually change (e.g.) Topic->Display back to Topic->All to see the non-Display results. I suggest defaulting Topic to All if no Topic is specified. Thanks again,
|
I appreciate your help, @PaulZC.
From #1442 (comment):
I see. What do you think, @per1234? Could you help figure out with the community how this should work? Since IDE2 does not run any search, we might need to adjust the CLI part too.
If it works in IDE 1.x it should also work with IDE2. In the long run, I believe we have to come up with a better spec and deprecate the IDE 1.x behavior. Once the 1.x URL spec is deprecated, it must still work in IDE2, but IDE2 should reveal it as a warning and provide a
It's a bug. Thank you for spotting it. I update the PR. |
Closes #1442 Signed-off-by: Akos Kitta <[email protected]>
Currently blocked by arduino/arduino-cli#1895. |
Closes #1442 Signed-off-by: Akos Kitta <[email protected]>
Closes #1442 Signed-off-by: Akos Kitta <[email protected]>
Closes #1442 Signed-off-by: Akos Kitta <[email protected]>
I updated the PR. As described here, IDE2 escapes the See it in action. IDE2: escape_underscore_ide2.mp4IDE 1.x: escape_underscore_ide1.mp4Other than this hack, IDE2 cannot do much without furher CLI support. |
for reference here's how the Arduino IDE 1.8.x do the search, I'm going to implement the same search: private boolean filterCondition(ContributedLibraryReleases lib) {
if (selectedCategoryFilter != null && !selectedCategoryFilter.test(lib)) {
return false;
}
ContributedLibrary latest = lib.getLatest();
String compoundTargetSearchText = latest.getName() + " "
+ latest.getParagraph() + " "
+ latest.getSentence();
if (latest.getProvidesIncludes() != null) {
compoundTargetSearchText += " " + latest.getProvidesIncludes();
}
if (!stringContainsAll(compoundTargetSearchText, selectedFilters)) {
return false;
}
return true;
}
/**
* Check if <b>string</b> contains all the substrings in <b>set</b>. The
* compare is case insensitive.
*
* @param string
* @param filters
* @return <b>true<b> if all the strings in <b>set</b> are contained in
* <b>string</b>.
*/
private boolean stringContainsAll(String string, String filters[]) {
if (string == null) {
return false;
}
if (filters == null) {
return true;
}
for (String filter : filters) {
if (!string.toLowerCase().contains(filter.toLowerCase())) {
return false;
}
}
return true;
} |
I have updated the PR to include a |
Closes #1442 Signed-off-by: Akos Kitta <[email protected]>
Thank you @kittaakos & @cmaglie ,
No problem! |
Closes #1442 Signed-off-by: Akos Kitta <[email protected]>
Closes #1442 Signed-off-by: Akos Kitta <[email protected]>
Thank you @kittaakos @per1234 @cmaglie - #1481 works perfectly for me. |
Closes #1442 Signed-off-by: Akos Kitta <[email protected]>
Closes #1442 Signed-off-by: Akos Kitta <[email protected]>
Closes #1442 Signed-off-by: Akos Kitta <[email protected]>
Describe the problem
With IDE v1.8 Library Manager, we could include clickable links in examples which would open the library manager or board manager automatically.
With IDE v2, the only option seems to be to follow the link in a web browser, which then fails:
My question is: is there a new format for clickable library and board manager links in examples?
Thanks!
Paul
To reproduce
Add a clickable link to an example and click it:
Expected behavior
The library manager used to open (with v1.8) - with v2 it does not... (Sad times!)
Additional context
No response
Issue checklist
The text was updated successfully, but these errors were encountered: