Remove dioxus-lib, fix doc imports (#4438)
* remove dioxus lib * inline some doc items * fix tests * test docs * Fix doc tests * Pull out dioxus/lib feature * disable logger and devtools in library feature * fix cargo doc * fix cargo doc
This commit is contained in:
1 parent
4cb32d372b
commit
98f7667fb4
59 files changed
+216
-530
No files matched your search
@@ -54,7 +54,7 @@ impl AssetOptions {
|
||||
/// Create a new css asset builder
|
||||
///
|
||||
/// ```rust
|
||||
/// # use manganis::{asset, Asset, CssAssetOptions};
|
||||
/// # use manganis::{asset, Asset, AssetOptions};
|
||||
/// const _: Asset = asset!("/assets/style.css", AssetOptions::css());
|
||||
/// ```
|
||||
pub const fn css() -> AssetOptionsBuilder<CssAssetOptions> {
|
||||
@@ -68,7 +68,7 @@ impl AssetOptionsBuilder<CssAssetOptions> {
|
||||
/// Minifying the css can make your site load faster by loading less data
|
||||
///
|
||||
/// ```rust
|
||||
/// # use manganis::{asset, Asset, CssAssetOptions};
|
||||
/// # use manganis::{asset, Asset, AssetOptions};
|
||||
/// const _: Asset = asset!("/assets/style.css", AssetOptions::css().with_minify(false));
|
||||
/// ```
|
||||
pub const fn with_minify(mut self, minify: bool) -> Self {
|
||||
@@ -81,7 +81,7 @@ impl AssetOptionsBuilder<CssAssetOptions> {
|
||||
/// Preloading css will make the image start to load as soon as possible. This is useful for css that is used soon after the page loads or css that may not be used immediately, but should start loading sooner
|
||||
///
|
||||
/// ```rust
|
||||
/// # use manganis::{asset, Asset, CssAssetOptions};
|
||||
/// # use manganis::{asset, Asset, AssetOptions};
|
||||
/// const _: Asset = asset!("/assets/style.css", AssetOptions::css().with_preload(true));
|
||||
/// ```
|
||||
pub const fn with_preload(mut self, preload: bool) -> Self {
|
||||
|
||||
@@ -57,7 +57,7 @@ impl AssetOptions {
|
||||
/// Create a new css module asset builder
|
||||
///
|
||||
/// ```rust
|
||||
/// # use manganis::{asset, Asset, CssModuleAssetOptions};
|
||||
/// # use manganis::{asset, Asset, AssetOptions};
|
||||
/// const _: Asset = asset!("/assets/style.css", AssetOptions::css_module());
|
||||
/// ```
|
||||
pub const fn css_module() -> AssetOptionsBuilder<CssModuleAssetOptions> {
|
||||
|
||||
@@ -127,7 +127,7 @@ impl AssetOptions {
|
||||
/// Create a new image asset builder
|
||||
///
|
||||
/// ```rust
|
||||
/// # use manganis::{asset, Asset, ImageAssetOptions};
|
||||
/// # use manganis::{asset, Asset, AssetOptions};
|
||||
/// const _: Asset = asset!("/assets/image.png", AssetOptions::image());
|
||||
/// ```
|
||||
pub const fn image() -> AssetOptionsBuilder<ImageAssetOptions> {
|
||||
@@ -141,7 +141,7 @@ impl AssetOptionsBuilder<ImageAssetOptions> {
|
||||
/// Preloading an image will make the image start to load as soon as possible. This is useful for images that will be displayed soon after the page loads or images that may not be visible immediately, but should start loading sooner
|
||||
///
|
||||
/// ```rust
|
||||
/// # use manganis::{asset, Asset, ImageAssetOptions};
|
||||
/// # use manganis::{asset, Asset, AssetOptions};
|
||||
/// const _: Asset = asset!("/assets/image.png", AssetOptions::image().with_preload(true));
|
||||
/// ```
|
||||
pub const fn with_preload(mut self, preload: bool) -> Self {
|
||||
@@ -154,7 +154,7 @@ impl AssetOptionsBuilder<ImageAssetOptions> {
|
||||
/// Choosing the right format can make your site load much faster. Webp and avif images tend to be a good default for most images
|
||||
///
|
||||
/// ```rust
|
||||
/// # use manganis::{asset, Asset, ImageAssetOptions, ImageFormat};
|
||||
/// # use manganis::{asset, Asset, AssetOptions, ImageFormat};
|
||||
/// const _: Asset = asset!("/assets/image.png", AssetOptions::image().with_format(ImageFormat::Webp));
|
||||
/// ```
|
||||
pub const fn with_format(mut self, format: ImageFormat) -> Self {
|
||||
@@ -168,7 +168,7 @@ impl AssetOptionsBuilder<ImageAssetOptions> {
|
||||
/// they compress images well
|
||||
///
|
||||
/// ```rust
|
||||
/// # use manganis::{asset, Asset, ImageAssetOptions, ImageFormat};
|
||||
/// # use manganis::{asset, Asset, AssetOptions, ImageFormat};
|
||||
/// const _: Asset = asset!("/assets/image.png", AssetOptions::image().with_avif());
|
||||
/// ```
|
||||
pub const fn with_avif(self) -> Self {
|
||||
@@ -181,7 +181,7 @@ impl AssetOptionsBuilder<ImageAssetOptions> {
|
||||
/// they compress images well
|
||||
///
|
||||
/// ```rust
|
||||
/// # use manganis::{asset, Asset, ImageAssetOptions, ImageFormat};
|
||||
/// # use manganis::{asset, Asset, AssetOptions, ImageFormat};
|
||||
/// const _: Asset = asset!("/assets/image.png", AssetOptions::image().with_webp());
|
||||
/// ```
|
||||
pub const fn with_webp(self) -> Self {
|
||||
@@ -193,7 +193,7 @@ impl AssetOptionsBuilder<ImageAssetOptions> {
|
||||
/// Jpeg images compress much better than [`ImageFormat::Png`], but worse than [`ImageFormat::Webp`] or [`ImageFormat::Avif`]
|
||||
///
|
||||
/// ```rust
|
||||
/// # use manganis::{asset, Asset, ImageAssetOptions, ImageFormat};
|
||||
/// # use manganis::{asset, Asset, AssetOptions, ImageFormat};
|
||||
/// const _: Asset = asset!("/assets/image.png", AssetOptions::image().with_jpg());
|
||||
/// ```
|
||||
pub const fn with_jpg(self) -> Self {
|
||||
@@ -205,7 +205,7 @@ impl AssetOptionsBuilder<ImageAssetOptions> {
|
||||
/// Png images don't compress very well, so they are not recommended for large images
|
||||
///
|
||||
/// ```rust
|
||||
/// # use manganis::{asset, Asset, ImageAssetOptions, ImageFormat};
|
||||
/// # use manganis::{asset, Asset, AssetOptions, ImageFormat};
|
||||
/// const _: Asset = asset!("/assets/image.png", AssetOptions::image().with_png());
|
||||
/// ```
|
||||
pub const fn with_png(self) -> Self {
|
||||
@@ -217,7 +217,7 @@ impl AssetOptionsBuilder<ImageAssetOptions> {
|
||||
/// If you only use the image in one place, you can set the size of the image to the size it will be displayed at. This will make the image load faster
|
||||
///
|
||||
/// ```rust
|
||||
/// # use manganis::{asset, Asset, ImageAssetOptions, ImageSize};
|
||||
/// # use manganis::{asset, Asset, AssetOptions, ImageSize};
|
||||
/// const _: Asset = asset!("/assets/image.png", AssetOptions::image().with_size(ImageSize::Manual { width: 512, height: 512 }));
|
||||
/// ```
|
||||
pub const fn with_size(mut self, size: ImageSize) -> Self {
|
||||
|
||||
@@ -55,7 +55,7 @@ impl AssetOptions {
|
||||
/// Create a new js asset builder
|
||||
///
|
||||
/// ```rust
|
||||
/// # use manganis::{asset, Asset, JsAssetOptions};
|
||||
/// # use manganis::{asset, Asset, AssetOptions};
|
||||
/// const _: Asset = asset!("/assets/script.js", AssetOptions::js());
|
||||
/// ```
|
||||
pub const fn js() -> AssetOptionsBuilder<JsAssetOptions> {
|
||||
@@ -69,7 +69,7 @@ impl AssetOptionsBuilder<JsAssetOptions> {
|
||||
/// Minifying the js can make your site load faster by loading less data
|
||||
///
|
||||
/// ```rust
|
||||
/// # use manganis::{asset, Asset, JsAssetOptions};
|
||||
/// # use manganis::{asset, Asset, AssetOptions};
|
||||
/// const _: Asset = asset!("/assets/script.js", AssetOptions::js().with_minify(false));
|
||||
/// ```
|
||||
#[allow(unused)]
|
||||
@@ -83,7 +83,7 @@ impl AssetOptionsBuilder<JsAssetOptions> {
|
||||
/// Preloading the javascript will make the javascript start to load as soon as possible. This is useful for javascript that will be used soon after the page loads or javascript that may not be used immediately, but should start loading sooner
|
||||
///
|
||||
/// ```rust
|
||||
/// # use manganis::{asset, Asset, JsAssetOptions};
|
||||
/// # use manganis::{asset, Asset, AssetOptions};
|
||||
/// const _: Asset = asset!("/assets/script.js", AssetOptions::js().with_preload(true));
|
||||
/// ```
|
||||
#[allow(unused)]
|
||||
|
||||
@@ -62,10 +62,10 @@ impl AssetOptions {
|
||||
/// A builder for [`AssetOptions`]
|
||||
///
|
||||
/// ```rust
|
||||
/// # use manganis::AssetOptionsBuilder;
|
||||
/// # use manganis::{AssetOptions, Asset, asset};
|
||||
/// static ASSET: Asset = asset!(
|
||||
/// "image.png",
|
||||
/// AssetOptionsBuilder::new()
|
||||
/// "/assets/style.css",
|
||||
/// AssetOptions::builder()
|
||||
/// .with_hash_suffix(false)
|
||||
/// );
|
||||
/// ```
|
||||
@@ -130,8 +130,8 @@ impl<T> AssetOptionsBuilder<T> {
|
||||
/// ```rust
|
||||
/// #[used]
|
||||
/// static ASSET: manganis::Asset = manganis::asset!(
|
||||
/// "path/to/asset.png",
|
||||
/// AssetVariant::Unknown.into_asset_options()
|
||||
/// "/assets/style.css",
|
||||
/// manganis::AssetOptions::builder()
|
||||
/// .with_hash_suffix(false)
|
||||
/// );
|
||||
/// ```
|
||||
|
||||
Reference in new issue
Block a user