From 22993c46a5ac5516679179b3ae9023d168cf7428 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Tue, 26 Nov 2013 07:38:16 -0700 Subject: [PATCH] Added scratchy tasks and config.js docs --- Gruntfile.js | 1 + docs/configuration/config.js.asciidoc | 24 +++++++++++++++++++ package.json | 3 ++- src/config.js | 34 +++++++++++++++++---------- tasks/default_task.js | 2 +- tasks/docs_task.js | 4 ++++ tasks/options/clean.js | 1 + tasks/options/scratchy.js | 12 ++++++++++ 8 files changed, 67 insertions(+), 14 deletions(-) create mode 100644 docs/configuration/config.js.asciidoc create mode 100644 tasks/docs_task.js create mode 100644 tasks/options/scratchy.js diff --git a/Gruntfile.js b/Gruntfile.js index dceb171f69d1c..657fd572b9e0b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -8,6 +8,7 @@ module.exports = function (grunt) { srcDir: 'src', destDir: 'dist', tempDir: 'tmp', + docsDir: 'docs' }; // load plugins diff --git a/docs/configuration/config.js.asciidoc b/docs/configuration/config.js.asciidoc new file mode 100644 index 0000000000000..4dc02ada9289c --- /dev/null +++ b/docs/configuration/config.js.asciidoc @@ -0,0 +1,24 @@ += Config.js = +config.js is where you will find the core Kibana configuration. This file contains parameter that +must be set before kibana is run for the first time. +== Parameters == + +=== elasticsearch === + +The URL to your elasticsearch server. You almost certainly don't +want 'http://localhost:9200' here. Even if Kibana and Elasticsearch are on +the same host + +By default this will attempt to reach ES at the same host you have +elasticsearch installed on. You probably want to set it to the FQDN of your +elasticsearch host + +=== kibana-int === + +The default ES index to use for storing Kibana specific object +such as stored dashboards + +=== panel_name === + +An array of panel modules available. Panels will only be loaded when they are defined in the +dashboard, but this list is used in the "add panel" interface. diff --git a/package.json b/package.json index 50fe9d8d1548d..d58807e4ec9ae 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,8 @@ "grunt-contrib-uglify": "~0.2.4", "load-grunt-tasks": "~0.2.0", "glob": "~3.2.7", - "grunt-contrib-connect": "~0.5.0" + "grunt-contrib-connect": "~0.5.0", + "grunt-scratchy": "git://github.com/rashidkpc/grunt-scratchy.git" }, "license": "Apache License" } diff --git a/src/config.js b/src/config.js index 80c0c8129a728..fb4eae7f19342 100644 --- a/src/config.js +++ b/src/config.js @@ -1,36 +1,46 @@ -/** - * These is the app's configuration, If you need to configure - * the default dashboard, please see dashboards/default +/** @scratch /configuration/config.js/1 + * = Config.js = + * config.js is where you will find the core Kibana configuration. This file contains parameter that + * must be set before kibana is run for the first time. */ define(['settings'], function (Settings) { "use strict"; + /** @scratch /configuration/config.js/2 + * == Parameters == + */ return new Settings({ - /** - * URL to your elasticsearch server. You almost certainly don't - * want 'http://localhost:9200' here. Even if Kibana and ES are on + /** @scratch /configuration/config.js/5 + * + * === elasticsearch === + * + * The URL to your elasticsearch server. You almost certainly don't + * want 'http://localhost:9200' here. Even if Kibana and Elasticsearch are on * the same host * * By default this will attempt to reach ES at the same host you have * elasticsearch installed on. You probably want to set it to the FQDN of your * elasticsearch host - * @type {String} */ elasticsearch: "http://"+window.location.hostname+":9200", - /** + /** @scratch /configuration/config.js/5 + * + * === kibana-int === + * * The default ES index to use for storing Kibana specific object * such as stored dashboards - * @type {String} */ kibana_index: "kibana-int", - /** - * Panel modules available. Panels will only be loaded when they are defined in the + /** @scratch /configuration/config.js/5 + * + * === panel_name === + * + * An array of panel modules available. Panels will only be loaded when they are defined in the * dashboard, but this list is used in the "add panel" interface. - * @type {Array} */ panel_names: [ 'histogram', diff --git a/tasks/default_task.js b/tasks/default_task.js index c81cf9ba6108f..86bef62326ab0 100644 --- a/tasks/default_task.js +++ b/tasks/default_task.js @@ -1,4 +1,4 @@ // Lint and build CSS module.exports = function(grunt) { - grunt.registerTask('default', ['jshint:source', 'less:src']); + grunt.registerTask('default', ['jshint:source', 'less:src', 'docs']); }; \ No newline at end of file diff --git a/tasks/docs_task.js b/tasks/docs_task.js new file mode 100644 index 0000000000000..2ff68b885dc54 --- /dev/null +++ b/tasks/docs_task.js @@ -0,0 +1,4 @@ +// Lint and build CSS +module.exports = function(grunt) { + grunt.registerTask('docs', ['clean:docs', 'scratchy:docs']); +}; \ No newline at end of file diff --git a/tasks/options/clean.js b/tasks/options/clean.js index e1624ebae7435..7db6ef22f26a7 100644 --- a/tasks/options/clean.js +++ b/tasks/options/clean.js @@ -2,5 +2,6 @@ module.exports = function(config) { return { on_start: ['<%= destDir %>', '<%= tempDir %>'], temp: ['<%= tempDir %>'], + docs: ['<%= docsDir %>'] }; }; \ No newline at end of file diff --git a/tasks/options/scratchy.js b/tasks/options/scratchy.js new file mode 100644 index 0000000000000..c1ab22cc4275c --- /dev/null +++ b/tasks/options/scratchy.js @@ -0,0 +1,12 @@ +module.exports = function(config) { + return { + docs: { + src: ['src/app/**/*.js','src/config.js'], + dest: config.docsDir, + options: { + unslash: true, + extension: '.asciidoc' + } + } + } +}; \ No newline at end of file