Code Monkey home page Code Monkey logo

markdowntemplates's Introduction

output
html_document md_document
keep_md
true
variant
markdown_github

Build Status

A package of R markdown templates and knitr knit engine replacments

These are a set of alternate R markdown templates that do not use Bootstrap and do not include or rely on jQuery. These are primarily here for demonstration purposes but are also useful in and of themselves (it's always good to have choices). If you have a particular framework you like and it's not here, file an issue and I'll add it.

  • bulma (output: markdowntemplates::bulma) uses the Bulma CSS framework and has optional navlink YAML header elements and also has support for arbitrary footer content & a subset of OpenGraph tags (see the example Rmd) which will be used in header of the generated file.
  • skeleton (output: markdowntemplates::skeleton) or default (output: markdowntemplates::default) uses the Skeleton CSS framework and has optional navlink YAML header elements and also has support for arbitrary footer content & a subset of OpenGraph tags (see the example Rmd) which will be used in header of the generated file.
  • kube (output: markdowntemplates::kube) uses the Kube CSS framework (contributed by Kieran Healy)
  • minimal (output: markdowntemplates::minimal) uses no CSS framework and only uses the title YAML header element.
  • hugo (output: markdowntemplates::hugo) produces markdown suitable for Hugo websites. It makes a broad assumption that you will save/use the hugo document in the content directory of your Hugo websites.
  • prismpress (output: markdowntemplates::prismpress) produces markdown suitable for use in WordPress with Jetpack (markdown-enabled) and Prism
  • prismskel (output: markdowntemplates::hrbrskel) is a revamp of the skeleton template that has top navbar and footer as optional, uses different base colors, is Fira Sans/Fira Code-based and uses Prism for code highlighting with a dark theme.

When you use RStudio to create a new R Markdown document, select "From Template" and choose one of these templates.

knit engine replacements

  • to_jupyter() : uses notedown to make an ipynb out of an Rmd If you create an R markdown (Rmd) document with the following YAML header:


    knit: markdowntemplates::to_jupyter run: false

The to_jupyter() engine will be used and notedown will be used to convert the notebook to a Jupyter (ipynb) notebook. The run parameter is optional. If not present or set to true the notebook will be executed as it is converted to a Jupyter notebook. The engine is also now smart enough to detect the absence of pure R code chunks and avoid including of:

%load_ext rpy2.ipython

at the top of the notebook.

Installation

Since the package is not on CRAN yet, you have to install it devtools-style

devtools::install_git("https://sr.ht/~hrbrmstr/markdowntemplates")
# OR
devtools::install_git("https://gitlab.com/hrbrmstr/markdowntemplates")
# OR
devtools::install_github("hrbrmstr/markdowntemplates")

Bulma example

Skeleton/default example

Kube example

Minimal example

markdowntemplates's People

Contributors

hrbrmstr avatar jankatins avatar jemus42 avatar kjhealy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

markdowntemplates's Issues

CRAN release?

I'm hoping to write a post for the RStudio blog soon about custom R Markdown formats and as part of that want to point to formats currently available on CRAN (may even to do a "gallery" page on rmarkdown.rstudio.com). Do you think these formats will hit CRAN soon so I can include them?

Color code chunks

Hello, good afternoon / evening. I would like to know if there is any way in which the code chunks can have different colors in the "skeleton" template, since there all the codes look gray and I would like something more pleasant to look at.

Thanks for reading me

Possible new github_document variant

Surprisingly, pandoc's line endings vary based upon the OS it's running under (jgm/pandoc#2097). This causes me some grief as I try to keep my docs using UNIX. This could be addressed by wrapping the existing github_document template with a post_processor that calls dos2unix (or some more universal solution for Windows OS).

Would you like a PR to add such a template or does that make sense in a different repo? I know your feelings on Windows. 😃

Can't install package

Can't install:

> install.packages("markdowntemplates")
Installing package into ‘D:/Users/geo_gusc/Documents/R/win-library/3.2’ (as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘markdowntemplates’ is not available (for R version 3.2.3)

Here my sessioninfo:

> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

[Questions] When creating Rmd from template, YAML title field is not populated with entered title

…instead, the file is placed in a folder named after the entered title.
I get that this might me intended behavior, however, "normal" Rmd documents behave differently, and I feel it would be more adequate to mimic that behavior (i.e. creating a file with entered name and title: in the working directory, since the template only produces a single HTML file anyway, thereby I don't see the need for an enclosing folder.

Thoughts?

Figure captions

Hi, thanks for the great templates. I'm new to markdown and when I add an image from a file I don't seem to be able to have the caption displayed (it works with the standard markdown templates such as Bioconductor template). Is there a way to change this?
Thanks

Print out Hugo shortcodes

In my Rmd file for Hugo output I am trying to print out a shortcode which looks like this:
{{< highlight >}}.
I tried a couple of ways:

{r chunk, echo=FALSE, results='asis'}
cat("{{< highlight >}}")

but this produces {{&lt; highlight &gt;}} when rendered.

On the other hand, if I use

{r chunk, echo=FALSE}
cat("{{< highlight >}}")

I get:

    ## {{< highlight >}}

So, neither approach renders the Hugo shortcode properly.

I apologize if this is a rmarkdown/knitr/pandoc question, but was hoping that you had come across this with Hugo and could point me in the right direction.

Can I use 'toc' function in those templates

Hi, I'm a newer of R markdown.
Can I use 'toc' function in those templates?
I Followed the Definitive Guide book, something like:

output:
html_document:
toc:ture
toc_depth:3

Skeleton navlink broken

There seems to be some accidental HTML escaping in the navlink code.

Example result:

HTML source of affected area:

<div class="hdr u-max-full-width"><a href="&lt;a href=" http: stats.jemu.name qm" class="uri">http://stats.jemu.name/qm</a>&quot;&gt;QM Aufgaben</a></div>

YAML used:


---
title: "Title"
author: "Jemus42"
navtitle: "QM Aufgaben"
navlink: "http://stats.jemu.name/qm"
date: "`r Sys.Date()`"
output: markdowntemplates::skeleton

---

Version:
markdowntemplates 0.3.2.9000 2016-02-06 Github (hrbrmstr/markdowntemplates@33b2ed5)

Hugo: YAML not rendered in ouput md file

I am sure there is a reason why you left out the preserve_yaml argument in the md_document function in hugo.R, but am wondering if there might be a way to set additional values in the front matter of the Rmd file that are preserved for use in Hugo.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.