Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1,027 changes: 228 additions & 799 deletions Cargo.lock

Large diffs are not rendered by default.

23 changes: 3 additions & 20 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,8 @@ pdf-engine = "lualatex"
mainfont = "Noto Serif"
sansfont = "Noto Sans"
monofont = "Noto Sans Mono"
mainfontfallback = [
"NotoColorEmoji:mode=harf",
"NotoNaskhArabic:",
]
sansfontfallback = [
"NotoSansArabic:",
]
mainfontfallback = ["NotoColorEmoji:mode=harf", "NotoNaskhArabic:"]
sansfontfallback = ["NotoSansArabic:"]
monofontfallback = [
"NotoColorEmoji:mode=harf",
"NotoSansMath:",
Expand All @@ -58,10 +53,7 @@ urlcolor = "red"

[output.html]
smart-punctuation = true
additional-js = [
"theme/speaker-notes.js",
"theme/redbox.js",
]
additional-js = ["theme/speaker-notes.js", "theme/redbox.js"]
additional-css = [
"theme/css/svgbob.css",
"theme/css/redbox.css",
Expand Down Expand Up @@ -293,15 +285,6 @@ use-boolean-and = true
[output.exerciser]
output-directory = "comprehensive-rust-exercises"

[output.linkcheck]
optional = true
follow-web-links = false # change to true to check web links
exclude = [
"comprehensive-rust.pdf",
"comprehensive-rust-exercises.zip",
# "crates.io", # uncomment when follow-web-links is true
]

[output.linkcheck2]
optional = true
follow-web-links = false # change to true to check web links
Expand Down
3 changes: 2 additions & 1 deletion mdbook-course/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ clap = "4.5.56"
lazy_static = "1.5"
log = "0.4.29"
matter = "0.1.0-alpha4"
mdbook = "0.4.52"
mdbook-driver = "0.5.2"
mdbook-preprocessor = "0.5.2"
pretty_env_logger = "0.5.0"
regex = "1.12"
serde = "1.0.228"
Expand Down
2 changes: 1 addition & 1 deletion mdbook-course/src/bin/course-content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use mdbook::MDBook;
use mdbook_course::course::Courses;
use mdbook_driver::MDBook;
use std::fs;
use std::path::Path;

Expand Down
2 changes: 1 addition & 1 deletion mdbook-course/src/bin/course-schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
// limitations under the License.

use clap::Command;
use mdbook::MDBook;
use mdbook_course::course::Courses;
use mdbook_course::markdown::duration;
use mdbook_driver::MDBook;

fn main() {
pretty_env_logger::init();
Expand Down
6 changes: 3 additions & 3 deletions mdbook-course/src/bin/mdbook-course.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
// limitations under the License.

use clap::{Arg, Command};
use mdbook::book::BookItem;
use mdbook::preprocess::CmdPreprocessor;
use mdbook_course::course::Courses;
use mdbook_course::{replacements, timing_info};
use mdbook_preprocessor::book::BookItem;
use mdbook_preprocessor::parse_input;
use std::io::{stdin, stdout};
use std::process;

Expand All @@ -41,7 +41,7 @@ fn main() {
}

fn preprocess() -> anyhow::Result<()> {
let (_, book) = CmdPreprocessor::parse_input(stdin())?;
let (_, book) = parse_input(stdin())?;
let (courses, mut book) = Courses::extract_structure(book)?;

book.for_each_mut(|chapter| {
Expand Down
4 changes: 2 additions & 2 deletions mdbook-course/src/course.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

use crate::frontmatter::{Frontmatter, split_frontmatter};
use crate::markdown::{Table, duration};
use mdbook::book::{Book, BookItem, Chapter};
use mdbook_preprocessor::book::{Book, BookItem, Chapter};
use std::fmt::Write;
use std::path::PathBuf;

Expand Down Expand Up @@ -105,7 +105,7 @@ impl Courses {
let mut current_course_name = None;
let mut current_session_name = None;

for item in &mut book.sections {
for item in &mut book.items {
// We only want to process chapters, omitting part titles and separators.
let BookItem::Chapter(chapter) = item else {
continue;
Expand Down
2 changes: 1 addition & 1 deletion mdbook-course/src/frontmatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

use anyhow::Context;
use matter::matter;
use mdbook::book::Chapter;
use mdbook_preprocessor::book::Chapter;
use serde::Deserialize;

#[derive(Deserialize, Debug, Default)]
Expand Down
2 changes: 1 addition & 1 deletion mdbook-course/src/replacements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

use crate::course::{Course, Courses, Segment, Session};
use mdbook::book::Chapter;
use mdbook_preprocessor::book::Chapter;
use regex::Regex;

lazy_static::lazy_static! {
Expand Down
2 changes: 1 addition & 1 deletion mdbook-course/src/timing_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

use crate::course::Slide;
use mdbook::book::Chapter;
use mdbook_preprocessor::book::Chapter;

/// Insert timing information for this slide into the speaker notes.
pub fn insert_timing_info(slide: &Slide, chapter: &mut Chapter) {
Expand Down
4 changes: 3 additions & 1 deletion mdbook-exerciser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ description = "A tool for extracting starter code for exercises from Markdown fi
[dependencies]
anyhow = "1.0.100"
log = "0.4.29"
mdbook = "0.4.52"
mdbook-preprocessor = "0.5.2"
mdbook-renderer = "0.5.2"
pretty_env_logger = "0.5.0"
pulldown-cmark = { version = "0.13.0", default-features = false }
serde = "1.0.228"
24 changes: 11 additions & 13 deletions mdbook-exerciser/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

use anyhow::Context;
use log::trace;
use mdbook::BookItem;
use mdbook::book::Book;
use mdbook::renderer::RenderContext;
use mdbook_exerciser::process;
use mdbook_preprocessor::book::{Book, BookItem};
use mdbook_renderer::RenderContext;
use serde::{Deserialize, Serialize};
use std::fs::{create_dir, remove_dir_all};
use std::io::stdin;
use std::path::Path;
Expand All @@ -29,18 +29,10 @@ fn main() -> anyhow::Result<()> {

let config = context
.config
.get_renderer("exerciser")
.get::<Config>("output.exerciser")?
.context("Missing output.exerciser configuration")?;

let output_directory = Path::new(
config
.get("output-directory")
.context(
"Missing output.exerciser.output-directory configuration value",
)?
.as_str()
.context("Expected a string for output.exerciser.output-directory")?,
);
let output_directory = Path::new(&config.output_directory);

let _ = remove_dir_all(output_directory);
create_dir(output_directory).with_context(|| {
Expand Down Expand Up @@ -70,3 +62,9 @@ fn process_all(book: &Book, output_directory: &Path) -> anyhow::Result<()> {

Ok(())
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")]
struct Config {
output_directory: String,
}
6 changes: 3 additions & 3 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ fn install_tools(binstall: bool) -> Result<()> {

// The --locked flag is important for reproducible builds.
let tools = [
("mdbook", "0.4.52"),
("mdbook", "0.5.2"),
("mdbook-svgbob", "0.2.2"),
("mdbook-pandoc", "0.10.4"),
("mdbook-i18n-helpers", "0.3.6"),
("mdbook-i18n-helpers", "0.4.0"),
("i18n-report", "0.2.0"),
("mdbook-linkcheck2", "0.9.1"),
("mdbook-linkcheck2", "0.11.0"),
];

for (tool, version) in tools {
Expand Down
Loading