Page

Page

A page resource represents a markdown file that can be used to display content in the lab.


resource "page" "name" {
  ...
}

Attributes

Attribute
Description

File file required type: string

The path to the markdown file that contains the content of the page.

file = "instructions/first_chapter/first_page.md"
file = "instructions/introduction/first.md"

Title title type: string

The title of the page. This can be overridden in the `content` block of a `lab` when referencing the page.

title = "Getting Started"

Variables variables type: map[string]string

A key/value map of variables that are passed to the markdown. Handlebars templates are used to substitute the variables. The placeholders will be replaced with the variable values at runtime.

variables = {
  version = "v0.1.0"
}

Activities activities type: Reference to Task, Quiz

The activities that are embedded in the content of the page. This maps the chosen ID to the activity reference. This ID will be replaced with the interpolated activity reference at runtime.

activities = {
  first = resource.task.my_task
  second = resource.quiz.my_quiz
}

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.

Attribute
Description

Meta ID meta.id string

The full ID of the resource e.g. `resource.type.name`. This is computed from the full resource path:

// given the following resource
resource "container" "ubuntu" {
  ...
}

// the resulting id will be
resource.container.ubuntu

Meta Type meta.type string

The type of the resource. This taken from the type label of the resource definition.

// given the following resource
resource "container" "ubuntu" {
  ...
}

// the resulting type will be
container

Meta Name meta.name string

The name of the resource. This taken from the name label of the resource definition.

// given the following resource
resource "container" "ubuntu" {
  ...
}

// the resulting name will be
ubuntu

Content content type: string

The content of the file at the path specified in the `file` field.

Examples

Minimal

resource "page" "first" {
  file = "instructions/introduction/first.md"
}

Full Example

resource "page" "second" {
  file = "instructions/introduction/second.md"

  activities = {
    "exam" = resource.task.first_task
    "quiz" = resource.quiz.france
  }
}

Last updated