Skip to content

Commit

Permalink
Move backend documentation out of readme
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lampsitter committed Feb 1, 2024
1 parent 6bfa917 commit 85ee3d0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
33 changes: 33 additions & 0 deletions Backends.md
Original file line number Diff line number Diff line change
@@ -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 |


33 changes: 0 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 85ee3d0

Please sign in to comment.