Open johno opened 9 years ago
Absolutely, just going to wait for a few more plugins to hit npm so there's something to test against!
Will this work with unpublished plugins too?
Yep. It will, hypothetically, take any function. The proposed API for plugins:
var gulp = require('gulp'),
name = require('gulp-rename'),
md = require('gulp-remarkable'),
somePlugin = require('some-plugin'),
unpublishedPlugin = require('./path/to/plugin');
gulp.task('md', function() {
return gulp.src('file.md')
.pipe(md({
preset: 'full',
plugins: [somePlugin, unpublishedPlugin]
}))
.pipe(name('file.html'))
.pipe(gulp.dest('dist'));
});
gulp.task('default', ['md']);
That way, whether you're installing the plugin from npm, or from a local module, it's all just passed in as an array.
Looks good :+1:
:smiley:
@johnotander , switch to markdown-it, it's much more fresh and supports curring.
Instead of adding tons of option, just extend prototype with .gulp()
method. So, use will look like this:
var md = require('gulp-markdown-it'); // just returns markdown-it with extended prototype
// ...
.pipe(md(options).enable(...).disable(...).use(...).gulp())
That's much more easy and compatible with all future changes.
+1
@puzrin Seems gulp-markdown-it doesn't have an API like you have write
var md = require('gulp-markdown-it'); // just returns markdown-it with extended prototype // ... .pipe(md(options).enable(...).disable(...).use(...).gulp())
@xcatliu i think it's better to ask author or write your own. I'm not familiar well with gulp - don't use it in my projects. I can help only with questions about markdown-it.
@johnotander has there been any traction on this?
I would love this too!