1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
.. _ctags_lang-rmarkdown(7):
======================================================================
ctags-lang-rmarkdown
======================================================================
Random notes about tagging R Markdown source code with Universal Ctags
:Version: 6.2.1
:Manual group: Universal Ctags
:Manual section: 7
SYNOPSIS
--------
| **ctags** ...--extras=+{subparser}{guest} --languages=+RMarkdown ...
| **ctags** ...--extras=+{subparser}{guest} --language-force=RMarkdown ...
| **ctags** ...--extras=+{subparser}{guest} --map-RMarkdown=+.rmd ...
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:
.. code-block::
```language-name
...
```
For an example
.. code-block::
```r
...
```
The RMarkdown parser accepts the following syntax for code chunks:
.. code-block::
```{language-name chunk-label, ...}
...
```
For an example
.. code-block::
```{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
--------
"input.rmd"
.. code-block:: RMarkdown
# Section 1
```{r myblock}
zero_fun <- function () {
return 0
}
```
# Section 2
"output.tags"
with "--options=NONE --extras=+{guest} --fields=+KZln -o - input.rmd"
.. code-block:: tags
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
--------
:ref:`ctags(1) <ctags(1)>`, :ref:`ctags-client-tools(7) <ctags-client-tools(7)>`, :ref:`ctags-lang-r(7) <ctags-lang-r(7)>`,
`R Markdown: The Definitive Guide <https://bookdown.org/yihui/rmarkdown/>`_
|