From 892a50974376eef80d23f4cdaccafed985ab4ef3 Mon Sep 17 00:00:00 2001 From: rnentjes Date: Wed, 7 Jan 2026 15:17:27 +0100 Subject: [PATCH] Add `readme.md` with detailed Markdown parser usage, features, and supported syntax. --- readme.md | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 readme.md diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..ec8fc05 --- /dev/null +++ b/readme.md @@ -0,0 +1,88 @@ +# Markdown parser in kotlin multiplatfom common + +A basic markdown parser in kotlin multiplatform common. It can be used on any platform supported by kotlin. +By default only javascript en the jvm are configured. Fork the repository and add any platform you need, no +other changes should be required. + +See the [Markdown.kt](src/commonMain/kotlin/nl/astraeus/markdown/parser/Markdown.kt) class for the format of the output. + +## Mark down support + +### Headers + +# Header 1 + +## Header 2 + +### Header 3 + +#### Header 4 + +##### Header 5 + +###### Header 6 + +### Horizontal line + +--- + +### Formatting + +Text can be formatted with **bold**, *italic*, ***bold and italic***, ~~strikethrough~~, and `code`. + +### Lists + +- *Bullet* point 1 +- Bullet **point** 2 +- Bullet point ***3*** +- ~~Bullet point 4~~ + +### Lists with checkboxes + +- [ ] Checkbox 1 +- [x] Checkbox 2 +- [ ] Checkbox 3 + +### Ordered list + +1. Item 1 +2. Item 2 +3. Item 3 + +### Ordered list alternate syntax + +-. Item 1 +-. Item 2 +-. Item 3 + +### Code blocks + +You can create code blocks by indenting lines with two (or more) spaces or inline using the `backtick character` \`. + + Some code + Block code + +Also code blocks are supported: + +```java +// java code +public class Example { + public static void main(String[] args) { + System.out.println("Hello, World!"); + } +} +``` + +The language (or whatever the text is) will be added to the MarkdownPart.CodeBlock class. + +### Images and links + +Images and links with labels are supported. + +### Tables + +| Header 1 | Header 2 | +|---------------|---------------| +| Row 1, Cell 1 | Row 1, Cell 2 | +| Row 2, Cell 1 | Row 2, Cell 2 | +| Row 3 | etc |