Adding Syntax Highlighting to Steemit?

in #programming7 years ago

I just joined steemit and really looking forward posting about programming. I write apps in React for my day job, so got even more excited when I saw that steemit was written in React. I was looking to make a post about Javascript when I noticed none of my code was syntax highlighted. For example:

const isFavoriteColor = ({ color }) => color ===  'green';

This code just looks boring. Imagine instead if we could have code that looked like this:
Screen Shot 2017-06-27 at 1.11.16 AM.png

I thought this would be a very useful feature for any programmer on this site. So I went to the github to make an issue discussing it. But after checking the contributing guide, I found this:

Do not use the issue tracker to suggest enhancements or improvements to the platform. The best place for these discussions is on Steemit.com. If there is a well vetted idea that has the support of the community that you feel should be considered by the development team, please email it to [email protected] for review.

So I figured this would make a great topic for a first post.

So would you like to see syntax highlighting added to steemit? Any specific features or languages you'd like to make sure are supported? If the community wants this I am happy to make the contribution.

Sort:  

Yes please! I suggest using https://highlightjs.org, it support most languages

This is a great idea! A definite need for the programming community on steemit.

Great idea! I think that this would go far to help promote additional programming content on Steemit. I never notice how nice having syntax highlighting is until I see code without it.

Thanks for posting this jimmyhmiller.

For those stumbling on this thread, discussion of the feature (with links to a closed PR and other info) can be found here:

https://github.com/steemit/condenser/issues/2095

The best workaround looks to be to generate your Markdown on the command line and upload HTML instead.

Congratulations @jimmyhmiller! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on any badge to view your own Board of Honnor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Welcome, Jimmy.
Just to let you know, you upvoted a comment of mine. I followed you immediately, and came here to your first post, and resteemed. If I can give you any advice here, (I'm here 1 month) you need to find good discussions about topics you are passionate about, and just comment.
Good post here, and it's a good intro. But you need to spend your time writing good, succinct comments. For like a month.
Good Luck, bon voyage!
(and YES! anything you can contribute to the UI would be sooo appreciated.)

Yes! I'm in the process of writing a piece about capturing/reading/analyzing network packets in C# and having syntax hightlighing built in would be amazing. Currently just uploading screencaps instead, but that's not ideal for a variety of reasons.

I think that would be great, but I feel the Steemit - team has other priorities. Since it isn't necessary for mass adoption, it will likely be shot down.

I'm planning on doing the work as far as the code goes. Since steemit already supports github flavored markdown, it shouldn't be a hard change. They are using remarkable, which supports highlightjs.

Obviously the programming community isn't the largest on steemit, but I feel it has a great chance to be and this feature would make a huge difference.

That said if the team doesn't want to accept it, I understand.

Have a quick look at the closed merge requests and the explanation ...

Help me out. I'm not really seeing a pattern or anything. Are you part of the team?

I'm not part of the team.

I have just seen some good merge requests being closed for good.
Before you put a lot of work in, be aware, that it probably will not go through.

I'd appreciate colored code, but as I said above: Given the history, it probably has very little chance ...
Maybe it would be something for chainbb ...

I was a bit worried about your comments so I looked trough 20+ pages of pull requests on condenser... I could only find one feature request that was closed and I found the reasoning for that one to be sound. Do you have some examples?

https://github.com/steemit/condenser/pull/1433

edit:

Well ... looks like there were not many merge requests for features.
The two I found were shut down.

Awesome. I'm right behind you on this one.

@jimmyhmiller this sounds like an excellent improvement for people who want to share example code. I tried sharing some the other day and it was pretty trick to read.

I'm totally with you on this one. I have started a tutorial series on Android dev exclusively here on Steemit. Obviously code highlighting is the feature that I miss the most.

Let's just hope that the implementation will be so that my currently unhighlighted code will be hightlighted properly once the feature will be available.

Btw, does anybody know if there is a changelog site or something that we could monitor?

Yes! Syntax Highlighting would make technical writing so much more readable and enjoyable.
While waiting for Syntax Highlighting to be supported on Steemit, I added it on my Steemit using TamperMonkey.
Syntax Highlighting with TamperMonkey