r/o

flake.lock: sync. a42a8494 parent 2ac7fa3b

authored by ~talya

1
# koino
2
3
![Spec Status: 671/671](https://img.shields.io/badge/specs-671%2F671-brightgreen.svg)
4
5
Zig port of [Comrak](https://github.com/kivikakk/comrak). Maintains 100% spec-compatibility with [GitHub Flavored Markdown](https://github.github.com/gfm/).
6
7
8
## Getting started
9
10
### Using koino as a library
11
12
* Add koino via the zig package manager:
13
```console
14
$ zig fetch --save git+https://nossa.ee/~talya/koino
15
```
16
17
* Add the following to your `build.zig`'s `build` function:
18
```zig
19
const koino_pkg = b.dependency("koino", .{ .optimize = optimize, .target = target });
20
exe.root_module.addImport("koino", koino_pkg.module("koino"));
21
```
22
23
* Have a look at the bottom of [`parser.zig`](src/parser.zig) to see some test usage.
24
25
26
### Using it as a CLI executable
27
28
* Clone this repository:
29
```console
30
$ git clone https://nossa.ee/~talya/koino
31
```
32
* Build
33
```console
34
$ zig build
35
```
36
* Use `./zig-out/bin/koino`
37
38
39
### Development
40
41
There's a `flake.nix` for building or getting a devShell if you're so-inclined.
42
43
* Clone this repository (with submodules for the `cmark-gfm` dependency):
44
```console
45
$ git clone --recurse-submodules https://nossa.ee/~talya/koino
46
$ cd koino
47
```
48
49
* Build and run the spec suite.
50
51
```console
52
$ zig build test
53
$ make spec
54
```
55
56
57
## Usage
58
59
Command line:
60
61
```console
62
$ koino --help
63
Usage: koino [-hu] [-e <str>...] [--header-anchors] [--smart] <str>
64
65
Options:
66
-h, --help
67
Display this help and exit
68
69
-u, --unsafe
70
Render raw HTML and dangerous URLs
71
72
-e, --extension <str>...
73
Enable an extension (table,strikethrough,autolink,tagfilter)
74
75
--header-anchors
76
Generate anchors for headers
77
78
--smart
79
Use smart punctuation
80
81
<str>
82
```
83
84
Library:
85
86
Documentation is TODO โ€” see [LoLa](https://github.com/MasterQ32/LoLa/blob/d02b0e6774fedbe07276d8af51e1a305cc58fb34/src/tools/render-md-page.zig#L157) for an example of use. Note also the [`build.zig`](https://github.com/MasterQ32/LoLa/blob/d02b0e6774fedbe07276d8af51e1a305cc58fb34/build.zig#L41-L50) declaration.
87
88