• Stars
    star
    4,173
  • Rank 10,280 (Top 0.3 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Codelabs management & hosting tools

Tools for authoring and serving codelabs

Demo

Codelabs are interactive instructional tutorials, which can be authored in Google Docs using some simple formatting conventions. You can also author codelabs using markdown syntax. This repo contains all the tools and documentation you’ll need for building and publishing your own codelabs.

If you're interested in authoring codelabs, create a doc following the Codelab Formatting Guide. and see the claat directory for a detailed description of the claat command line tool.

Also, consider joining the codelab-authors Google Group, which connects you with other authors and provides updates on new releases.

What is this?

For the past 3+ years, the CLaaT (Codelabs as a Thing) project has given developers around the world a hands-on experience with Google products and tools. We’ve accumulated over 500 high quality codelabs, served millions of web visitors, and supported over 100 events, from local meetups all the way up to Google I/O.

This project has been implemented as a volunteer project by a small group of dedicated Googlers who care deeply about this kind of “learning by doing” approach to education.

What's special about this tool?

  • Powerful and flexible authoring flow via Google Docs
  • Optional support for authoring in Markdown text
  • Ability to produce interactive web or markdown tutorials without writing any code
  • Easy interactive previewing
  • Usage monitoring via Google Analytics
  • Support for multiple target environments (kiosk, web, markdown, offline, etc.)
  • Support for anonymous use - ideal for public computers at developer events
  • Looks great, with a responsive web implementation
  • Remembers where the student left off when returning to a codelab
  • Mobile friendly user experience

Can I use this to create my own codelabs and serve my own codelabs online?

Yes, the claat tool and the serving mechanism can be used by anyone to author their own codelabs and to serve up their own codelabs on the web.

You can also use this tool to create a nice looking summary page like the one you see on the official Google Codelabs site.

If you're interested in authoring codelabs, join codelab-authors group, which connects you with other authors and provides access to the Codelab Formatting Guide.

Ok, how do I use it?

Check out this excellent tutorial.

  1. Create a doc following the syntax conventions described in the Codelab Formatting Guide. Here’s an example doc. Feel free to copy that doc as a starter template. Once you have your own source doc, note its DocId, which is the long string near the end of the URL (right after docs.google.com/document/d/).

  2. Make one or more changes and preview your codelab, using the preview app provided by Google. To preview a codelab, install the Preview Codelab Chrome extension in your browser. Now you can preview a codelab directly from the Google Doc view by clicking the Chrome extension’s button, which will open a new tab to display the preview. Alternatively, navigate manually to https://codelabs-preview.appspot.com/?file_id=

  3. Install the claat command -- see the README in the claat directory of this repo for instructions..

  4. Run the claat command to transform the doc contents into one of the supported output formats. The default supported formats are html and markdown but the claat tool supports adding additional formats by specifying a path to a Go template. For example, using the example document above:

     $ claat export 1rpHleSSeY-MJZ8JvncvYA8CFqlnlcrW8-a4uEaqizPY  
     ok      your-first-pwapp
    

    You can also specify a markdown document (.md file) as input. It has to adhere to the syntax conventions described here

     $ claat export document.md
     ok      your-md-based-codelab
    
  5. Run the claat serve command.

     $ claat serve
    

This will start a local web server and open a browser tab to the local server. Click on the hyperlink represent your codelab of interest to experience a fully rendered version.

How do I generate my own landing page?

See instructions in the site directory's readme.

How do I generate a custom view?

Copy the sample view, customize it to your liking, tag and rebuild the codelabs you want included, and then generate your view.

How do I publish my codelabs?

The output generated by claat is a purely static set of HTML or Markdown code. As such, it can be served by any web serving mechanism, including any of the following options:

Simply commit the artifacts generated by the claat command into your preferred serving vehicle and you should be ready to go.

The site directory contains tools for building your own custom landing page(s) and publishing both landing pages and codelabs to Google Cloud Storage.

Why bother with this approach when I can write tutorials directly in Markdown?

Some people like the Google Docs authoring flow, others prefer to specify their codelabs directly in Markdown. Using the Docs approach, one source format can be used to generate numerous output formats. Also, you can use a doc for the initial formulation stage, where WYSIWYG and easy collaboration are extremely useful. Once the content stabilizes, typically after the first launch, you are free to make the generated markdown your source of truth and discard the Google Doc as a controlling source. This is desirable because it gives you the ability to manage the content as code in a source control system, but it comes at the cost of having to commit to one specific output format, or having to maintain multiple sources of truth.

This tool and corresponding authoring approach are agnostic with respect to whether (and when) you choose to manage your source as a Google Doc or as Markdown text checked into a repo. The only hard and fast rule is that, at any one point in time, you should choose one or the other. Trying to simultaneously maintain a doc and a corresponding repository is a recipe for disaster.

What are the supported input formats?

  • Google Docs (following FORMAT-GUIDE.md formatting conventions)
  • Markdown

What are the supported output formats?

  • Google Codelabs - HTML and Markdown
  • Qwiklabs - Markdown
  • Cloud Shell Tutorials - Markdown with special directives
  • Jupyter, Kaggle Kernels, Colaboratory, et. al. - Markdown with format specific cells

There’s no one “best” publication format. Each format has its own advantages, disadvantages, community, and application domain. For example, Jupyter has a very strong following in the data science and Python communities.

This variety of formats is healthy because we’re seeing new innovative approaches all the time (for example, see observablehq.com, which recently launched their Beta release).

While this evolving format ecosystem is generally a good thing, having to maintain tutorials in multiple formats, or switch from one format to another can be painful. The Codelabs doc format (as specified in FORMAT-GUIDE.md) can provide a high level specification for maintaining a single source of truth, programmatically translated into one or more tutorial specific formats.

Can I contribute?

Yes, by all means. Have feature ideas? Send us a pull request or file a bug.

Where did this come from?

For several years, Googlers would rush to build new tutorials and related assets for our annual developer event, Google I/O. But every year the authoring platform and distribution mechanism changed. As a result, there was little reuse of content and serving infrastructure, And every year we essentially kept reinventing the same wheel.

For Google I/O 2014, Shawn Simister wrote a Python program which retrieved specially formatted documents from Google Drive, parsed them, and generated a nice interactive web-based user experience. This allowed authors to design their codelabs using Google Docs, with its great interactivity and collaboration features, and automatically convert those documents into beautiful web based tutorials, without needing to write a single line of code.

Later, Ewa Gasperowicz wrote a site generator, supporting the ability to publish custom landing pages, with associated branding and an inventory of codelabs specially curated for a given event.

Alex Vaghin later rewrote Shawn's Python program as a statically linked Go program (the claat command in this repo), eliminating many runtime dependencies, improving translation performance. Alex also added, among many other enhancements, a proper abstract syntax tree (to facilitate translation to different output formats), an app engine based previewer, an extensible rendering engine, support for generating markdown output. Alex also wrote the web serving infrastructure, the build tooling (based on gulp), and, with the author, the ability to self-publish codelabs directly from the preview app.

Clare Bayley has been the guru of onsite codelab experiences, running events large and small, while Sam Thorogood and Chris Broadfoot made major contributions to the onsite kiosks you may have seen at Google I/O.

Eric Bidelman redesigned the codelab user interface using Polymer components and built the g.co/codelabs landing page, to provide a beautiful user experience that looks great and works equally well on desktop and mobile devices.

Lots of other contributions have been made over the years and I’m sure that I’m neglecting some important advances but for the sake of brevity, I’ll leave it at that.

Acknowledgements

Google Codelabs exists thanks to the talents and efforts of many fine volunteers, including: Alex Vaghin, Marc Cohen, Shawn Simister, Ewa Gasperowicz, Eric Bidelman, Robert Kubis, Clare Bayley, Cassie Recher, Chris Broadfoot, Sam Thorogood, Ryan Seys, and the many codelab authors, inside and outside of Google, who have generated a veritable treasure trove of content.

Notes

This is not an official Google product.

More Repositories

1

webrtc-web

Realtime communication with WebRTC
JavaScript
701
star
2

your-first-pwapp

Code associated with Your First Progressive Web App codelab
JavaScript
636
star
3

tensorflow-for-poets-2

Python
501
star
4

orchestrate-with-kubernetes

Orchestrating the Cloud with Kubernetes
Shell
497
star
5

codelab-components

Web components for creating codelabs
HTML
473
star
6

android-design-library

Build a Material Design App with the Android Design Support Library
Java
379
star
7

android-build-an-app-architecture-components

Java
268
star
8

android-persistence

Java
216
star
9

monolith-to-microservices

JavaScript
206
star
10

flutter-cupertino-store

Dart
132
star
11

tensorflow-style-transfer-android

C++
96
star
12

photos-sharing

Code for the "Build a Photo Sharing app with Google Photos and Flutter" codelab
95
star
13

android-perf-testing

Automated Performance Testing on Android
Java
94
star
14

google-maps-simple-store-locator

JavaScript
83
star
15

background-location-updates-android-o

Sample for background location changes in Android "O"
Java
79
star
16

workbox-lab

Codelab for learning to build Progressive Web Apps with Workbox.js
HTML
63
star
17

codelab-elements

Next generation of codelab-components using Custom Elements
HTML
61
star
18

cloud-slack-bot

Build a Slack Bot with Node.js on Cloud Run
JavaScript
60
star
19

android-agera

Java
58
star
20

workbox-indexeddb

JavaScript
58
star
21

user-authentication-with-iap

Example code for the User Authentication with IAP codelab
Python
55
star
22

cloud-dataflow-nyc-taxi-tycoon

This is the support code and solutions for the NYC Taxi Tycoon Dataflow Codelab
Java
55
star
23

admob-native-advanced-feed

Java
54
star
24

google-maps-nearby-search-js

Sample code for a web app using Google Maps Platform APIs for maps, geolocation, and place search
HTML
50
star
25

odml-pathways

Jupyter Notebook
45
star
26

bigquery-sheets-slides

Code repo for the Google Apps Script BigQuery-Sheets-Slides codelab application
JavaScript
44
star
27

cloud-nodejs

Build a Node.js Web App using Google Cloud Platform
JavaScript
43
star
28

android-music-player

Playing music on cars and wearables
Java
40
star
29

mlkit-ios

Swift
39
star
30

maps-platform-101-js

JavaScript
39
star
31

android-n-quick-settings

Android N Quick Settings Codelab
Java
38
star
32

cloud-grpc

Google Cloud Platform - Building a gRPC service with Node.js Source Repository
Go
37
star
33

angular-accessibility

Build more accessible Angular apps: Dumpling Shop demo
TypeScript
37
star
34

smarthome-washer

JavaScript
36
star
35

speaking-with-a-webpage

JavaScript
36
star
36

debugging-service-workers

code associated with the "Debugging Service Workers" codelabs (https://codelabs.developers.google.com/codelabs/debugging-service-workers/index.html)
JavaScript
36
star
37

amp-pwa-workbox

HTML
35
star
38

vr_view_app_101

Getting started with VR View for Android
Java
34
star
39

performance-analytics

Measuring Critical Performance Metrics with Google Analytics
JavaScript
33
star
40

maps-platform-101-android

Starter and solution code for Google Maps Platform 101: Android codelab
Kotlin
32
star
41

migrate-to-progressive-web-apps

Migrate to Progressive Web Apps Codelab
JavaScript
32
star
42

mdc-android-kotlin

Kotlin
31
star
43

headless-commerce-demo

30
star
44

androidthings-googleassistant

Integrate Google Assistant into Android Things
Java
30
star
45

cast-videos-android

Java
29
star
46

complications

Adding Complications to your Android Wear Watch Face
Java
28
star
47

cloud-nebulous-serverless

This repo is for the codelabs (free, online, self-paced tutorials) showing developers how they can deploy the same app locally *and* to all three fully-managed serverless compute platforms from Google Cloud w/just minor config changes.
Python
28
star
48

accelerated-mobile-pages-foundations

Accelerated Mobile Pages Foundations
HTML
27
star
49

kubeflow-introduction

Python
26
star
50

web-assembly-introduction

Introduction to Web Assembly
C++
25
star
51

maps-platform-101-webgl

JavaScript
25
star
52

sceneform-intro

Java
25
star
53

appauth-android-codelab

Achieving Single Sign-on with AppAuth
Java
25
star
54

smarthome-local

JavaScript
25
star
55

amp-pwa

These are the resource files needed for the Progressive Web AMPs code lab from Google.
HTML
24
star
56

advanced-interactivity-in-amp

HTML
24
star
57

migrate-python2-appengine

This repo is for the codelabs (free, online, self-paced tutorials) showing developers how to migrate their Google App Engine applications from the Python 2 runtime to the 2nd generation Python3 App Engine or Cloud Run serverless container services. The repo for the code samples in the documentation are elsewhere: https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/appengine/standard/migration
Python
24
star
58

cloud-cardboard-viewer

Build a Node.js & Angular 2 Web App using Google Cloud Platform
TypeScript
24
star
59

cosu

Build Applications for Single-Use Devices
Java
24
star
60

android-storage-permissions

This codelab will cover the correct way to store data securely in an Android app, how to access data on the device securely and how to limit the amount of data that apps expose.
Java
23
star
61

androidthings-imageclassifier

Java
22
star
62

android-tv-leanback

Adding Leanback to your Android TV app
Java
22
star
63

watchface

Create a watchface for Android Wear
Java
22
star
64

polymer-first-elements

Get started creating custom elements with Polymer
HTML
22
star
65

android-network-manager

Network Manager In Your App
Java
20
star
66

google-maps-in-flutter

Dart
20
star
67

play-billing-codelab

Codelab to demonstrate new way of integration with Google Play billing
Java
20
star
68

psk-es2015

How to build an ES2015 app using Polymer Starter Kit
HTML
20
star
69

current-place-picker-android

Use Google Maps Platform to add a current place picker to your Android app
Java
19
star
70

gcf-gmail-codelab

JavaScript
19
star
71

bigquery-maps-api

HTML
19
star
72

play-billing-scalable-kotlin

Kotlin
19
star
73

iot-data-pipeline

Python
18
star
74

app-indexing

App Indexing API: Get your Android app into Search autocomplete
Java
18
star
75

gcp-marketplace-integrated-saas

Python
18
star
76

feedback

Provide feedback to our codelabs by filing an issue here
18
star
77

chrome-es2015

How to build your first ES2015/ES6 app
JavaScript
18
star
78

watchface-kotlin

Codelab to simplify watchface creation with Kotlin DSL.
Kotlin
18
star
79

polymer-firebase

Interacting with data using the <firebase-elements>
HTML
17
star
80

android-smart-lock

Seamless Sign In with Smart Lock
Java
16
star
81

add-to-home-screen

Add Your Web App to a User's Home Screen
JavaScript
16
star
82

androidthings-weatherstation

Codelab and solution for the Android Things Weatherstation
Java
16
star
83

cast-unity-plugin

Google Cast Remote Display Plugin For Unity Codelab
C#
16
star
84

polymer-webgl-visualization

Create a data visualization using Polymer and WebGL
JavaScript
15
star
85

android-migrate-to-jobs

Removing dependencies on background services
Java
15
star
86

hello-beacons

Hello, Beacons! Proximity & Context-aware Apps
Java
15
star
87

tv-recommendations

Java
14
star
88

style-transfer

Java
14
star
89

transport-tracker-codelab

JavaScript
14
star
90

cloud-vision-python

Code repo for the Google Cloud Vision API for Python codelab scripts
Python
14
star
91

adaptive-web-media

High performance video for the mobile web
HTML
13
star
92

automl-vision-edge-in-mlkit

Swift
13
star
93

credential-management-api

Enabling auto sign-in with Credential Management API
HTML
13
star
94

display-nearby-places-ar-android

Starter and solution code for "Display nearby places in AR on Android in Kotlin" codelab.
Kotlin
12
star
95

arcore-intro

C#
12
star
96

recaptcha-codelab

Java
12
star
97

android-androidme

Code for https://codelabs.developers.google.com/codelabs/make-your-first-android-app-with-machine-learning
Kotlin
12
star
98

vr_view_101

Getting started with VR view for HTML
HTML
12
star
99

google-maps-web-services-proxy

Go
11
star
100

cloud-vision

Google Cloud Platform - Using Cloud Vision with Node.js Source Repository
JavaScript
11
star