From 85ee3d07b5b6d5ae9f6b1e0549cb10e2d0418f23 Mon Sep 17 00:00:00 2001 From: Erlend Walstad <96946613+lampsitter@users.noreply.github.com> Date: Thu, 1 Feb 2024 20:49:56 +0100 Subject: [PATCH] Move backend documentation out of readme Since I'm still not sure whether I want this or not, it's best to keep it out of README.md At least it allows for finding inconsistencies the existing backend --- Backends.md | 33 +++++++++++++++++++++++++++++++++ README.md | 33 --------------------------------- 2 files changed, 33 insertions(+), 33 deletions(-) create mode 100644 Backends.md diff --git a/Backends.md b/Backends.md new file mode 100644 index 0000000..e136210 --- /dev/null +++ b/Backends.md @@ -0,0 +1,33 @@ +## Parsing backends + +egui_commonmark offers __experimental__ support for using [comrak](https://crates.io/crates/comrak) +as parsing backend. By default pulldown_cmark is used. To use comrak instead do: + +```toml +egui_commonmark = { version = "0.11", default-features = false, features = ["load-images", "comrak"] } +``` + +### Why two parsing backends? + +egui_commonmark was originally implemented using pulldown_cmark, however comrak +has stricter commonmark/github style markdown support. In addition it allows the +crate to support more features than pulldown_cmark can offer with regards to github +style markdown. + +pulldown_cmark has fewer dependencies and should theoretically be faster. + +Due to these reasons both backends are supported. At least for now. + + +### Differences in support + +Currently both support the same feature set + +### Known rendering differences + +| Type | pulldown_cmark | comrak | +|---------|----------------|--------| +| Footers | Placed when they appear | Placed at the end | +| Spec incompatibilies | Blocks such as images can be rendered inside tables. This is against the spec | Disallowed | + + diff --git a/README.md b/README.md index 950761e..3a995ef 100644 --- a/README.md +++ b/README.md @@ -38,39 +38,6 @@ CommonMarkViewer::new("viewer").show(ui, &mut cache, markdown); * `svg`: Support for viewing svg images * `fetch`: Images with urls will be downloaded and displayed -## Parsing backends - -egui_commonmark offers __experimental__ support for using [comrak](https://crates.io/crates/comrak) -as parsing backend. By default pulldown_cmark is used. To use comrak instead do: - -```toml -egui_commonmark = { version = "0.11", default-features = false, features = ["load-images", "comrak"] } -``` - -### Why two parsing backends? - -egui_commonmark was originally implemented using pulldown_cmark, however comrak -has stricter commonmark/github style markdown support. In addition it allows the -crate to support more features than pulldown_cmark can offer with regards to github -style markdown. - -pulldown_cmark has fewer dependencies and should theoretically be faster. - -Due to these reasons both backends are supported. At least for now. - - -### Differences in support - -Currently both support the same feature set - -### Known rendering differences - -| Type | pulldown_cmark | comrak | -|---------|----------------|--------| -| Footers | Placed when they appear | Placed at the end | -| Spec incompatibilies | Blocks such as images can be rendered inside tables. This is against the spec | Disallowed | - - ## License