From 5c5b1f80eb99c52569733dfff5aab02e539418dd Mon Sep 17 00:00:00 2001
From: Ian Jackson
Date: Tue, 12 Jan 2021 19:19:59 +0000
Subject: [PATCH] otterlib: Include HTML prelude and trailer
Signed-off-by: Ian Jackson
---
src/bin/otterlib.rs | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/src/bin/otterlib.rs b/src/bin/otterlib.rs
index 4fddfa6f..63c024c9 100644
--- a/src/bin/otterlib.rs
+++ b/src/bin/otterlib.rs
@@ -4,6 +4,35 @@
// target/debug/otterlib --libs ~ian/Rustup/Game/server/library/\*.toml preview
+const HTML_PRELUDE: &str = r##"
+
+
+
+ Otter builtin shape library
+
+
+Otter builtin shape library
+This lists all the shapes provided by the library in this version of Otter.
+
+"##;
+
+const HTML_TRAILER: &str = r##"
+
+
+Otter and its shape (piece picture) libraries
+are Free Software and come with NO
+WARRANTY.
+
+The shapes come from a variety of sources and are the work of many
+contributors. Further information about
+their authorship and licensing etc. is available.
+
+If you wish to edit these shapes you should probably start with
+the source code.
+"##;
+
pub use otter::imports::*;
pub use shapelib::*;
@@ -83,6 +112,7 @@ fn preview(items: Vec) {
let max_facecols = pieces.iter().map(|s| s.face_cols()).max().unwrap_or(1);
let max_uos = pieces.iter().map(|s| s.uos.len()).max().unwrap_or(0);
+ println!("{}", &HTML_PRELUDE);
println!(r#""#);
for s in &pieces {
let Prep { spec, pc, uos, bbox, size } = s;
@@ -153,6 +183,7 @@ fn preview(items: Vec) {
println!("");
}
println!("
");
+ println!("{}", &HTML_TRAILER);
}
#[throws(anyhow::Error)]
--
2.30.2