mirror of
https://github.com/videojs/video.js.git
synced 2025-06-19 00:28:02 +02:00
docs: deploy docs using netlify (#4774)
This adds in the legacy docs into the repo and enables automatic deployment via netlify. The netlify-docs.js script will error out the build on netlify on master if we're not on a tagged commit so that it won't redeploy the docs unless there's a new release. If we're not on master or on master with a tagged commit, it will process with the deploy. Also, this removes the API docs from being published with npm, fixes #4609.
This commit is contained in:
31
docs/legacy-docs/api/js/highlight-syntax.js
Normal file
31
docs/legacy-docs/api/js/highlight-syntax.js
Normal file
@ -0,0 +1,31 @@
|
||||
BCLSHighlighter = (function(hljs) {
|
||||
var codeBlocks = document.querySelectorAll('pre>code'),
|
||||
i,
|
||||
iMax,
|
||||
txt,
|
||||
reLT = new RegExp('<', 'g'),
|
||||
reGT = new RegExp('>;', 'g');
|
||||
|
||||
/**
|
||||
* tests for all the ways a variable might be undefined or not have a value
|
||||
* @param {*} x the variable to test
|
||||
* @return {Boolean} true if variable is defined and has a value
|
||||
*/
|
||||
function isDefined(x) {
|
||||
if (x === '' || x === null || x === undefined || x === NaN) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
if (isDefined(codeBlocks)) {
|
||||
iMax = codeBlocks.length;
|
||||
for (i = 0; i < iMax; i++) {
|
||||
txt = codeBlocks[i].innerHTML.toString();
|
||||
txt = txt.replace(reLT, '<');
|
||||
txt = txt.replace(reGT, '>');
|
||||
codeBlocks[i].innerHTML = txt;
|
||||
hljs.highlightBlock(codeBlocks[i]);
|
||||
}
|
||||
}
|
||||
})(hljs);
|
Reference in New Issue
Block a user