Git Product home page Git Product logo

miniverse's Introduction

miniverse

The miniverse is a constellation of packages for creating documents within R.

The purpose of this miniverse package is to:

  1. Highlight the common interface used across the packages
  2. Provide links to the various packages

Installation

You can install miniverse from GitHub with:

# install.packages("devtools")
devtools::install_github("coolbutuseless/miniverse")
devtools::install_github("coolbutuseless/minipdf")
devtools::install_github("coolbutuseless/minihtml")
devtools::install_github("coolbutuseless/minicss")
devtools::install_github("coolbutuseless/minixml")
devtools::install_github("coolbutuseless/minisvg")

# Pattern libraries for `minisvg`
devtools::install_github("coolbutuseless/svgpatternsimple")

Create PDF documents
Github
Online documentation

Create CSS
Github
Online documentation

Create HTML documents
Github
Online documentation

Create XML documents
Github
Online documentation

Create SVG documents
Github
Online documentation

SVG patterns for minisvg
Github
Online documentation

SVG Geologic Patterns for minisvg
Github
Online documentation

High level document description

  • A document is a tree of objects, with a a document node at the root, and element nodes branching from this.
  • A document is represented by a document class e.g. HTMLDocument()
  • Each thing within a document is represented by an element class e.g. HTMLElement()
  • Documents and Elements contain:
    • attributes - information about the item
    • children - nested sub-elements of this element

Initialising a new document

New documents can usually be initialised in 2 ways:

  1. R6 object initialisation
  2. A function call (which just wraps the R6 initialisation call)
package Document R6 initialisation Document function init
minipdf PDFDocument$new() pdf_doc()
minicss StyleSheet$new() css_stylesheet()
minihtml HTMLDocument$new() html_doc()
minixml XMLDocument$new() xml_doc()
minisvg SVGDocument$new() svg_doc()

Initialising a bare element

A bare element can usually be initialised in 3 ways:

  1. R6 object initialisation
  2. A function call (which just wraps the R6 initialisation call)
  3. Using a tag helper method which wraps the R6 initialisation call for a lot of standard elements. This usually includes autocomplete for the arguments for each element.
package Element R6 initialisation Document function init Helper
minipdf PDFCircle$new(), PDFRect$new(), etc pdf_doc() ptag$circle(), ptag$rect(), etc
minicss Style$new() css_style()
minihtml HTMLElement$new() html_elem() htag$title(), htag$div(), etc
minixml XMLElement$new() xml_elem()
minisvg SVGElement$new() svg_elem() stag$circle(), stag$rect(), etc

Appending an element to an existing element or document

After appending a new element, the returned value is the document that was being appended to.

package Append bare element to current element
minipdf PDFCircle$append(), PDFRect$append(), etc
minicss Style$append()
minihtml HTMLElement$append()
minixml XMLElement$append()
minisvg SVGElement$append()

Creating an element directly within an existing element or document

After creating a new element within an existing element, it is the new element that is returned.

package Create element within existing element (specific) Create element within existing element (generic)
minipdf PDFDocument$circle(), PDFDocument$rect(), etc
minicss StyleSheet$add()
minihtml HTMLElement$div(), HTMLDocument$title(), etc HTMLElement$add(), HTMLDocument$add(), etc
minixml XMLElement$add(), XMLDocument$add(), etc
minisvg SVGElement$circle(), SVGDocument$rect() SVGElement$add(), SVGDocument$add(), etc

Update attributes and Add Child Elements

In general when calling $update() on a document or element:

  • Named arguments are added as attributes of the element
  • Unnamed arguments are added as children of the element
package Update attributes and add child elements
minipdf PDFCircle$update(), PDFRect$update(), etc
minicss Style$update()
minihtml HTMLElement$update(), HTMLDocument$update()
minixml XMLElement$update(), XMLDocument$update()
minisvg SVGElement$update(), SVGDocument$update()

Logo

The logo for all the miniverse packages include a drawing of a Mini Cooper S.

miniverse's People

Contributors

coolbutuseless avatar

Watchers

James Cloos avatar

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.