Skip to content

Commit 2045b0b

Browse files
Add support for serializing trees as JSON
This adds support for serializing the mdast syntax tree as JSON, with serde, through a feature. Closes GH-10. Related-to GH-30. Closes GH-37.
1 parent af202d3 commit 2045b0b

File tree

6 files changed

+250
-18
lines changed

6 files changed

+250
-18
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
with:
1212
toolchain: stable
1313
components: rustfmt, clippy
14-
- run: cargo fmt --check && cargo clippy --examples --tests --benches
15-
- run: cargo test
14+
- run: cargo fmt --check && cargo clippy --examples --tests --benches --all-features
15+
- run: cargo test --all-features
1616
coverage:
1717
runs-on: ubuntu-latest
1818
steps:

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ name = "bench"
1717
path = "benches/bench.rs"
1818
harness = false
1919

20+
[features]
21+
default = ["json"]
22+
json = ["dep:serde", "dep:serde_json"]
23+
2024
[dependencies]
2125
log = "0.4"
2226
unicode-id = { version = "0.3", features = ["no_std"] }
27+
serde = { version = "1.0", optional = true }
28+
serde_json = { version = "1.0", optional = true }
2329

2430
[dev-dependencies]
2531
env_logger = "0.10"

0 commit comments

Comments
 (0)