Scully: How to get code highlight in markdown?

Created on 29 Dec 2019  路  8Comments  路  Source: scullyio/scully

If I have the following markdown for blog application, how do I get syntax highlighted?
do you have to add any 3rd party CSS ?

---
title: My second page
author: Sander Elias
publish: true
publish_date: 2019-11-27
description: This is the second demo page in this sample.
---
# Page 3

## its a wild world after all

    ```typescript
      console.log('amazing')
    ```

documentation question

Most helpful comment

Nonetheless I think a small paragraph in the docs would be good to point this out.

All 8 comments

Hey, the rendered markdown code contains the class names matching with this ones used by prismjs.
So you can just include prismjs in your project and it will work.
In my repo https://github.com/d-koppenhagen/d-koppenhagen.de you can see how it will be implemented

Nonetheless I think a small paragraph in the docs would be good to point this out.

@d-koppenhagen
Would you like add a small paragraph in docs/blog.md with the explanation?

Could you add it?

Sure. I will send a PR later :)

Sure. I will send a PR later :)

No rush, Thanks @d-koppenhagen
If you need help to contribute flow , just let me know...

@d-koppenhagen I am getting Copy to Clipboard plugin loaded before Toolbar plugin. warning
I am also not getting copy button for code highlight section. Rest of the styling works.
any suggestions to fix this?
Thanks

image

Hmm good question. Can you compare it maybe with my implementation here: https://github.com/d-koppenhagen/d-koppenhagen.de/commit/330e4008646fa1b35709a56cb80d3b139b3ab62a ? I don't see this warning when starting my project.

@SanderElias I am also thinking about a configuration option for an easier setup / integration. What do you think?

Was this page helpful?
0 / 5 - 0 ratings