kibana/docs/developer/architecture/add-data-tutorials.asciidoc
Anton Dosov d58b812ece
[8.x] Sustainable Kibana Architecture: Move plugins owned by @elastic/appex-sharedux (#204959) (#205508)
# Backport

This will backport the following commits from `main` to `8.x`:
- [Sustainable Kibana Architecture: Move plugins owned by
`@elastic/appex-sharedux`
(#204959)](https://github.com/elastic/kibana/pull/204959)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Anton
Dosov","email":"anton.dosov@elastic.co"},"sourceCommit":{"committedDate":"2025-01-03T11:38:57Z","message":"Sustainable
Kibana Architecture: Move plugins owned by `@elastic/appex-sharedux`
(#204959)\n\n## Summary\r\n\r\nPart of
https://github.com/elastic/kibana/pull/203163\r\n\r\nRelocating only
shared-ux-owned plugins for
now","sha":"9215df9200edac72f2225760043ac45c9e82cdf0","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:SharedUX","backport:prev-minor","plugin
groups"],"number":204959,"url":"https://github.com/elastic/kibana/pull/204959","mergeCommit":{"message":"Sustainable
Kibana Architecture: Move plugins owned by `@elastic/appex-sharedux`
(#204959)\n\n## Summary\r\n\r\nPart of
https://github.com/elastic/kibana/pull/203163\r\n\r\nRelocating only
shared-ux-owned plugins for
now","sha":"9215df9200edac72f2225760043ac45c9e82cdf0"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/204959","number":204959,"mergeCommit":{"message":"Sustainable
Kibana Architecture: Move plugins owned by `@elastic/appex-sharedux`
(#204959)\n\n## Summary\r\n\r\nPart of
https://github.com/elastic/kibana/pull/203163\r\n\r\nRelocating only
shared-ux-owned plugins for
now","sha":"9215df9200edac72f2225760043ac45c9e82cdf0"}}]}] BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Timothy Sullivan <tsullivan@elastic.co>
2025-01-05 19:48:48 +00:00

38 lines
2.3 KiB
Text

[[add-data-tutorials]]
== Add data tutorials
`Add Data` in the {kib} Home application contains tutorials for setting up data flows in the Elastic stack.
Each tutorial contains three sets of instructions:
* `On Premise.` Set up a data flow when both {kib} and {es} are running on premise.
* `On Premise Elastic Cloud.` Set up a data flow when {kib} is running on premise and {es} is running on Elastic Cloud.
* `Elastic Cloud.` Set up a data flow when both {kib} and {es} are running on Elastic Cloud.
[discrete]
=== Creating a new tutorial
1. Create a new directory in the link:https://github.com/elastic/kibana/tree/main/src/platform/plugins/shared/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:{kib-repo}tree/{branch}/src/platform/plugins/shared/home/server/services/tutorials/lib/tutorial_schema.ts[tutorial schema].
3. Register the tutorial in link:{kib-repo}tree/{branch}/src/platform/plugins/shared/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 `tutorial_resources` directory.
5. Run {kib} 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.
[discrete]
==== 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 {kib} 6.2.
link:{kib-repo}tree/{branch}/src/platform/plugins/shared/home/public/application/components/tutorial/replace_template_strings.js[Provided variables]
[discrete]
==== Markdown
String values can contain limited Markdown syntax.
https://elastic.github.io/eui/#/editors-syntax/markdown-format[Enabled Markdown grammars]