From 976c4080b3701039aeb5a22213e0031d8bd7d12f Mon Sep 17 00:00:00 2001 From: Mathieu Loiseau <mathieu.loiseau@univ-grenoble-alpes.fr> Date: Mon, 10 Dec 2018 08:15:21 +0100 Subject: [PATCH] stringr imports + link err correction --- DESCRIPTION | 6 +++--- R/class.R | 11 ++++++----- man/Batchator.Rd | 8 ++++---- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b3bee77..3c10292 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,12 +1,12 @@ Package: mediawikir Type: Package Title: Connects to a mediawiki instance and writes in it what you want -Version: 0.1.5 +Version: 0.1.6 Author: Mathieu Loiseau Maintainer: Mathieu Loiseau <loiseaum@univ-grenoble-alpes.fr> -Description: It can be used to post the output of an R script directly into a mediawiki instance +Description: Mediawikir class can be used to post the output of an R script directly into a mediawiki instance. Batchator class allows batch page creation. License: MIT Encoding: UTF-8 LazyData: true RoxygenNote: 6.0.1 -Imports: httr,R6 +Imports: httr,R6,stringr diff --git a/R/class.R b/R/class.R index 24af10e..6796d1a 100644 --- a/R/class.R +++ b/R/class.R @@ -1,5 +1,7 @@ library(R6) library(httr) +library(stringr) + #'Mediawikir: write R output to mediawiki #' @@ -243,7 +245,6 @@ Mediawikir <- R6Class("Mediawikir", ) ) -library(stringr) #'Batchator: Batch input to mediawiki based on a csv and a template #' #'@docType class @@ -259,7 +260,7 @@ library(stringr) #'@field field_list the list of symbols that will be replaced (the first line of the csv file that will be sent to the Batchator) #'@field content a matrix of the words that will replace the symbols in the templates (both content and page names — the next lines of the csv file) #'@examples -#' bachata <- Batchator$new("http://wiki.lezinter.net", "user","pass") +#' bachata <- Batchator$new("http://my.wiki", "user","pass") #' bachata$loadTemplate("/path/to/template.wiki") #' bachata$loadContent("/path/to/content.csv") #' bachata$setPageNamePattern("Project:Media/Sounds/~word~ (~voice_artist~)") @@ -288,12 +289,12 @@ library(stringr) #' \item{\code{pass}}{The user's password} #' }} #' \item{\code{loadTemplate(file_path)}}{Takes the path of a text file containing a template that will serve as base -#' for all the pages generated. The template should contain occurrences of the fields defined in the \link{content} file.} +#' for all the pages generated. The template should contain occurrences of the fields defined in the content file.} #' \item{\code{setPageNamePattern(naming_pattern)}}{Takes a string of the parttern for the page names that will be generated. -#' The template should contain occurrences of the fields defined in the \link{content} file.} +#' The template should contain occurrences of the fields defined in the content file.} #' \item{\code{loadContent(file_path)}}{Takes the path to a csv file that contains both the list of fields used in the templates (1st line) #' AND the data for each of those fields (following lines).} -#' \item{\code{applyTemplate()}}{Applies the templates defined using \link{loadTemplate}, \link{setPageNamePattern} to the data loaded with \link{loadContent}.} +#' \item{\code{applyTemplate()}}{Applies the templates defined using loadTemplate, setPageNamePattern to the data loaded with loadContent.} #'} #'@importFrom stringr str_replace_all diff --git a/man/Batchator.Rd b/man/Batchator.Rd index 32bd356..df4165a 100644 --- a/man/Batchator.Rd +++ b/man/Batchator.Rd @@ -40,17 +40,17 @@ Uses \link{Mediawikir} to create/edit a batch of mediawiki pages \item{\code{pass}}{The user's password} }} \item{\code{loadTemplate(file_path)}}{Takes the path of a text file containing a template that will serve as base - for all the pages generated. The template should contain occurrences of the fields defined in the \link{content} file.} + for all the pages generated. The template should contain occurrences of the fields defined in the content file.} \item{\code{setPageNamePattern(naming_pattern)}}{Takes a string of the parttern for the page names that will be generated. - The template should contain occurrences of the fields defined in the \link{content} file.} + The template should contain occurrences of the fields defined in the content file.} \item{\code{loadContent(file_path)}}{Takes the path to a csv file that contains both the list of fields used in the templates (1st line) AND the data for each of those fields (following lines).} - \item{\code{applyTemplate()}}{Applies the templates defined using \link{loadTemplate}, \link{setPageNamePattern} to the data loaded with \link{loadContent}.} + \item{\code{applyTemplate()}}{Applies the templates defined using loadTemplate, setPageNamePattern to the data loaded with loadContent.} } } \examples{ - bachata <- Batchator$new("http://wiki.lezinter.net", "user","pass") + bachata <- Batchator$new("http://my.wiki", "user","pass") bachata$loadTemplate("/path/to/template.wiki") bachata$loadContent("/path/to/content.csv") bachata$setPageNamePattern("Project:Media/Sounds/~word~ (~voice_artist~)") -- GitLab