Type: | Package |
Title: | R Interface for 'TiddlyWiki' |
Version: | 0.1.0 |
Author: | Bangyou Zheng |
Maintainer: | Bangyou Zheng <Bangyou.Zheng@csiro.au> |
Description: | 'TiddlyWiki' is a unique non-linear notebook for capturing, organising and sharing complex information. 'rtiddlywiki' is a R interface of 'TiddlyWiki' https://tiddlywiki.com to create new tiddler from Rmarkdown file, and then put into a local 'TiddlyWiki' node.js server if it is available. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
URL: | https://rtiddlywiki.bangyou.me/, https://github.com/byzheng/rtiddlywiki |
BugReports: | https://github.com/byzheng/rtiddlywiki/issues |
Imports: | settings, httr, rmarkdown, utils, jsonlite, bookdown, stringr |
RoxygenNote: | 7.1.2 |
Suggests: | covr, knitr, testthat (≥ 3.0.0) |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2022-07-05 03:25:48 UTC; zhe00a |
Repository: | CRAN |
Date/Publication: | 2022-07-05 21:00:02 UTC |
Generate tiddler in json format
Description
Generate tiddler in json format
Usage
.tiddler_json(
title,
text,
type = c("text/vnd.tiddlywiki", "text/x-tiddlywiki", "text/x-markdown", "text/html",
"text/plain"),
tags = NULL,
fields = NULL
)
Arguments
title |
tiddler title |
text |
tiddler text |
type |
tiddler type |
tags |
a vector for tiddler tags |
fields |
a named vector for tiddler fields. |
Value
New tiddler in json format
Get a tiddler
Description
Get a tiddler
Usage
get_tiddler(title)
Arguments
title |
title of the tiddler to retrieve |
Value
tiddler information in JSON format
Examples
## Not run:
get_tiddler("GettingStarted")
## End(Not run)
Get all tiddlers
Description
Get all tiddlers
Usage
get_tiddlers(filter = NULL, exclude = NULL)
Arguments
filter |
filter identifying tiddlers to be returned (optional, defaults to "[all[tiddlers]!is[system]sort[title]]") |
exclude |
comma delimited list of fields to excluded from the returned tiddlers (optional, defaults to "text") |
Value
all tiddlers information in JSON format
Examples
## Not run:
#' Get all tiddlers
get_tiddlers()
## End(Not run)
Put a tiddler
Description
Put a tiddler
Usage
put_tiddler(
title,
text,
type = c("text/vnd.tiddlywiki", "text/x-tiddlywiki", "text/x-markdown", "text/html",
"text/plain"),
tags = NULL,
fields = NULL
)
Arguments
title |
tiddler title |
text |
tiddler text |
type |
tiddler type |
tags |
tiddler tags |
fields |
a named vector for tiddler fields |
Value
null if success
Examples
## Not run:
title <- "New tiddler"
text <- c("!! Section",
"This is a new tiddler")
type <- "text/vnd.tiddlywiki"
tags <- c("Tag1", "Tag 2")
fields <- c("F1" = "V1", "F2" = "V2")
put_tiddler(title = title,
text = text,
type = type,
tags = tags,
fields = fields)
## End(Not run)
Perform a request to TiddlyWiki WebServer
Description
Perform a request to TiddlyWiki WebServer
Usage
request(method, path = "/", query = list(), ...)
Arguments
method |
The method in the httr package, e.g. GET, POST |
path |
The path of request |
query |
The query of request |
... |
Other arguments of request |
Value
The contents of response
Format for converting from R Markdown to another tiddler markdown
Description
Format for converting from R Markdown to another tiddler markdown
Usage
tiddler_document(
host = NULL,
path = NULL,
tags = NULL,
fields = NULL,
use_bookdown = FALSE,
overwrite = FALSE,
...
)
Arguments
host |
the host of tiddlywiki web server |
path |
The folder of tiddlywiki. Temp solution as no PUT file api in tiddlywiki WebServer. |
tags |
tiddler tags |
fields |
a named vector for tiddler fields |
use_bookdown |
logical. Use bookdown to generate markdown file. |
overwrite |
whether to overwrite the existing tiddler. |
... |
Other argument pass to md_document |
Value
R Markdown output format to pass to render()
Examples
## Not run:
library(rmarkdown)
render("input.Rmd")
## End(Not run)
Set or get options for my package
Description
Set or get options for my package
Usage
tw_options(...)
Arguments
... |
Option names to retrieve option values or |
Value
the default and modified options.
Supported options
The following options are supported
host
character
host of tiddlywiki
Examples
tw_options(host = "http://127.0.0.1:8080/")
Reset global options for pkg
Description
Reset global options for pkg
Usage
tw_reset()
Value
the default options
Examples
tw_options()