aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2023-02-10 12:43:38 +0100
committerLibravatar Titus Wormer <tituswormer@gmail.com>2023-02-10 12:43:38 +0100
commit905b62583be73a8969014dbb98b6fd1c92c23df6 (patch)
tree78827305dcb1110ca48c2951c8eae82dc182f268
parent72a8cf99fbd20ab29f4f3c1845c67898cdaff7de (diff)
downloadmarkdown-rs-905b62583be73a8969014dbb98b6fd1c92c23df6.tar.gz
markdown-rs-905b62583be73a8969014dbb98b6fd1c92c23df6.tar.bz2
markdown-rs-905b62583be73a8969014dbb98b6fd1c92c23df6.zip
Add `log` feature, document features
Diffstat (limited to '')
-rw-r--r--Cargo.toml1
-rw-r--r--examples/lib.rs2
-rw-r--r--readme.md2
-rw-r--r--src/lib.rs11
4 files changed, 14 insertions, 2 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 68c4b3f..0019649 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,6 +20,7 @@ harness = false
[features]
default = []
json = ["dep:serde", "dep:serde_json"]
+log = ["dep:log"]
[dependencies]
log = { version = "0.4", optional = true }
diff --git a/examples/lib.rs b/examples/lib.rs
index 3c76022..14cfa64 100644
--- a/examples/lib.rs
+++ b/examples/lib.rs
@@ -1,6 +1,6 @@
fn main() -> Result<(), String> {
// Turn on debugging.
- // You can show it with `RUST_LOG=debug cargo run --example lib`
+ // You can show it with `RUST_LOG=debug cargo run --features log --example lib`
env_logger::init();
// Safely turn (untrusted?) markdown into HTML.
diff --git a/readme.md b/readme.md
index d806281..abe1329 100644
--- a/readme.md
+++ b/readme.md
@@ -247,7 +247,7 @@ The following bash scripts are useful when working on this project:
```
* run examples:
```sh
- RUST_BACKTRACE=1 RUST_LOG=debug cargo run --example lib
+ RUST_BACKTRACE=1 RUST_LOG=debug cargo run --features log --example lib
```
* format:
```sh
diff --git a/src/lib.rs b/src/lib.rs
index 143c931..6d19396 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -11,6 +11,17 @@
//! constructs (GFM, MDX, and the like)
//! * [`to_mdast()`][]
//! — turn markdown into a syntax tree
+//!
+//! ## Features
+//!
+//! * **`default`**
+//! — nothing is enabled by default
+//! * **`json`**
+//! — enable serde to serialize the AST (includes `dep:serde`, `dep:serde_json`)
+//! * **`log`**
+//! — enable logging (includes `dep:log`);
+//! you can show logs with `RUST_LOG=debug`
+
#![no_std]
#![deny(clippy::pedantic)]
#![allow(clippy::doc_link_with_quotes)]