Skip to content

Commit aca87ec

Browse files
committed
fix tutorial documentation (#55996)
1 parent 512b9eb commit aca87ec

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

docs/developer/add-data-guide.asciidoc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,24 @@ Each tutorial contains three sets of instructions:
1111

1212
[float]
1313
=== Creating a new tutorial
14-
1. Create a new directory in the link:https://github.com/elastic/kibana/tree/master/src/legacy/core_plugins/kibana/server/tutorials[tutorials directory].
15-
2. In the new directory, create a file called `index.js` that exports a function.
16-
The function must return a JavaScript object that conforms to the link:https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/kibana/common/tutorials/tutorial_schema.js[tutorial schema].
17-
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.registerTutorial(myFuncImportedFromIndexJs)`.
14+
1. Create a new directory in the link:https://github.com/elastic/kibana/tree/master/src/plugins/home/server/tutorials[tutorials directory].
15+
2. In the new directory, create a file called `index.ts` that exports a function.
16+
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].
17+
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`.
18+
// TODO update path once assets are migrated
1819
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].
1920
5. Run Kibana locally to preview the tutorial.
2021
6. Create a PR and go through the review process to get the changes approved.
2122

23+
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.
24+
Then register the tutorial object by calling `home.tutorials.registerTutorial(tutorialObject)` in the `setup` lifecycle of your server plugin.
25+
2226
[float]
2327
==== Variables
2428
String values can contain variables that are substituted when rendered. Variables are specified by `{}`.
2529
For example: `{config.docs.version}` is rendered as `6.2` when running the tutorial in Kibana 6.2.
2630

27-
link:https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/kibana/public/home/components/tutorial/replace_template_strings.js#L23[Provided variables]
31+
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]
2832

2933
[float]
3034
==== Markdown

0 commit comments

Comments
 (0)