2024-03-31 19:01:47 +00:00
|
|
|
# markdown
|
|
|
|
|
2024-04-02 08:44:47 +00: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 19:01:47 +00:00
|
|
|
|
|
|
|
## Features
|
|
|
|
|
2024-04-01 19:27:10 +00:00
|
|
|
- Code
|
2024-04-01 09:54:14 +00:00
|
|
|
- Links
|
2024-04-01 18:04:20 +00:00
|
|
|
- Lists
|
2024-03-31 21:08:01 +00:00
|
|
|
- Headers
|
|
|
|
- Paragraphs
|
2024-04-01 16:10:52 +00:00
|
|
|
- Quotes
|
2024-04-01 19:27:10 +00:00
|
|
|
- Tables
|
2024-03-31 19:01:47 +00:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
```shell
|
|
|
|
go get git.akyoto.dev/go/markdown
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```go
|
2024-03-31 21:08:01 +00:00
|
|
|
html := markdown.Render("# Header")
|
2024-03-31 19:01:47 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
|
|
|
|
```
|
2024-03-31 21:08:01 +00:00
|
|
|
PASS: TestEmpty
|
2024-04-01 19:27:10 +00:00
|
|
|
PASS: TestParagraph
|
2024-03-31 21:08:01 +00:00
|
|
|
PASS: TestHeader
|
2024-04-01 09:54:14 +00:00
|
|
|
PASS: TestLink
|
2024-04-01 19:27:10 +00:00
|
|
|
PASS: TestList
|
|
|
|
PASS: TestTables
|
|
|
|
PASS: TestCode
|
2024-04-01 16:10:52 +00:00
|
|
|
PASS: TestQuote
|
2024-03-31 21:08:01 +00:00
|
|
|
PASS: TestCombined
|
2024-04-01 09:54:14 +00:00
|
|
|
PASS: TestSecurity
|
2024-03-31 21:08:01 +00:00
|
|
|
coverage: 100.0% of statements
|
2024-03-31 19:01:47 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Benchmarks
|
|
|
|
|
2024-03-31 21:08:01 +00:00
|
|
|
```
|
2024-04-02 09:50:37 +00:00
|
|
|
BenchmarkSmall-12 8899971 131.5 ns/op 32 B/op 1 allocs/op
|
|
|
|
BenchmarkMedium-12 980007 1217 ns/op 512 B/op 1 allocs/op
|
|
|
|
BenchmarkLarge-12 315229 3554 ns/op 2560 B/op 2 allocs/op
|
2024-03-31 21:08:01 +00:00
|
|
|
```
|
2024-03-31 19:01:47 +00:00
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
Please see the [license documentation](https://akyoto.dev/license).
|
|
|
|
|
|
|
|
## Copyright
|
|
|
|
|
|
|
|
© 2024 Eduard Urbach
|