mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Image docs
This commit is contained in:
parent
be83b3d687
commit
4af7b9118c
@ -9,6 +9,16 @@ use crate::prelude::*;
|
|||||||
///
|
///
|
||||||
/// Supported formats are PNG, JPEG, GIF and SVG.
|
/// Supported formats are PNG, JPEG, GIF and SVG.
|
||||||
///
|
///
|
||||||
|
/// ## Example
|
||||||
|
/// ```
|
||||||
|
/// #align(center)[
|
||||||
|
/// #image("molecular.jpg", width: 2in)
|
||||||
|
///
|
||||||
|
/// *A step in the molecular testing
|
||||||
|
/// pipeline of our lab*
|
||||||
|
/// ]
|
||||||
|
/// ```
|
||||||
|
///
|
||||||
/// ## Parameters
|
/// ## Parameters
|
||||||
/// - path: EcoString (positional, required)
|
/// - path: EcoString (positional, required)
|
||||||
/// Path to an image file.
|
/// Path to an image file.
|
||||||
@ -122,10 +132,11 @@ pub enum ImageFit {
|
|||||||
|
|
||||||
castable! {
|
castable! {
|
||||||
ImageFit,
|
ImageFit,
|
||||||
/// The image should completely cover the area.
|
/// The image should completely cover the area. This is the default.
|
||||||
"cover" => Self::Cover,
|
"cover" => Self::Cover,
|
||||||
/// The image should be fully contained in the area.
|
/// The image should be fully contained in the area.
|
||||||
"contain" => Self::Contain,
|
"contain" => Self::Contain,
|
||||||
/// The image should be stretched so that it exactly fills the area.
|
/// The image should be stretched so that it exactly fills the area, even if
|
||||||
|
/// this means that the image will be distorted.
|
||||||
"stretch" => Self::Stretch,
|
"stretch" => Self::Stretch,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user