This is the source for the Kotlin Web Site
We use YouTrack for bug reports and suggestions. Click here to report an issue.
After installation of required tools run npm i
to download all frontend dependencies and pip install -r requirements.txt
to download backend dependencies.
npm run build
command to build assets. If you are going to modify js/scss files use npm start
instead.python kotlin-website.py
commandAll data is stored in the *.yml files in folder _data
:
content
property is used to create categories.
It contains a list of videos or other categories. Maximum tree depth level is 3.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)
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.
The Kotlin grammar reference (grammar.xml) is generated by the Kotlin grammar generator from the Kotlin grammar definition.
Kramdown with some additions (like GitHub fenced code blocks) is used as markdown parser. See the complete syntax reference at Kramdown site.
With Kramdown you can assign HTML attributes to page elements via {:%param%}
. E.g.:
*important text*{:.important}
- produces <em class="important">important text</em>
*important text*{:#id}
- produces <em id="id">important text</em>
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.
{:.keyword}
highlights a keyword.{:.error}
highlights an error.{:.warning}
highlights a warning.{:.wide}
stretches a table to occupy the entire width of a page.{:.zebra}
interleaves table rows.E.g.:
| Expression | Translated to |
|------------|---------------|
| `a++` | `a.inc()` + see below |
| `a--` | `a.dec()` + see below |
{:.wide.zebra}
They're used in a slightly other manner that they were originally designed for: as universal block container elements.
{:.note}
highlights a note block.E.g.:
> **`inc()/dec()` shouldn't mutate the receiver object**.
>
> By "changing the receiver" we mean `the receiver-variable`, not the receiver object.
{:.note}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。