Jump to content

A script/add-on to colorize code in Evernote?


Recommended Posts

Hello All!

 

While I know Evernote isn't tailored for coders, I've tried to set up my EN styling to help. For instance, I use a mono-space font as default this way when I paste in code, things will look readable (or familiar, at least).

 

I use Sublime as my editor of choice, like many other programmers, and Sublime will colorize your code as you type to help visualize what's going on. While I don't expect EN to do something like this, I was wondering if there was a script or some add-on that could accomplish this. Here would be the workflow:

  1. Paste code into a new note
  2. Select the code (or portion of text) you'd like to colorize
  3. Run script or add-on
  4. The selected code is now colorized as in Sublime and other text editors

Does something like this exist? Is it possible to create this in the EN universe? Not really sure of what can and can't be done here in EN land, but I'd sure like to find out! I've attached a screenshot of the colorization in Sublime for a visual reference. Thanks for any tips and constructive comments!

 

post-98385-0-45052900-1437574368_thumb.p

Link to comment
  • 6 months later...

In fact, ultraEdit and Notepad++ also support copy as RTF, which is a very good solution for code highlight.

but the core problem is, evernote will add extra spaces in paste result, which makes none of these solution works good enough.

check:

and

 

Link to comment
  • Level 5*
19 minutes ago, bootislands said:

the core problem is, evernote will add extra spaces in paste result, which makes none of these solution works good enough.

I don't use Evernote as a code repository; but I do store snippets of code for reference.
Below is a sample of a note with applescript code I've saved from the Script Editor app.

Yes, it may not have the exact spacing as in the editor, and possibly I should change the font.
This seems adequate for my needs.
I tried the new code block feature but I lost all the formatting.
What am I missing?

screenshot.png.445966fc09eb78a91e8120ccd

Link to comment
  • Level 5*
8 hours ago, bootislands said:

but the core problem is, evernote will add extra spaces in paste result, which makes none of these solution works good enough.

So, since I can't trust Evernote to always paste my code *exactly* as I copied it, I can't use Evernote for storing code snippets.  You gave one JavaScript example, but who knows how many other cases also cause the insertion of spaces or other changes.

Evernote has recently added a "Code Block" feature in EN Mac 6.5 Beta 3 Release Candidate , and I would guess it will make its way into the EN Win app as well.  But until it is working perfectly in a public, general release, I will continue to store my code snippets elsewhere.  I am using Quiver The Programmer's Notebook , and it works very well.  Unfortunately, it is available only for the Mac.

EDIT:  Fri, Feb 19, 2016 at 5:18 PM CST

Evernote has just posted: Evernote for Mac 6.5 Released 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...