Jump to content
  • 5

Improve code block - styling AND functionality


DMiddleton

Idea

I know others have posted about the styling on code blocks but they also really need some additional work, there are several competitors that have (in my opinion) nailed these.

I would bet a lot of people use EN for storing code snippits so, please give them an upgrade with:

  • Better styling as mentioned by other people with colours and bold type etc
  • Add the option to set the language, or have it detected and change the style accordingly
  • Add a 'Copy to clipboard' button/menu option - I cant stress this enough as at present if I use Ctrl + A to select the text it also selects other content in the note rendering it useless. Or, make it so Ctrl + A inside the code block only highlights content within the bounds.
  • Add option to show line numbers against each new line of code, maybe with a line separator between the line numbers and the actual code content.
  • Another neat addition may be to 'Save As' which would let you export the code block to a file with the relevant extension ie: code.js or code.xml etc etc.

Come on EN, as well as the new stuff you are working on let's get some updates on the existing stuff to bring it up to date too!

  • Like 6
Link to comment

7 replies to this idea

Recommended Posts

  • 0
On 4/25/2021 at 7:54 PM, DMiddleton said:

I know others have posted about the styling on code blocks but they also really need some additional work, there are several competitors that have (in my opinion) nailed these.

I would bet a lot of people use EN for storing code snippits so, please give them an upgrade with:

  • Better styling as mentioned by other people with colours and bold type etc
  • Add the option to set the language, or have it detected and change the style accordingly
  • Add a 'Copy to clipboard' button/menu option - I cant stress this enough as at present if I use Ctrl + A to select the text it also selects other content in the note rendering it useless. Or, make it so Ctrl + A inside the code block only highlights content within the bounds.
  • Add option to show line numbers against each new line of code, maybe with a line separator between the line numbers and the actual code content.
  • Another neat addition may be to 'Save As' which would let you export the code block to a file with the relevant extension ie: code.js or code.xml etc etc.

Come on EN, as well as the new stuff you are working on let's get some updates on the existing stuff to bring it up to date too!

I fear the developers are hung on doing things that are interesting to code rather than easy to code and useful for customers.

Link to comment
  • 0
  • Level 5

Personally I doubt it is easy to code multicolor coding „text“  - and there are enough code / coding editors out there. IMHO no need to create a “next” one, just to have a pale copy of what already exists.

The key promises of EN is not to  make coding easy - the key promises is to find when you need it whatever you dropped in there before. That is AFAIK the primary use case of EN for most customers.

I doubt that „coding“ even reaches a single digit percentage of all users. This would be 2 Million coders in the customer base - IMHO pretty unlikely.

Link to comment
  • 0
3 minutes ago, PinkElephant said:

The key promises of EN is not to  make coding easy - the key promises is to find when you need it whatever you dropped in there before.

On that basis you could argue there is no need for any formatting at all in any note. 

If I paste a code snippit in, EN removes the formatting from the code editor and applies its own style.. Imagine if you clipped a website and it removed all the styling and replaced it with something else! You could still find it but it wouldn't look like it did when you dropped it in there. 

Link to comment
  • 0
  • Level 5

Clipping web sites is probably used by 100% of users.

Clipping code (with a necessity of reproducing the original layout details) do how many ? Probably I am in between, sometimes copying some lines of code from a Linux hack I think I may reuse in the future.

For anything more serious I use CotEditor on the Mac, and may attach the resulting file to an EN note.

As I said, I think that bloating (again) the code base of EN for tiny user groups is doing harm to the general user base, be it because there is an additional source of slowliness, of bugs or simply because it takes dev resources away from more pressing gaps. This is why I argue against it, just to contribute to a balanced forum view.

Link to comment
  • 0
7 hours ago, PinkElephant said:

Clipping web sites is probably used by 100% of users.

I would like to bet a lot of people use the code block function, hence why it is even there. And I don't use the Web clipper so not 100% of people do. 

And I would not say changing styling and adding some minor functionality was contributing bloat, to something which is already there. 

I take you point about that being the reason you argue about it but this is a part of the forum for 'feature requests', the whole point is to ask for things you would like to see in EN. 

  • Like 1
Link to comment
  • 0

I personally wouldn't like to count how many people "need" better codeblock formatting in Evernote.
But I would appreciate every "simple to include" and "easy to maintain" functionality which gives us more options and use for individual use of EN. 

I don't know how hard it would be to develop this, but if codeblock formatting could be managed with (extended) markdown-functionalities it shouldn't be to big a problem.
(And this would extend markdown in EN as well ;))

As probably quite a lot of users I tend to collect and save several code-snippeds in Evernote.
And it would be nice and helpful if these snippets could be better rendered and displayed by EN...

Link to comment
  • 0

There are a number of open source and high quality code highlighters that work in Javascript. This is basically a solved problem for anyone who wishes to implement code highlighting in their web site or web application. Now, there is always complexity and unexpected issues arise when integrating third party code, so I can not say with certainty that it would be "easy" for Evernote to do, but certainly they don't need to start from scratch and very likely 90%+ of the work has been done for them.

For this reason I am hopeful that we will see it one day, despite it being applicable to just a small percentage of the user base. See the below site for a brief overview of several popular, open source code highlighters that are free and available to be integrated into an app such as Evernote:

https://ourcodeworld.com/articles/read/140/top-5-best-code-syntax-highlighter-javascript-plugins

  • Like 2
Link to comment

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...