Skip to content

Document support code annotation comment chars #13545

@cderv

Description

@cderv

Following question at #13540

I wonder if we should try add a callout collapsed by default at https://quarto.org/docs/authoring/code-annotation.html#annotation-syntax

and try to have its content synced to

-- for a given language, the comment character(s)
local kLangCommentChars = {
r = {"#"},
python = {"#"},
julia = {"#"},
scala = {"//"},
matlab = {"%"},
csharp = {"//"},
fsharp = {"//"},
c = {"/*", "*/"},
css = {"/*", "*/"},
sas = {"*", ";"},
powershell = {"#"},
bash = {"#"},
sql = {"--"},
mysql = {"--"},
psql = {"--"},
lua = {"--"},
cpp = {"//"},
cc = {"//"},
stan = {"#"},
octave = {"#"},
fortran = {"!"},
fortran95 = {"!"},
awk = {"#"},
gawk = {"#"},
stata = {"*"},
java = {"//"},
groovy = {"//"},
sed = {"#"},
perl = {"#"},
ruby = {"#"},
tikz = {"%"},
js = {"//"},
d3 = {"//"},
node = {"//"},
sass = {"//"},
scss = {"//"},
coffee = {"#"},
go = {"//"},
asy = {"//"},
haskell = {"--"},
dot = {"//"},
mermaid = {"%%"},
apl = {""},
yaml = {"#"},
json = {"//"},
latex = {"%"},
typescript = {"//"},
swift = { "//" },
javascript = { "//"},
elm = { "#" },
vhdl = { "--"},
html = { "<!--", "-->"},
markdown = {"<!--", "-->"},
gap = { "#" },
dockerfile = { "#" },
ocaml = { "(*", "*)"},
rust = { "// "}
}
local kDefaultCodeAnnotationComment = {"#"}

This would be an improvement. But we could also add a footnote (or margin note) for url to where to look in the code on github.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions