Open danse opened 7 years ago
contenteditable
seems to offer a good base support for this. I mainly need some lightweight logic to save a document on local storage upon modification, and restore it at the next access
a list of links can be in itself a powerful tool, that's how Abanico started
this is the most popular local storage library for Purescript. The types seem overcomplicated to me though, and i am afraid that this could create problems when i want to create keys dynamically. A solution could be to not create keys dynamically, and just store dynamically defined data in the same record with the same key
document.body.innerHTML
can be got and set, representing the whole body content
here is the body element and to get it i can use this code from Pangolin as a reference. This seems to be the interface for elements, but it does not include innerHTML
, because it's deprecated
So, the W3C does not like innerHTML
but it doesn't look like an alternative serialisation and parsing method is offered. So i think that i will have to write my serialisation and parsing logic. Since JSON can represent tree-like structures and it's easily serializable and parsable, i could write two functions converting an HTML element into JSON and vice versa.
Alternatively to writing my serialisation and parsing logic, i could just define a foreign function importing innerHTML
. I could use existing code from the HTMLElement module as a reference
Currently, when i want to develop lightweight logic on top of some accessible technology i use the file system, but this seems suboptimal given the past development of web technologies. The file system is, for me, a content system, which means that i can access and modify most contents stored in a file system, without the need of any custom software. I think that i could easily build the foundation for a similar content system also on a single web page, to start with. That would easily be comparable with essential operations i perform on a file system:
Among these tasks, 5 seems the hardest to port to a single web page, but it's also not the most frequent i perform