Workbench
                                
                                 Workbench copied to clipboard
                                
                                    Workbench copied to clipboard
                            
                            
                            
                        Support a URI scheme, to open demos from online documentation
Loading example content from external sources is a complicated topic, and would involve thinking about a lot of security implications and committing to stable file formats.
On the other hand, if we can add support for a URI scheme something like workbench://demo/List View, we can link to interactive demos in Workbench from websites like gjs.guide easily and safely.
Similar https://github.com/sonnyp/Workbench/issues/181
I think there are 2 options
- 
The code is encoded in the uri so it is provided by the website and only requested to be opened in Workbench 
- 
The uri is a "link" to a specific demo in Workbench 
1 could work if we had multiple Workbench versions workbench44://... otherwise we'll have issues with outdated code and breaking changes in Workbench / GNOME
2 works too but it makes the tutorials somewhat depend on Workbench
wdyt?
- The code is encoded in the uri so it is provided by the website and only requested to be opened in Workbench
Possible, but I think there's fairly small upper-limit and multiple files might be a problem.
- The uri is a "link" to a specific demo in Workbench
This is more what I was thinking, especially considering security implications of importing arbitrary code.
It's possible to define a set of trusted domains like gjs.guide, vala.dev, developer.gnome.org. Maybe that's a more maintainable way to go?
We might want to support both
1st for small snippets and 2nd for well-defined examples
Probably makes more sense to start with 2nd. Maybe the HIG is a good starting place ?
It's possible to define a set of trusted domains like gjs.guide, vala.dev, developer.gnome.org. Maybe that's a more maintainable way to go?
Workbench doesn't know the origin. We would have to implement some complex token thingy.
Workbench doesn't know the origin. We would have to implement some complex token thingy.
I think we could just handle workbench://vala.dev/something, then rewrite it to https://vala.dev/something before downloading. Then we're just using well-known domains and tested encryption.
But we can also just start with workbench://hig/patterns/controls/buttons. That should be easy to map to built-in demos, and we can later add support for parsing the first path element as a known domain later.
Ha ok so Workbench would download the example from the website, interesting.
See also: https://gitlab.gnome.org/ewlsh/gjs-guide/-/issues/40
Postponed for now:
https://matrix.to/#/!kDBZrVKCdhrVuWxbGe:matrix.org/$18474sTznVydhYZCugb1JxYtAWRQ02NaNUg3O37yYDo?via=gnome.org&via=matrix.org&via=fedora.im