Open thangngoc89 opened 6 years ago
I would make all the text content blocks on their own line, rather than the same line as the /*:
, so you have:
/*:
# ReasonML playground
*/
Instead of
/*: # ReasonML playground */
I think this would make the serialized file easier to read and understand. There would be no need to deal with trimming lines (spaces in front of markdown lines can be meaningful) or determining to fit it in one line comments.
With this restraint, you could do something more explicit than /*:
, perhaps:
/* rtop-ui:text-block
# ReasonML playground
*/
This could also give you a way to add other kinds of blocks in the future, by modifying text-block
.
I also think it could be important to allow some sort of meta-data about how the code is run, perhaps you want to disable certain warnings in the notebook. That could then be done like:
/* rtop-ui:metadata
-w -40
*/
I would also be very interested by a direct way to save / import sketch.sh pages. In the meantime, I'm made a quick'n dirty downloader tool : https://github.com/letouzey/sketch-downloader . It uses curl used to dump the json data of the page, then a little ocaml script to pretty-print it as markdown and OCaml/Reason code. @thangngoc89 thanks for creating and maintaining this nice plateform.
I want the data to be as portable as possible so here are some of my thoughts about data serialization and deserialization:
Source code format (.re, .ml):
Any notebook should be a valid ReasonML program.
When serialize a note into source code format, text block will be block comment like this:
Notice the colon, it's used to distinguish between text block and actual code comment in deserialization.
Markdown format
~~Simply convert code blocks into markdown's codeblock with fences ~~
From @jordwalke in #98
TODO: