Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/foolishchow/connect-md
view markdow files in browser with connect.js
https://github.com/foolishchow/connect-md
Last synced: 5 days ago
JSON representation
view markdow files in browser with connect.js
- Host: GitHub
- URL: https://github.com/foolishchow/connect-md
- Owner: foolishchow
- License: mit
- Created: 2017-03-17T04:54:19.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-03-17T05:44:04.000Z (over 7 years ago)
- Last Synced: 2024-10-30T03:42:44.232Z (15 days ago)
- Language: CSS
- Size: 261 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# connect-md
view markdow files in browser with connect.js in a specify url ext> configs
- it very simple
|name | description|default value|
|------|------------|------|
|baseDir|the basepath of your md files|'./md/'|
|ext| you special url ext |'.md'|to visit `/foler/README.md` just use `/folder`
#### test
just clone this and run `npm run test`> useage
- with `connect.js`
```
var connect = require('connect')
var connct_md = require('connect-md')
var opt = {
baseDir: './doc/',
ext: '.html'
};
connect.server({
root: ['./doc'],
port: 9400,
livereload: false,
middleware: function() {
return [connct_md(opt)];
}
});
```- with `gulp-connect`
```
var gulp = require('gulp')
var connect = require('gulp-connect')
var connct_md = require('connect-md')
var opt = {
baseDir: './doc/',
ext: '.html'
};
gulp.task('previewMarkdown',()=>{
return connect.server({
root: ['./doc'],
port: 9400,
livereload: false,
middleware: function() {
return [connct_md(opt)];
}
});
})```