Home

Awesome

<a href="http://kotlinslackin.herokuapp.com"><img src="https://kotlinslackin.herokuapp.com/badge.svg" height="20"></a>

This is the source for the Kotlin Web Site

Filing Bugs

We use YouTrack for bug reports and suggestions. Click here to report an issue.

Installation

Prerequisites

Installation

After installation of required tools run npm i to download all frontend dependencies and pip install -r requirements.txt to download backend dependencies.

Working with site

Run site

Data

All data is stored in the *.yml files in folder _data:

Templates

Kotlinlang uses Jinja2 templates that can be found in templates folder. Note, that before converting to html all markdown files are processed as jinja templates. This allows you to use all jinja power inside markdown (for example, build urls with url_for function)

Page metadata

Every page can have an unlimited number of metadata fields. More information here. The most important of them are the page template (e.g. layout: reference) and its type (e.g. type: tutorial). category and title fields are added for future development.

Kotlin grammar reference

The Kotlin grammar reference (grammar.xml) is generated by the Kotlin grammar generator from the Kotlin grammar definition.

Writing content

Markup

Kramdown with some additions (like GitHub fenced code blocks) is used as markdown parser. See the complete syntax reference at Kramdown site.

Specifying page element attributes

With Kramdown you can assign HTML attributes to page elements via {:%param%}. E.g.:

For block elements this instruction must be specified on the line following element definition:

This is a paragraph
{:.important}

This is a paragraph

More information about attributes can be found here.

Custom element styles

Inline elements

Tables

E.g.:

| Expression | Translated to |
|------------|---------------|
| `a++` | `a.inc()` + see below |
| `a--` | `a.dec()` + see below |
{:.wide.zebra}

Quotation blocks

They're used in a slightly other manner that they were originally designed for: as universal block container elements.

E.g.:

> **`inc()/dec()` shouldn't mutate the receiver object**.
>
> By "changing the receiver" we mean `the receiver-variable`, not the receiver object.
{:.note}