Jump to content
  • 57
cjjoy1980

mac REQUEST: Embed Code Snippets with Auto-Formatting and Syntax Highlighting

Idea

I mostly use evernote to collect code snippets mainly C/C++ related.

When I copy the code from my editor like vim or xcode(mac), I dont see the

syntax being heighlighted.

On googling I found a online syntax highlighting tool. (http://tohtml.com/c/).

I was able to get my code higlighted but when I paste to evernote I see all the

code being pasted in a single line as below :

int sum(){>----int result = 0;>----return result != 0;}

Let me know if this could be avoided or if there is a better way for pasting code into evernote..

THanks

  • Like 1

Share this post


Link to post

Recommended Posts

  • 0

Tried using the online version of Evernote, it seems to be working.. Its not working

with the evernote client installed on my windows.

Thanks for the info.

Share this post


Link to post
  • 0

Nine worked beautifully, pasting from Visual Studio into the Win 4.3 version of Evernote. Didn't work so fine posting into the new web interface.

Share this post


Link to post
  • 0

I use Evernote for A LOT (practically everything).

One thing I started using it for recently is "Code Snippet" database. I have a main folder called "Code Snippets". Then I have folders in their for each language. Then on the pages I have a note for each "Snippet" with one section called "Notes" and one called "Code". The code has just one table cell, and I put all my code in there..and it looks like

 

tags from a forum, without the syntax highlighting. But the entire situation works

great for me.

Now, I want to setup another notebok within code snippet called "Code Vault". Where I was going to throw all my "Code Files". If it was an actual site, I would put it in a zip file. I know those can't be searched, but if I have some situations where it's just a few PHP files, and I load them as attachments..can Evernote search those? Meaning if I have a straight .php file attached, and then run a search on Evernote..will it search the text within that .php file (or .htm, or .js, or .css for that matter), or not?

Share this post


Link to post
  • 0

As far as I know, Evernote doesn't search attachments, except for PDF files. So I don't think that your PHP attachment will be searched.

Tip: It was a little hard to figure out what you were trying to do; it helps to use the correct Evernote terminology. Evernote doesn't have folders or pages, it has stacks, notebooks and notes. Thanks.

Share this post


Link to post
  • 0

As an aside, I have tried a few similar things, the only problem that I have had is that EN always formats the code in a "rich text" format, and thus I sometimes get some weird results when I copy and paste to Notepad++, Dreamweaver, or HippoEdit.

  • Like 1

Share this post


Link to post
  • 0
One thing I started using it for recently is "Code Snippet" database.

Evernote is not well suited to be used as a Code Snippet manager.

There are a number of other apps (Windows, Mac, Web) that are dedicated to this function, and do it much better.

While Evernote can store the text of your code, it can have problems in doing so reliably since your code is actually embedded in HTML like code.

So, you may be better off with another app for this purpose.

Share this post


Link to post
  • 0

Thanks for the tool. Now it works on my Mac client app.

I mostly use evernote to collect code snippets mainly C/C++ related.

When I copy the code from my editor like vim or xcode(mac), I dont see the

syntax being heighlighted.

Share this post


Link to post
  • 0

There's Sniptastic which was a 2011 DevCup finalist. I've never used it myself:

http://trunk.evernot...tastic/web-apps

Note, I went to that link and clicked the Buy Now button. Instead of an ordering page I get a web page with a huge number of public snippets. I think they may have converted the product to a free web service for now. (at least for the beta period). If any Evernote staff or Sniptastic folk can fill in here that would be great. The Trunk page and their Help page talk about a Visual Studio plug-in. I think your best bet is the Help page:

http://www.sniptasti...m/SiteInfo/Help

-- roschler

Share this post


Link to post
  • 0

Is there a simple way, besides having to select text and change the display properties to look like code? Kind of like using the "Code" button in these posts. Basically I want an easy way to turn this:

 

var quarter = function (number)  {
    return number/4;
};
if (quarter(24) % 3 === 0 ) {
  console.log("The statement is true");
} else {
  console.log("The statement is false");
}
 

to this:

var quarter = function (number)  {    return number/4;};if (quarter(24) % 3 === 0 ) {  console.log("The statement is true");} else {  console.log("The statement is false");}

TIA!!!

Share this post


Link to post
  • 0

Hi. Welcome to the forums. I am not aware of any way to do that. Honestly speaking, I doubt there is enough of a user interest in this niche activity for Evernote to code it into the main app. However, I could see a third-party developer coming up with an integration to do it.

My recommendation would be to stick with a text editor for code (depending on what you are doing), because Evernote doesn't handle Tabs well (if you use those) and it isn't exactly plain text, so you might run into issues. A text editor ensures that everything goes smoothly for you. That said, Evernote can be a great place to store code snippets (as .txt attachments).

  • Like 1

Share this post


Link to post
  • 0

The reason I wanted to be able to do this is I'm watching a JavaScript class online and am taking notes in Evernote, so I was hoping to mimic what I have in my text editor as close as possible in my notes. Make sense? I noticed it I copy the code as it appears here, and paste it into Evernote, it keeps the formatting and looks like I want it to.

Share this post


Link to post
  • 0

The reason I wanted to be able to do this is I'm watching a JavaScript class online and am taking notes in Evernote, so I was hoping to mimic what I have in my text editor as close as possible in my notes. Make sense? I noticed it I copy the code as it appears here, and paste it into Evernote, it keeps the formatting and looks like I want it to.

If you find that it is working for you, then you are all set! For JavaScript, I don't think you'll run into any issues. you won't get the line numbers, though. One thing that I have recently discovered (I am a little behind the curve!) is that Android is wonderfully flexible, and you can have a video playing in one window while you take notes in Evernote. Amazingly, on my Nexus 7 I think I will be able to work a little more effectively than I do on my iPad (as soon as I swipe to change the window the sound and video stop). Testing this workflow out this week.

Share this post


Link to post
  • 0

Is there somewhere you know of that offers an area that I could type my plain text code into and it would convert it to something similar to the code above? Just so I don't have to come here, log in and start/reply to a post? Thanks!

Share this post


Link to post
  • 0

Is there somewhere you know of that offers an area that I could type my plain text code into and it would convert it to something similar to the code above? Just so I don't have to come here, log in and start/reply to a post? Thanks!

I don't understand the question. You want an area to type plain text so you don't have to log into the forums? Could you explain a little more? Sorry.

Share this post


Link to post
  • 0

When I'm typing my notes and I type some lines of code, is there a website that has the feature that this forum has to turn plain text to look like formatted code. In otherwords, is there a site that I can go to, paste type like this:

 

var quarter = function (number)  {
    return number/4;
};
if (quarter(24) % 3 === 0 ) {
  console.log("The statement is true");
} else {
  console.log("The statement is false");
}
 
and have it format like this:
 
var quarter = function (number)  {    return number/4;};if (quarter(24) % 3 === 0 ) {  console.log("The statement is true");} else {  console.log("The statement is false");}

Share this post


Link to post
  • 0

 

When I'm typing my notes and I type some lines of code, is there a website that has the feature that this forum has to turn plain text to look like formatted code. In otherwords, is there a site that I can go to, paste type like this:

 

var quarter = function (number)  {
    return number/4;
};
if (quarter(24) % 3 === 0 ) {
  console.log("The statement is true");
} else {
  console.log("The statement is false");
}
 
and have it format like this:
 
var quarter = function (number)  {    return number/4;};if (quarter(24) % 3 === 0 ) {  console.log("The statement is true");} else {  console.log("The statement is false");}

 

 

Sure.

http://www.amyeditor.com

 

Why not use an editor on your device, though? What OS are you using?

Share this post


Link to post
  • 0

I am on Windows 7 using SublimeText 2. The problem is I want it to visually look like code, with the syntax highlighting and whatnot.

Share this post


Link to post
  • 0

I am on Windows 7 using SublimeText 2. The problem is I want it to visually look like code, with the syntax highlighting and whatnot.

 

That makes sense to me. I don't know how one would do that, though, outside of an app that is designed to display code that way. Maybe one of our other members knows of something.

Share this post


Link to post
  • 0

I would be great if Evernote had built-in code formatting.  I often store code snippets and it would be nice if they were formatted and colored.

  • Like 1

Share this post


Link to post
  • 0

In the Windows client, Evernote will store code formatting if it's clipped with coloring/font information. For example, Microsoft Visual Studio puts rich text on the clipboard when you clip from a code window, and Evernote will recognize that. Sadly, Notepad++, which I also use, does not.

I don't think that it's much in scope for them to put in automatic code formatting -- that's a pretty specialized niche -- but you never know. I think that most people would be happy with the ability to have preset formats for things like headings and paragraphs, etc.

  • Like 1

Share this post


Link to post
  • 0
Hello, I have EXACTLY the same probème. I want to store code snippets in Evernote, and the resulting output is generally impossible to predict. The worst is when you try to write a piece of HTML ... I tried to put various tags to inhibit formatting Evernote without success.

 

I use https://gist.github.com/, it's nice but it does not really solve the problem. I think Sniptastic allowed the integration of excerpts in Evernote, but they seem to have disappeared.

 

In addition, Evernote gets a little crazy when you start to simplify or remove formatting. On the PC it sometimes becomes impossible to edit the note, or the selection of an area becomes aberrant ...

 

I'm quite surprised that the developers of Evernote, which must use Evernote (???), did not think (and solved) the problem ...

 

Did you find a solution?

Share this post


Link to post
  • 0

Okay. So it's a little rough around the edges, but I did just try out Cheeatz. It seems to work just fine.

 

Let's you suck in Gists like a champ. They display fine in the Mac client.

 

 

http://www.cheeatz.com/home

 

Edit: Oh. And a second bonus, since the code highlighting stuff is a shortcoming of the EN editor application and not ENML itself you can actually modify the Gist output in EN a little. If you are careful. Of course, the whole note will blow up if you try to get too fancy.

Edited by sh.Preston

Share this post


Link to post
  • 0

I'm a developer and I love my code snippets libraries.  However, my snippets are all over the place -- in local files, in Dropbox, in Google Drive, on Github, on USB thumb drives, etc.  It's a chore keeping up with them.

 

I've used some code library apps on OS X and Windows.  They're ok.  Some of them even backup to cloud services.  None of the good ones are cross-platform though, so you end up using the app on one system, but rewriting files on the other.

 

This seems silly to me.  I'd like to use Evernote as a code snippets library because I use Evernote everywhere.  It already has all the features I would want.  I could tag my snippets, keep them in folders, search my library, share my snippets and access them everywhere.

 

The only thing missing are the most important features:  Auto-formatting and Syntax Highlighting.

 

There are plenty of open-source tools for doing this on the web.  SyntaxHighlighter by Alex Gorbatchev is one of them.  Even this forum has very basic support for embedding code into a note.  See?

<div id="example" class="code"><p>Some not-so-beautifully formatted code.  But it's a start.</p></div>

The most practical implementation would be a button somewhere in the editor.  Maybe next to the highlighter icon, or include it in the Justification drop-down.

 

10366237766_b830739a62_b_d.jpg

 

 

In any case, please consider it because it would be amazing.

  • Like 4

Share this post


Link to post
  • 0

+1

 

I also think code hightlighting is very very important for me. Currently I just use gist.github.com + GistBox + gist-vim to collect my code snippets.

 

 

Actually the people around me (most are coders) use wiznote rather than Evernote, because wiznote's Windows version supports Markdown (Actually it is not implemented by official developers. wiznote has custom plug-in interface, and some geeks develop this amazing Markdown plug-in.). Of course if Markdown is supported, code highlighting can also be done. 

However, I use MAC OS X and wiznote's MAC version is really rough. I use the amazing Evernote to record all my things, but not code.

 

I understand the Evernote tend to meet the needs of the majority, rather than coders. But I strongly request Evernote native client support custom plug-in. 

As far as I know, there are some users switch Evernote to wiznote because users can add different plug-ins to meet the needs of them, ranther than Evernote do--let the minority yield to the majority. Actually the majority may have their own needs, too. Maybe Evernote's current feature only meet the full needs of the minority.

 

If Evernote support custom plug-in, I would be happy to develop a Markdown plug-in for it.

  • Like 1

Share this post


Link to post
  • 0

The usual response seems to be to use a document type that will allow the markdown/markup and then store that in a note. Not as convenient, I know, and it doesn't allow automatic updating if you make changes in the code. I have only done a little coding (and copying of code) in VB, but I know how frustrating it can be.

  • Like 1

Share this post


Link to post
  • 0

+1 for this. 

 

I have used EN a little bit for code snippets, but have mostly given up on it, partly because of the lack of syntax highlighting. I doubt I would write my code snippets in Evernote, I am too comfortable with Textmate for that, but it could be nice place to dump and search for the snippets – rather than the long txt files I use for snippets now.

  • Like 1

Share this post


Link to post
  • 0

But does (Multi)Markdown actually do syntax highlighting? It certainly respects 4 indenting spaces as denoting code. But I don't think that buys you colo(u)r.

 

There is another thread on this newsgroup about wanting (Multi)Markdown, by the way.

 

And yes I too would like syntax highlighting. 

Share this post


Link to post
  • 0

+1 for this. 

 

I have used EN a little bit for code snippets, but have mostly given up on it, partly because of the lack of syntax highlighting. I doubt I would write my code snippets in Evernote, I am too comfortable with Textmate for that, but it could be nice place to dump and search for the snippets – rather than the long txt files I use for snippets now.

 

I completely agree.  Most of the snippets I would put into Evernote would be entered by copy/paste, but native support for highlighting and formatting would mean that I could update my snippets directly in Evernote on the fly.

Share this post


Link to post
  • 0

I've resorted to using Skitch to take a screenshot of my code in my current code editor(s) (PhpStorm and Notepad++) and SQL tool (SQLyog) into my EN notes. But this of course means you can't copy/paste the actual code (although maybe the OCR function in EN Premium would read the code somehow???).

 

To be fair, EN was designed as a general purpose tool and not a programmer's tool, but it would be great if this feature was available. As a programmer developing/supporting a large & complex PHP web dev framework I make heavy use of EN to keep track of my work and make notes how the code works etc. I couldn't manage without it!

 

FWIW, Notepad++ uses the free Scintilla package http://en.wikipedia.org/wiki/Scintilla_%28editing_component%29 which has implementations for several different platforms including Windows. Maybe this could be added to EN, eben just for the synax colouring?

Share this post


Link to post
  • 0

I am after the same feature - I cannot believe that the writers of Evernote don't use their own service for a note taking service.

 

To be honest, this should be a pro-feature - I could then justify billing my company for its usage, and everyone wins! :)

 

I need to be able to do this in whatever client, and ideally in a future version be able to choose the font I want for style X

 

I can then do headers, sub headers easily in a way that translates nicely into our corp wiki.

 

How do we vote for this feature?

 

Cheers,

 

Richie

Share this post


Link to post
  • 0

The thing that bugs me is mostly that they allow more powerful formatting in ENML than they let you access with the editors themselves. I get that EN is not a word processor and I appreciate that. The last thing we need is another app-of-all-trades. But it's already there.. just.. add.. the.. button.  :wub:

Share this post


Link to post
  • 0

+1

 

Brilliant. A feature I didn't know I needed until I read this post.

Share this post


Link to post
  • 0

Came here to post the exactly same request! Would love to see this feature in Evernote.

I have lots of code snippets in Evernote, but they look ugly in plaintext. What I usually do is just set the font of a snippet to Source Code Pro to make it look a bit more bearable.

Share this post


Link to post
  • 0

Hi. Welcome to the forums. I am not aware of any way to do that. Honestly speaking, I doubt there is enough of a user interest in this niche activity for Evernote to code it into the main app. However, I could see a third-party developer coming up with an integration to do it.

My recommendation would be to stick with a text editor for code (depending on what you are doing), because Evernote doesn't handle Tabs well (if you use those) and it isn't exactly plain text, so you might run into issues. A text editor ensures that everything goes smoothly for you. That said, Evernote can be a great place to store code snippets (as .txt attachments).

 

