johno / ember-remarkable

Ember addon for Remarkable markdown parsing helpers and components.
MIT License
26 stars 20 forks source link

Add syntax highlighting option. #2

Closed johno closed 9 years ago

srsgores commented 9 years ago

+1. What is the progress on this?

johno commented 9 years ago

Whoops, this issue should've been closed a while ago! It should be on by default now.

johno commented 9 years ago

Oh man am I dumb, thought this was my gulp-remarkable plugin. My apologies.

johno commented 9 years ago

I've added this to my list to attempt to tackle tomorrow, I will let you know how it goes @srsgores

srsgores commented 9 years ago

@johnotander, thanks. I just had a look into it, and it appears that we might need highlightjs in order to get things working. And it looks like the option we want to set it ishighlight.

johno commented 9 years ago

Yep, @srsgores you're exactly right, I've just added a highlight.js shim and bower dependency.

It's basically together now, implemented with some rudimentary tests. Tomorrow I will add documentation, bump the version, verify everything is working in a test app, and publish to npm (v0.2.0).

If you want to take it for a spin, feel free to install from the add-highlightjs-support branch, and let me know how it goes: https://github.com/johnotander/ember-remarkable/tree/add-highlightjs-support

Something similar to the following should illustrate whether it's working or not:

{{md-text text='# Markdown is fun\n ```js\nvar awesome = require("awesome");```'}}
{{md-text text='# Markdown is fun\n ```var awesome = require("awesome");```'}}

:)

johno commented 9 years ago

The relevant PR: https://github.com/johnotander/ember-remarkable/pull/4

srsgores commented 9 years ago

@johnotander, looks good. I'll try to have a go at it tomorrow.

Thanks for your prompt responses.

johno commented 9 years ago

Published to npm as ember-remarkable@1.0.0.

srsgores commented 9 years ago

@johnotander, did you forget to include highlightjs in the dependencies section of bower.json?

Path or pattern "bower_components/highlightjs/highlight.pack.js" did not match any files Error: Path or pattern "bower_components/highlightjs/highlight.pack.js" did not match any files at Object.multiGlob (C:\Users_admin\Documents\GitHub\seangoresht\node_modules\ember-cli\node_modules\broccoli-kitchen-sink-helpers\index.js:202:13) at C:\Users_admin\Documents\GitHub\seangoresht\node_modules\ember-cli\node_modules\broccoli-concat\index.js:62:32 at $$$internal$$tryCatch (C:\Users_admin\Documents\GitHub\seangoresht\node_modules\ember-cli\node_modules\rsvp\dist\rsvp.js:470:16) at $$$internal$$invokeCallback (C:\Users_admin\Documents\GitHub\seangoresht\node_modules\ember-cli\node_modules\rsvp\dist\rsvp.js:482:17) at $$$internal$$publish (C:\Users_admin\Documents\GitHub\seangoresht\node_modules\ember-cli\node_modules\rsvp\dist\rsvp.js:453:11) at $$rsvp$asap$$flush (C:\Users_admin\Documents\GitHub\seangoresht\node_modules\ember-cli\node_modules\rsvp\dist\rsvp.js:1531:9) at process._tickCallback (node.js:419:13)

srsgores commented 9 years ago

It also appears that the assets for highlightjs aren't being included...

johno commented 9 years ago

Hrm, did you run ember g ember-remarkable after installing the package?

srsgores commented 9 years ago

@johnotander, yes.

johno commented 9 years ago

Okay, thanks for checking. I'll get digging here shortly.

johno commented 9 years ago

Fixed the problem (wasn't specifying both bower dependencies correctly). Published as ember-remarkable@1.0.1.

Sorry about that, should be in working order now!