From: Ian Jackson
Date: Tue, 12 Jan 2021 19:19:59 +0000 (+0000)
Subject: otterlib: Include HTML prelude and trailer
X-Git-Tag: otter-0.3.0~64
X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=5c5b1f80eb99c52569733dfff5aab02e539418dd;p=otter.git
otterlib: Include HTML prelude and trailer
Signed-off-by: Ian Jackson
---
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)]