A niche activity..  is this guy high?   im honestly floored that evernote doesnt have code snippets and syntax highlighting. FLOORED.

Share this post


Link to post
  • 0

A niche activity..  is this guy high?   im honestly floored that evernote doesnt have code snippets and syntax highlighting. FLOORED.

So a guess at the percentage of coders who use Evernote would be...???
  • Like 1

Share this post


Link to post
  • 0

Pretty much all junior developers i know have been using it for a while and we all share notes about code all the time.  If i'm really in a pinch to make something look more like code i'll change the font and color. but that's a pretty janky option if you ask me.

 

how hard would it be for evernote to implement this? 

http://highlightjs.org/

 

not hard.

  • Like 1

Share this post


Link to post
  • 0

A niche activity..  is this guy high?

 

While I disagree with his conclusion, it's hard to debate the demographics of somebody else's customer base. The only people who really know the answer to this question are the folks at EN.

 

I'm sure Grumpy Monkey isn't high. Well. I'm not sure of that. But, I don't see his statement as evidence in support of that hypothesis.

  • Like 1

Share this post


Link to post
  • 0

Pretty much all junior developers i know have been using it for a while and we all share notes about code all the time.  If i'm really in a pinch to make something look more like code i'll change the font and color. but that's a pretty janky option if you ask me.

 

how hard would it be for evernote to implement this? 

http://highlightjs.org/

 

not hard.

 

I agree on all points. I stick to gists for my snippets at this point, though.

Share this post


Link to post
  • 0

Pretty much all junior developers i know have been using it for a while and we all share notes about code all the time.  If i'm really in a pinch to make something look more like code i'll change the font and color. but that's a pretty janky option if you ask me.

 

how hard would it be for evernote to implement this? 

http://highlightjs.org/

 

not hard.

The question was what your guess at percentage of the Evernote user base (i.e., >60 million users) are developers who use this to store code snippets (I'm one) and require format highlight support (I'm not) is (not what is the percentage of users that you know are using it for this purpose)?

 

Given that, you'd have some basis for making the claim that this is or is not a niche activity (and therefore worthwhile for Evernote to do). So is it technically easy? Maybe, but to put in a wholesale highlighting system for arbitrary languages is probably beyond Evernote's intended scope, as far as I can tell). Anyways, my guess is that GrumpyMonkey is correct. I can't testify to his altitude, but he's usually pretty level-headed, and often in favor of adding new features, as well as being extremely helpful to other users on the forum. Take that for what you will.

  • Like 1

Share this post


Link to post
  • 0

I think everyone is missing the point here.  It doesn't matter about coding, or otherwise...

 

What is important and needed is a way to use different font/styling at the push of a button.  For example, I might want to write a note with some titles - a level 1 heading, level 2 heading, etc would help.  If I am storing some output from a terminal or some code, I want a way to display that info in a monospace font easily.

 

The argument that this is a 'niche' requirement is bogus - every word processor and most webpage text editors have the same facility (I see this one has a 'code' button for example), so am surprised Evernote doesn't have such a universal and simple method.

 

Cheers,

 

Richie

Share this post


Link to post
  • 0

@RichieJarvis: Well, since the topic is entitled "Simple way to mimic code formatting...", and given the original poster's stated request (line numbering, syntax highlighting; and the "Code" button doesn't deliver those), you'll have to forgive us for focusing on the code formatting aspect. That certainly *is* a niche, and I think that that request is a bit beyond the scope of what Evernote's looking to do, at least at this point. That being said, in the broader sense, sure, I think that we all want easier ways of applying formats more easily, including code / monospaced formatting, and requests like format painters, predefined or user-definable styles are not, in my opinion, beyond the scope of what Evernote could be delivering. So we're not missing the point here -- that point has been amply addressed in many other posts in the forums here. We're just sticking to the topic.

Share this post


Link to post
  • 0

 

Hi. Welcome to the forums. I am not aware of any way to do that. Honestly speaking, I doubt there is enough of a user interest in this niche activity for Evernote to code it into the main app. However, I could see a third-party developer coming up with an integration to do it.

My recommendation would be to stick with a text editor for code (depending on what you are doing), because Evernote doesn't handle Tabs well (if you use those) and it isn't exactly plain text, so you might run into issues. A text editor ensures that everything goes smoothly for you. That said, Evernote can be a great place to store code snippets (as .txt attachments).

 

A niche activity..  is this guy high?   im honestly floored that evernote doesnt have code snippets and syntax highlighting. FLOORED.

 

gngrdev,

 

I couldn't agree with you more. In fact it is funny because the wysiwyg used for this post has a code block feature. I would settle for a feature as simple as the html pre tag.

Share this post


Link to post
  • 0

I would settle for a feature as simple as the html pre tag.

ENML actually supports HTML5 style code tags. I would think they could just add a button on the client side with no adverse effect anywhere else. Of course I'm only speculating and it may be more difficult than any of us are assuming (for whatever reason).

 

Markdown for a codeblock is four spaces before each line:

