-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better Markdown rendering / syntax highlighting #95
Comments
Very important, havnt found time for it. Formatting atm is suboptimal at best. |
Right, I had a bit of difficulty with the initial version when we introduced msee and had to get an update there to make it all work nicely but since then it's been a bit of a struggle and something we obviously need to rectify. My first suggestion would be for someone with time on their hands and that cares enough to go ask the msee author if we can take over maintaining it (well, "we" meaning one of us probably). Then we could have our way with it and be responsive to user requests. Next would be to either fork or reimplement it. We're having the same problems with terminal-menu and it's due for a fork so we can do our own special stuff with it. I'm 👍 on anything that would let us make better progress. Also @thlorenz who may be interested in the comments on ES6 / cardinal / redeyed thing. My understanding is that Esprima 2 has started adding more ES6 stuff, maybe we just need an upgrade? |
Yes, I'm absolutely going to address these in the coming weeks, along with pending g11n/L10n's on workshopper-based workshops, adventure, adventure-based workshops and stream-adventure refactoring and bugfixing (it has at least 2 confirmed bugs in its exercise handlers). Also, FYI: how-to-nom, freshly released by npm Inc, is buggy as hell. 12+ people yesterday got into a lot of different issues. Going to assert these, raise issues, and write as many fixes as I can before translating. I also slated some time to look deeper into any workshopper / workshopper-exercise open issues, see what can be closed and what warrants further investigation. You might get some new pings on these when I need clarification / context. Best, |
@rvagg very hesitant to switch to ES6 branch of esprima as last time browserify did things got very unstable. |
@thlorenz perhaps you could |
Cool! We should then update |
BTW not currently documented but redeyed now supports jsx as well. We could add that to cardinal themes to highlight jsx if that is needed. |
Hey there, I gave this a try and sent a PR to msee + forked it. This fork includes a few changes from another fork + dependency updates to I also looked at Both modules have small codebases because they rely on Edit: The msee PR was merged by the project's maintainer! Here's a PR: #127 I also forked workshopper to use my I tried it with I'm very keen to make those changes available as part of this module, let me know what you think. |
I just published workshopper-adventure version 4.0.x which does a very different job of rendering markdown code. Particularily with my custom version of msee ( 😈 ) To try it out check this out: workshopper/learnyounode#368 |
I updated the custom version of msee in the latest workshopper-adventure. and now it is not using |
Just wanted to let you know that redeyed is about to switch to latest esprima with ES6 support which will affect cardinal and thus msee as well. |
Hey all,
So, currently we're relying on the released-once-never-updated
msee
module for rendering Markdown and doing syntax highlighting on the code snippets.It's doing a pretty good job right now. It actually relies on a number of other modules, and the split of responsibilities is not always super-clear.
marked
parses the Markdown and renders it in terminal-oriented text. Its actual rendering is hijacked bymsee
, that only relies on its inline lexers and processes tokens internally, deferring code blocks highlighting to…cardinal
, that processes the parsed code blocks and renders them in terminal-based colors (this thing's even themable!). It specifically deports JavaScript code parsing (better not parse anything else!) to…redeyed
, which in turn isesprima
-based. Unfortunately, it has next to no ES6 support.This way, any ES6 code is not properly colored, which is kinda too bad. Can't we figure out another way to highlight our code? I mean,
marked
will happily honor ahighlight
callback option that could use whatever we want (bundled pygmentize, highlight.js, etc.), so there might be a way there…msee
also makes a number of other questionable calls, such as rendering all types of lists as bullet lists, and not rendering anything inside a list item (most notably inline code), and also not honoring source code line breaks in list items, all of which regularly forces me to "fake" lists with undetected syntaxes so they look alright (yeah, no kidding).What do you guys (mostly @rvagg and @martinheidegger) think?
The text was updated successfully, but these errors were encountered: