mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-22 16:24:48 -06:00
fa9ae9437c
The gitbook install has been incredibly flaky due to it's dependency on npm. This commit simply vendors the node_modules so that each time we build the site the process doesn't have to re-run gitbook install. Signed-off-by: Torin Sandall <torinsandall@gmail.com>
36 lines
823 B
JavaScript
36 lines
823 B
JavaScript
require(["gitbook", "jquery"], function (gitbook, $) {
|
|
|
|
var init = function () {
|
|
var aceCount = 0;
|
|
|
|
$('.ace').each(function () {
|
|
var $ace = $(this).children('.aceCode');
|
|
var config = $ace.data('config');
|
|
var id = 'ace' + (aceCount++);
|
|
$ace.attr('id', id);
|
|
|
|
var editor = ace.edit(id);
|
|
|
|
editor.setOptions({
|
|
autoScrollEditorIntoView: true,
|
|
maxLines: 100
|
|
});
|
|
|
|
if (!config.edit)
|
|
editor.setReadOnly(true);
|
|
|
|
if (!config.theme)
|
|
editor.setTheme('ace/theme/chrome');
|
|
else
|
|
editor.setTheme('ace/theme/' + config.theme);
|
|
|
|
if (!config.check)
|
|
editor.session.setOption("useWorker", false);
|
|
|
|
editor.getSession().setMode('ace/mode/' + config.lang);
|
|
});
|
|
};
|
|
|
|
gitbook.events.bind("page.change", init);
|
|
});
|