MCPcopy
hub / github.com/docsifyjs/docsify / _renderMain

Method _renderMain

src/core/render/index.js:310–348  ·  view source on GitHub ↗
(text, opt = {}, next)

Source from the content-addressed store, hash-verified

308 }
309
310 _renderMain(text, opt = {}, next) {
311 if (!text) {
312 return renderMain.call(this, text);
313 }
314
315 this.callHook('beforeEach', text, result => {
316 let html;
317 const callback = () => {
318 if (opt.updatedAt) {
319 html = formatUpdated(
320 html,
321 opt.updatedAt,
322 this.config.formatUpdated
323 );
324 }
325
326 this.callHook('afterEach', html, hookData => {
327 renderMain.call(this, hookData);
328 next();
329 });
330 };
331
332 if (this.isHTML) {
333 html = this.result = text;
334 callback();
335 } else {
336 prerenderEmbed(
337 {
338 compiler: this.compiler,
339 raw: result,
340 },
341 tokens => {
342 html = this.compiler.compile(tokens);
343 callback();
344 }
345 );
346 }
347 });
348 }
349
350 _renderCover(text, coverOnly) {
351 const el = dom.getNode('.cover');

Callers 3

contentFetchedMethod · 0.80
_fetchFallbackPageMethod · 0.80
_fetch404Method · 0.80

Calls 2

prerenderEmbedFunction · 0.90
callHookMethod · 0.80

Tested by

no test coverage detected