mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
API changes:
+ No more `jsdoc/template` module. Each JSDoc template uses whatever templating system it wants.
+ No more TaffyDB. Each template finds doclets however it wants. (TODO: Update `jsdoc/util/templateHelper` so none of its methods expect a TaffyDB object.)
+ Templates are now loaded with `require('my-template-name-here')`. The resulting object must include a `publish` method.
+ The `publish` method now takes two parameters: a `data` object with `doclets` and `tutorials` properties, and an `options` object. `data.doclets` is just an array.
Other notable changes:
+ No more `haruki` template.
+ Moved the `default` and `silent` templates to new packages.
+ The `.tmpl` files for the `default` template (now called `@jsdoc/template-original`) no longer use custom delimiters.
26 lines
672 B
JavaScript
26 lines
672 B
JavaScript
/* global document */
|
|
(() => {
|
|
const source = document.getElementsByClassName('prettyprint source linenums');
|
|
let i = 0;
|
|
let lineNumber = 0;
|
|
let lineId;
|
|
let lines;
|
|
let totalLines;
|
|
let anchorHash;
|
|
|
|
if (source && source[0]) {
|
|
anchorHash = document.location.hash.substring(1);
|
|
lines = source[0].getElementsByTagName('li');
|
|
totalLines = lines.length;
|
|
|
|
for (; i < totalLines; i++) {
|
|
lineNumber++;
|
|
lineId = `line${lineNumber}`;
|
|
lines[i].id = lineId;
|
|
if (lineId === anchorHash) {
|
|
lines[i].className += ' selected';
|
|
}
|
|
}
|
|
}
|
|
})();
|