1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
//! Render a page to Markdown using the library API. //! //! Run with: //! ```text //! CF_ACCOUNT_ID=... CF_API_TOKEN=... \ //! cargo run --example markdown -- https://example.com //! ``` use flarer::{Account, Flarer, Tool}; #[tokio::main] async fn main() -> flarer::Result<()> { let url = std::env::args() .nth(1) .unwrap_or_else(|| "https://example.com".to_string()); let account = Account::from_env()?; let flarer = Flarer::builder().account(account).build()?; flarer.verify().await?; let out = flarer.run(Tool::Markdown, &url).await?; println!("{}", out.display_string()); Ok(()) }