docs for export HTML

This commit is contained in:
John McLear 2015-01-24 02:24:10 +00:00
parent 4fa47ea969
commit 4ecf0dfad2

View file

@ -247,6 +247,30 @@ Things in context:
This hook will allow a plug-in developer to re-write each line when exporting to HTML.
Example:
```
var Changeset = require("ep_etherpad-lite/static/js/Changeset");
exports.getLineHTMLForExport = function (hook, context) {
var header = _analyzeLine(context.attribLine, context.apool);
if (header) {
return "<" + header + ">" + context.lineContents + "</" + header + ">";
}
}
function _analyzeLine(alineAttrs, apool) {
var header = null;
if (alineAttrs) {
var opIter = Changeset.opIterator(alineAttrs);
if (opIter.hasNext()) {
var op = opIter.next();
header = Changeset.opAttributeValue(op, 'heading', apool);
}
}
return header;
}
```
## stylesForExport
Called from: src/node/utils/ExportHtml.js