Skip to content

Commit

Permalink
Merge branch 'master' into np/console/move-out-legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Jan 28, 2020
2 parents 90d7b72 + 106ddf9 commit 5d0082b
Show file tree
Hide file tree
Showing 148 changed files with 2,399 additions and 1,335 deletions.
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"embeddableExamples": "examples/embeddable_examples",
"share": "src/plugins/share",
"home": "src/plugins/home",
"charts": "src/plugins/charts",
"esUi": "src/plugins/es_ui_shared",
"devTools": "src/plugins/dev_tools",
"expressions": "src/plugins/expressions",
Expand Down
17 changes: 9 additions & 8 deletions docs/developer/add-data-guide.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@ Each tutorial contains three sets of instructions:

[float]
=== Creating a new tutorial
// TODO: update path to where the directory must be created on the new platform
1. Create a new directory in the link:https://github.com/elastic/kibana/tree/master/src/legacy/core_plugins/kibana/server/tutorials[tutorials directory].
2. In the new directory, create a file called `index.js` that exports a function.
The function must return a JavaScript object that conforms to the link:https://github.com/elastic/kibana/blob/master/src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts[tutorial schema].
// TODO: update path to where the tutorial must be registered on the new platform
3. Register the tutorial in link:https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/kibana/server/tutorials/register.js[register.js] by calling `server.newPlatform.setup.plugins.home.tutorials.registerTutorial(myFuncImportedFromIndexJs)`.
// TODO: update path to where the image assets must be added on the new platform
1. Create a new directory in the link:https://github.com/elastic/kibana/tree/master/src/plugins/home/server/tutorials[tutorials directory].
2. In the new directory, create a file called `index.ts` that exports a function.
The function must return a function object that conforms to the `TutorialSchema` interface link:https://github.com/elastic/kibana/blob/master/src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts[tutorial schema].
3. Register the tutorial in link:https://github.com/elastic/kibana/blob/master/src/plugins/home/server/tutorials/register.ts[register.ts] by adding it to the `builtInTutorials`.
// TODO update path once assets are migrated
4. Add image assets to the link:https://github.com/elastic/kibana/tree/master/src/legacy/core_plugins/kibana/public/home/tutorial_resources[tutorial_resources directory].
5. Run Kibana locally to preview the tutorial.
6. Create a PR and go through the review process to get the changes approved.

If you are creating a new plugin and the tutorial is only related to that plugin, you can also place the `TutorialSchema` object into your plugin folder. Add `home` to the `requiredPlugins` list in your `kibana.json` file.
Then register the tutorial object by calling `home.tutorials.registerTutorial(tutorialObject)` in the `setup` lifecycle of your server plugin.

[float]
==== Variables
String values can contain variables that are substituted when rendered. Variables are specified by `{}`.
For example: `{config.docs.version}` is rendered as `6.2` when running the tutorial in Kibana 6.2.

link:https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/kibana/public/home/components/tutorial/replace_template_strings.js#L23[Provided variables]
link:https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/replace_template_strings.js#L23[Provided variables]

[float]
==== Markdown
Expand Down
Loading

0 comments on commit 5d0082b

Please sign in to comment.