This might be a silly question, i really have no way to explain this better. So let me have a go at this.
So, i want to hypothetically write a Electron app, that opens when a file is double clicked. Lets say for sake of argument, its a rich text editor (like Microsoft Word). So, once a user double clicks any “.rtxt” file (lets say rtxt is the file extension i created specifically for my app), it will be opened automatically from my app. Alright, so the basics are out of the way. Lets talk about how to create the rtxt file.
Lets say a user wants to add an image to this rich text file, a video, styles etc. Lets say i render the rich text using html, i store styles as css and store images as images (rather than links to existing files on the users hdd). How will i then create a myfile.rtxt that contains all that information (having all the dependencies self contained within it)? Obviously i could store/render images etc with some base64 encoded string, but is there a better way? Is there some way that i could sort of create the .rtxt file as a zipped up folder and essentially store multiple files within this folder (ie. separate image files, data file for the main html, css file for stylings), yet only showing a single .rtxt file for the end users?
Obviously some of you might suggest to treat rtxt file as a data file (say json file) and convert all data into data strings and store them all in the one file. I guess this is fair, is there any pre-made easy tools for this? Anyway, that means, when the file is being run, all assets that were stored within the file will need to come into memory instead of just fetching the file when you need it (lets say a video, you only want to play the video when the user clicks on it, not when they just double click the file).
If this can be achieved, could someone direct me to some resources? any node modules/tools i can use?
Also, i prefer if this can be achieved cross platform (windows/linux/mac).
Ty in advance