From 8d7e03a6914b098496f42df4461dfee2f53974d1 Mon Sep 17 00:00:00 2001 From: Erlend Walstad <96946613+lampsitter@users.noreply.github.com> Date: Sat, 11 May 2024 19:36:12 +0200 Subject: [PATCH] Rename feature macro -> macros --- ARCHITECTURE.md | 2 +- CHANGELOG.md | 2 +- README.md | 4 ++-- egui_commonmark/Cargo.toml | 6 +++++- egui_commonmark/examples/macro.rs | 4 ++-- egui_commonmark/src/lib.rs | 2 +- egui_commonmark_macros/README.md | 2 +- 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 9e8c452..d962688 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -9,7 +9,7 @@ ### egui_commonmark This is the main crate. It depends on `egui_commonmark_backend` and can expose -`egui_commonmark_macros` through the `macro` feature. +`egui_commonmark_macros` through the `macros` feature. ### egui_commonmark_macros diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f3e0f3..a8d2c20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ - `commonmark!` and `commonmark_str!` for compile time parsing of markdown. The proc macros will output egui widgets directly into your code. To use this - enable the `macro` feature. + enable the `macros` feature. ### Changed diff --git a/README.md b/README.md index 4848e3f..91e8b63 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ CommonMarkViewer::new("viewer").show(ui, &mut cache, markdown); ## Compile time evaluation of markdown -If you want to embed markdown directly the binary then you can enable the `macro` feature. +If you want to embed markdown directly the binary then you can enable the `macros` feature. This will do the parsing of the markdown at compile time and output egui widgets. ### Example @@ -58,7 +58,7 @@ commonmark_str!("example_file", ui, &mut cache, "content.md"); ## Features -* `macro`: macros for compile time parsing of markdown +* `macros`: macros for compile time parsing of markdown * `better_syntax_highlighting`: Syntax highlighting inside code blocks with [`syntect`](https://crates.io/crates/syntect) * `svg`: Support for viewing svg images diff --git a/egui_commonmark/Cargo.toml b/egui_commonmark/Cargo.toml index 76bb61d..c1e5a0c 100644 --- a/egui_commonmark/Cargo.toml +++ b/egui_commonmark/Cargo.toml @@ -31,7 +31,11 @@ pulldown-cmark = { version = "0.10", default-features = false, optional = true } default = ["load-images", "pulldown_cmark"] ## Enable proc macros for compile time generation of egui widgets from markdown -macro = ["dep:egui_commonmark_macros", "dep:pulldown-cmark"] # For simplicity it only supports pulldown-cmark +macros = ["dep:egui_commonmark_macros", "dep:pulldown-cmark"] # For simplicity it only supports pulldown-cmark + +## Builds upon the `macros` feature. Enables tracking of markdown files to recompile +## when their content changes. Uses nightly features +nightly = ["macros", "egui_commonmark_macros/nightly"] # For internal debugging use only! dump-macro = ["egui_commonmark_macros/dump-macro"] diff --git a/egui_commonmark/examples/macro.rs b/egui_commonmark/examples/macro.rs index 93ef776..ffe95d9 100644 --- a/egui_commonmark/examples/macro.rs +++ b/egui_commonmark/examples/macro.rs @@ -1,8 +1,8 @@ //! Make sure to run this example from the repo directory and not the example //! directory. To see all the features in full effect, run this example with -//! `cargo r --example macro --features macro,better_syntax_highlighting` +//! `cargo r --example macro --features macros,better_syntax_highlighting` //! Add `light` or `dark` to the end of the command to specify theme. Default -//! is light. `cargo r --example macro --features macro,better_syntax_highlighting -- dark` +//! is light. `cargo r --example macro --features macros,better_syntax_highlighting -- dark` use eframe::egui; use egui_commonmark::*; diff --git a/egui_commonmark/src/lib.rs b/egui_commonmark/src/lib.rs index e7441de..3d9ad07 100644 --- a/egui_commonmark/src/lib.rs +++ b/egui_commonmark/src/lib.rs @@ -26,7 +26,7 @@ //! ``` //! # Compile time evaluation of markdown //! -//! If you want to embed markdown directly the binary then you can enable the `macro` feature. +//! If you want to embed markdown directly the binary then you can enable the `macros` feature. //! This will do the parsing of the markdown at compile time and output egui widgets. //! //! ## Example diff --git a/egui_commonmark_macros/README.md b/egui_commonmark_macros/README.md index 7d219e2..f0f9d57 100644 --- a/egui_commonmark_macros/README.md +++ b/egui_commonmark_macros/README.md @@ -6,7 +6,7 @@ showcase This crate is `egui_commonmark`'s compile time variant. It is recommended to use -this crate through `egui_commonmark` by enabling the `macro` feature. +this crate through `egui_commonmark` by enabling the `macros` feature. ## Usage