grunt-markdown -> marked
This commit is contained in:
parent
49342e5561
commit
00487fb49a
@ -129,6 +129,8 @@ module.exports = (grunt) ->
|
|||||||
""".split('\n').join('&&').replace(/\//g, path.sep)
|
""".split('\n').join('&&').replace(/\//g, path.sep)
|
||||||
'templates-userscript-meta':
|
'templates-userscript-meta':
|
||||||
command: 'node_modules/.bin/coffee tools/templates.coffee src/meta/metadata.js testbuilds/<%= pkg.name %><%= pkg.meta.suffix[pkg.channel] %>.meta.js userscript <%= pkg.channel %>'.replace(/\//g, path.sep)
|
command: 'node_modules/.bin/coffee tools/templates.coffee src/meta/metadata.js testbuilds/<%= pkg.name %><%= pkg.meta.suffix[pkg.channel] %>.meta.js userscript <%= pkg.channel %>'.replace(/\//g, path.sep)
|
||||||
|
markdown:
|
||||||
|
command: 'node tools/markdown.js'
|
||||||
commit:
|
commit:
|
||||||
command: """
|
command: """
|
||||||
git commit -am "Release <%= pkg.meta.name %> v<%= pkg.meta.version %>."
|
git commit -am "Release <%= pkg.meta.name %> v<%= pkg.meta.version %>."
|
||||||
@ -215,13 +217,6 @@ module.exports = (grunt) ->
|
|||||||
'testbuilds/<%= pkg.name %><%= pkg.meta.suffix.dev %>.meta.js'
|
'testbuilds/<%= pkg.name %><%= pkg.meta.suffix.dev %>.meta.js'
|
||||||
]
|
]
|
||||||
|
|
||||||
markdown:
|
|
||||||
web:
|
|
||||||
src: 'README.md'
|
|
||||||
dest: 'test.html'
|
|
||||||
options:
|
|
||||||
template: 'template.jst'
|
|
||||||
|
|
||||||
jshint:
|
jshint:
|
||||||
options:
|
options:
|
||||||
undef: true
|
undef: true
|
||||||
@ -404,8 +399,13 @@ module.exports = (grunt) ->
|
|||||||
'popd'
|
'popd'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
grunt.registerTask 'markdown', [
|
||||||
|
'shell:markdown'
|
||||||
|
]
|
||||||
|
|
||||||
grunt.registerTask 'web', 'Move website changes to gh-pages.', ->
|
grunt.registerTask 'web', 'Move website changes to gh-pages.', ->
|
||||||
grunt.task.run 'markdown:web'
|
grunt.task.run 'shell:markdown'
|
||||||
|
# XXX Grunt seems to see test.html as nonexistent when it was just created.
|
||||||
if not grunt.file.exists('test.html') or grunt.file.read('test.html') isnt grunt.file.read('index.html')
|
if not grunt.file.exists('test.html') or grunt.file.read('test.html') isnt grunt.file.read('index.html')
|
||||||
grunt.task.run [
|
grunt.task.run [
|
||||||
'copy:web'
|
'copy:web'
|
||||||
|
|||||||
22
npm-shrinkwrap.json
generated
22
npm-shrinkwrap.json
generated
@ -1737,24 +1737,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"grunt-markdown": {
|
|
||||||
"version": "0.7.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/grunt-markdown/-/grunt-markdown-0.7.0.tgz",
|
|
||||||
"dependencies": {
|
|
||||||
"highlight.js": {
|
|
||||||
"version": "8.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-8.4.0.tgz"
|
|
||||||
},
|
|
||||||
"lodash": {
|
|
||||||
"version": "2.4.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz"
|
|
||||||
},
|
|
||||||
"marked": {
|
|
||||||
"version": "0.3.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/marked/-/marked-0.3.5.tgz"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"grunt-shell": {
|
"grunt-shell": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/grunt-shell/-/grunt-shell-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/grunt-shell/-/grunt-shell-1.2.1.tgz",
|
||||||
@ -1899,6 +1881,10 @@
|
|||||||
"version": "4.9.0",
|
"version": "4.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.9.0.tgz"
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.9.0.tgz"
|
||||||
},
|
},
|
||||||
|
"marked": {
|
||||||
|
"version": "0.3.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/marked/-/marked-0.3.5.tgz"
|
||||||
|
},
|
||||||
"npm-shrinkwrap": {
|
"npm-shrinkwrap": {
|
||||||
"version": "200.5.1",
|
"version": "200.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/npm-shrinkwrap/-/npm-shrinkwrap-200.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/npm-shrinkwrap/-/npm-shrinkwrap-200.5.1.tgz",
|
||||||
|
|||||||
@ -70,11 +70,11 @@
|
|||||||
"grunt-contrib-copy": "^1.0.0",
|
"grunt-contrib-copy": "^1.0.0",
|
||||||
"grunt-contrib-jshint": "^1.0.0",
|
"grunt-contrib-jshint": "^1.0.0",
|
||||||
"grunt-contrib-watch": "^1.0.0",
|
"grunt-contrib-watch": "^1.0.0",
|
||||||
"grunt-markdown": "^0.7.0",
|
|
||||||
"grunt-shell": "^1.2.1",
|
"grunt-shell": "^1.2.1",
|
||||||
"jszip": "^2.6.0",
|
"jszip": "^2.6.0",
|
||||||
"load-grunt-tasks": "^3.5.0",
|
"load-grunt-tasks": "^3.5.0",
|
||||||
"lodash": "^4.9.0",
|
"lodash": "^4.9.0",
|
||||||
|
"marked": "^0.3.5",
|
||||||
"npm-shrinkwrap": "^200.5.1",
|
"npm-shrinkwrap": "^200.5.1",
|
||||||
"webstore-upload": "^0.0.7"
|
"webstore-upload": "^0.0.7"
|
||||||
},
|
},
|
||||||
|
|||||||
9
tools/markdown.js
Normal file
9
tools/markdown.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
var fs = require('fs');
|
||||||
|
var marked = require('marked');
|
||||||
|
var _ = require('lodash');
|
||||||
|
|
||||||
|
var md = fs.readFileSync('README.md', 'utf8');
|
||||||
|
var content = marked(md);
|
||||||
|
var template = fs.readFileSync('template.jst', 'utf8');
|
||||||
|
var output = _.template(template)({content: content});
|
||||||
|
fs.writeFileSync('test.html', output);
|
||||||
Loading…
x
Reference in New Issue
Block a user