This commit is contained in:
John McLear 2014-12-08 19:08:12 +00:00
parent 6080de9d79
commit 2218cbd252
2 changed files with 22 additions and 0 deletions

View File

@ -247,6 +247,23 @@ Things in context:
This hook will allow a plug-in developer to re-write each line when exporting to HTML. This hook will allow a plug-in developer to re-write each line when exporting to HTML.
## stylesForExport
Called from: src/node/utils/ExportHtml.js
Things in context:
1. padId - The Pad Id
This hook will allow a plug-in developer to append Styles to the Exported HTML.
Example:
```
exports.stylesForExport = function(hook, context){
return("body{margin-left:20px;body{color:orange}");
}
```
## exportFileName ## exportFileName
Called from src/node/handler/ExportHandler.js Called from src/node/handler/ExportHandler.js

View File

@ -425,6 +425,9 @@ exports.getPadHTMLDocument = function (padId, revNum, noDocType, callback)
{ {
if(ERR(err, callback)) return; if(ERR(err, callback)) return;
// Include some Styles into the Head for Export
var stylesForExport = hooks.callAllStr("stylesForExport") || ''
var head = var head =
(noDocType ? '' : '<!doctype html>\n') + (noDocType ? '' : '<!doctype html>\n') +
'<html lang="en">\n' + (noDocType ? '' : '<head>\n' + '<html lang="en">\n' + (noDocType ? '' : '<head>\n' +
@ -442,6 +445,7 @@ exports.getPadHTMLDocument = function (padId, revNum, noDocType, callback)
'ol ol ol ol ol ol{ list-style-type: lower-roman; }' + 'ol ol ol ol ol ol{ list-style-type: lower-roman; }' +
'ol ol ol ol ol ol ol { list-style-type: decimal; }' + 'ol ol ol ol ol ol ol { list-style-type: decimal; }' +
'ol ol ol ol ol ol ol ol{ list-style-type: lower-latin; }' + 'ol ol ol ol ol ol ol ol{ list-style-type: lower-latin; }' +
stylesForExport +
'</style>\n' + '</head>\n') + '</style>\n' + '</head>\n') +
'<body>'; '<body>';
@ -452,6 +456,7 @@ exports.getPadHTMLDocument = function (padId, revNum, noDocType, callback)
if(ERR(err, callback)) return; if(ERR(err, callback)) return;
callback(null, head + html + foot); callback(null, head + html + foot);
}); });
}); });
}; };