ctags-lang-rmarkdown(7)

πŸ“¦ version 6.2.1, in ubuntu resolute, ubuntu stonking

✨ ctags-lang-rmarkdown ✨

okay bestie, welcome to the R Markdown corner of the Universal Ctags universe πŸ’… this is the ctags-lang-rmarkdown manual, aka all the random notes you need about tagging R Markdown source code with Universal Ctags. no cap, it's a whole vibe.


🌸 SYNOPSIS 🌸

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

like, those three dots in the middle? yeah they're literally in there, keep them. 🫢


πŸ’– DESCRIPTION πŸ’–

So the RMarkdown parser? It's an exclusive subparser stacked on top of the Markdown parser. main character energy fr. It only does its thing when all three of these are true:

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

The RMarkdown parser levels up the way the Markdown parser detects codeblocks. This glow-up exists so you can run guest parsers on code chunks. 😌

Now, the Markdown parser expects this syntax for codeblocks:

...

for example:

...

but the RMarkdown parser is not like other girls β€” she accepts this syntax for code chunks:

...

for example:

...

If you want proper parsers actually running on the lines inside your code chunks, pass --extras=+{guest} on the command line. periodt.

The parser pulls the chunk labels that come right after language-name and turns them into chunklabel kind objects. In that example up there, the RMarkdown parser extracts precalc as a chunklabel kind object. and good news: the chunklabel kind is enabled by default. slay. πŸŽ€


πŸ¦‹ EXAMPLES πŸ¦‹

okay so here's "input.rmd":

# Section 1

zero_fun <- function () { return 0 }


# Section 2

and here's "output.tags", generated 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

look at those kinds go, we love a chapter, a chunklabel, and a function all showing up in the same tags file πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page bestie, you ate it πŸ’– this was ctags-lang-rmarkdown, version 6.2.1, part of the Universal Ctags fam β€” go tag something iconic, ily, bye πŸ¦‹βœ¨πŸ’…

πŸ“¦ where this page comes from