Git Product home page Git Product logo

Comments (6)

jimhester avatar jimhester commented on August 20, 2024

I am not at a computer so I can't be positive this is the problem, but it
looks like from your example you do not call the knitr render_markdown
function. Put that function in the first code block or in a setup block
and it should work. I will take a look at this and make sure I am correct
when I can. Sorry fir the problems, there is not a great way for me to fix
this particular issue transparently unfortunately.
On Oct 13, 2013 2:39 PM, "Carson" [email protected] wrote:

This probably isn't a real issue (just me being ignorant), but for some
reason, I can't get proper code highlighting using the RStudio option:

options(rstudio.markdownToHTML =
function(inputFile, outputFile) {
require(knitrBootstrap)
knit_bootstrap_md(input=inputFile, output=outputFile)
}
)

I've also tried changing the default code_style option:

options(rstudio.markdownToHTML =
function(inputFile, outputFile) {
require(knitrBootstrap)
knit_bootstrap_md(input=inputFile, output=outputFile, code_style='tomorrow')
}
)

Not sure how I can provide a reproducible example, but herehttps://github.com/cpsievert/cpsievert.github.com/tree/master/projects/615/HW4is what I'm working on. Also, I'm using RStudio version 0.98.313 and here
is my sessionInfo:

R version 3.0.1 (2013-05-16)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] knitrBootstrap_0.8.0 markdown_0.6.3 knitr_1.5 dlm_1.1-3 XML2R_0.1
[6] roxygen2_2.2.2 digest_0.6.3 devtools_1.3

loaded via a namespace (and not attached):
[1] brew_1.0-6 evaluate_0.5 formatR_0.9 httr_0.2 memoise_0.1 parallel_3.0.1 plyr_1.8 RCurl_1.95-4.1
[9] stringr_0.6.2 tools_3.0.1 whisker_0.3-2 XML_3.95-0.2


Reply to this email directly or view it on GitHubhttps://github.com//issues/25
.

from knitrbootstrap.

cpsievert avatar cpsievert commented on August 20, 2024

I just tried that and it doesn't seem to help. I also pushed the changes to the input file to make sure I'm not missing something...

from knitrbootstrap.

jimhester avatar jimhester commented on August 20, 2024

Sorry I told you the wrong function the first time. The function you need to call is knitr::render_html() Code highlighting in your example seems to work fine once you do that. My apologies, I should have proof read my email more thoroughly the first time.

from knitrbootstrap.

cpsievert avatar cpsievert commented on August 20, 2024

Ah, yes. That was the issue. One more thing. I noticed that the cached code chunks aren't highlighted. Is there a workaround for that? My instinct would be to add echo=FALSE the cached chunk, then rewrite that chunk with eval=FALSE, but that is obviously not optimal.

from knitrbootstrap.

jimhester avatar jimhester commented on August 20, 2024

That is just because the result is cached from before you added
render_html(). Just delete your cache and rerun and it will work properly.

On Sun, Oct 13, 2013 at 4:50 PM, Carson [email protected] wrote:

Ah, yes. That was the issue. One more thing. I noticed that the cached
code chunks aren't highlighted. Is there a workaround for that? My instinct
would be to add echo=FALSE the cached chunk, then rewrite that chunk with
eval=FALSE, but that is obviously not optimal.


Reply to this email directly or view it on GitHubhttps://github.com//issues/25#issuecomment-26226758
.

from knitrbootstrap.

cpsievert avatar cpsievert commented on August 20, 2024

Awesome. Looks good now. Thanks!

from knitrbootstrap.

Related Issues (20)

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.