AnaYs / mcl

0 stars 0 forks source link

Integrating Code Snippets #2

Open AnaYs opened 9 years ago

AnaYs commented 9 years ago

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

AnaYs commented 9 years ago

or we replace the special characters with a div class= "code" and the closing character with /div

AnaYs commented 9 years ago

http://www.renpy.org/doc/html/text.html http://apidock.com/rails/ActionView/Helpers/SanitizeHelper/sanitize https://github.com/bernat/best_in_place

http://simplenote.com/

Antholimere commented 9 years ago

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.

Antholimere commented 9 years ago

We can distinguish ourselves from simple_note:

  1. Focusing MCL purely on code and programmers
  2. Making notes a sharing experience
  3. Giving the possibility for programmers to gain rep from their notes

It's easy to elaborate on each bullet - and I'm sure we can come up with a few more still.

Antholimere commented 9 years ago

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

Antholimere commented 9 years ago

Ideally, MCL would be note-taking for code with the community/sharing https://jsfiddle.net/ http://codepen.io/thebabydino/pen/ZGNJZm has.

Antholimere commented 9 years ago

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!

Antholimere commented 9 years ago

http://www.rubyinside.com/build-cross-platform-ruby-and-html-desktop-apps-with-bowline-3276.html