xref: /Universal-ctags/man/ctags-lang-rmarkdown.7.rst.in (revision 405e795f26711a831066f39a5c63539e3555be6f)
1.. _ctags_lang-rmarkdown(7):
2
3======================================================================
4ctags-lang-rmarkdown
5======================================================================
6-----------------------------------------------------------------------
7Random notes about tagging R Markdown source code with Universal Ctags
8-----------------------------------------------------------------------
9:Version: @VERSION@
10:Manual group: Universal Ctags
11:Manual section: 7
12
13SYNOPSIS
14--------
15|	**@CTAGS_NAME_EXECUTABLE@** ...--extras=+{subparser}{guest} --languages=+RMarkdown ...
16|	**@CTAGS_NAME_EXECUTABLE@** ...--extras=+{subparser}{guest} --language-force=RMarkdown ...
17|	**@CTAGS_NAME_EXECUTABLE@** ...--extras=+{subparser}{guest} --map-RMarkdown=+.rmd ...
18
19DESCRIPTION
20-----------
21RMarkdown parser is an exclusive subparser stacked on top of the Markdown parser.
22It works when:
23
24* the Markdown parser is enabled,
25* the ``subparser`` extra is enabled, and
26* the RMarkdown parser itself is enabled.
27
28The RMarkdown parser extends the way of detecting **codeblocks** from the
29Markdown parser for running guest parsers on **code chunks**.
30
31The Markdown parser expects the following syntax for codeblocks
32
33.. code-block::
34
35	```language-name
36		...
37	```
38
39For an example
40
41.. code-block::
42
43	```r
44		...
45	```
46
47The RMarkdown parser accepts the following syntax for code chunks
48as the markdown parser accepts codeblocks
49
50.. code-block::
51
52	```{language-name chunk-label, ...}
53		...
54	```
55
56For an example
57
58.. code-block::
59
60	```{r precalc fig.height=4}
61		...
62	```
63
64Give `--extras=+{guest}` for enabling ``guest`` to command line if you
65want to run proper parsers on inside code chunks.
66
67The parser extrats chunk labels coming after `language-name` as
68`chunklabel` kind objcts. The kind is enabled by default.
69
70EXAMPLES
71--------
72"input.rmd"
73
74.. code-block:: RMarkdown
75
76	# Section 1
77
78	```{r myblock}
79		zero_fun <- function () {
80			return 0
81		}
82	```
83
84	# Section 2
85
86"output.tags"
87with "--options=NONE --extras=+{guest} --fields=+KZln -o - input.rmd"
88
89.. code-block:: tags
90
91	Section 1	input.rmd	/^# Section 1$/;"	chapter	line:1	language:Markdown
92	Section 2	input.rmd	/^# Section 2$/;"	chapter	line:9	language:Markdown
93	myblock	input.rmd	/^```{r myblock}$/;"	chunklabel	line:3	language:RMarkdown
94	zero_fun	input.rmd	/^	zero_fun <- function () {$/;"	function	line:4	language:R
95
96SEE ALSO
97--------
98ctags(1), ctags-client-tools(7), `R Markdown: The Definitive Guide <https://bookdown.org/yihui/rmarkdown/>`_
99