Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge remote-tracking branch 'upstream/master' into amend-to-mdbook-v…
…0.5.1

Adjust everything to compile and use matching versions of dependencies.
  • Loading branch information
michalfita committed Dec 1, 2025
commit 19c7606ab5931511dcfafc1ef4bb1993d6ee3801
818 changes: 106 additions & 712 deletions Cargo.lock

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ documentation = "https://docs.rs/mdbook-epub"
keywords = ["epub", "mdbook", "documentation", "markdown"]
categories = ["command-line-interface", "development-tools"]
edition = "2024"
rust-version = "1.88"
rust-version = "1.91.1"

[package.metadata.release]
sign-commit = true
Expand All @@ -31,18 +31,19 @@ epub-builder = "0.8"
thiserror = "2.0"
pulldown-cmark = "0.13.0"
semver = "1.0"
toml = "0.9.8"
env_logger = "0.11.1"
serde = { version = "1.0.228", features = ["derive"] }
serde_derive = "1.0"
serde_json = "1.0.145"
mime_guess = "2.0"
env_logger = "0.11.8"
log = "0.4.28"
mdbook-core = { version = "0.5.1", default-features = false } # I'm kinda anxious about it as they say it's for internal use, examples still outdated
mdbook-driver = { version = "0.5.1", default-features = false } # Because we support standalone rendering...
#log = "0.4.17"
tracing = "0.1.41"
tracing-subscriber = { version = "0.3.20", features = ["env-filter"] }
mdbook-core = { version = "0.5.1", default-features = false } # I'm kinda anxious about it as they say it's for internal use, examples still outdated
mdbook-driver = { version = "0.5.1", default-features = false } # Because we support standalone rendering...
mdbook-renderer = { version = "0.5.1", default-features = false }

handlebars = "6.3"
toml = "0.9.8"
handlebars = "6.3.2" # downgraded due to parent 'mdbook' dependency and error there
html_parser = "0.7.0"
url = "2.5"
ureq = "3.1"
Expand Down
6 changes: 2 additions & 4 deletions src/bin/mdbook-epub.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#[macro_use]
extern crate log;

use std::io;
use std::path::PathBuf;
use std::process;
Expand All @@ -13,6 +10,7 @@ use mdbook_renderer::RenderContext;

use ::mdbook_epub;
use mdbook_epub::errors::Error;
use tracing::{debug, error, info};

