1 Star 0 Fork 0

胶布小子 / kotlin-web-site-cn

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

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

  • Python. Kotlinlang is Flask-based site, so you'll need python 2 to get it working.
  • ruby + kramdown. Python has a very poor support for markdown, so kramdown is used as markdown to html converter
  • nodejs + npm to build frontend assets

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

  • Use npm run build command to build assets. If you are going to modify js/scss files use npm start instead.
  • To run site use python kotlin-website.py command

Data

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

  • _nav.yml site navigation and PDF building.
  • releases.yml info about releases.
  • videos.yml data for the Videos page. The content property is used to create categories. It contains a list of videos or other categories. Maximum tree depth level is 3.
  • events.yml event 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.:

  • *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.

Custom element styles

Inline elements

  • {:.keyword} highlights a keyword.
  • {:.error} highlights an error.
  • {:.warning} highlights a warning.

Tables

  • {:.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}

Quotation blocks

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}

空文件

简介

中文Kotlin编程语言网站,制作中,欢迎加入(Chinese Kotlin website),本库已经废弃,同步翻译站请移步 https://github.com/hltj/kotlin-web-site-cn 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/jiaobuxiaozi/kotlin-web-site-cn.git
git@gitee.com:jiaobuxiaozi/kotlin-web-site-cn.git
jiaobuxiaozi
kotlin-web-site-cn
kotlin-web-site-cn
master

搜索帮助