loading...

This is the vignettes/test/rendering.Rmd file from {pkgdown} copied here to see how pages render with the {svPkgdown} style, and amended with more examples.

The {svPkgdown} styles have been made as close as possible as the styles used in the SciViews blogdown pages at https://www.sciviews.org. However, there are a few differences:

  • Presentation of chunks inputs/outputs differ. Here, input and outputs are in the same boxes, and a copy to clipboard button is available at the top right, while in the blogdown, chunks inputs and outputs are separated and styled differently for a better perception (with varying styles for normal outputs, errors and warnings)

  • Syntax highlighting use different coloring schemes and here, recognized R functions are links to their man pages on the web.

  • Figures and tables are not numbered here, and it is not possible to reference to them (a mechanism available in bookdown/blogdown). Table styling is also a little bit different, and they are left-aligned here while they are centered in blogdown.

Now a couple of tests.. borrowed from {pkgdown}

This vignette tests {pkgdown} output rendering for several use cases.

Highlighting

This document uses a variety of linking styles for testing purposes

These shouldn’t be linked.

  • Authors@R
  • content-home.html
  • toc: depth
  • x = y

Code blocks

# Shouldn't get linked
enlist(5)
# Should get linked
MASS::enlist(5)
library(MASS)
enlist(5)
#> [[1]]
#> [1] 5
# Should get linked because MASS was loaded previously
enlist(5)
#> [[1]]
#> [1] 5

Figures

plot(1:10)


External files

x <- readLines("test.txt")
x
#> [1] "a" "b" "c" "d"


Details tag

This should only be shown when required
Some R code
1 + 2
#> [1] 3

Tables

col 1 col 2 col 3 col 4
Brightness Total brightness, total reflectance, spectral intensity y=x2y = x^2 test

Mathjax

f(x)=12πσ2e(xμ2)2σ2f(x) = \dfrac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{(x-\mu^2)}{2\sigma^2}}

Inline equations: y=x2y=x^2


Widgets

Test spacing above widget.

Test spacing below widget.


Crayon

cat(crayon::red("This is red"), "\n")
#> This is red

cat(crayon::blue("This is blue\n"), "\n")
#> This is blue
#> 

message(crayon::green("This is green"))
#> This is green

warning(crayon::bold("This is bold"))
#> Warning: This is bold

Some text

stop(crayon::italic("This is italic"))
#> Error in eval(expr, envir, enclos): This is italic

Some more text