Open AnaYs opened 9 years ago
or we replace the special characters with a div class= "code" and the closing character with /div
The best_in_place gem looks very decent but makes use of AJAX so I don't know if it's worth the hassle for now? Lets do it the way you thought of, defining characters that assign the start- and end of the div wrapper.
We can distinguish ourselves from simple_note:
It's easy to elaborate on each bullet - and I'm sure we can come up with a few more still.
Else simple_note is pretty much like Evernote, GoogleDrive and Nvalt: They synchronise on cross-platform Clean and simple UI Tagging - Markdown - .. Focusing around personal notes
Ideally, MCL would be note-taking for code with the community/sharing https://jsfiddle.net/ http://codepen.io/thebabydino/pen/ZGNJZm has.
So let's build it step by step - might even be possible to embed the fiddle/codepen further down development, though that's for later.
Conclusion: My opinion is to use div-wrappers for code snippets in our case, the way most web-note-taking-tools do the job as well. BabySteps!
Problem: how to integrate code snippets into notes allowing them to be displayed differently in the view
Ideas:
This could be something like: array_of_strings= @note.content.split(' ^ ') code_snippets= array_of_strings.values_at(* array_of_strings.each_index.select { | i | i.odd?}) -> code snippets will be all the odd numbered strings in the array if the first break happens only after the special character