feat: Add codeFig snippet
This commit is contained in:
parent
6a30594699
commit
79ed239d07
7 changed files with 69 additions and 36 deletions
|
|
@ -105,6 +105,29 @@ local codeSnippet = s(
|
|||
)
|
||||
table.insert(snippets, codeSnippet)
|
||||
|
||||
local codeFigure = s(
|
||||
"codefig-",
|
||||
fmt(
|
||||
[[
|
||||
#let code = "
|
||||
{1}"
|
||||
|
||||
#align(
|
||||
left, [#figure(
|
||||
sourcecode(raw(code, lang: "{2}")), kind: "code", supplement: "Listing", caption: [{3}],
|
||||
)<{4}>],
|
||||
)
|
||||
]],
|
||||
{
|
||||
i(1, ""),
|
||||
i(2, "rs"),
|
||||
i(3, ""),
|
||||
i(4, ""),
|
||||
}
|
||||
)
|
||||
)
|
||||
table.insert(snippets, codeFigure)
|
||||
|
||||
local patternSnippet = s(
|
||||
"pattern-",
|
||||
fmt(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue