Code annotations for NetLogo not working as expected (by me) #13884
Unanswered
alan-isaac
asked this question in
Q&A
Replies: 2 comments 6 replies
-
|
There are roughly 50 languages at the moment. For all the others, code annotation uses |
Beta Was this translation helpful? Give feedback.
5 replies
-
|
FYI, for a related issues with code-annotations and Typst, I've made a Lua filter to workaround the issue and use the proper comment symbol.
filters:
- path: typst-annotations.lua
at: pre-quarto
--[[
# MIT License
#
# Copyright (c) 2026 Mickaël Canouil
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
]]
--- Convert annotation markers in Typst code blocks.
--- Replaces `// <N>` patterns with `# <N>` at end of lines.
--- This allows using Quarto's code annotation feature with Typst's comment syntax.
--- @param el pandoc.CodeBlock The code block element to process.
--- @return pandoc.CodeBlock The modified code block element.
function CodeBlock(el)
if el.classes:includes("typst") then
el.text = el.text:gsub("// (<[0-9]+>)%s*$", "# %1")
el.text = el.text:gsub("// (<[0-9]+>)%s*\n", "# %1\n")
end
return el
end |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Is it possible to get code annotations in Logo based languages such as NetLogo? (The comment character is a semicolon.)
Beta Was this translation helpful? Give feedback.
All reactions