Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate svd2html, add htmlcompare #154

Merged
merged 3 commits into from
Sep 19, 2023
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
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ clap = { version = "4.1", features = ["derive", "cargo", "color"] }
serde = { version = "1.0", features = ["derive"] }
quick-xml = { version = "0.28", features = ["serialize"] }
svd-rs = { version = "0.14.2", features = ["serde", "derive-from"] }
svd-parser = { version = "0.14.1", features = ["expand"] }
svd-parser = { version = "0.14.2", features = ["expand"] }
svd-encoder = "0.14.3"
yaml-rust = "0.4"
# serde_yaml 0.9.x looks broken
Expand All @@ -42,6 +42,10 @@ commands = "0.0.5"
env_logger = "0.10"
log = { version = "~0.4", features = ["std"] }
normpath = "1.1.0"
liquid = "0.26.0"
once_cell = "1.18.0"
rayon = "1.7.0"
regex = "1.9.1"

[dev-dependencies]
tempfile = "3.3"
27 changes: 25 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use clap::Parser;
use std::path::PathBuf;

use svdtools::{
convert::convert_cli, interrupts::interrupts_cli, makedeps::makedeps_cli, mmap::mmap_cli,
patch::patch_cli,
convert::convert_cli, html::html_cli, html::htmlcompare_cli, interrupts::interrupts_cli,
makedeps::makedeps_cli, mmap::mmap_cli, patch::patch_cli,
};

#[derive(Parser, Debug)]
Expand Down Expand Up @@ -82,6 +82,23 @@ enum Command {
#[clap(long)]
format_config: Option<PathBuf>,
},
/// Generates webpage with tables of existing peripherals
Htmlcompare {
/// Path to write HTML files to
htmldir: PathBuf,

/// Input SVD XML files
svdfiles: Vec<PathBuf>,
},
/// Generates a webpage for a given SVD file containing details on every
/// peripheral and register and their level of coverage.
Html {
/// Path to write HTML files to
htmldir: PathBuf,

/// Path to patched SVD files
svdfiles: Vec<PathBuf>,
},
}

impl Command {
Expand Down Expand Up @@ -123,6 +140,12 @@ impl Command {
},
format_config.as_ref().map(|p| p.as_path()),
)?,
Self::Htmlcompare { htmldir, svdfiles } => {
htmlcompare_cli::htmlcompare(htmldir, svdfiles)?;
}
Self::Html { htmldir, svdfiles } => {
html_cli::svd2html(htmldir, svdfiles)?;
}
}
Ok(())
}
Expand Down
Loading
Loading