Type: | Package |
Title: | Turn HTML 'Shiny' |
Version: | 1.0.1 |
Author: | Nicholas Jhirad |
Maintainer: | Nicholas Jhirad <lostnfound@gmail.com> |
Description: | Contains functions for converting existing HTML/JavaScript source into equivalent 'shiny' functions. Bootstraps the process of making new 'shiny' functions by allowing us to turn HTML snippets directly into R functions. |
Imports: | shiny (≥ 1.0.3), xml2 (≥ 1.1.1) |
BugReports: | https://github.com/shapenaji/midas/issues |
License: | GPL-3 |
LazyData: | true |
Encoding: | UTF-8 |
RoxygenNote: | 6.0.1 |
NeedsCompilation: | no |
Packaged: | 2017-07-05 12:36:33 UTC; hq-nb-nicholasj |
Repository: | CRAN |
Date/Publication: | 2017-07-05 22:53:56 UTC |
Uses xml2 to parse html text into a list
Description
Uses xml2 to parse html text into a list
Usage
html_to_list(x)
Arguments
x |
string of html |
Value
html as an R list
Examples
# create some test data
html <- '<div class="example"><h3>test</h3></div>'
html_to_list(html)
turns an xml2 list into a shiny function call
Description
turns an xml2 list into a shiny function call
Usage
midas_touch(root)
Arguments
root |
an html list (from xml2 as_list). Note: If the list is particularly deep, you may need to set option(expressions = SOMETHING BIG) |
Value
a function call that produces the equivalent shiny objects
Turns a string of html into the equivalent shiny code
Description
Turns a string of html into the equivalent shiny code
Usage
turn_shiny(html, remove_newlines = TRUE, file = NULL)
Arguments
html |
a string of complete html |
remove_newlines |
whether or not to remove newlines from the string |
file |
default (NULL) is to return the object, if this is set it will write to file |
Value
a function call that produces the equivalent shiny objects
Examples
html <- '<div class="example"><h3>test</h3></div>'
turn_shiny(html)
eval(turn_shiny(html))