feenkcom / gtoolkit

Glamorous Toolkit is the Moldable Development environment. It empowers you to make systems explainable through experiences tailored for each problem.
https://gtoolkit.com
MIT License
1.08k stars 46 forks source link

Add a File snippet #3743

Open svenvc opened 4 months ago

svenvc commented 4 months ago

Often in a narrative on a page we assign some variable to a a file reference to later use that file's contents in further processing.

file := FileLocator imageDirectory / 'myfile.data'

A File snippet would make this explicit and could offer some additional support in setting/locating the file, tracking the file when it moves or resolving special locations like gtResource.

By using the existing support in AbstractFileReference view/editing/parsing/styling are already covered.

The fundamental properties of the File snippet would be the fileReference in File URL form and the binding name.

svenvc commented 4 months ago

This is the current state of the File snippet:

2024-04-30_20-35-52_BlElement-348731904

Search for the Snippet of type File.

Package Lepiter-Snippet-File, class LeFileSnippet.

botwhytho commented 4 months ago

This snippet type is rather welcome :+1: . Assuming this would also work for folders right? Would be useful to be able to bind to either (File or Folder). Did some explorations on this a while back on my LepiterBuildingBlocs repo. That pushed the limit of what could be done without creating custom snippet types, but the correct way to do this is with a custom snippet type.

botwhytho commented 2 months ago

Any additional work here @svenvc ? This looks done (probably for a while already) as of v1.0.876