mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-12 22:26:08 -04:00
Updated slide mode
This commit is contained in:
parent
54b33f181f
commit
031c96c72d
6 changed files with 42 additions and 22 deletions
|
@ -24,8 +24,8 @@ var Mustache = require('mustache');
|
|||
var opts = {
|
||||
userBasePath: process.cwd(),
|
||||
revealBasePath: path.resolve(require.resolve('reveal.js'), '..', '..'),
|
||||
template: fs.readFileSync(path.join('.', '/public/views/templates', 'reveal.html')).toString(),
|
||||
templateListing: fs.readFileSync(path.join('.', '/public/views/templates', 'listing.html')).toString(),
|
||||
template: fs.readFileSync(path.join('.', '/public/views/slide', 'reveal.hbs')).toString(),
|
||||
templateListing: fs.readFileSync(path.join('.', '/public/views/slide', 'listing.hbs')).toString(),
|
||||
theme: 'css/theme/black.css',
|
||||
highlightTheme: 'zenburn',
|
||||
separator: '^(\r\n?|\n)---(\r\n?|\n)$',
|
||||
|
@ -404,7 +404,6 @@ function publishNoteActions(req, res, next) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
function showPublishSlide(req, res, next) {
|
||||
var shortid = req.params.shortid;
|
||||
if (shortId.isValid(shortid)) {
|
||||
|
@ -425,8 +424,12 @@ function showPublishSlide(req, res, next) {
|
|||
return;
|
||||
}
|
||||
var body = LZString.decompressFromBase64(data.rows[0].content);
|
||||
var title = data.rows[0].title;
|
||||
var decodedTitle = LZString.decompressFromBase64(title);
|
||||
if (decodedTitle) title = decodedTitle;
|
||||
title = Note.generateWebTitle(title);
|
||||
var text = S(body).escapeHTML().s;
|
||||
render(res, text);
|
||||
render(res, title, text);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -436,10 +439,11 @@ function showPublishSlide(req, res, next) {
|
|||
}
|
||||
|
||||
//reveal.js render
|
||||
var render = function (res, markdown) {
|
||||
var render = function (res, title, markdown) {
|
||||
var slides = md.slidify(markdown, opts);
|
||||
|
||||
res.end(Mustache.to_html(opts.template, {
|
||||
title: title,
|
||||
theme: opts.theme,
|
||||
highlightTheme: opts.highlightTheme,
|
||||
slides: slides,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue