Giter VIP home page Giter VIP logo

rtiddlywiki's Introduction

Caution

This package will modify and delete tidders in Tiddlywiki. Use it with caution. Create a backup and test it before using,

rtiddlywiki

R-CMD-check CRAN_Status_Badge

R interface for tiddlywiki which is a unique non-linear notebook for capturing, organising and sharing complex information.

Communicate with WebServer API for node.js only

WebServer APIs of tiddlywiki are implemented in R interface including GET list of tiddlers by filters, a tiddler, and file; PUT a new tiddler.

tw_options(host = "http://127.0.0.1:8080/")
# Get all tiddlers
get_tiddlers()
# Get a tiddler by title 
get_tiddler(title = "GettingStarted")

# Put a new tiddler 
title <- "New tiddler"
text <- c("!! Section",
          "This is a new tiddler")
type <- "text/vnd.tiddlywiki"
tags <- c("Tag1", "Tag 2")
fields <- c("field 1" = "value 1", "field 2" = "field 2")
put_tiddler(title = title, 
            text = text,
            type = type, 
            tags = tags,
            fields = fields)

Generate markdown tiddler from Rmarkdown file

A new output format tiddler_document is exported to generate markdown tiddler from Rmarkdown file and then PUT into tiddlywiki WebServer. The image files generated by knitr are copied into local folder of tiddlywiki as no PUT file API in tiddlywiki 5.2.2. This is a temporary solution.

Two parameter are used to specify the host of tiddlywiki server and path in the local file system.

A new tiddler in json format is generated in the Rmd folder and can be used to import into tiddlywiki in the server or single file. The tiddler PUT into server if host is specified. All images copy into local file system of tiddlywiki if path is specified.

The yaml header can be specified to export tiddler_document.

title: "R Markdown file"
output: 
  rtiddlywiki::tiddler_document:
    path: "full-path-to-tiddlywiki-project"
    host: "http://127.0.0.1:8080/"
    tags: ["tag 1", "tag 2"]
    fields:
      "field1": "V1"
      "field 2": "Value 2"

The title in the Rmarkdown file is used as tiddler name.

The markdown file is generated by functions rmarkdown::md_document or bookdown::markdown_document2 if use_bookdown is specified.

Installation

Install the developing version from Github.

devtools::install_github('byzheng/rtiddlywiki')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.