mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
added grunt support for yui doc generator
This commit is contained in:
parent
c20dac0b42
commit
ed92eab2d8
5 changed files with 41 additions and 9 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,6 +1,7 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
node_modules
|
node_modules
|
||||||
src/bower_components
|
src/bower_components
|
||||||
|
docs/
|
||||||
**/*.css
|
**/*.css
|
||||||
trash
|
trash
|
||||||
build
|
build
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
"grunt-contrib-less": "~0.10.0",
|
"grunt-contrib-less": "~0.10.0",
|
||||||
"grunt-contrib-requirejs": "~0.4.4",
|
"grunt-contrib-requirejs": "~0.4.4",
|
||||||
"grunt-contrib-watch": "~0.5.3",
|
"grunt-contrib-watch": "~0.5.3",
|
||||||
|
"grunt-contrib-yuidoc": "~0.5.2",
|
||||||
"grunt-mocha": "~0.4.10",
|
"grunt-mocha": "~0.4.10",
|
||||||
"http-proxy": "~1.1.4",
|
"http-proxy": "~1.1.4",
|
||||||
"husky": "~0.6.0",
|
"husky": "~0.6.0",
|
||||||
|
|
|
@ -20,6 +20,12 @@ module.exports = function (grunt) {
|
||||||
],
|
],
|
||||||
tasks: ['jade:test']
|
tasks: ['jade:test']
|
||||||
},
|
},
|
||||||
|
docs: {
|
||||||
|
files: [
|
||||||
|
'<%= app %>/**/*.js'
|
||||||
|
],
|
||||||
|
tasks: ['yuidoc']
|
||||||
|
},
|
||||||
clientside_jade: {
|
clientside_jade: {
|
||||||
files: [
|
files: [
|
||||||
'<%= testUtilsDir %>/istanbul_reporter/report.clientside.jade'
|
'<%= testUtilsDir %>/istanbul_reporter/report.clientside.jade'
|
||||||
|
@ -28,10 +34,8 @@ module.exports = function (grunt) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (grunt.option('no-test-watcher')) {
|
if (grunt.option('no-test-watcher')) delete config.test;
|
||||||
// unset the test watcher
|
if (!grunt.option('doc-watcher')) delete config.docs;
|
||||||
delete config.test;
|
|
||||||
}
|
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
};
|
};
|
||||||
|
|
24
tasks/config/yuidoc.js
vendored
Normal file
24
tasks/config/yuidoc.js
vendored
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
module.exports = function (grunt) {
|
||||||
|
return {
|
||||||
|
compile: {
|
||||||
|
name: '<%= pkg.name %>',
|
||||||
|
description: '<%= pkg.description %>',
|
||||||
|
version: '<%= pkg.version %>',
|
||||||
|
url: '<%= pkg.homepage %>',
|
||||||
|
options: {
|
||||||
|
linkNatives: true,
|
||||||
|
paths: [
|
||||||
|
'src/kibana/components'
|
||||||
|
],
|
||||||
|
excludePaths: [
|
||||||
|
'src/kibana/components/courier'
|
||||||
|
],
|
||||||
|
outdir: 'docs',
|
||||||
|
tabtospace: 2,
|
||||||
|
markdown: {
|
||||||
|
gfm: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
|
@ -6,11 +6,12 @@ var Promise = require('bluebird');
|
||||||
|
|
||||||
var instrumentationMiddleware = require('./_instrumentation');
|
var instrumentationMiddleware = require('./_instrumentation');
|
||||||
var amdRapperMiddleware = require('./_amd_rapper');
|
var amdRapperMiddleware = require('./_amd_rapper');
|
||||||
var rel = require('path').join.bind(null, __dirname);
|
|
||||||
|
|
||||||
var proxy = require('http-proxy').createProxyServer({});
|
var proxy = require('http-proxy').createProxyServer({});
|
||||||
var ROOT = rel('../../../');
|
|
||||||
var SRC = rel('../../../src');
|
var join = require('path').join;
|
||||||
|
var ROOT = join(__dirname, '../../../');
|
||||||
|
var DOCS = join(ROOT, 'docs');
|
||||||
|
var SRC = join(ROOT, 'src');
|
||||||
|
|
||||||
module.exports = function DevServer(opts) {
|
module.exports = function DevServer(opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
|
@ -39,8 +40,9 @@ module.exports = function DevServer(opts) {
|
||||||
});
|
});
|
||||||
|
|
||||||
app.use(connect.static(ROOT));
|
app.use(connect.static(ROOT));
|
||||||
|
app.use('/docs', connect.static(DOCS));
|
||||||
|
|
||||||
// respond to the "maybe_start_server" pings
|
// respond to "maybe_start_server" pings
|
||||||
app.use(function (req, res, next) {
|
app.use(function (req, res, next) {
|
||||||
if (req.method !== 'HEAD' || req.url !== '/') return next();
|
if (req.method !== 'HEAD' || req.url !== '/') return next();
|
||||||
res.statusCode === 200;
|
res.statusCode === 200;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue