gobengo / distbin

distributed social pastebin using Activitypub
https://distbin.com
Apache License 2.0
78 stars 8 forks source link

Adding Syntax Highlighting #26

Closed yalh76 closed 5 years ago

yalh76 commented 5 years ago

const highlightCss = fs.readFileSync(require.resolve('highlight.js/styles/github.css'), 'utf-8'); allow to select a style from highlight.js available styles

I haven't been able to add line numbers. I don't if it's possible with marked package. And if it's not possible, can we change the markdown package? Maybe you choose this one for good reasons

Capture

yalh76 commented 5 years ago

Wooo! Thanks. You said you hadn't really done node.js or typescript before, right? But boom, now you have. You did great. See below for how you can make travis-ci pass to make this mergeable. And please see the two changes I requested below and why.

It tooks me like 4 hours to write 17 lines ^^, I far from ready to do node.js : alt text

Travis won't pass until npm run lint passes: https://travis-ci.com/gobengo/distbin/jobs/186899812#L472

I think the ones it doesn't like here can be auto-fixed by running npm run lint-fix and commiting the changes that it will make for yours.

Travis is happy now ^^

gobengo commented 5 years ago

It tooks me like 4 hours to write 17 lines ^^, I far from ready to do node.js :

You're doing it! Hope it goes even faster next time. We can pair program next time. I would like to try doing screencasts of distbin development so others can learn from our experience.

I haven't been able to add line numbers. I don't if it's possible with marked package. And if it's not possible, can we change the markdown package? Maybe you choose this one for good reasons

No problem with making another issue to talk line numbers. Not attached to marked necessarily, but it's pretty good. I would generally prefer to use a server-side solution that doesn't like re-render everything after page load in a browser. Quick google can't find an easy solution. But open the issue and we can think through options with others on there.


Thanks for your contribution, @yalh76! distbin and the #fediverse are better off for it.