Navigation Menu

Skip to content

Commit

Permalink
correct handling of preamble
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Jan 31, 2013
1 parent 575f47d commit 46c7001
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/cpp/session/modules/learning/SessionLearning.cpp
Expand Up @@ -256,6 +256,7 @@ void handleLearningPaneRequest(const http::Request& request,
// build template variables
std::map<std::string,std::string> vars;
vars["title"] = slideDeck.title();
vars["preamble"] = slideDeck.preamble();
vars["slides"] = slides;
vars["slide_commands"] = slideCommands;
vars["slides_css"] = resourceFiles().get("learning/slides.css");
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/session/modules/learning/SlideParser.cpp
Expand Up @@ -232,7 +232,7 @@ Error SlideDeck::readSlides(const FilePath& filePath)
preamble_.clear();
if (!headerLines.empty())
{
for (std::size_t i = 0; i<headerLines[0]; i++)
for (std::size_t i = 0; i<(headerLines[0]-1); i++)
preamble_.append(lines[i]);
}

Expand Down
3 changes: 0 additions & 3 deletions src/cpp/session/modules/learning/SlideRenderer.cpp
Expand Up @@ -210,9 +210,6 @@ Error renderSlides(const SlideDeck& slideDeck,
// render the slides to HTML and slide commands to case statements
std::ostringstream ostr, ostrRevealConfig, ostrInitActions, ostrSlideActions;

// first the preamble
ostr << slideDeck.preamble() << std::endl;

// now the slides
std::string cmdPad(8, ' ');
int slideNumber = 0;
Expand Down
4 changes: 3 additions & 1 deletion src/cpp/session/resources/learning/slides.html
Expand Up @@ -16,7 +16,9 @@
#!r_highlight#

#!mathjax#


#!preamble#

</head>

<body>
Expand Down

0 comments on commit 46c7001

Please sign in to comment.