r - Convert markdown to Rd, or define custom markdown conversion rules? -
I am trying to write a documentation for an R package in Markdown, and it has changed it to an RD file. .
I think there is another way to see that I need a framework that recognizes different marktains and allows me to specify how this should be provided, such as:
-
`
** text ** is converted to
\ Bold {text}
- Markdown lists by
\ itemize {...}
and so on are given.
Is there anything that will allow me to do this? R
pander package in R (wrapping around Pandok) in R, looks promising, but I'm not sure that I can specify conversion rules (for example it's
\ texttt Converts backtaking by using I
\ code ), and it creates a complete standalone document instead of just changing my input snippet.
The
markdown package for R appears simply markdown - & gt; Html It seems that possibly may be supported for custom presentations, but I'm not sure how to write one (It seems that I have to type c code?)
I get back to something like this:
Convert Marks (myTextSnippet, backticks = function (txt) {return (paste0 ('\\ code {', txt, '}'))}, Bold = function (txt)) {return (paste 0 ('\\ bold {', txt, '}'))}, unordered.list = function (items) {itms & lt; - paste ('\\ item', item, collapse = '\ n') back (paste ('\\ itemize {', itms, '}', sep = '\ n'))}), # ... And
does one thing exist?
(Bonus: I just want to be able to embed the markdown in my
roxygen comments, so I was thinking of converting parts of the comments from the Markdown to RD, and Then running Roxin on the output).
Have you seen the Max Jain package by @Gebor-Sesadi?
It basically lets you write the Roxian header in Marcdon.
[UPDATE] These changes will have to go out with the Roxygen2 package and the version 6 release has been disjointed. From GitHub:
Most of the fields can now be written using Markdown markup instead of traditional RD language. You can turn on the markdown globally by adding Roxygen: List (Markdown = TRUE) up to DESCRIPTION. @ MD / @Nomedy tag has turned the markdown parsing on / off for the given block. For more details (# 364, # 431, # 499, # 506, # 507), @GorborsDaddy, see the 'Markdown' widget for
Comments
Post a Comment