diff --git a/Cargo.toml b/Cargo.toml index 460c4f653..27b714889 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,9 +62,9 @@ members = [ "tide-forms", "tide-headers", "tide-log", + "tide-panic", "tide-querystring", "tide-slog", - "tide-panic", ] [patch.crates-io] diff --git a/src/lib.rs b/src/lib.rs index 244b3e735..69afca565 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,7 @@ +//! Welcome to Tide. +//! +//! The [`App`](struct.App.html) docs are a good place to get started. + #![cfg_attr(any(feature = "nightly", test), feature(external_doc))] #![cfg_attr(feature = "nightly", doc(include = "../README.md"))] #![feature(async_await, existential_type)] @@ -9,13 +13,6 @@ missing_docs )] -//! -//! Welcome to Tide. -//! -//! The [`App`](struct.App.html) docs are a good place to get started. -//! -//! - #[cfg(test)] #[doc(include = "../README.md")] const _README: () = (); diff --git a/tide-compression/README.md b/tide-compression/README.md index 4c8eb8b10..fc19a1351 100644 --- a/tide-compression/README.md +++ b/tide-compression/README.md @@ -8,9 +8,12 @@ Examples are in the `/examples` folder of this crate. __Simple Example__ -You can test the simple example by running `cargo run --example simple` while in this crate's directory, and then running either of the following commands: +You can test the simple example by running `cargo run --example simple` while in this crate's directory, and then running any variety of the following commands: ```console $ curl -v http://127.0.0.1:8000/ -$ echo 'why hello there' | gzip | curl -v --compressed -H 'Content-Encoding: gzip' http://127.0.0.1:8000/echo --data-binary @- +$ curl -v -H 'Accept-Encoding: br' http://127.0.0.1:8000/ +$ echo 'hello there' | gzip | curl -v --compressed -H 'Content-Encoding: gzip' http://127.0.0.1:8000/echo --data-binary @- +$ echo 'general kenobi' | brotli | curl -v --compressed -H 'Content-Encoding: br' http://127.0.0.1:8000/echo --data-binary @- +$ echo 'you are a bold one' | zstd | curl -v --compressed -H 'Content-Encoding: zstd' http://127.0.0.1:8000/echo --data-binary @- ``` diff --git a/tide-cookies/src/lib.rs b/tide-cookies/src/lib.rs index c1c72a651..18645641d 100644 --- a/tide-cookies/src/lib.rs +++ b/tide-cookies/src/lib.rs @@ -10,8 +10,6 @@ missing_docs )] -//! Cookie management for Tide web framework - mod data; mod middleware; diff --git a/tide-core/src/lib.rs b/tide-core/src/lib.rs index 4ede67a03..f67178a22 100644 --- a/tide-core/src/lib.rs +++ b/tide-core/src/lib.rs @@ -12,12 +12,6 @@ // ISSUE: https://github.com/rust-lang/rust-clippy/issues/3988 #![allow(clippy::needless_lifetimes)] -//! -//! Tide core api document -//! -//! The [`App`] docs are a good place to get started. -//! - mod app; mod context; mod endpoint; diff --git a/tide-cors/README.md b/tide-cors/README.md index b83932197..62be88f93 100644 --- a/tide-cors/README.md +++ b/tide-cors/README.md @@ -6,7 +6,7 @@ This crate provides cors-related middleware for Tide. Examples are in the `/examples` folder of this crate. -```rust +```rust,no_run #![feature(async_await)] use http::header::HeaderValue; @@ -27,12 +27,12 @@ fn main() { } ``` -**Simple Example** +__Simple Example__ You can test the simple example by running `cargo run --example cors` while in this crate's directory, and then running this script in the browser console: ```console -fetch("http://127.0.0.1:8000") +$ fetch("http://127.0.0.1:8000") ``` -You will probably get a browser alert when running without cors middleware +You will probably get a browser alert when running without cors middleware. diff --git a/tide-cors/src/lib.rs b/tide-cors/src/lib.rs index ae867300f..c2fe3215e 100644 --- a/tide-cors/src/lib.rs +++ b/tide-cors/src/lib.rs @@ -1,14 +1,10 @@ -//! Cors middleware and extensions for Tide -//! -//! # tide-cors -//! //! This crate provides cors-related middleware for Tide. //! //! ## Examples //! //! Examples are in the `/examples` folder of this crate. //! -//! ```rust, no_run +//! ```rust,no_run //! #![feature(async_await)] //! //! use http::header::HeaderValue; @@ -29,16 +25,15 @@ //! } //! ``` //! -//! **Simple Example** +//! __Simple Example__ //! //! You can test the simple example by running `cargo run --example cors` while in this crate's directory, and then running this script in the browser console: //! //! ```console -//! fetch("http://127.0.0.1:8000") +//! $ fetch("http://127.0.0.1:8000") //! ``` //! -//! You will probably get a browser alert when running without cors middleware -//! +//! You will probably get a browser alert when running without cors middleware. #![feature(async_await)] #![warn( diff --git a/tide-panic/src/lib.rs b/tide-panic/src/lib.rs index 530f264b0..3174a2a83 100644 --- a/tide-panic/src/lib.rs +++ b/tide-panic/src/lib.rs @@ -1,3 +1,9 @@ +//! Advanced panic support for Tide applications. +//! +//! These middleware should not generally be necessary, they are provided for situations in which +//! Tide's default panic handling is not usable by your application. Before using these you should +//! have a good understanding of how the different components involved in [`std::panic`] works. + #![feature(async_await, doc_cfg)] #![warn( nonstandard_style, @@ -7,12 +13,6 @@ missing_docs )] -//! Advanced panic support for Tide applications. -//! -//! These middleware should not generally be necessary, they are provided for situations in which -//! Tide's default panic handling is not usable by your application. Before using these you should -//! have a good understanding of how the different components involved in [`std::panic`] works. - mod catch_unwind; pub use crate::catch_unwind::CatchUnwind;