All Projects → yixuan → Prettydoc

yixuan / Prettydoc

Creating Pretty HTML From R Markdown

Projects that are alternatives of or similar to Prettydoc

Remarkdown
Styling HTML as if it were raw Markdown text.
Stars: ✭ 141 (-58.28%)
Mutual labels:  markdown, scss
Stylelint
A mighty, modern linter that helps you avoid errors and enforce conventions in your styles.
Stars: ✭ 9,350 (+2666.27%)
Mutual labels:  markdown, scss
Vscode Stylelint
A Visual Studio Code extension to lint CSS/SCSS/Less with stylelint
Stars: ✭ 260 (-23.08%)
Mutual labels:  markdown, scss
Prettier
Prettier is an opinionated code formatter.
Stars: ✭ 41,411 (+12151.78%)
Mutual labels:  markdown, scss
Grav Plugin Admin
Grav Admin Plugin
Stars: ✭ 316 (-6.51%)
Mutual labels:  markdown, scss
Devportfolio
A lightweight, customizable single-page personal portfolio website template built with JavaScript and Sass
Stars: ✭ 3,582 (+959.76%)
Mutual labels:  scss
Greybird
Desktop Suite for Xfce
Stars: ✭ 329 (-2.66%)
Mutual labels:  scss
Md Writer
✒️ Make Atom a better Markdown/AsciiDoc editor for writers and bloggers
Stars: ✭ 326 (-3.55%)
Mutual labels:  markdown
Rigel
🌌 Colorscheme for vim, terminal, vscode and slack - based on the star Rigel ✨.
Stars: ✭ 324 (-4.14%)
Mutual labels:  markdown
Markdown Loader
markdown loader for webpack
Stars: ✭ 335 (-0.89%)
Mutual labels:  markdown
Restapidocs
Templates for documenting REST APIs
Stars: ✭ 327 (-3.25%)
Mutual labels:  markdown
Centurion
Centurion is a web-based framework for rapid prototyping and building larger web projects.
Stars: ✭ 327 (-3.25%)
Mutual labels:  scss
Papercss
PaperCSS was originally made by @rhyneav to be something different than the typical mODerN STylEs and clean pages found in every other CSS framework. It was built with LESS and deployed on a single index.html page before being open sourced. It has since evolved; The CSS source has been rewritten in SCSS and the documentation is now built with Hugo (all thanks to some wonderful contributors). In addition to the original creator, it is maintained by @Fraham and @TotomInc.
Stars: ✭ 3,539 (+947.04%)
Mutual labels:  scss
Pug Starter
Simple pug (jade) starter [framework] enabling faster delivery of HTML & CSS projects to a private server and/or automatic deployment of GitHub pages.
Stars: ✭ 328 (-2.96%)
Mutual labels:  scss
Phenomic
DEPRECATED. Please use Next.js instead.
Stars: ✭ 3,264 (+865.68%)
Mutual labels:  markdown
Breakpoint Slicer
Slice media queries with ease
Stars: ✭ 332 (-1.78%)
Mutual labels:  scss
Issues
Caret issues
Stars: ✭ 326 (-3.55%)
Mutual labels:  markdown
Stackedit
In-browser Markdown editor
Stars: ✭ 18,744 (+5445.56%)
Mutual labels:  markdown
File System React
File System UI in Web using react
Stars: ✭ 331 (-2.07%)
Mutual labels:  scss
Notable
The Markdown-based note-taking app that doesn't suck.
Stars: ✭ 18,866 (+5481.66%)
Mutual labels:  markdown

Creating Pretty Documents From R Markdown

Have you ever tried to find a lightweight yet nice theme for the R Markdown documents, like this page?

Themes for R Markdown

With the powerful rmarkdown package, we could easily create nice HTML document by adding some meta information in the header, for example

---
title: Nineteen Years Later
author: Harry Potter
date: July 31, 2016
output:
  rmarkdown::html_document:
    theme: lumen
---

The html_document engine uses the Bootswatch theme library to support different styles of the document. This is a quick and easy way to tune the appearance of your document, yet with the price of a large file size (> 700KB) since the whole Bootstrap library needs to be packed in.

For package vignettes, we can use the html_vignette engine to generate a more lightweight HTML file that is meant to minimize the package size, but the output HTML is less stylish than the html_document ones.

So can we do BOTH, a lightweight yet nice-looking theme for R Markdown?

The prettydoc Engine

The answer is YES! (At least towards that direction)

The prettydoc package provides an alternative engine, html_pretty, to knit your R Markdown document into pretty HTML pages. Its usage is extremely easy: simply replace the rmarkdown::html_document or rmarkdown::html_vignette output engine by prettydoc::html_pretty in your R Markdown header, and use one of the built-in themes and syntax highlighters. For example

---
title: Nineteen Years Later
author: Harry Potter
date: July 31, 2016
output:
  prettydoc::html_pretty:
    theme: cayman
    highlight: github
---

You can also create documents from prettydoc templates in RStudio.

Step 1: Click the "New File" button and choose "R Markdown".

Step 1

Step 2: In the "From Template" tab, choose one of the built-in templates.

Step 2

Options and Themes

The options for the html_pretty engine are mostly compatible with the default html_document (see the documentation) with a few exceptions:

  1. Currently the theme option can take the following values. More themes will be added in the future.
    • cayman: Modified from the Cayman theme.
    • tactile: Modified from the Tactile theme.
    • architect: Modified from the Architect theme.
    • leonids: Modified from the Leonids theme.
    • hpstr: Modified from the HPSTR theme.
  2. The highlight option takes value from github and vignette.
  3. A new math parameter to choose between mathjax and katex for rendering math expressions. The katex option supports offline display when there is no internet connection.
  4. Options code_folding, code_download and toc_float are not applicable.

Offline Math Expressions

By default, html_pretty uses MathJax to render math expressions. However, using MathJax requires an internet connection. If you need to create documents that can show math expressions offline, simply add one line math: katex to the document metadata:

---
title: Nineteen Years Later
author: Harry Potter
date: July 31, 2016
output:
  prettydoc::html_pretty:
    theme: cayman
    highlight: github
    math: katex
---

This option will enable KaTeX for rendering the math expressions, and all resource files will be included in for offline viewing. The offline document will be ~800k larger.

Related Projects

  • tufte provides the Tufte style for R Markdown documents.
  • BiocStyle provides standard formatting styles for Bioconductor PDF and HTML documents.
  • rmdformats by Julien Barnier contains HTML formats and templates for R Markdown documents, with some extra features such as automatic table of contents, lightboxed figures, and dynamic crosstab helper.
  • markdowntemplates by Bob Rudis is a collection of alternative R Markdown templates.
  • prettyjekyll by Florian Privé uses prettydoc to convert R Markdown documents to Jekyll Markdown for blog posting.

Gallery

Here are some screenshots of the HTML pages generated by prettydoc with different themes and syntax highlighters.

Cayman (demo page)

Cayman Theme

Tactile (demo page)

Tactile Theme

Architect (demo page)

Architect Theme

Leonids (demo page)

Leonids Theme

HPSTR (demo page)

HPSTR Theme
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].