1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
//! Minification tool for html and json
//!
//! # Usage
//!
//! First add the library to the dependencies of your project like this:
//!
//! ```toml
//! [dependencies]
//! minify = "1.2"
//! ```
//!
//! Afterwards you can import the library like this:
//!
//! ```rust
//! extern crate minify;
//! ```
//!
//! # Minify Html
//!
//! The following rules are applied for html minification:
//!
//! * Removal of ascii control characters
//! * Removal of comments
//! * Removal of multiple whitespaces
//! * Removal of whitespaces before and after greater-than and less-than signs
//! * `_<_html_>_` => `<html>`
//!
//! ```rust
//! extern crate minify;
//! use minify::html::minify;
//!
//! fn main() {
//! let html = r#"
//! <html>
//! <head>
//! </head>
//! <body>
//! </body>
//! <html>
//! "#;
//! let html_minified = minify(html);
//! }
//! ```
//!
//! # Minify JSON
//!
//! The following rules are applied for json minification:
//!
//! * Removal of ascii control characters
//! * Removal of whitespaces outside of strings
//!
//! ```rust
//! extern crate minify;
//! use minify::json::minify;
//!
//! fn main() {
//! let json = r#"
//! {
//! "test": "test",
//! "test2": 2
//! }
//! "#;
//! let json_minified = minify(json);
//! }
//! ```
#![warn(
absolute_paths_not_starting_with_crate,
anonymous_parameters,
box_pointers,
confusable_idents,
deprecated_in_future,
// elided_lifetimes_in_paths,
explicit_outlives_requirements,
indirect_structural_match,
keyword_idents,
macro_use_extern_crate,
meta_variable_misuse,
missing_copy_implementations,
missing_debug_implementations,
missing_docs,
non_ascii_idents,
single_use_lifetimes,
trivial_casts,
trivial_numeric_casts,
unaligned_references,
// unreachable_pub,
unsafe_code,
unstable_features,
unused_crate_dependencies,
unused_extern_crates,
unused_import_braces,
unused_lifetimes,
unused_qualifications,
unused_results,
variant_size_differences
)]
#![warn(
clippy::cargo,
clippy::complexity,
clippy::correctness,
clippy::nursery,
clippy::pedantic,
clippy::perf,
clippy::style
)]
#![allow(
clippy::implicit_return,
clippy::shadow_unrelated,
clippy::struct_excessive_bools,
clippy::module_name_repetitions,
clippy::match_wildcard_for_single_variants
)]
/// Minification for html content
pub mod html;
mod io;
/// Minifigation for json content
pub mod json;