Hi telescopers,

I've started working to a new telescope package, it can highlight code snippets inside post and comment text. It is at a very early stage and is part of my learning process, don't expect too much, feel free to fork, make issues and pull requests:

https://github.com/massimilianomarini/telescope-hljs

I hope to learn more from you. Thanks for reading.

Comments

JeremyJeremy
2 years ago

I'm a big fan of highlightjs. I use it everywhere that I style code. The only snag I've run into trying to use it in a standalone Meteor package is you have to commit to one specific stylesheet out of the 18 that are available. Perhaps it's worth making it only use the JS and suggest users add their own stylesheet? For example, I'm not a fan of the monokai theme at all (it reminds me too much of a default Sublime Text install), so I'd never end up using the package because I'd have to override everything.

Another option... You could make the theme configurable by wrapping the contents of each css file in <style> tags and adding them to a template. Then you could just insert a specific chunk into the page with helpers that are controlled by Meteor.settings or a settings page select box (in the case of Telescope). Those options wouldn't be too hard to implement and would allow people to avoid dealing with their own css.

What do you think?

Reply

@jeremy: I really like your second option, give the administrator the ability to choose their own style in the settings page with a select box. Thanks much appreciated.

@sacha: You will be covered! :-)

Reply
Sacha GreifSacha Greif
2 years ago

I'd be happy with a package that just uses whatever styles GitHub uses. That seems like the most "default" code highlighting out there.

Reply
JeremyJeremy
2 years ago

Absolutely. Good call.

Reply