flowtype: flowtype.js for a better reading experience

Description Usage Arguments Examples

Description

One and only function of this htmlwidget which runs flowtype.js on a CSS selector of your choice. By default, body will be the CSS selector, so all text on the page will adjust to flowtype.

Usage

1
2
3
flowtype(selector = "body", minimum = NULL, maximum = NULL,
  minFont = NULL, maxFont = NULL, fontRatio = NULL, width = 0,
  height = 0)

Arguments

selector

string of a valid CSS selector. body is the default.

minimum

integer see Thresholds

maximum

integer see Thresholds

minFont

integer see Thresholds

maxFont

integer see Thresholds

fontRatio

integer see Font-size

width

a valid CSS size for the width of the htmlwidget container div. The default is 0 since we expect the container to be invisible.

height

a valid CSS size for the height of the htmlwidget container div. The default is 0 since we expect the container to be invisible.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
## Not run: 
library("flowtypeR")
library("htmltools")

#  get NEWS from http://cran.r-project.org/doc/manuals/r-devel/NEWS.html
browsable(
  tagList(
    HTML(
      readLines("http://cran.r-project.org/doc/manuals/r-devel/NEWS.html")[8:145]
    )
    ,flowtype()
  )
)

# using about.html from R help
library("flowtypeR")
library("htmltools")
library("shiny")

about_html <- readLines(file.path(R.home("doc/html"),"about.html"))
browsable(
  tagList(
    bootstrapPage(
      tags$div(class="row"
        ,tags$div(class="col-xs-6"
          ,tags$h1("with flowtype")
          ,tags$div(
            id="flowtype-resize"
            ,style="padding:0em 1em 0em 1em; border: 2px solid gray;"
            ,HTML(
              about_html[do.call(seq,as.list(grep(x=about_html,pattern="<h2>")+c(0,-1)))]
            )
          )
        )
        ,tags$div(class="col-xs-6"
          ,tags$h1("without flowtype")
          ,tags$div(id="flowtype-resize"
            ,style="padding:0em 1em 0em 1em; border: 2px dashed gray;"
            ,HTML(
              about_html[do.call(seq,as.list(grep(x=about_html,pattern="<h2>")+c(0,-1)))]
            )
          )
        )
      )
    )
    ,flowtype(
      '#flowtype-resize'
      ,minFont = 12
      ,fontRatio = 20
    )
  )
)

## End(Not run)

timelyportfolio/flowtypeR documentation built on May 31, 2019, 1:50 p.m.