The miniverse
is a constellation of packages for creating documents within R.
The purpose of this miniverse
package is to:
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 |
HTMLDocument()
HTMLElement()
New documents can usually be initialised in 2 ways:
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() |
A bare element can usually be initialised in 3 ways:
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 |
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() |
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 |
In general when calling $update()
on a document or 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()
|