CTAGS-LANG-RMARKDOWN(7)

πŸ“¦
version 6.2.1 Β· 6 versions
, in alpine 3.24, fedora 43, fedora 44

πŸ’… CTAGS-LANG-RMARKDOWN(7) πŸ’…

okay bestie, so this is a page from the Universal Ctags manual, and it's all about ctags-lang-rmarkdown β€” like, the random notes about tagging R Markdown source code with Universal Ctags. it's giving niche but iconic, fr fr. πŸŽ€


✨ NAME ✨

ctags-lang-rmarkdown β€” random notes about tagging R Markdown source code with Universal Ctags


🌸 SYNOPSIS 🌸

ctags ...--extras=+{subparser}{guest} --languages=+RMarkdown ...
ctags ...--extras=+{subparser}{guest} --language-force=RMarkdown ...
ctags ...--extras=+{subparser}{guest} --map-RMarkdown=+.rmd ...

πŸ¦‹ DESCRIPTION πŸ¦‹

so the RMarkdown parser is an exclusive subparser that's stacked on top of the Markdown parser. it only does its thing when all three of these are true, no cap:

  • the Markdown parser is enabled,
  • the subparser extra is enabled, and
  • the RMarkdown parser itself is enabled.

the RMarkdown parser extends the way of detecting codeblocks from the Markdown parser. and the whole point of that extension? running guest parsers on code chunks. periodt. πŸ’…

the Markdown parser expects the following syntax to represent codeblocks:

...

for an example:

...

meanwhile the RMarkdown parser accepts the following syntax for code chunks:

...

for an example:

...

give --extras=+{guest} for enabling guest to command line if you want to run proper parsers on lines inside code chunks. literally that's the unlock. πŸ”₯

the parser extracts chunk labels coming after language-name as chunklabel kind objects. in the example above, the RMarkdown parser extracts precalc as a chunklabel kind object. and the chunklabel kind is enabled by default, so you don't even gotta ask. πŸ‘‘


🌈 EXAMPLES 🌈

"input.rmd"

# Section 1

zero_fun <- function () { return 0 }


# Section 2

"output.tags" with --options=NONE --extras=+{guest} --fields=+KZln -o - input.rmd

Section 1       input.rmd       /^# Section 1$/;"       chapter line:1  language:Markdown
Section 2       input.rmd       /^# Section 2$/;"       chapter line:9  language:Markdown
myblock input.rmd       /^```{r myblock}$/;"    chunklabel      line:3  language:RMarkdown
zero_fun        input.rmd       /^      zero_fun <- function () {$/;"   function        line:4  language:R

πŸ‘€ SEE ALSO πŸ‘€


okay that's the whole page, bestie, you ate it up πŸ’– this was Universal Ctags version 6.2.1, and the page is CTAGS-LANG-RMARKDOWN(7) β€” go forth and tag your R Markdown, mwah 🫢✨🌸

πŸ“¦ where this page comes from