Knitr / rmkarkdown html (document or laptop) larger than 700 KB, even without images

If I embed a very simple .Rmd file in html, even if no images or code are included, I get an html file larger than 700 KB.

    ---
    title: "Hello world!"
    output:
      html_document: default
      html_notebook: default
    ---

    Nothing else to say, really.

If I insert the above snippet as a “test”, I get a test.html file of 708.6 kilobytes in size and a test.nb.html file, which is 765.7 kb.

Is there a way to reduce the size of the html file?

Other apparently similar questions about stackoverflow are actually related to reducing the file size of html files containing images.

+4
source share
1 answer

, javascript (bootstrap, highlight, jquery, navigation) base64. .: http://rmarkdown.rstudio.com/html_document_format.html#document_dependencies

javascript , :

---
title: "Hello world!"
output:
  html_document:
    self_contained: false
    lib_dir: libs
---

Nothing else to say, really.

html ~ 2.7kB libs javascript. libs 4 . javascript, html .

, html_fragment (http://rmarkdown.rstudio.com/html_fragment_format.html):

---
title: "Hello world!"
output:
  html_fragment: default
---

Nothing else to say, really.

html-, html-, -. test.html 36 . .

html pandoc: http://rmarkdown.rstudio.com/html_document_format.html#custom_templates

+4

Source: https://habr.com/ru/post/1664261/


All Articles