{"route":"/en-US-v0.14.1/reference/introspection/metadata/","title":"Metadata","description":"Documentation for the `metadata` function.","part":null,"outline":[{"id":"summary","name":"Summary","children":[]},{"id":"parameters","name":"Parameters","children":[{"id":"parameters-value","name":"value","children":[]}]}],"body":{"kind":"func","content":{"path":[],"name":"metadata","title":"Metadata","keywords":[],"oneliner":"Exposes a value to the query system without producing visible content.","element":true,"contextual":false,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>Exposes a value to the query system without producing visible content.</p>\n<p>This element can be retrieved with the <a href=\"/en-US-v0.14.1/reference/introspection/query/\" title=\"`query`\"><code>query</code></a> function and from the\ncommand line with\n<a href=\"/en-US-v0.14.1/reference/introspection/query/#command-line-queries\"><code>typst query</code></a>. Its\npurpose is to expose an arbitrary value to the introspection system. To\nidentify a metadata value among others, you can attach a <a href=\"/en-US-v0.14.1/reference/foundations/label/\" title=\"`label`\"><code>label</code></a> to it and\nquery for that label.</p>\n<p>The <code>metadata</code> element is especially useful for command line queries because\nit allows you to expose arbitrary values to the outside world.</p>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-comment\">// Put metadata somewhere.</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">metadata</span><span class=\"typ-punct\">(</span><span class=\"typ-str\">&quot;This is a note&quot;</span><span class=\"typ-punct\">)</span> <span class=\"typ-label\">&lt;note&gt;</span>\n\n<span class=\"typ-comment\">// And find it from anywhere else.</span>\n<span class=\"typ-key\">#</span><span class=\"typ-key\">context</span> <span class=\"typ-punct\">{</span>\n  <span class=\"typ-func\">query</span><span class=\"typ-punct\">(</span><span class=\"typ-label\">&lt;note&gt;</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">.</span><span class=\"typ-func\">first</span><span class=\"typ-punct\">(</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">.</span>value\n<span class=\"typ-punct\">}</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/b1b17f01cf3adfe808d66deaa0bf5abf.png\" alt=\"Preview\"></div></div>"}],"self":false,"params":[{"name":"value","details":[{"kind":"html","content":"<p>The value to embed into the document.</p>"}],"types":["any"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false}],"returns":["content"],"scope":[]}}}