Skip to content

Commit e82538b

Browse files
committed
convertion between .Rmd, .R. and .mm
New Functions: r2rmd(), rmd2r(), r2mm(), mm2r().
1 parent 555e546 commit e82538b

File tree

22 files changed

+815
-213
lines changed

22 files changed

+815
-213
lines changed

DESCRIPTION

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
Package: mindr
2-
Version: 1.1.7
3-
Date: 2018-10-25
2+
Version: 1.1.8
3+
Date: 2018-11-16
44
Title: Convert Files Between Markdown or Rmarkdown Files and Mindmaps
55
Author: Peng Zhao
66
Maintainer: Peng Zhao <pzhao@pzhao.net>
77
Depends: R (>= 3.0.0)
8-
Imports: htmlwidgets
8+
Imports:
9+
htmlwidgets,
10+
knitr
911
Suggests:
1012
Description: Convert Markdown ('.md') or Rmarkdown ('.Rmd') files into FreeMind mindmap ('.mm') files, and vice versa. FreeMind mindmap ('.mm') files can be opened by or imported to common mindmap software such as 'FreeMind' (<http://freemind.sourceforge.net/wiki/index.php/Main_Page>) and 'XMind' (<http://www.xmind.net>).
1113
License: MIT + file LICENSE

NAMESPACE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ export(md2mm)
88
export(md2r)
99
export(mdtxt2mmtxt)
1010
export(mm2md)
11+
export(mm2r)
1112
export(outline)
1213
export(r2md)
14+
export(r2mm)
15+
export(r2rmd)
1316
export(renderMarkmap)
17+
export(rmd2r)
1418
export(tree2mm)
1519
import(htmlwidgets)

R/internal.R

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,26 @@ get_heading <- function(pattern = '^#+ ', text){
8181
return(grep(pattern = pattern, x = text))
8282
}
8383

84+
#' get the headings out of given strings
85+
#'
86+
#' @param pattern The definition of the headings
87+
#' @param text the given strings
88+
#'
89+
#' @return integer. the index of the headings in the given strings.
90+
get_heading2 <- function(pattern = '^#= #+ ', text){
91+
return(grep(pattern = pattern, x = text))
92+
}
93+
94+
#' get the headings out of given strings
95+
#'
96+
#' @param pattern The definition of the headings
97+
#' @param text the given strings
98+
#'
99+
#' @return integer. the index of the headings in the given strings.
100+
get_heading3 <- function(pattern = "^#' #+ ", text){
101+
return(grep(pattern = pattern, x = text))
102+
}
103+
84104
#' get the body out of given strings
85105
#'
86106
#' @param pattern The definition of the body text

0 commit comments

Comments
 (0)