Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Maintenance for rmarkdown #18

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ cd "$TM_PROJECT_DIRECTORY"
cd "$DIR"

# Prepare output window.
html_header 'knit html result with knitrBootstrap' "$FILENAME"
echo '<h2>Kniting…</h2>'
html_header 'render with rmarkdown' "$FILENAME"
echo '<h2>Rendering…</h2>'

# Choose R from the TextMate TM_REXEC variable or default to R
if [ "$TM_REXEC" = "" ]
Expand All @@ -42,10 +42,9 @@ fi

# Define working dir
SW=${TM_SWEAVE_WD:=${TM_DIRECTORY}}
# Actually run knitrBoostrap
# More info at http://cran.at.r-project.org/web/packages/knitrBootstrap/index.html
# You might want to change the code style, which 'chooser's so show and whether you want to show the code, figures, etc.
echo -e "setwd('$SW');library(knitrBootstrap); if(packageVersion('knitrBootstrap') < '1.0.0') knit_bootstrap('$FILENAME', code_style='Brown Paper', chooser=c('boot', 'code'), show_code=FALSE) else library(rmarkdown); render('$FILENAME', bootstrap_document(theme.chooser=TRUE, highlight.chooser=TRUE, highlight='Brown Paper'))" | ${USE_THIS_R} --vanilla --quiet | pre
# Render with rmarkdown
# Specify proper YAML, more info at http://rmarkdown.rstudio.com/
echo -e "setwd('$SW'); library(rmarkdown); render('$FILENAME')" | ${USE_THIS_R} --vanilla --quiet | pre

# If there is output and it's newer than the current document, then we go directly to preview or link to it.

Expand All @@ -62,7 +61,7 @@ html_footer
<key>keyEquivalent</key>
<string>~t</string>
<key>name</key>
<string>knit to html with knitrBootstrap</string>
<string>knit to html with rmarkdown</string>
<key>outputCaret</key>
<string>afterOutput</string>
<key>outputFormat</key>
Expand Down
2 changes: 1 addition & 1 deletion Snippets/Fenced code block.tmSnippet
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>content</key>
<string>\`\`\`${1|,css,js,javascript,coffee,coffeescript,elixir,r,bash,ruby,shell,haml,html|}
<string>\`\`\`${1|,css,js,javascript,coffee,coffeescript,elixir,{r},bash,ruby,shell,haml,html|}
${0:${TM_SELECTED_TEXT}}
\`\`\`
</string>
Expand Down