serenader2014/decent

Code formating

Closed this issue · 9 comments

I saw at your website that your code is color formated. How is the syntax for this?

@jwillmer Hello, thank you for your attention for this project.

In this project, I use prism.js to enable the syntax highlighting. Prism.js is easy to use, you don't need to modify any code in the theme. You just need to change the way you write your markdown.

You just need to specify which language of your code block is, and it's done! For example:

```javascript
Array.prototype.uniq = function () {
    var map = {};
    return this.filter(function (item) {
        if (map[item]) {
            return false;
        } else {
            map[item] = true;
            return true;
        }
    });
};
```


```css
html {
    margin: 0;
    padding: 0;
}
```

As you can see, you just need to add the code block's language to let the prism.js know how to render its syntax.

If you have any further question, please let me know.

Perfect, I know prism! I tested it even with the prism/GitHub syntax but it does not work for c-sharp. Did you maybe not include all supported languages?

Yes. I just include HTML/Sass/CSS/Javascript (maybe more) languages. If you want to add C# language syntax highlighting maybe you need to download prism.js again and use UglifyJS to create the bundle.js file.

Sorry for the inconvenient. I will update the instruction in the README.md soon.

Yes, not a problem but maybe update the instructions and specify which features are included and how to use them (link to prism).

@jwillmer Hey, just want to let you know that I've update the README, check it out.

I would maybe add an additional screenshot that showcases the code highlighting but not needed - documentation looks good, thx for sharing the theme:+1:

How about a second issue? This one is at the end of it's purpose ;)

@jwillmer Which issue?

If you want to translate the theme to Jekyll, just do it.

@Geoffreyvdb added a new issue in the issue. Just ignore it.