fn main() {
env_logger::init();
Expand All @@ -21,7 +19,7 @@ fn main() {
debug!("prepared generator args = {:?}", args);

if let Err(e) = run(&args) {
log::error!("{}", e);
error!("{}", e);

process::exit(1);
}
Expand Down
2 changes: 2 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use super::Error;
use mdbook_renderer::RenderContext;
use serde::{Deserialize, Serialize};
use std::path::PathBuf;

pub const DEFAULT_TEMPLATE: &str = include_str!("index.hbs");
Expand Down Expand Up @@ -80,6 +81,7 @@ impl Default for Config {
#[cfg(test)]
mod tests {
use super::*;
use serde_json::json;
use std::path::Path;
use tempfile::TempDir;

Expand Down
1 change: 1 addition & 0 deletions src/filters/asset_link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::collections::HashMap;
use std::ffi::OsString;
use std::iter;
use std::path::{Component, Path};
use tracing::{debug, error, trace};
use url::Url;

/// Filter is used for replacing remote urls with local images downloaded from internet
Expand Down
1 change: 1 addition & 0 deletions src/filters/footnote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ impl<'a> FootnoteFilter<'a> {
mod tests {
use super::*;
use pulldown_cmark::{Event, Options, Parser, Tag, TagEnd};
use tracing::debug;

fn parse_markdown_with_footnotes(input: &str) -> Vec<Event<'_>> {
let mut footnote_filter = FootnoteFilter::new(true);
Expand Down
2 changes: 2 additions & 0 deletions src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use handlebars::{Handlebars, RenderError, RenderErrorReason};
use mdbook_core::book::{BookItem, Chapter};
use mdbook_renderer::RenderContext;
use pulldown_cmark::html;
use serde_json::json;
use std::collections::HashSet;
use std::path::Path;
use std::{
Expand All @@ -23,6 +24,7 @@ use std::{
iter,
path::PathBuf,
};
use tracing::{debug, error, info, trace, warn};

/// The actual EPUB book renderer.
pub struct Generator<'a> {
Expand Down
8 changes: 1 addition & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
//! A `mdbook` backend for generating a book in the `EPUB` format.

#[macro_use]
extern crate log;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate serde_json;

use std::fs::{File, create_dir_all};
use std::path::{Path, PathBuf};

Expand All @@ -16,6 +9,7 @@ use ::thiserror::Error;
use mdbook_core::config::Config as MdConfig;
use mdbook_renderer::RenderContext;
use semver::{Version, VersionReq};
use tracing::{debug, info};

use errors::Error;

Expand Down
1 change: 1 addition & 0 deletions src/resources/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use mime_guess::Mime;
use std::fmt::{Display, Formatter};
use std::hash::Hash;
use std::path::{MAIN_SEPARATOR_STR, Path, PathBuf};
use tracing::{debug, trace};
use url::Url;

/// The type of asset, remote or local
Expand Down
1 change: 1 addition & 0 deletions src/resources/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use html_parser::{Dom, Element, Node};
use mdbook_core::book::BookItem;
use mdbook_renderer::RenderContext;
use pulldown_cmark::{Event, Tag};
use tracing::{debug, trace, warn};
use url::Url;

use crate::resources::asset::{Asset, AssetKind};
Expand Down
2 changes: 2 additions & 0 deletions src/resources/retrieve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use std::{
io::{self, Read},
path::Path,
};
use tracing::debug;

/// Struct to keep file (image) data 'mime type' after recognizing downloaded content
#[allow(dead_code)]
Expand Down Expand Up @@ -210,6 +211,7 @@ mod tests {
use mime_guess::Mime;
use std::path::PathBuf;
use tempfile::TempDir;
use tracing::trace;
use url::Url;

use super::{ContentRetriever, ResourceHandler, RetrievedContent, UpdatedAssetData};
Expand Down
4 changes: 2 additions & 2 deletions tests/common/epub.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use crate::common::init_logging::init_logging;
use epub::doc::EpubDoc;
use log::{debug, error};
use mdbook_driver::MDBook;
use mdbook_renderer::RenderContext;
use mdbook_epub::errors::Error;
use mdbook_renderer::RenderContext;
use std::fs::File;
use std::io::BufReader;
use std::path::{Path, PathBuf};
use std::process::Command;
use tempfile::TempDir;
use tracing::{debug, error};

/// Convenience function for compiling the dummy book into an `EpubDoc`.
#[allow(dead_code)]
Expand Down
2 changes: 1 addition & 1 deletion tests/footnote_epub3_example.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use log::debug;
use serial_test::serial;
use std::path::Path;
use tracing::debug;

mod common;
use crate::common::epub::{create_dummy_book, output_epub_is_valid};
Expand Down
3 changes: 0 additions & 3 deletions tests/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
pub mod common;

extern crate log;
extern crate serial_test;
2 changes: 1 addition & 1 deletion tests/long_book_example.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use log::debug;
use serial_test::serial;
use std::path::Path;
use tracing::debug;
mod common;
use crate::common::epub::{create_dummy_book, output_epub_is_valid};
use common::epub::generate_epub;
Expand Down
2 changes: 1 addition & 1 deletion tests/remote_image_fetch.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use log::debug;
use serial_test::serial;
use std::path::Path;
use tracing::debug;
mod common;
use crate::common::epub::{generate_epub, output_epub_is_valid};
use crate::common::init_logging::init_logging;
Expand Down
2 changes: 1 addition & 1 deletion tests/straight_quotes_into_curly_quotes.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use log::debug;
use serial_test::serial;
use std::path::Path;
use tracing::debug;

mod common;
use crate::common::epub::output_epub_is_valid;
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.