Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mediawikiR
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mathieu Loiseau
mediawikiR
Commits
f3dad30d
Commit
f3dad30d
authored
6 years ago
by
Mathieu Loiseau
Browse files
Options
Downloads
Patches
Plain Diff
mediawikir:postContent now allows summary
parent
f6b5a501
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
DESCRIPTION
+1
-1
1 addition, 1 deletion
DESCRIPTION
R/class.R
+6
-5
6 additions, 5 deletions
R/class.R
man/Mediawikir.Rd
+2
-1
2 additions, 1 deletion
man/Mediawikir.Rd
with
9 additions
and
7 deletions
DESCRIPTION
+
1
−
1
View file @
f3dad30d
Package: Mediawikir
Type: Package
Title: Connects to a mediawiki instance and writes in it what you want
Version: 0.1.
9
Version: 0.1.
10
Author: Mathieu Loiseau
Maintainer: Mathieu Loiseau <loiseaum@univ-grenoble-alpes.fr>
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.
...
...
This diff is collapsed.
Click to expand it.
R/class.R
+
6
−
5
View file @
f3dad30d
...
...
@@ -62,7 +62,8 @@ library(stringr)
#' \item{\code{raw} → No editing of the content}{}
#' }}
#' }}
#' \item{\code{postContent()}}{To replace the content of \code{page} with \code{content}}
#' \item{\code{postContent(comment)}}{To replace the content of the \code{page} (attribute) with \code{content} (attribute).
#' Parameter \code{comment} specifies the description of the modification, default is \code{“R generated content”}}
#' \item{\code{uploadFile(file_path, file_name)}}{To upload a file to the server (will overwrite existing files)
#' \describe{
#' \item{\code{file_path}}{Path to the file to upload to the server}
...
...
@@ -182,7 +183,7 @@ Mediawikir <- R6Class("Mediawikir",
######
# postContent
######
postContent
=
function
(){
postContent
=
function
(
comment
=
"R generated content"
){
success
<-
TRUE
tryCatch
(
{
#Verify that a page has been selected
...
...
@@ -216,7 +217,7 @@ Mediawikir <- R6Class("Mediawikir",
fields
<-
list
(
action
=
"edit"
,
title
=
self
$
page
,
#basetimestamp = "TODO",
summary
=
"R generated cont
ent
"
,
summary
=
comm
ent
,
format
=
"json"
,
text
=
self
$
content
,
token
=
response
$
query
$
tokens
$
csrftoken
)
...
...
@@ -225,7 +226,7 @@ Mediawikir <- R6Class("Mediawikir",
fields
<-
list
(
action
=
"edit"
,
pageid
=
self
$
page
,
#basetimestamp = "TODO",
summary
=
"R generated cont
ent
"
,
summary
=
comm
ent
,
format
=
"json"
,
text
=
self
$
content
,
token
=
response
$
query
$
tokens
$
csrftoken
)
...
...
@@ -293,7 +294,7 @@ Mediawikir <- R6Class("Mediawikir",
if
(
newText
!=
formerText
){
self
$
resetContent
()
self
$
addContent
(
newText
,
"raw"
)
success
<-
self
$
postContent
()
success
<-
self
$
postContent
(
paste
(
field
,
" → "
,
newValue
,
sep
=
""
)
)
}
else
{
success
<-
paste
(
"No modification of "
,
self
$
page
,
" due to setting “"
,
field
,
"” to “"
,
newValue
,
"”."
,
sep
=
""
)
...
...
This diff is collapsed.
Click to expand it.
man/Mediawikir.Rd
+
2
−
1
View file @
f3dad30d
...
...
@@ -60,7 +60,8 @@ A Mediawikir controller serves to connect to a mediawiki API as a registered use
\item{\code{raw} → No editing of the content}{}
}}
}}
\item{\code{postContent()}}{To replace the content of \code{page} with \code{content}}
\item{\code{postContent(comment)}}{To replace the content of the \code{page} (attribute) with \code{content} (attribute).
Parameter \code{comment} specifies the description of the modification, default is \code{“R generated content”}}
\item{\code{uploadFile(file_path, file_name)}}{To upload a file to the server (will overwrite existing files)
\describe{
\item{\code{file_path}}{Path to the file to upload to the server}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment