ctags-lang-rmarkdown(7) Universal Ctags ctags-lang-rmarkdown(7)

# [Name](#Name)

ctags-lang-rmarkdown - Random notes about tagging R Markdown source code with Universal Ctags

# [SYNOPSIS](#SYNOPSIS)

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

# [DESCRIPTION](#DESCRIPTION)

RMarkdown parser is an exclusive subparser stacked on top of the Markdown parser. It works when:

- 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. This extension is for running guest parsers on **code chunks**.

The Markdown parser expects the following syntax represents codeblocks:

````
```language-name


        ...
```
````

For an example

````
```r


        ...
```
````

The RMarkdown parser accepts the following syntax for code chunks:

````
```{language-name chunk-label, ...}


        ...
```
````

For an example

````
```{r precalc fig.height=4}


        ...
```
````

Give *--extras=+{guest}* for enabling **guest** to command line if you want to run proper parsers on lines inside code chunks.

The parser extracts chunk labels coming after *language-name* as *chunklabel* kind objects. In the example, the RMarkdown parser extracts *precalc* as a *chunklabel* kind object. The *chunklabel* kind is enabled by default.

# [EXAMPLES](#EXAMPLES)

"input.rmd"

````
# Section 1
```{r myblock}


        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](#SEE_ALSO)

[ctags(1)](/man/os/universal-ctags/ctags.1), [ctags-client-tools(7)](/man/os/universal-ctags/ctags-client-tools.7), [ctags-lang-r(7)](/man/os/universal-ctags/ctags-lang-r.7), R Markdown: The Definitive Guide &lt;https://bookdown.org/yihui/rmarkdown/&gt;

6.2.1

---

Document: ctags-lang-rmarkdown(7) from universal-ctags 6.2.1-r1 (Chainguard OS)
Source: https://github.com/universal-ctags/ctags
