Getting Started with Code Labs Formated Tutorial
Based on the following repository
- Go
- Node.js v10+ and npm
- claat (open source command line tool maintained by Google)
Go and Node has been already installed.
$ wget https://golang.org/dl/go1.15.linux-amd64.tar.gz
$ sudo tar -C /usr/local -xzf go1.15.linux-amd64.tar.gz
$ set --universal -x GOPATH $HOME/go
$ set --universal -x GOROOT /usr/local/go
$ vim ~/.config/fish/config.fish
$PATH:/usr/local/go/bin
$PATH:$HOME/go/bin
$ brew install go
$ export GOPATH=$HOME/Go
$ export GOROOT=/usr/local/opt/go/libexec
$ export PATH=$PATH:$GOPATH/bin
$ export PATH=$PATH:$GOROOT/bin
sudo apt update
sudo apt install -y nodejs npm
- claat
go get -u -v -x github.com/googlecodelabs/tools/claat
- feature:1
- feature:2
$ cd tools
$ git submodule update -i
$ cd site
$ nvm use v12.22.1
$ npm install
$ npm install -g gulp-cli
$ mkdir codelabs
$ cd codelabs
$ docker pull shinyay/claat
$ docker run --rm -it -v (pwd):/app shinyay/claat export -o labs <TARGET_MARKDOWN>
$ cd <GENERATED_HTML_DIR>
$ docker run --rm -it -v (pwd):/app -p 9090:9090 shinyay/claat serve -addr 0.0.0.0:9090
- Build Site Distribution
- Containerize Site Distribution
Icon for Categories
$ cp images/template.md tools/site/codelabs/
$ cp images/icons/* tools/site/app/images/icons/
$ echo "@include codelab-card(['spring'], $color-google-blue, 'spring.svg');" >> tools/site/app/styles/_categories.scss
$ echo "@include codelab-card(['quarkus'], $color-google-blue, 'quarkus.svg');" >> tools/site/app/styles/_categories.scss
$ echo "@include codelab-card(['micronaut'], $color-google-blue, 'micronaut.svg');" >> tools/site/app/styles/_categories.scss
Views for Tags
$ rm -fr tools/site/app/views/*
$ cp -pr views/*cloudrun* tools/site/app/views/
$ cd tools/site/
$ gulp serve --codelabs-dir codelabs/labs
$ gulp clean
$ gulp serve:dist --codelabs-dir codelabs/labs
$ docker build -t shinyay/codelab:0.0.1 .
$ docker run --rm -d -p 8080:8080 shinyay/codelab:0.0.1
Released under the MIT license