Google Codelab Format

 

The Problem

The Solution

Landing page where codelabs are hosted
Sample codelab
Confluence Group/Space landing page

Imitation is the sincerest form of flattery :)

The Execution

Install Software

Configure Go Environment

## not required if you’re only using Go modules 
export GOPATH=$HOME/go
export GOROOT=/usr/local/go
## required
export PATH=$PATH:$HOME/go/bin

Manage claat

chmod u+x claat

Setup the Landing Page

git clone https://github.com/googlecodelabs/tools
## navigate to folder
cd site/
## install dependencies
npm install
npm install -g gulp-cli
gulp serve
Running via Terminal
Codelab landing page running locally

Write a Sample Codelab

## create codelabs folder
mkdir codelabs
## go into directory
cd codelabs/
## create assets folder
mkdir assets
tools
|-- site
|--|-- codelabs
|--|--|-- assets
summary: How to Write a Codelab
id: how-to-write-a-codelab
categories: Sample
tags: medium
status: Published
authors: Zarin
Feedback Link: https://zarin.io

# How to Write a Codelab
<!-- ------------------------ -->
## Overview
Duration: 1

### What You’ll Learn
- how to set the amount of time each slide will take to finish
- how to include code snippets
- how to hyperlink items
- how to include images
- other stuff

<!-- ------------------------ -->
## Setting Duration
Duration: 2

To indicate how long each slide will take to go through, set the `Duration` under each Heading 2 (i.e. `##`) to an integer.
The integers refer to minutes. If you set `Duration: 4` then a particular slide will take 4 minutes to complete.

The total time will automatically be calculated for you and will be displayed on the codelab once you create it.

<!-- ------------------------ -->
## Code Snippets
Duration: 3

To include code snippets you can do a few things.
- Inline highlighting can be done using the tiny tick mark on your keyboard: "`"
- Embedded code

### JavaScript

```javascript
{
key1: "string",
key2: integer,
key3: "string"
}
```

### Java

```java
for (statement 1; statement 2; statement 3) {
// code block to be executed
}
```

<!-- ------------------------ -->
## Hyperlinking and Embedded Images
Duration: 1
### Hyperlinking
[Youtube - Halsey Playlists](https://www.youtube.com/user/iamhalsey/playlists)

### Images
![alt-text-here](assets/puppy.jpg)

<!-- ------------------------ -->
## Other Stuff
Duration: 1

Checkout the official documentation here: [Codelab Formatting Guide](https://github.com/googlecodelabs/tools/blob/master/FORMAT-GUIDE.md)
## go into codelabs folder
cd codelabs
## export md to html
claat export how-to-write-a-codelab.md
Output for claat command
Filesystem after running claat export within codelabs directory
## go back to site folder
cd ..
## re-run command
gulp serve --codelabs-dir=codelabs
Landing page now rendering newly written codelab
Sample codelab on desktop
Sample codelab on iPhone 6/7

Categorize Codelabs

@include codelab-card(['sample'], #FC0023, 'sample.svg');
gulp serve --codelabs-dir=codelabs
Your codelab formatted nicely
“Web” is a predefined Category, and “Sample” is the one we just created

Create Multiple Homepages (Views)

{
"title": "Medium Articles",
"description": "Hosting codelabs that have been used to write Medium articles",
"logoUrl": "/medium/medium.png",
"tags": ["medium"],
"exclude": [
".*-about$",
"^lang-.*"
]
}
summary: How to Write a Codelab
id: how-to-write-a-codelab
categories: Sample
tags: medium
status: Published
authors: Zarin
Feedback Link: https://zarin.io
You should see the Medium view appear in the drop-down
Example of associating a codelab to a view

The Response

Publishing Codelabs

Next Steps

Comments

Popular posts from this blog

Easy Text-to-Speech with Python

Flutter for Single-Page Scrollable Websites with Navigator 2.0

Better File Storage in Oracle Cloud