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: add starlark writing tips to more places in the docs #1889

Merged
merged 3 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/docs/api-reference/starlark-reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ pagination_next: api-reference/starlark-reference/standard-library

This section details the Kurtosis Starlark DSL used to manipulate the contents of enclaves. Feel free to use the [official Kurtosis Starlark VS Code extension][vscode-plugin] when writing Starlark with VSCode for features like syntax highlighting, method signature suggestions, hover preview for functions, and auto-completion for Kurtosis custom types.

Useful tips for using and writing Starlark
------------------------------------------
If you're using Visual Studio Code, you may find our [Kurtosis VS Code Extension][vscode-plugin] helpful when writing Starlark.

If you're using Vim, you can add the following to your `.vimrc` to get Starlark syntax highlighting:

```
" Add syntax highlighting for Starlark files
autocmd FileType *.star setlocal filetype=python
```

or if you use Neovim:
```
autocmd BufNewFile,BufRead *.star set filetype=python
```

Parameter Naming Convention
---------------------------

Expand Down
17 changes: 16 additions & 1 deletion docs/docs/best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,26 @@ Kurtosis service names implements [RFC-1035](https://datatracker.ietf.org/doc/ht

Failure to adhere to the above standards will result in errors when running Kurtosis.

Writing and reading Starlark
----------------------------

If you're using Visual Studio Code, you may find our [Kurtosis VS Code Extension][vscode-plugin] helpful when writing Starlark.

If you're using Vim, you can add the following to your `.vimrc` to get Starlark syntax highlighting:

```
" Add syntax highlighting for Starlark files
autocmd FileType *.star setlocal filetype=python
```

or if you use Neovim:
```
autocmd BufNewFile,BufRead *.star set filetype=python
```

<!---------------------------------------- ONLY LINKS BELOW HERE!!! ----------------------------------->
[package-parameterization]: ./advanced-concepts/packages.md#parameterization

[vscode-plugin]: https://marketplace.visualstudio.com/items?itemName=Kurtosis.kurtosis-extension
[service-config-starlark-reference]: ./api-reference/starlark-reference/service-config.md
[port-spec-starlark-reference]: ./api-reference/starlark-reference/port-spec.md
[ready-condition-starlark-reference]: ./api-reference/starlark-reference/ready-condition.md
Expand Down
23 changes: 22 additions & 1 deletion docs/docs/get-started/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,25 @@ kurtosis run github.com/kurtosis-tech/basic-service-package \

![service-c-partying.png](/img/home/service-c-k8s.png)

</details>
</details>
leeederek marked this conversation as resolved.
Show resolved Hide resolved

Writing and reading Starlark
----------------------------
The Starlark programming language is used to manipulate the contents of environments spun up with Kurtosis. Read more about Starlark and why we chose to use it [here](../advanced-concepts/why-kurtosis-starlark.md).

If you're using Visual Studio Code to write and edit Starlark in Kurtosis packages, you may find our [Kurtosis VS Code Extension][vscode-plugin] helpful when writing Starlark.

If you're using Vim, you can add the following to your `.vimrc` to get Starlark syntax highlighting:

```
" Add syntax highlighting for Starlark files
autocmd FileType *.star setlocal filetype=python
```

or if you use Neovim:
```
autocmd BufNewFile,BufRead *.star set filetype=python
```

<!--------------- ONLY LINKS BELOW THIS POINT ---------------------->
[vscode-plugin]: https://marketplace.visualstudio.com/items?itemName=Kurtosis.kurtosis-extension
4 changes: 4 additions & 0 deletions docs/docs/get-started/write-your-first-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ If you're using Vim, you can add the following to your `.vimrc` to get Starlark
autocmd FileType *.star setlocal filetype=python
```

or if you use Neovim:
```
autocmd BufNewFile,BufRead *.star set filetype=python
```
:::

Finally, [run][kurtosis-run-reference] the script (we'll explain enclaves in the "Review" section):
Expand Down