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 08:44:47 +00:00
|
|
|
BenchmarkSmall-12 7223979 164.2 ns/op 64 B/op 2 allocs/op
|
|
|
|
BenchmarkMedium-12 832531 1310 ns/op 992 B/op 2 allocs/op
|
|
|
|
BenchmarkLarge-12 295946 3732 ns/op 3712 B/op 3 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
|