Skip to content

Commit 905b625

Browse files
committed
Add log feature, document features
1 parent 72a8cf9 commit 905b625

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ harness = false
2020
[features]
2121
default = []
2222
json = ["dep:serde", "dep:serde_json"]
23+
log = ["dep:log"]
2324

2425
[dependencies]
2526
log = { version = "0.4", optional = true }

examples/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn main() -> Result<(), String> {
22
// Turn on debugging.
3-
// You can show it with `RUST_LOG=debug cargo run --example lib`
3+
// You can show it with `RUST_LOG=debug cargo run --features log --example lib`
44
env_logger::init();
55

66
// Safely turn (untrusted?) markdown into HTML.

readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ The following bash scripts are useful when working on this project:
247247
```
248248
* run examples:
249249
```sh
250-
RUST_BACKTRACE=1 RUST_LOG=debug cargo run --example lib
250+
RUST_BACKTRACE=1 RUST_LOG=debug cargo run --features log --example lib
251251
```
252252
* format:
253253
```sh

src/lib.rs

+11
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@
1111
//! constructs (GFM, MDX, and the like)
1212
//! * [`to_mdast()`][]
1313
//! — turn markdown into a syntax tree
14+
//!
15+
//! ## Features
16+
//!
17+
//! * **`default`**
18+
//! — nothing is enabled by default
19+
//! * **`json`**
20+
//! — enable serde to serialize the AST (includes `dep:serde`, `dep:serde_json`)
21+
//! * **`log`**
22+
//! — enable logging (includes `dep:log`);
23+
//! you can show logs with `RUST_LOG=debug`
24+
1425
#![no_std]
1526
#![deny(clippy::pedantic)]
1627
#![allow(clippy::doc_link_with_quotes)]

0 commit comments

Comments
 (0)