All Projects → Thomasorus → Kaku

Thomasorus / Kaku

Licence: other
Kaku - 書く - A markup language I did for myself

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to Kaku

python-textile
A Python port of Textile, A humane web text generator
Stars: ✭ 61 (+190.48%)
Mutual labels:  markup-language
mathup
Easy MathML authoring tool with a quick to write syntax
Stars: ✭ 46 (+119.05%)
Mutual labels:  markup-language
d-mark
Semantic markup language
Stars: ✭ 13 (-38.1%)
Mutual labels:  markup-language
markright
A customizable markdown parser in Elixir: pure pattern matching.
Stars: ✭ 14 (-33.33%)
Mutual labels:  markup-language
CDom
Simple HTML/XML/BBCode DOM component for PHP.
Stars: ✭ 26 (+23.81%)
Mutual labels:  markup-language
abstractmark
Next level generation of markdown, allowing users to add styling, classes, and more into their markdown.
Stars: ✭ 19 (-9.52%)
Mutual labels:  markup-language
PENDOWN
Text-to-HTML conversion tool for web writers, with integrated styling and tag customization.
Stars: ✭ 33 (+57.14%)
Mutual labels:  markup-language
doconce
Lightweight markup language - Document Once
Stars: ✭ 43 (+104.76%)
Mutual labels:  markup-language
hext
Markup language and tool for generating binary files
Stars: ✭ 23 (+9.52%)
Mutual labels:  markup-language
Retext
ReText: Simple but powerful editor for Markdown and reStructuredText
Stars: ✭ 1,500 (+7042.86%)
Mutual labels:  markup-language
Heml
HEML is an open source markup language for building responsive email.
Stars: ✭ 4,264 (+20204.76%)
Mutual labels:  markup-language
strictdown
A Strictdown parser and compiler written in Javascript. Built for web browsers and Node.js™.
Stars: ✭ 27 (+28.57%)
Mutual labels:  markup-language

Kaku 書く

Kaku (write) is my own markup language. It's inspired by Markdown with a few modification for quotes, links, images and lists handling. It was created to fit my needs. This repositoty contains a parser for Kaku.

Branches

The parser exists in two branches:

  • the master branch is the classic parser as explained below
  • the responsive-lazy-images is a modified version with more advanced image management, but severely opiniated so it can work with Ronbun

If you are new to Kaku, use the master branch!

License

Kaku 書く is a free to use by individuals and organizations that do not operate by capitalist principles. For more information see the license file.

Syntax

Kaku uses some syntax from Markdown for basic text transformation. However it uses an array like declaration with special characters for things like quotes, links and images.

Typography

Title 1

Example : # Title

Will return:

<h1>Title</h1>

Title 2

Example : ## Title

Will return:

<h2>Title</h2>

Same for titles 3 to 6...

Bold

Example : *bold*

Will return:

<strong>bold</strong>

Emphasis

Example : _emphasis_

Will return:

<em>emphasis</em>

Code

Example : code

Will return:

<code>code</code>

Code Block

Example:

```

This is some code

```

Will return:

This is some code

Striked throught

Example : strike

Will return:

<del>strike</del>

Quotes

Quotes can take up to 4 arguments:

  1. The quote itself
  2. The author
  3. The source of the quote
  4. The url of the quote

Example: (quote: I am the quoted text! author: Author of quote source: Source of quote link: url_of_quote

Will return:

<figure>
    <blockquote cite="url_of_quote">
        And even, quotes!
    </blockquote>
    <figcaption>—Author, <a href="url_of_quote"> Source of quote</a></figcaption>
</figure>

Links

Links can take up to 3 arguments:

  1. The link url
  2. The text of the link
  3. The text for the accessibility label (optionnal)
  4. The text for the title (optionnal)

Example: (link: https://github.com/Thomasorus/Kaku text: Check the this link to the repo! label: Link to Kaku's repo title: Hover title)

Will return:

<a href="https://github.com/Thomasorus/Kaku" aria-label="Link to Kaku's repo" title="Hover title">Check the this link to the repo!</a>

Images

Images can take up to 3 arguments:

  1. The image name or url
  2. The image alt text for accessibility
  3. The image caption (optionnal, will create a figure and figcaption)

Image with alt text : (image: img_url, alt: the alternate text)

Will return;

<img src="img_url" alt="the alternate text">

Image with caption : (image: img_url, alt: the alternate text figcaption: the text under the image)

Will return:

<figure>
    <img src="img_url" alt="the alternate text">
    <figcaption>the text under the image</figcaption>
</figure>

Bullet lists

- AAA
- BBB
- CCC

Will return:

<ul>
    <li>AAA</li>
    <li>BBB</li>
    <li>CCC</li>
</ul>

Ordered lists

+ Number 1
+ Number 1
+ Number 1

Will return:

<ol>
    <li>Number 1</li>
    <li>Number 2</li>
    <li>Number 3</li>
</ol>

Descriptive lists

? Term 1 : definition 1
? Term 2 : definition 2

Will return:

<dl>
    <dt>Term 1</dt>
    <dd>definition 1</dd>
    <dt>Term 2</dt>
    <dd>definition 2</dd>
</dl>

Videos and audios

Videos can take up to 2 arguments:

  1. The video name or url (mp3 only for audio)
  2. If a video you can add a g parameter to use the video as a gif

Classic video: (video: videoUrl)

Will return:

<video controls="" preload="metadata" src="videoUrl" type="video/mp4"></video>

Video as gif: (video: videoUrl autoplay)

Will return:

<video autoplay="true" playsinline="true" loop="true" mute="true" preload="metadata" src="videoUrl" type="video/mp4"></video>

Audio: (audio: audioUrl)

Will return;

<audio controls="" preload="metadata" src="audioUrl" type="audio/mpeg"></audio>

Note: all audio and video elements come with the preload="metadata" attribute to help slower connections.

HR

----

Will return:

<hr>

Run tests

This projects comes with unit tests. To run them:

  • Install with yarn
  • Configure tests in test.js
  • Run tests with npx ava
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].