MCPcopy Create free account
hub / github.com/frank-lam/fullstack-tutorial / install

Function install

notes/docsify/unpkg/docsify/lib/plugins/search.js:317–342  ·  view source on GitHub ↗
(hook, vm)

Source from the content-addressed store, hash-verified

315};
316
317var install = function (hook, vm) {
318 var util = Docsify.util;
319 var opts = vm.config.search || CONFIG;
320
321 if (Array.isArray(opts)) {
322 CONFIG.paths = opts;
323 } else if (typeof opts === 'object') {
324 CONFIG.paths = Array.isArray(opts.paths) ? opts.paths : 'auto';
325 CONFIG.maxAge = util.isPrimitive(opts.maxAge) ? opts.maxAge : CONFIG.maxAge;
326 CONFIG.placeholder = opts.placeholder || CONFIG.placeholder;
327 CONFIG.noData = opts.noData || CONFIG.noData;
328 CONFIG.depth = opts.depth || CONFIG.depth;
329 CONFIG.hideOtherSidebarContent = opts.hideOtherSidebarContent || CONFIG.hideOtherSidebarContent;
330 }
331
332 var isAuto = CONFIG.paths === 'auto';
333
334 hook.mounted(function (_) {
335 init(CONFIG, vm);
336 !isAuto && init$1(CONFIG, vm);
337 });
338 hook.doneEach(function (_) {
339 update(CONFIG, vm);
340 isAuto && init$1(CONFIG, vm);
341 });
342};
343
344$docsify.plugins = [].concat(install, $docsify.plugins);
345

Callers

nothing calls this directly

Calls 3

initFunction · 0.85
init$1Function · 0.85
updateFunction · 0.85

Tested by

no test coverage detected