Просмотр исходного кода

Tweak styles and headers in view_regex()

tags/v0.1.4
Garrick Aden-Buie 8 лет назад
Родитель
Сommit
cf640fc45c
2 измененных файлов: 18 добавлений и 4 удалений
  1. +4
    -4
      R/run_regex.R
  2. +14
    -0
      inst/styles/style.css

+ 4
- 4
R/run_regex.R Просмотреть файл

if (!render) return(res) if (!render) return(res)
head <- c( head <- c(
"---", "pagetitle: View Regex", "---", "---", "pagetitle: View Regex", "---",
"<h5>Regex</h5>",
"<h5>Pattern</h5>",
"<p><pre>", wrap_regex(pattern, escape, exact), "</pre></p>", "<p><pre>", wrap_regex(pattern, escape, exact), "</pre></p>",
"<h5>Results</h5>"
"<h5>Matches</h5>"
) )
res <- c(head, res) res <- c(head, res)
tmp <- tempfile(fileext = ".Rmd") tmp <- tempfile(fileext = ".Rmd")
tmp_html <- suppressWarnings( tmp_html <- suppressWarnings(
rmarkdown::render( rmarkdown::render(
tmp, tmp,
output_format = rmarkdown::html_document(css = c(system.file("styles", 'style.css', package='regexplain'),
system.file("styles", 'skeleton.css', package='regexplain')),
output_format = rmarkdown::html_document(css = c(system.file("styles", 'skeleton.css', package='regexplain'),
system.file("styles", 'style.css', package='regexplain')),
theme = NULL), theme = NULL),
quiet = TRUE quiet = TRUE
)) ))

+ 14
- 0
inst/styles/style.css Просмотреть файл

padding-bottom: 25px; padding-bottom: 25px;
margin-bottom: 25px; margin-bottom: 25px;
} }

pre,
blockquote,
dl,
figure,
table,
p,
ul,
ol,
form {
margin-bottom: 1rem; }

body {
line-height: 18px;}

Загрузка…
Отмена
Сохранить