I have worked on implementing the #JSON structure for my notes app. All notes are saved as JSON files, except for the #Markdown files. Unfortunately, I have put them on a hold because I’m having too much trouble with developing the live-preview feature, so for now, I’m concentrating on JSON. I need to have a format that allows all formatting options you can think of, and defining a JSON structure allows me to build this. Markdown is too limiting, but great for really simple notes - and this is why the plan is to keep it (perhaps Asciidoc in the future as well).
I have defined all the different blocks as models. Each type of supported object is its own type of block, such as text, image, video, code-block, bullet point list, checklist, etc.
Each block can then have styling, but it depends on the specific block which styling is supported. For example, it doesn’t make sense to support bold formatting for an image, only for text-related blocks.
I have decided to basically support all formatting options. All the way from simple things like bold and italic, to text and highlight colors, alignment (left, center, and right), etc.
The rendering works, but it’s not editable yet - well, you can click options in the toolbar and that works (like clicking button to toggle bold styling), but can’t write or delete anything. Still figuring out the best way. I’m using an AttributedString and perhaps it will work well with NSTextView. First time working with AttributedString, so need to do some experimenting…
nostr:nevent1qqsyg0k0hu035pgst87e6vry50swpvg46f6nkfcalfcywuh6vcrwfdczyzwflq0d090s7hh62kyn9qjxslvyl3lx5n86dk6ad5a4pl9hl7hvyqcyqqqqqqgpz3mhxue69uhkummnw3ezummcw3ezuer9wcgp06up
Login to reply