2024-03-31 21:01:47 +02:00
|
|
|
# markdown
|
|
|
|
|
2024-04-02 10:44:47 +02:00
|
|
|
A markdown renderer that supports only a subset of the CommonMark spec in order to make the rendering more efficient and the syntax more consistent.
|
2024-03-31 21:01:47 +02:00
|
|
|
|
|
|
|
## Features
|
|
|
|
|
2024-04-02 20:52:48 +02:00
|
|
|
- Bold
|
|
|
|
- Code
|
|
|
|
- Italic
|
2024-04-01 11:54:14 +02:00
|
|
|
- Links
|
2024-04-01 20:04:20 +02:00
|
|
|
- Lists
|
2024-03-31 23:08:01 +02:00
|
|
|
- Headers
|
|
|
|
- Paragraphs
|
2024-04-01 18:10:52 +02:00
|
|
|
- Quotes
|
2024-04-02 19:25:42 +02:00
|
|
|
- Separators
|
2024-04-02 20:52:48 +02:00
|
|
|
- Strikethrough
|
2024-04-01 21:27:10 +02:00
|
|
|
- Tables
|
2024-03-31 21:01:47 +02:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
```shell
|
|
|
|
go get git.akyoto.dev/go/markdown
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```go
|
2024-03-31 23:08:01 +02:00
|
|
|
html := markdown.Render("# Header")
|
2024-03-31 21:01:47 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
|
|
|
|
```
|
2024-03-31 23:08:01 +02:00
|
|
|
PASS: TestEmpty
|
2024-04-01 21:27:10 +02:00
|
|
|
PASS: TestParagraph
|
2024-03-31 23:08:01 +02:00
|
|
|
PASS: TestHeader
|
2024-04-02 19:48:35 +02:00
|
|
|
PASS: TestItalic
|
|
|
|
PASS: TestBold
|
2024-04-02 20:50:33 +02:00
|
|
|
PASS: TestStrike
|
2024-04-01 11:54:14 +02:00
|
|
|
PASS: TestLink
|
2024-04-01 21:27:10 +02:00
|
|
|
PASS: TestList
|
|
|
|
PASS: TestTables
|
|
|
|
PASS: TestCode
|
2024-04-01 18:10:52 +02:00
|
|
|
PASS: TestQuote
|
2024-04-02 19:25:42 +02:00
|
|
|
PASS: TestSeparator
|
2024-03-31 23:08:01 +02:00
|
|
|
PASS: TestCombined
|
2024-04-01 11:54:14 +02:00
|
|
|
PASS: TestSecurity
|
2024-03-31 23:08:01 +02:00
|
|
|
coverage: 100.0% of statements
|
2024-03-31 21:01:47 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
## Benchmarks
|
|
|
|
|
2024-03-31 23:08:01 +02:00
|
|
|
```
|
2024-04-03 09:23:52 +02:00
|
|
|
BenchmarkSmall-12 5836533 205.3 ns/op 32 B/op 1 allocs/op
|
|
|
|
BenchmarkMedium-12 967740 1103 ns/op 512 B/op 1 allocs/op
|
|
|
|
BenchmarkLarge-12 277908 4099 ns/op 2560 B/op 2 allocs/op
|
2024-03-31 23:08:01 +02:00
|
|
|
```
|
2024-03-31 21:01:47 +02:00
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
Please see the [license documentation](https://akyoto.dev/license).
|
|
|
|
|
|
|
|
## Copyright
|
|
|
|
|
|
|
|
© 2024 Eduard Urbach
|