Skip to content

Commit

Permalink
- removed peerDependencies to support grunt >= 1.0
Browse files Browse the repository at this point in the history
- Updated some minor highlightjs documentation
  • Loading branch information
bylexus committed Feb 25, 2016
1 parent 362393c commit 3b6345c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 8 deletions.
42 changes: 38 additions & 4 deletions README.md
Expand Up @@ -130,11 +130,13 @@ options.highlightjs: {
```

md2html includes [highlightjs](https://highlightjs.org/) if you want to highlight source code in the markdown file.
Code blocks then are enriched by highlightjs with HTML and style elements.
Code blocks then are enriched by highlightjs with HTML and style elements: The HTML is parsed and code blocks are sent through highlightjs before writing the final HTML.

Enable code highlighting by setting `enabled` to true.
Enable code highlighting / highlightjs tags by setting `enabled` to true.

You have two options for styling / theming your highlightjs source code:
To style the enriched code blocks, you have to include an official highlightjs CSS file:

You have two options for adding highlightjs styling / theming:

1. Include a highlightjs CSS file in your layout manually (see example [here](https://highlightjs.org/download/) )
2. Use the stringified CSS version in your template: grunt-md2html reads the original highlightjs
Expand All @@ -146,6 +148,36 @@ You have two options for styling / theming your highlightjs source code:
</style>
```

An example:

```html
<!-- layout HTML file -->
<!DOCTYPE html>
<html>
<head>
<style>
<%= highlightjs_style %>
</style>
</head>
<body>
<%= document %>
</body>
</html>
```
<pre><code>
Markdown file with code snippet:
=================================
Now follows some javascript code:
```
var f = function(var1) {
console.log(var1);
}
```
</code></pre>
### Usage Examples
#### Single HTML file output
Expand Down Expand Up @@ -293,9 +325,11 @@ And now some highlighted code:
* 0.2.1: Fixing Relative Path bug: introduced in 0.2.0, the basepath was no longer relative to the options.basePath set in config in scenarios using more than one directory level.
* 0.2.2: Updated dev environment and added unit tests
* 0.3.0: highlightjs support
* 0.3.1:
* changed dependencies to support grunt 1.x
* updated highlightjs related documentation
## License
(c) 2013-2016 Alexander Schenkel
Licensed under the MIT License

5 changes: 1 addition & 4 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "grunt-md2html",
"description": "Small Grunt MultiTask to convert Markdown files to HTML, supporting Grunt >= 0.4.0",
"version": "0.3.0",
"version": "0.3.1",
"homepage": "https://github.com/bylexus/grunt-md2html",
"author": {
"name": "Alexander Schenkel",
Expand Down Expand Up @@ -34,9 +34,6 @@
"grunt-contrib-jshint": "^0.11.2",
"grunt-contrib-nodeunit": "^0.4.1"
},
"peerDependencies": {
"grunt": "~0.4.0"
},
"keywords": [
"gruntplugin",
"markdown",
Expand Down

0 comments on commit 3b6345c

Please sign in to comment.