Coder Social home page Coder Social logo

featherhunter / kotlin-web-site Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jetbrains/kotlin-web-site

0.0 2.0 0.0 67.47 MB

The Kotlin Programming Language Website

Home Page: http://kotlinlang.org/

License: Apache License 2.0

Python 11.49% HTML 17.43% CSS 29.00% XSLT 1.09% JavaScript 41.00%

kotlin-web-site's Introduction

official project

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 3. Kotlinlang is a Flask-based site, so you'll need Python 3 to get it working.
  • Ruby + kramdown. Python has very poor support for Markdown, so kramdown is used as the 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 this site

Running this 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 all Markdown files are processed as Jinja templates before being converted to HTML. 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 the 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-web-site's People

Contributors

abreslav avatar anton-bannykh avatar apatrida avatar bashor avatar belovrv avatar cypressious avatar dipanshkhandelwal avatar ekaterinamusienko avatar elizarov avatar h0tk3y avatar hhariri avatar hltj avatar ilya-g avatar kisenka avatar mg6maciej avatar miha-x64 avatar mikehearn avatar nadavc avatar nataliaukhorskaya avatar pardom avatar pawegio avatar philipto avatar satamas avatar semoro avatar svtk avatar udalov avatar voddan avatar wild-lynx avatar yanex avatar yole avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.