From 89650af4b2ed0e179d99af9a0f6ba711086e9797 Mon Sep 17 00:00:00 2001 From: Malo <57839069+MDLC01@users.noreply.github.com> Date: Tue, 15 Jul 2025 22:46:52 +0100 Subject: [PATCH] Add documentation --- crates/typst-library/src/introspection/query.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/typst-library/src/introspection/query.rs b/crates/typst-library/src/introspection/query.rs index b742ac010..083c30f96 100644 --- a/crates/typst-library/src/introspection/query.rs +++ b/crates/typst-library/src/introspection/query.rs @@ -117,6 +117,8 @@ use crate::foundations::{func, Array, Context, LocatableSelector, Value}; /// ] /// ``` /// +/// ## Retrieving a specific field +/// /// Frequently, you're interested in only one specific field of the resulting /// elements. In the case of the `metadata` element, the `value` field is the /// interesting one. You can extract just this field with the `--field` @@ -134,6 +136,12 @@ use crate::foundations::{func, Array, Context, LocatableSelector, Value}; /// $ typst query example.typ "" --field value --one /// "This is a note" /// ``` +/// +/// ## Querying for a specific export target +/// +/// In case you need to query a document when exporting for a specific target, +/// you can use the `--target` argument. Valid values are `paged`, and `html` +/// (if the [`html`]($html) feature is enabled). #[func(contextual)] pub fn query( engine: &mut Engine,