sh0rez / tkbyexample

Tanka by Example

Home Page:https://x.tanka.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tanka by Example

Tanka by Example is a hands-on introduction to Tanka and Jsonnet using annotated example programs, inspired by the popular gobyexample.com.

Creating examples

Example source is located in src/examples/<example_path>. To create a new one, make a new folder in that directory and add a .x.yml file to it:

title: Hello World # <title>, also shown in index and <h1>
description: A warm welcome to tkbyexample # <meta name=description>

To write the actual example, add a main.jsonnet file and annotate it using comments.

Running locally

This page consists of two parts:

  1. Golang based example generator, ported from https://gobyexample.com
  2. GatbsyJS based static site using React, rendering the markdown generated by Go

For development purposes (file watching, etc):

$ make dev

This will run the generator in watching mode (go run ./gen dev) and gatsby develop for you.

Publishing

The site is built and published by Netlify. Pushing to the master branch will automatically update the page.

About

Tanka by Example

https://x.tanka.dev

License:Apache License 2.0


Languages

Language:Go 43.8%Language:JavaScript 34.7%Language:CSS 15.6%Language:Jsonnet 5.1%Language:Makefile 0.7%