Skip to content
Merged
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
2 changes: 1 addition & 1 deletion packages/mdbook-plugin-utils/src/markdown/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ where
let mut nested_level = 0;

for (event, span) in Parser::new(content).into_offset_iter() {
debug!("{:?} {:?}", event, span);
debug!("{event:?} {span:?}");

if is_start(&event) {
if let Some(block) = blocks.last_mut() {
Expand Down
6 changes: 3 additions & 3 deletions packages/mdbook-tabs/src/parser/tabs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub fn parse_tabs(chapter: &Chapter) -> Result<(Vec<SpanAndTabs>, bool)> {
let mut configs: Vec<(Range<usize>, TabsConfig)> = vec![];

let blocks = parse_blocks(&chapter.content, is_tabs_start, is_tabs_end, true)?;
debug!("{:?}", blocks);
debug!("{blocks:?}");

for block in &blocks {
let start_text = match &block.events[0].0 {
Expand All @@ -70,7 +70,7 @@ pub fn parse_tabs(chapter: &Chapter) -> Result<(Vec<SpanAndTabs>, bool)> {
is_tab_end,
true,
)?;
debug!("{:?}", subblocks);
debug!("{subblocks:?}");

for subblock in subblocks {
let start_text = match &subblock.events[0].0 {
Expand All @@ -95,7 +95,7 @@ pub fn parse_tabs(chapter: &Chapter) -> Result<(Vec<SpanAndTabs>, bool)> {
configs.push((block.span.clone(), tabs));
}

debug!("{:?}", configs);
debug!("{configs:?}");

Ok((configs, blocks.iter().any(|block| block.has_nested)))
}
2 changes: 1 addition & 1 deletion packages/mdbook-tabs/src/tabs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub fn tabs(config: &TabsConfig) -> String {
config
.global
.as_ref()
.map(|global| format!(" data-tabglobal=\"{}\"", global))
.map(|global| format!(" data-tabglobal=\"{global}\""))
.unwrap_or("".to_string()),
config
.tabs
Expand Down
4 changes: 2 additions & 2 deletions packages/mdbook-trunk/src/bin/mdbook-trunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fn handle_combine() -> Result<()> {
let dest_dir = book.root.join("dist");
let dest_dir_str = dest_dir.to_str().unwrap();

log::info!("Combining into directory `{}`.", dest_dir_str);
log::info!("Combining into directory `{dest_dir_str}`.");

if dest_dir.exists() {
log::info!("Directory exists, recreating.");
Expand All @@ -92,7 +92,7 @@ fn handle_combine() -> Result<()> {
continue;
}

log::info!("Adding directory `{}`.", directory);
log::info!("Adding directory `{directory}`.");
copy(
build_dir.join(directory),
&dest_dir,
Expand Down
2 changes: 1 addition & 1 deletion packages/mdbook-trunk/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl Config {
}

pub fn parse_from_toml(content: &str) -> Result<Self, toml::de::Error> {
log::debug!("{:?}", content);
log::debug!("{content:?}");
toml::from_str(content)
}

Expand Down
4 changes: 2 additions & 2 deletions packages/mdbook-trunk/src/parser/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ pub fn parse_definitions(chapter: &Chapter) -> Result<Vec<(Range<usize>, Config)
let mut configs: Vec<(Range<usize>, Config)> = vec![];

let blocks = parse_code_blocks(&chapter.content, is_tags)?;
debug!("{:?}", blocks);
debug!("{blocks:?}");

for block in blocks {
let config = Config::parse_from_toml(&chapter.content[block.inner_span.clone()])?;
configs.push((block.span, config));
}

debug!("{:?}", configs);
debug!("{configs:?}");

Ok(configs)
}
4 changes: 2 additions & 2 deletions packages/mdbook-trunk/src/parser/iframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub fn parse_iframes(chapter: &Chapter) -> Result<Vec<(Range<usize>, Config)>> {
let mut configs: Vec<(Range<usize>, Config)> = vec![];

let blocks = parse_blocks(&chapter.content, is_iframe_start, is_iframe_end, false)?;
debug!("{:?}", blocks);
debug!("{blocks:?}");

for block in blocks {
let dom = Dom::parse(&chapter.content[block.span.clone()])?;
Expand Down Expand Up @@ -53,7 +53,7 @@ pub fn parse_iframes(chapter: &Chapter) -> Result<Vec<(Range<usize>, Config)>> {
configs.push((block.span, config));
}

debug!("{:?}", configs);
debug!("{configs:?}");

Ok(configs)
}
6 changes: 2 additions & 4 deletions packages/mdbook-trunk/src/trunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ fn files(workspace: &Workspace, config: &Config) -> Result<String> {

header_elements.push(format!(
"<button class=\"mdbook-trunk-file{}\" data-file=\"{}\">{}</button>",
(config.show_files.unwrap_or(false) && index == 0)
.then_some(" active")
.unwrap_or_default(),
if config.show_files.unwrap_or(false) && index == 0 { " active" } else { Default::default() },
file,
file_path
.file_name()
Expand All @@ -97,7 +95,7 @@ fn files(workspace: &Workspace, config: &Config) -> Result<String> {

content_elements.push(format!(
"<div class=\"mdbook-trunk-file-content{}\" data-file=\"{}\">\n\n```{}\n{}\n```\n\n</div>",
(!(config.show_files.unwrap_or(false) && index == 0)).then_some(" hidden").unwrap_or_default(),
if !(config.show_files.unwrap_or(false) && index == 0) { " hidden" } else { Default::default() },
file,
language,
content
Expand Down
Loading