diff --git a/README.md b/README.md index e1e47b25..c6223dc7 100644 --- a/README.md +++ b/README.md @@ -1,155 +1,149 @@ # Quarkdown -Quarkdown is a work-in-progress markup language to create documents with the minimalism and straightforwardness of Markdown, -while allowing full control over the structure and style of the document that LaTeX provides via a Turing complete, dynamically typed scripting engine. +Quarkdown is a Markdown parser and renderer that extends the capabilities of CommonMark and GFM with its own *Quarkdown +flavor*. + +The standout feature the flavor introduces is its support for **functions**, allowing users to access an +extensive [standard library](stdlib/src/main/kotlin/eu/iamgio/quarkdown/stdlib), use conditional statements and loops, +define new functions and variables - all within Markdown. + +This out-of-the-box scripting support opens doors to complex and dynamic content that would be otherwise impossible +to achieve with vanilla Markdown. + +## Comparison + +| | Markdown | LaTeX | Quarkdown | +|-----------------------|:------------------:|:------------------:|:------------------:| +| Concise and readable | :white_check_mark: | :x: | :white_check_mark: | +| Full document control | :x: | :white_check_mark: | :white_check_mark: | +| Scripting | :x: | :x: | :white_check_mark: | + +
LaTeX | +Quarkdown | +
---|---|
+ +```latex +\section{Section} +\subsection{Subsection} +\begin{enumerate} + \item \textbf{First} item + \item \textbf{Second} item +\end{itemize} +\begin{center} + This text is \textit{centered}. +\end{center} +``` -The base Markdown parsing is CommonMark-compliant, along with several GFM extensions. + | +-## Overview +```markdown +# Section -### Basics -CommonMark/GFM Markdown is (almost) 100% supported. Along with it, Quarkdown's flavor introduces the following: +## Subsection -- Math span - `$ \LaTeX expression $` +1. **First** item +2. **Second** item -- Math block - ``` - $$$ - \LaTeX expression - $$$ - ``` - -- Image size specification: - - `!(150x100)[label](/url.png)` (manual width and height) - - `!(150x_)[label](/url.png)` (manual width, automatic height, keeps the aspect ratio) - - `!(_x100)[label](/url.png)` (automatic width, manual height, keeps the aspect ratio) - - -- Functions: - - `.func` - - `.func {arg1} {arg2}` - - ``` - .func {arg1} {arg2} - This is some nested body content. - ``` - -### Scripting -_Block function calls_, opposite to _inline function calls_, also support a _body_ argument, -which is some nested and indented Quarkdown content. - -The following snippets are valid Quarkdown sources that calculate and display the first 8 numbers of the Fibonacci sequence: -- Iterative: - ```markdown - .var {t1} {0} - .var {t2} {1} - - .table - .foreach {..8} - | $ F_{.1} $ | - |:-------------:| - | .t1 | - .var {tmp} {.sum {.t1} {.t2}} - .var {t1} {.t2} - .var {t2} {.tmp} - ``` -- Recursive: - ```markdown - .function {fib} - num: - .if { .islower {.num} than:{2} } - .num - .ifnot { .islower {.num} than:{2} } - .sum { - .fib { .subtract {.num} {1} } - } { - .fib { .subtract {.num} {2} } - } - - .table - .foreach {..7} - | $ F_{.1} $ | - |:------------:| - | .fib {.1} | - ``` +.center + This text is _centered_. +``` -Output: + | +