docs: uniform codeblocs => use shell language + add title

Signed-off-by: Guillaume de Rouville <guillaume.derouville@gmail.com>
This commit is contained in:
Guillaume de Rouville
2021-06-16 15:48:49 +02:00
committed by Sam Alba
parent 829ad4c951
commit 255e6c9c16
4 changed files with 84 additions and 111 deletions

View File

@@ -77,13 +77,13 @@ If you are new to Cue, we recommend keeping the following resources in browser t
You will need a local copy of the [Dagger examples repository](https://github.com/dagger/examples).
```bash
```shell
git clone https://github.com/dagger/examples
```
Make sure that all commands are run from the `todoapp` directory:
```bash
```shell
cd examples/todoapp
```
@@ -95,7 +95,7 @@ Otherwise, don't worry: a Cue module is simply a directory with one or more Cue
In this guide we will use the same directory as the root of the Dagger workspace and the root of the Cue module; but you can create your Cue module anywhere inside the Dagger workspace.
```bash
```shell
cue mod init
```
@@ -114,7 +114,7 @@ But you can call your packages anything you want.
Let's layout the structure of our package by creating all the files in advance:
```bash
```shell
touch multibucket-source.cue multibucket-yarn.cue multibucket-netlify.cue
```
@@ -129,7 +129,7 @@ In Dagger terms, this component has 2 important properties:
Let's write the corresponding Cue code to `multibucket-source.cue`:
```cue
```cue title="~/examples/todoapp/multibucket-source.cue"
package multibucket
import (
@@ -148,7 +148,7 @@ The second component of our plan is the Yarn package built from the source code.
Let's write it to `multibucket-yarn.cue`:
```cue
```cue title="~/examples/todoapp/multibucket-yarn.cue"
package multibucket
import (
@@ -179,7 +179,7 @@ The third component of our plan is the Netlify site to which the app will be dep
Let's write it to `multibucket-netlify.cue`:
```cue
```cue title="~/examples/todoapp/multibucket-netlify.cue"
package multibucket
import (
@@ -205,7 +205,7 @@ This is very similar to the previous component:
But wait: how did we know what fields were available in `yarn.#Package` and `netlify.#Site`?
Answer: thanks to the `dagger doc` command, which prints the documentation of any package from [Dagger Universe](https://github.com/dagger/dagger/tree/main/stdlib).
```bash
```shell
dagger doc dagger.io/netlify
dagger doc dagger.io/js/yarn
```
@@ -218,7 +218,7 @@ You can also browse the [Dagger Universe](/reference/universe) reference in the
Now that your Cue package is ready, let's create an environment to run it,
```bash
```shell
dagger new 'multibucket'
```
@@ -226,7 +226,7 @@ dagger new 'multibucket'
Now let's configure the new environment to use our package as its plan:
```bash
```shell
cp multibucket-*.cue .dagger/env/multibucket/plan/
```