diff --git a/DESCRIPTION b/DESCRIPTION index b3bee77f9387b67b44ebe17a8dc82d9e74c295c3..3c10292ab22a26bc25f8dd92a57e8b11ec9e93ab 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 24af10ea497fd0acb901b3dfb217a7c5d4d5ff02..6796d1a09e7cd28074f742d943b44a5af3db4085 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 32bd3566c08ebbc6cccf00a61e4aeb8132f61d15..df4165a9de6e2deb3b0587b125cd5aebcd80091f 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~)")