Words words words.    echo "hello world";Back to words word.

That should make HTML that looks something like:

<div>Words words words</div><code>echo "hello world";</code><div>Back to words words</div>

^All of that is perfectly valid within a note. You can import notes like this and they display fine in the EN clients. You just can't _make them_ in EN.

Share this post


Link to post
  • 0

^All of that is perfectly valid within a note. You can import notes like this and they display fine in the EN clients. You just can't _make them_ in EN.

Not sure if the 3rd-party ENML Editor still works: http://enml-editor.ping13.net/, but worth a try, if you feel like mucking around with the HTML under the hood. The ENML spec can help (http://dev.evernote.com/doc/articles/enml.php). The code tag is explicitly allowed.

Share this post


Link to post
  • 0

Oh snap jefito! That's really interesting. I'll have to give it a try. Thanks for the link.

It's been awhile since I used it. I wouldn't want to use it all the time, but for making a pre-formatted template it might be just the trick. Let us know if it works. Thanks.

Share this post


Link to post
  • 0

I'd like to add my voice to this as well. I already use Evernote for all of my code snippets, how-to's, and learning coding languages. Currently I just set all code to a generic monospaced font. It'd be extremely helpful to be able to automatically highlight blocks of code with line numbers and basic syntax highlighting.

  • Like 1

Share this post


Link to post
  • 0

+1

 

I'm starting to save code snippets more and more these days, and already use EN for many other things (as the post author)

Share this post


Link to post
  • 0

+1!

 

I know the team can come up with a great format for this, as well.  So many programming languages and learning and Evernoting is the way it's done!

Share this post


Link to post
  • 0

I totally need a code snippet feature.  I'm currently using Backpack and I'm waiting on such a feature to migrate over to Evernote.  

I need code snippet for instructions for command-line usage
and for code examples, ...

Until that moment, I'm gonna stick with Backpack.  Funny that I can include code snippets in the Forum!  :)

 

It would really be nice if EN was offering a Markdown (or Textile) editing mode, as well as there WYSIWYG toolbar.  That would solve all the issues I guess.

Share this post


Link to post
  • 0

+1

 

Seriously looking into alternatives to Evernote (which I pay for) because I want a note app that has this feature! 

Share this post


Link to post
  • 0

Created a forum account just to +1 this. I already keep plenty of code learning resources and snippets in Evernote so I can access it anywhere and sync it to whatever device I may be working on - gists are alright but I'm not always online when working.

Share this post


Link to post
  • 0

Wondering if this could be done with a Syntax Highlighter as part of the toolchain - something like:

  1. Put the code through a language-sensitive highlighter.
  2. Convert to HTML.
  3. Convert to ENML.
  4. Send to Evernote.

This definitely wouldn't round trip and I don't even know which platforms it could be done on. Anyone know of programs that do highlighting for ANY target language?

 

(And steps 2 and 3 should probably be conflated.)

Share this post


Link to post
  • 0

I really love the idea.  I store code snippets in Evernote already, but they lose all formatting and syntax highlighting, and *sometimes* indentation.  We know ENML can handle it since syntax highlighted code you clip from the web comes through with the same formatting.

 

What might work as a patch is a web app based on the existing javascript syntax highlighting libraries out there.  You could repurpose an existing app to clip to Evernote, or if somebody puts some real elbow grease into it, Evernote Cloud API could be used.

  • Like 1

Share this post


Link to post
  • 0

I like the idea - but when at 35000 feet in a tin can that doesn't (economically perhaps) favour internet connection that's not very helpful.

 

I looked at the HTML that Pygment I mentioned creates and it's tough as it uses classes rather than the style attributes. The latter is what Evernote tolerates in ENML.

 

Maybe that's only a minor problem, though.

 

Regrettably I can't actually work on this (because my employer would probably be most grumpy with me). :-(

Share this post


Link to post
  • 0

Also need this feature badly. All of us who do not need services like GitHub or Bitbucket, or can figure them out, need a place to store, organize and share code snippets - and Evernote would be the perfect place...

 

It would be great with color formatting and so on, but I would be satisfied if I could just click a button and the text would be monotype with line numbers and raw text. I have experienced that copy/pasting from Evernote would mess up my snippets with line breaks, additional spaces etc.

 

