diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-11-23 16:25:49 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-11-24 12:30:02 +0100 |
| commit | 7eebafa7837ec173a7b2064ae60fd45b5413d17c (patch) | |
| tree | b63b302b6d7747bcbb28571713745b9ca1aa83a4 /crates/typst-library/src/layout/hide.rs | |
| parent | 76e173b78b511b506b928c27ac360f75fa455747 (diff) | |
Merge `typst` and `typst-library`
Diffstat (limited to 'crates/typst-library/src/layout/hide.rs')
| -rw-r--r-- | crates/typst-library/src/layout/hide.rs | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/crates/typst-library/src/layout/hide.rs b/crates/typst-library/src/layout/hide.rs deleted file mode 100644 index af3d0631..00000000 --- a/crates/typst-library/src/layout/hide.rs +++ /dev/null @@ -1,29 +0,0 @@ -use smallvec::smallvec; - -use crate::prelude::*; - -/// Hides content without affecting layout. -/// -/// The `hide` function allows you to hide content while the layout still 'sees' -/// it. This is useful to create whitespace that is exactly as large as some -/// content. It may also be useful to redact content because its arguments are -/// not included in the output. -/// -/// # Example -/// ```example -/// Hello Jane \ -/// #hide[Hello] Joe -/// ``` -#[elem(Show)] -pub struct HideElem { - /// The content to hide. - #[required] - pub body: Content, -} - -impl Show for HideElem { - #[tracing::instrument(name = "HideElem::show", skip(self))] - fn show(&self, _: &mut Vt, _: StyleChain) -> SourceResult<Content> { - Ok(self.body().clone().styled(MetaElem::set_data(smallvec![Meta::Hide]))) - } -} |
