This codelab page describe the process that making codelab page in Github pages.

Why Use Google Codelabs?

In local machine, brew should be installed.

googlecodelab will be deployed and served by(using) claat, and claat can be installed by go lang. So, first of all, install go using brew and then, install claat using go.

Install go:

brew install go

When brew install go lang, it add the go binary to the PATH, but if it does not add binary to the PATH, add it manually.

Add go binary to PATH:

echo 'export PATH=$PATH:~/go/bin' >> ~/.zshrc

Refresh .zshrc file to activate PATH:

source ~/.zshrc

Then, install claat:

go install github.com/googlecodelabs/tools/claat@latest

To check claat installed successfully:

claat --help

Make a markdown file(sample.md) like:

summary: Title of the Codelab
id: codelab-id
categories: Web, Beginner
status: Published

# Title of the Codelab

## Introduction
Brief introduction of the blog/tutorial.

## Step 1: Do Something
Instructions for step 1.

## Step 2: Do Something Else
Instructions for step 2.

Export the markdown file by claat

In the same directory with markdown file:

claat export sample.md

claat create a codelab-id directory in the same path. (id based directory.)

Check in local

After export the file, codelab can be check in local:

claat serve

When run this command, the default browser is open. If you type this command in same directory for .md file, you can see as below:

img.png

You can check the codelab with clicking the codelab-id path.

Copy the codelab-id directory to the github repo's docs folder.

Then, in the settings in the repository, enable pages as below:

settings in repository

For this codelab, the directory structure is:

img.png

Finally, we can check the codelab in:

https://<username>.github.io/<repo>/codelab-id/

Open your markdown file

$ vim <name-of-codelab>.md

Header metadata [Auto generated]

Update the headers metadata in your markdown file and change the values appropriately. Guidelines are available below the sample headers.

author: Author Name
summary: Summary of your codelab that is human readable
id: unique-codelab-identifier
tags: workshop,iguide
categories: Java,Spring
environments: Web
status: Published
feedback link: A link where users can go to provide feedback (e.g. the git repo or issue page)

Metadata consists of key-value pairs of the form "key: value". Keys cannot contain colons, and separate metadata fields must be separated by blank lines. At present, values must all be on one line. All metadata must come before the title. Any arbitrary keys and values may be used; however, only the following will be understood by the renderer:

Add the Title

Next add your title using a single ‘#' character

# Title of codelab

Add Sections & Durations

Then for each section use Header 2 or ‘##' & specify q duration beneath for time remaining calculations

Example

## Section 1
Duration: 0:10:00

## Section 2
Duration: 0:05:00

Add Section Content

Now that we have 2 sections to our titled codelab let's go ahead and add some content to each section. Make up your own or copy & paste the example below:

Copy into section 1 (Below Duration and above Section 2):

### Info Boxes
Plain Text followed by green & yellow info boxes

> aside negative
> This will appear in a yellow info box.
> This is line two of the negative block
> ```
> this is a code block
> with multiple lines
> ```

> aside positive
> This will appear in a green info box.

You created info boxes!

### Bullets
Plain Text followed by bullets
* Hello
* Codelab
* World

You created bullets!

### Numbered List
1. List
1. Using
1. Numbers

You created a numbered list!

Copy into section 2 (Below Duration):

### Add a Link
Add a link!
[Example of a Link](https://www.google.com)

### Add an Image
Add an image!
![image_caption](https://solace.com/wp-content/uploads/2019/09/goodbye_otter_v3.gif)

### Embed an iframe
![https://codepen.io/tzoght/embed/yRNZaP](https://en.wikipedia.org/wiki/File:Example.jpg "Try Me Publisher")

More Markdown Parser examples can be found here.