cheeatz.com is a good start but just as Gist/Zapier/Evernote it is just to much work getting it done.

 

Merry Christmas...

Share this post


Link to post
  • 0

I do store code snippets in Evernote, under the following rules / caveats:

  • Line numbers are not of any interest to me.
  • Syntax highlighting is OK, but not necessary -- that's what true code editors are for, so I get that if I paste it into one of those.
  • We don't use tabs in our code base, so Evernote's treatment of tab characters is not a problem. That's just a lucky break for my current job, the last one used tabs,
  • If the clip source supports it (e.g. Visual Studio), I get a monospace font automatically. Otherwise (NotePad++ unfortunately) it's a select / change font operation, not usually a big deal. If Evernote had support for generalized style shortcuts, I'd use one for code, but otherwise this isn't a big hardship for me.

Share this post


Link to post
  • 0

 

I do store code snippets in Evernote, under the following rules / caveats:

  • Line numbers are not of any interest to me.
  • Syntax highlighting is OK, but not necessary -- that's what true code editors are for, so I get that if I paste it into one of those.
  • We don't use tabs in our code base, so Evernote's treatment of tab characters is not a problem. That's just a lucky break for my current job, the last one used tabs,
  • If the clip source supports it (e.g. Visual Studio), I get a monospace font automatically. Otherwise (NotePad++ unfortunately) it's a select / change font operation, not usually a big deal. If Evernote had support for generalized style shortcuts, I'd use one for code, but otherwise this isn't a big hardship for me.

 

 

I work on both Windows and Mac so my color is Sublime Text, but that software is not the issue here and neither is the font choice as far as I am concerned. I just need raw text that I can be 100% sure that I can use again without having to go through it to see if there is a line break (or worse) that has sneaked its way in there in the meantime.

 

So my Christmas wish is actually very simple. Colors and numbers and code help is bonus...  

Share this post


Link to post
  • 0

Im kinda furious this isnt a default option in evernote, and the fact its possible on the forum? Would someone please please please please add it...

Share this post


Link to post
  • 0

I'd like some sort of monospaced unformatted code snippet feature too - you only have to search for the feature, to find a large number of threads where people are surprised that it doesn't exist - so there is a real demand for this.

Share this post


Link to post
  • 0

+1 for any variation of code/monospaced snippets.  The value of this application would go up considerably.

Share this post


Link to post
  • 0

+1!  Definitely need this.  I put code snippets in my EN all the time and they are U G L Y.  Markdown + syntax hilighting would be great, an open plug-in system would be even better (though the mobile clients at least need to be able to read plug-in content).

Share this post


Link to post
  • 0

+1   :D

 

This would be great. At the moment I just use Courier as a font to get stuff looking different but pygments is a great shout in the mean time. See attached image. I know this has been picked up by an Evernote member of staff but do you guys have a like a voting system or something where we can see what's happening. I appreciate you cant accommodate every feature that comes in but would be worth knowing how you guys see the feature fitting :) or not fitting :( . 

 

skitch.png?resizeSmall&width=832

 

This would be much better. 

 

skitch.png?resizeSmall&width=832

Share this post


Link to post
  • 0

See attached image. I know this has been picked up by an Evernote member of staff but do you guys have a like a voting system or something where we can see what's happening.

There is no voting system or feature progress reporting facility, and Evernote employees generally do not reveal future development plans, unless they're very close to delivery.

Share this post


Link to post
  • 0

Just another vote for syntax highlighting baked into Evernote - at least on the web and desktop clients.

 

Code snippets are probably some of the most important things in many of my notebooks.  Copying them to external websites, highlighting code, and copying back is not fun.

 

I'd like to be able to do something in Evernote that gives the equivalent of <code lang="something supported">code here</code>.  Markup like this would be fine.  A button with some options would be ok.  Right click with options would be ok.

 

The output would be formatted with a fixed width font, syntax highlighted for the appropriate language.  Optionally: surrounded in a tinted box to make it stand out from the rest of the text, and optional line numbers.

  • Like 1

Share this post


Link to post
  • 0

Been really wanting native syntax highlighting support for awhile now, so these past few weeks I decided to implement it myself. I have a functioning Evernote client that has syntax highlighting and code completion for nearly a dozen languages. These include C++, C#, COBOL, HTML, Java, SQL, Perl, Python, Ruby, VB.NET and XML. It is very much alpha stages right now, and there are many issues that I need to work out, but I have been using it for a couple weeks myself. I can definitely keep you all updated as I progress with it if anyone is interested in using it! 

  • Like 2

