Skip to content

Plugin to support R Markdown syntax for code chunks/fenced code blocks #638

Answered by rgaiacs
rgaiacs asked this question in Ideas
Discussion options

You must be logged in to vote

Thanks for the message. I started https://github.com/rgaiacs/remark-rmarkdown with a minimal code based on https://unifiedjs.com/learn.

R Markdown has code blocks like

```{r example, echo = FALSE}
x = 1 + 1
```

which generate a AST like

      {
      "type": "code",
      "lang": "{r",
      "meta": "example, echo = FALSE}",
      "value": "x = 1 + 1",
      "position": {
        "start": {
          "line": 1,
          "column": 1,
          "offset": 0
        },
        "end": {
          "line": 3,
          "column": 4,
          "offset": 42
        }
      }

My plugin removes the { from lang and } from meta.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ChristianMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants