Add mdbook-core
This is intended as a shared, internal library that will be used by other mdbook crates. The intention is that those crates will either directly use, or reexport items from this crate. Initially this includes MDBOOK_VERSION, which will get reexported from the preprocessor and renderer crates.
This commit is contained in:
parent
877a3af671
commit
4a655ff2a3
5 changed files with 36 additions and 8 deletions
7
Cargo.lock
generated
7
Cargo.lock
generated
|
|
@ -1,6 +1,6 @@
|
||||||
# This file is automatically @generated by Cargo.
|
# This file is automatically @generated by Cargo.
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
version = 3
|
version = 4
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "addr2line"
|
name = "addr2line"
|
||||||
|
|
@ -1270,6 +1270,7 @@ dependencies = [
|
||||||
"hex",
|
"hex",
|
||||||
"ignore",
|
"ignore",
|
||||||
"log",
|
"log",
|
||||||
|
"mdbook-core",
|
||||||
"memchr",
|
"memchr",
|
||||||
"notify",
|
"notify",
|
||||||
"notify-debouncer-mini",
|
"notify-debouncer-mini",
|
||||||
|
|
@ -1293,6 +1294,10 @@ dependencies = [
|
||||||
"walkdir",
|
"walkdir",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "mdbook-core"
|
||||||
|
version = "0.5.0-alpha.1"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mdbook-remove-emphasis"
|
name = "mdbook-remove-emphasis"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
|
||||||
10
Cargo.toml
10
Cargo.toml
|
|
@ -1,5 +1,9 @@
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [".", "examples/remove-emphasis/mdbook-remove-emphasis"]
|
members = [
|
||||||
|
".",
|
||||||
|
"crates/*",
|
||||||
|
"examples/remove-emphasis/mdbook-remove-emphasis",
|
||||||
|
]
|
||||||
|
|
||||||
[workspace.lints.clippy]
|
[workspace.lints.clippy]
|
||||||
all = { level = "allow", priority = -2 }
|
all = { level = "allow", priority = -2 }
|
||||||
|
|
@ -16,6 +20,9 @@ license = "MPL-2.0"
|
||||||
repository = "https://github.com/rust-lang/mdBook"
|
repository = "https://github.com/rust-lang/mdBook"
|
||||||
rust-version = "1.85.0" # Keep in sync with installation.md and .github/workflows/main.yml
|
rust-version = "1.85.0" # Keep in sync with installation.md and .github/workflows/main.yml
|
||||||
|
|
||||||
|
[workspace.dependencies]
|
||||||
|
mdbook-core = { path = "crates/mdbook-core" }
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "mdbook"
|
name = "mdbook"
|
||||||
version = "0.4.52"
|
version = "0.4.52"
|
||||||
|
|
@ -43,6 +50,7 @@ env_logger = "0.11.1"
|
||||||
handlebars = "6.0"
|
handlebars = "6.0"
|
||||||
hex = "0.4.3"
|
hex = "0.4.3"
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
|
mdbook-core.workspace = true
|
||||||
memchr = "2.5.0"
|
memchr = "2.5.0"
|
||||||
opener = "0.8.1"
|
opener = "0.8.1"
|
||||||
pulldown-cmark = { version = "0.10.0", default-features = false, features = ["html"] } # Do not update, part of the public api.
|
pulldown-cmark = { version = "0.10.0", default-features = false, features = ["html"] } # Do not update, part of the public api.
|
||||||
|
|
|
||||||
13
crates/mdbook-core/Cargo.toml
Normal file
13
crates/mdbook-core/Cargo.toml
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
[package]
|
||||||
|
name = "mdbook-core"
|
||||||
|
version = "0.5.0-alpha.1"
|
||||||
|
description = "The base support library for mdbook, intended for internal use only"
|
||||||
|
edition.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
workspace = true
|
||||||
7
crates/mdbook-core/src/lib.rs
Normal file
7
crates/mdbook-core/src/lib.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
//! The base support library for mdbook, intended for internal use only.
|
||||||
|
|
||||||
|
/// The current version of `mdbook`.
|
||||||
|
///
|
||||||
|
/// This is provided as a way for custom preprocessors and renderers to do
|
||||||
|
/// compatibility checks.
|
||||||
|
pub const MDBOOK_VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||||
|
|
@ -88,16 +88,11 @@ pub mod renderer;
|
||||||
pub mod theme;
|
pub mod theme;
|
||||||
pub mod utils;
|
pub mod utils;
|
||||||
|
|
||||||
/// The current version of `mdbook`.
|
|
||||||
///
|
|
||||||
/// This is provided as a way for custom preprocessors and renderers to do
|
|
||||||
/// compatibility checks.
|
|
||||||
pub const MDBOOK_VERSION: &str = env!("CARGO_PKG_VERSION");
|
|
||||||
|
|
||||||
pub use crate::book::BookItem;
|
pub use crate::book::BookItem;
|
||||||
pub use crate::book::MDBook;
|
pub use crate::book::MDBook;
|
||||||
pub use crate::config::Config;
|
pub use crate::config::Config;
|
||||||
pub use crate::renderer::Renderer;
|
pub use crate::renderer::Renderer;
|
||||||
|
pub use mdbook_core::MDBOOK_VERSION;
|
||||||
|
|
||||||
/// The error types used through out this crate.
|
/// The error types used through out this crate.
|
||||||
pub mod errors {
|
pub mod errors {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue