Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: further guidelines around adding extra scripts and assets #19

Merged
merged 9 commits into from
Jun 26, 2024
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Killercoda - Grafana Labs Tutorials

<p >
<a href="https://github.com/grafana/killercoda/actions/workflows/regenerate-tutorials.yml">
<img src="https://github.com/grafana/killercoda/actions/workflows/regenerate-tutorials.yml/badge.svg?branch=staging" alt="Regenerate Tutorials">
</a>
</p>


Welcome to the Grafana Labs tutorials repository.
This repository contains interactive tutorials for Grafana Labs, hosted on [Killercoda](https://killercoda.com/grafana-labs/).
These tutorials aim to help users understand and implement Grafana solutions without the need to download or install the software.
Expand Down Expand Up @@ -39,6 +46,8 @@ We welcome contributions to enhance these tutorials.

### Propose changes

> **Note:** Follow the below contribution steps if you plan to create a tutorial that is independant from the offical Grafana Labs documentation. Otherwise follow these [steps](./docs/transformer.md#generate-a-tutorial).
Jayclifford345 marked this conversation as resolved.
Show resolved Hide resolved

1. Fork the repository by clicking on the **Fork** button on the top right corner of this page.

For more information, refer to [Fork a repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo).
Expand Down
29 changes: 28 additions & 1 deletion docs/transformer.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The tool uses the metadata to perform preprocessing on the source file and gener

| Field | Type | Description |
| ---------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------ |
| `killercoda.backend.imageid` | String | The name of the Killercoda environment's backend image. Supported values include `ubuntu`. |
| `killercoda.backend.imageid` | String | The name of the Killercoda environment's backend image. Supported values include, `ubuntu`, `ubuntu-4GB` `kubernetes-kubeadm-1node`, `kubernetes-kubeadm-2nodes`|
| `killercoda.description` | String | The description displayed on the Killercoda website |
| `killercoda.details.finish.text` | String | The filename of the finish page Markdown source in the grafana/killercoda repository. |
| `killercoda.details.intro.text` | String | The filename of the introduction page Markdown source in the grafana/killercoda repository. |
Expand Down Expand Up @@ -333,3 +333,30 @@ To generate a tutorial:
1. In each repository, commit your changes, push your branch, and open a pull request.

1. A Killercoda maintainer reviews the PR to ensure that the generate tutorial works as expected.


## Scripts and Extra Course Files
Jayclifford345 marked this conversation as resolved.
Show resolved Hide resolved

If your tutorial requires scripts or extra files, make sure to manually add them to the tutorial directory in the Killercoda repository. For example, if your tutorial requires a script to run:

1. Add the bash script to the tutorial directory in the Killercoda repository. See the [what-is-loki](../loki/what-is-loki/) tutorial for an example.
Jayclifford345 marked this conversation as resolved.
Show resolved Hide resolved
2. Add the script to the `scripts` field in the `index.json` file:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use repetitive numbering and let the renderer auto increment for you which makes it easier to update steps: https://grafana.com/docs/writers-toolkit/write/markdown-guide/#numbered-lists

I'm a bit confused by the example because it doesn't reference the scripts field. JSON is very hard to demonstrate in the docs though and you have to be very verbose to help a user: https://grafana.com/docs/writers-toolkit/write/style-guide/write-for-developers/#partial-code-examples so I understand there may not be much you can do

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really good point let me flesh this out a little better!

```json
"intro": {
"text": "intro.md",
"foreground": "setup.sh"
},
```

For extra assets, such as images or configuration files:
1. Create a directory called `assets` in the tutorial directory.
2. Add the assets to the `assets` directory.
3. Add the mount path to the `index.json` file:
```json
"assets": {
"host01": [
{"file": "/assets", "target": "/assets"}
]
}
```
See the [grafana-basics](../grafana/grafana-basics/index.json) tutorial for an example.
Jayclifford345 marked this conversation as resolved.
Show resolved Hide resolved