Permalink
Browse files

move .header.hi.html inside render_html where it is used

  • Loading branch information...
1 parent dc49e76 commit 4502202931ba4b6a058a68f075ab672f7584aebb @ramnathv committed Mar 26, 2012
Showing with 6 additions and 7 deletions.
  1. +6 −1 R/hooks.R
  2. +0 −6 R/themes.R
View
@@ -342,7 +342,12 @@ render_html = function() {
function (x, options) sprintf('<div class="%s">%s</div>', name, x)
}
h = opts_knit$get('header')
- if (!nzchar(h['highlight'])) set_header(highlight = .header.hi.html)
+ if (!nzchar(h['highlight'])) {
+ # CSS for html syntax highlighting
+ .header.hi.html = paste(theme_to_header_html('default')$highlight,
+ collapse = '\n')
+ set_header(highlight = .header.hi.html)
+ }
z = list()
for (i in c('source', 'output', 'warning', 'message', 'error'))
z[[i]] = html.hook(i)
View
@@ -97,9 +97,3 @@ theme_to_header_html <- function(theme){
return(list(highlight = css))
}
-# TODO: may want to move it back to header.R. currently theme_to_header_latex
-# is not recognized in header.R probably because it is loaded first.
-
-
-# CSS for html syntax highlighting
-.header.hi.html = paste(theme_to_header_html('default')$highlight, collapse = '\n')

0 comments on commit 4502202

Please sign in to comment.