Share this post


Link to post
  • 0

Been really wanting native syntax highlighting support for awhile now, so these past few weeks I decided to implement it myself. I have a functioning Evernote client that has syntax highlighting and code completion for nearly a dozen languages. These include C++, C#, COBOL, HTML, Java, SQL, Perl, Python, Ruby, VB.NET and XML. It is very much alpha stages right now, and there are many issues that I need to work out, but I have been using it for a couple weeks myself. I can definitely keep you all updated as I progress with it if anyone is interested in using it! 

 

+1 for the OP request and adback03 I would love to try it out please keep us posted!

Share this post


Link to post
  • 0

This would be great, even if you have to bury it as an 'advanced preference' somewhere to enable. The hackers will find it.  

 

+1

Share this post


Link to post
  • 0

I have a good solution to this that's cross platform. Get yourself a copy of sublime text. (Other editors might be able to handle this too). Then install the package called sublimehighlight.  Now, simply paste your snippet into sublime, set the appropriate language in sublime, reindent, and highlight, copy, paste into Evernote. I use the rich text option. Simple pimple. I just notice it has a setting to do line numbers too, but this would be a hassle if you want to copy and paste it out of EN. Sure it's not perfect, but compared to anything else including evercode http://vimeo.com/45097420 this is better IMO. EN is very unlikely to add this feature anytime soon. Heck they can't even make tables work properly. If you're pasting from an IDE like Visual Studio or Xcode or one of the Jetbrains brilliant IDEs it should put rich text on the clipboard for pasting into EN anyway. So it shouldn't be an issue. The other thing I would say is if you're copying this highlighted code from EN into a text editor it's a good idea to use something to strip out any extraneous junk. I have never run into any issues myself. I have shortcut key setup that just strips out all text formatting on a paste and use that. I have alfred do this on my Mac but there are many options for doing this on any platform.

  • Like 1

Share this post


Link to post
  • 0

Hey Evernote, just go ahead and acquire Quiver from HappenApps and integrate all of it's features into Evernote! I really miss the possibility to store code snippets with syntax highlighting and I'd like to use Markdown to format my notes!

  • Like 2

Share this post


Link to post
  • 0

Hey Evernote, just go ahead and acquire Quiver from HappenApps and integrate all of it's features into Evernote! I really miss the possibility to store code snippets with syntax highlighting and I'd like to use Markdown to format my notes!

 

 

Something like Quiver built into Evernote would be excellent.

  • Like 1

Share this post


Link to post
  • 0

One thing to try, for those using the Web interface. Install the Markdown Here extension for Chrome and/or Firefox.

 

Then, when editing a note, switch Markdown on/off using ctrl-alt-M and the markdown for code snippets seems to work really well.

 

You may need to stick to fairly simple notes, rather than trying to edit complex web pages copied in to Evernote, but, for me, this is very helpful.

 

You can also use Markdown Here in your emails etc.

 

e.g. use this markdown for a php snippet:

 

```php

if($x) {

   $y = "foo";

}

```

 

112 different languages are supported via highlight.js

  • Like 1

Share this post


Link to post
  • 0

On googling I found a online syntax highlighting tool. (http://tohtml.com/c/).

I was able to get my code higlighted but when I paste to evernote I see all the

code being pasted in a single line as below :

int sum(){>----int result = 0;>----return result != 0;}

Let me know if this could be avoided or if there is a better way for pasting code into evernote..

 

 

Sadly, this bug still exists as of Evernote for the Mac 6.0.6:

  • Copying a formatted snippet from http://tohtml.com into Evernote then produces garbled results (line breaks are replaced with spaces) when later copying from Evernote elsewhere (such as into a plain-text editor).
    • Workaround: If the selection in Evernote contains at least 1 line OUTSIDE of the originally pasted code snippet, copying works fine.
    • Upshot: You can't (easily) copy parts of such code snippets elsewhere.

I don't know the reason - it may be specific to the HTML generated by http://tohtml.com/.

Share this post


Link to post
  • 0

You also have my vote +1!

 

@evernote: I think there are enough votes to realize this feature...

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...