Skip to content

Commit c671112

Browse files
authored
Merge pull request #154 from rust-embedded/htmlcompare
Integrate svd2html, add htmlcompare
2 parents 64074d9 + 2f7289e commit c671112

File tree

8 files changed

+1151
-3
lines changed

8 files changed

+1151
-3
lines changed

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ clap = { version = "4.1", features = ["derive", "cargo", "color"] }
2828
serde = { version = "1.0", features = ["derive"] }
2929
quick-xml = { version = "0.28", features = ["serialize"] }
3030
svd-rs = { version = "0.14.2", features = ["serde", "derive-from"] }
31-
svd-parser = { version = "0.14.1", features = ["expand"] }
31+
svd-parser = { version = "0.14.2", features = ["expand"] }
3232
svd-encoder = "0.14.3"
3333
yaml-rust = "0.4"
3434
# serde_yaml 0.9.x looks broken
@@ -42,6 +42,10 @@ commands = "0.0.5"
4242
env_logger = "0.10"
4343
log = { version = "~0.4", features = ["std"] }
4444
normpath = "1.1.0"
45+
liquid = "0.26.0"
46+
once_cell = "1.18.0"
47+
rayon = "1.7.0"
48+
regex = "1.9.1"
4549

4650
[dev-dependencies]
4751
tempfile = "3.3"

src/cli.rs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use clap::Parser;
33
use std::path::PathBuf;
44

55
use svdtools::{
6-
convert::convert_cli, interrupts::interrupts_cli, makedeps::makedeps_cli, mmap::mmap_cli,
7-
patch::patch_cli,
6+
convert::convert_cli, html::html_cli, html::htmlcompare_cli, interrupts::interrupts_cli,
7+
makedeps::makedeps_cli, mmap::mmap_cli, patch::patch_cli,
88
};
99

1010
#[derive(Parser, Debug)]
@@ -82,6 +82,23 @@ enum Command {
8282
#[clap(long)]
8383
format_config: Option<PathBuf>,
8484
},
85+
/// Generates webpage with tables of existing peripherals
86+
Htmlcompare {
87+
/// Path to write HTML files to
88+
htmldir: PathBuf,
89+
90+
/// Input SVD XML files
91+
svdfiles: Vec<PathBuf>,
92+
},
93+
/// Generates a webpage for a given SVD file containing details on every
94+
/// peripheral and register and their level of coverage.
95+
Html {
96+
/// Path to write HTML files to
97+
htmldir: PathBuf,
98+
99+
/// Path to patched SVD files
100+
svdfiles: Vec<PathBuf>,
101+
},
85102
}
86103

87104
impl Command {
@@ -123,6 +140,12 @@ impl Command {
123140
},
124141
format_config.as_ref().map(|p| p.as_path()),
125142
)?,
143+
Self::Htmlcompare { htmldir, svdfiles } => {
144+
htmlcompare_cli::htmlcompare(htmldir, svdfiles)?;
145+
}
146+
Self::Html { htmldir, svdfiles } => {
147+
html_cli::svd2html(htmldir, svdfiles)?;
148+
}
126149
}
127150
Ok(())
128151
}

0 commit comments

Comments
 (0)