Skip to main content

max / makenotwork

786 B · 25 lines History Blame Raw
1 //! Write the "email you cannot turn off" guide page from `email::OperationalKind`.
2 //!
3 //! The docs tree is static markdown, so the page is a checked-in artifact rather
4 //! than something rendered per request. `email::class::tests::
5 //! committed_doc_matches_generated` fails when this output is stale, so the
6 //! regeneration step is:
7 //!
8 //! ```sh
9 //! cargo run --bin export-operational-mail-doc
10 //! ```
11
12 use std::io::Write as _;
13
14 fn main() -> std::io::Result<()> {
15 let doc = makenotwork::email::operational_mail_doc();
16 let path = concat!(
17 env!("CARGO_MANIFEST_DIR"),
18 "/site-docs/public/guide/email-you-cannot-turn-off.md"
19 );
20 let mut file = std::fs::File::create(path)?;
21 file.write_all(doc.as_bytes())?;
22 println!("wrote {path}");
23 Ok(())
24 }
25