typst_library/layout/
hide.rs

1use crate::foundations::{Content, elem};
2use crate::introspection::Tagged;
3
4/// Hides content without affecting layout.
5///
6/// The `hide` function allows you to hide content while the layout still 'sees'
7/// it. This is useful to create whitespace that is exactly as large as some
8/// content. It may also be useful to redact content because its arguments are
9/// not included in the output.
10///
11/// # Example
12/// ```example
13/// Hello Jane \
14/// #hide[Hello] Joe
15/// ```
16#[elem(Tagged)]
17pub struct HideElem {
18    /// The content to hide.
19    #[required]
20    pub body: Content,
21
22    /// This style is set on the content contained in the `hide` element.
23    #[internal]
24    #[ghost]
25    pub hidden: bool,
26}