From 46d908dd48d3faf6a0d310eadecd32449876b839 Mon Sep 17 00:00:00 2001 From: sitandr <60141933+sitandr@users.noreply.github.com> Date: Thu, 12 Sep 2024 18:30:24 +0300 Subject: [PATCH] Commit suggestions --- src/snippets/scripting/index.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/snippets/scripting/index.md b/src/snippets/scripting/index.md index a5798c3..9d0c3da 100644 --- a/src/snippets/scripting/index.md +++ b/src/snippets/scripting/index.md @@ -39,9 +39,10 @@ This snippet creates a selector (that is then used in a show rule) that matches any of the values inside the array. Here, it is used to highlight -a few raw lines, but it can be adapted to any kind of selector obviously +a few raw lines, but it can be easily adapted to any kind of selector. ````typ +// author: Blokyk #let lines = (2, 3, 5) #let lines-selectors = lines.map(lineno => raw.line.where(number: lineno)) #let lines-combined-selector = lines-selectors.fold( @@ -70,6 +71,7 @@ In this example, it's used to give custom supplements to custom figure kinds, based on a dictionnary of correspondances. ```typ +// author: laurmaedje #let kind_supp_dict = ( algo: "Pseudo-code", ex: "Example", @@ -88,10 +90,14 @@ kinds, based on a dictionnary of correspondances. acc } ) -} +#figure( + kind: "algo", + caption: [My code], + ```Algorithm there``` +) ``` -Additonnaly, as this is this is applied at the position where you +Additonnaly, as this is applied at the position where you write it, these show-set rules will appear as if they were added in the same place where you wrote this rule. This means that you can override them later, just like any other show-set rules.