-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added index.js to repo for coverall report * added fixture for testing.
- Loading branch information
markus cecot
committed
Mar 19, 2015
1 parent
7ab8dc4
commit 22121dd
Showing
6 changed files
with
200 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ node_modules/ | |
temp/ | ||
coverage/ | ||
*.log | ||
index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
'use strict'; | ||
var PluginError, createPluginError, gutil, markdownIt, markdownItPlugin, through; | ||
|
||
through = require('through2'); | ||
|
||
gutil = require('gulp-util'); | ||
|
||
PluginError = gutil.PluginError; | ||
|
||
markdownIt = require('markdown-it'); | ||
|
||
createPluginError = function(message) { | ||
return new PluginError('gulp-markdown-it', message); | ||
}; | ||
|
||
markdownItPlugin = function(opt) { | ||
var i, len, md, options, plugin, plugins, preset, ref, ref1, ref2; | ||
if (opt == null) { | ||
opt = {}; | ||
} | ||
preset = (ref = opt.preset) != null ? ref : 'default'; | ||
plugins = (ref1 = opt.plugins) != null ? ref1 : []; | ||
options = (ref2 = opt.options) != null ? ref2 : {}; | ||
md = markdownIt(preset, options); | ||
for (i = 0, len = plugins.length; i < len; i++) { | ||
plugin = plugins[i]; | ||
md.use(require(plugin)); | ||
} | ||
return through.obj(function(file, encoding, callback) { | ||
var err; | ||
if (file.isNull() || file.content === null) { | ||
callback(null, file); | ||
return; | ||
} | ||
if (file.isStream()) { | ||
callback(new gutil.PluginError('gulp-markdown-it', 'stream content is not supported')); | ||
return; | ||
} | ||
try { | ||
file.contents = new Buffer(md.render(file.contents.toString())); | ||
file.path = gutil.replaceExtension(file.path, '.html'); | ||
this.push(file); | ||
} catch (_error) { | ||
err = _error; | ||
callback(new gutil.PluginError('gulp-markdown-it', err, { | ||
fileName: file.path, | ||
showstack: true | ||
})); | ||
} | ||
callback(); | ||
}); | ||
}; | ||
|
||
'use strict'; | ||
|
||
|
||
/** | ||
* Module dependencies. | ||
*/ | ||
|
||
module.exports = markdownItPlugin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
# Markdown Sampler | ||
|
||
# h1 Heading | ||
## h2 Heading | ||
### h3 Heading | ||
#### h4 Heading | ||
##### h5 Heading | ||
###### h6 Heading | ||
|
||
|
||
## Horizontal Rules | ||
|
||
___ | ||
|
||
--- | ||
|
||
*** | ||
|
||
|
||
## Typographic replacements | ||
|
||
Enable typographer option to see result. | ||
|
||
(c) (C) (r) (R) (tm) (TM) (p) (P) +- | ||
|
||
test.. test... test..... test?..... test!.... | ||
|
||
!!!!!! ???? ,, -- --- | ||
|
||
"Smartypants, double quotes" and 'single quotes' | ||
|
||
|
||
## Emphasis | ||
|
||
**This is bold text** | ||
|
||
__This is bold text__ | ||
|
||
*This is italic text* | ||
|
||
_This is italic text_ | ||
|
||
~~Strikethrough~~ | ||
|
||
|
||
## Blockquotes | ||
|
||
|
||
> Blockquotes can also be nested... | ||
>> ...by using additional greater-than signs right next to each other... | ||
> > > ...or with spaces between arrows. | ||
|
||
## Lists | ||
|
||
Unordered | ||
|
||
+ Create a list by starting a line with `+`, `-`, or `*` | ||
+ Sub-lists are made by indenting 2 spaces: | ||
- Marker character change forces new list start: | ||
* Ac tristique libero volutpat at | ||
+ Facilisis in pretium nisl aliquet | ||
- Nulla volutpat aliquam velit | ||
+ Very easy! | ||
|
||
Ordered | ||
|
||
1. Lorem ipsum dolor sit amet | ||
2. Consectetur adipiscing elit | ||
3. Integer molestie lorem at massa | ||
|
||
|
||
1. You can use sequential numbers... | ||
1. ...or keep all the numbers as `1.` | ||
|
||
Start numbering with offset: | ||
|
||
57. foo | ||
1. bar | ||
|
||
|
||
## Code | ||
|
||
Inline `code` | ||
|
||
Indented code | ||
|
||
// Some comments | ||
line 1 of code | ||
line 2 of code | ||
line 3 of code | ||
|
||
|
||
Block code "fences" | ||
|
||
``` | ||
Sample text here... | ||
``` | ||
|
||
Syntax highlighting | ||
|
||
``` js | ||
var foo = function (bar) { | ||
return bar++; | ||
}; | ||
|
||
console.log(foo(5)); | ||
``` | ||
|
||
## Tables | ||
|
||
| Option | Description | | ||
| ------ | ----------- | | ||
| data | path to data files to supply the data that will be passed into templates. | | ||
| engine | engine to be used for processing templates. Handlebars is the default. | | ||
| ext | extension to be used for dest files. | | ||
|
||
Right aligned columns | ||
|
||
| Option | Description | | ||
| ------:| -----------:| | ||
| data | path to data files to supply the data that will be passed into templates. | | ||
| engine | engine to be used for processing templates. Handlebars is the default. | | ||
| ext | extension to be used for dest files. | | ||
|
||
|
||
## Links | ||
|
||
[link text](http://dev.nodeca.com) | ||
|
||
[link with title](http://nodeca.github.io/pica/demo/ "title text!") | ||
|
||
Autoconverted link https://github.com/nodeca/pica (enable linkify to see) |