MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / render

Function render

src/pages/plugin/plugin.js:412–566  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

410 }
411
412 async function render() {
413 const pluginSettings = settings.uiSettings[`plugin-${plugin.id}`];
414 $page.body = view({
415 ...plugin,
416 body: markdownIt({
417 html: true,
418 xhtmlOut: true,
419 })
420 .use(MarkdownItGitHubAlerts)
421 .use(anchor, {
422 slugify: (s) =>
423 s
424 .trim()
425 .toLowerCase()
426 .replace(/[^a-z0-9]+/g, "-"),
427 })
428 .use(markdownItTaskLists)
429 .use(markdownItFootnote)
430 .render(plugin.description),
431 changelogs: plugin.changelogs
432 ? markdownIt({ html: true, xhtmlOut: true })
433 .use(MarkdownItGitHubAlerts)
434 .use(anchor, {
435 slugify: (s) =>
436 s
437 .trim()
438 .toLowerCase()
439 .replace(/[^a-z0-9]+/g, "-"),
440 })
441 .use(markdownItTaskLists)
442 .use(markdownItFootnote)
443 .render(plugin.changelogs)
444 : null,
445 purchased,
446 installed,
447 update,
448 isPaid,
449 price,
450 buy,
451 refund,
452 install,
453 uninstall,
454 currentVersion,
455 minVersionCode,
456 isSupported,
457 unsupportedEditor,
458 showEditorSupportWarning: !isSupported,
459 });
460
461 // Handle anchor links
462 $page.body.querySelectorAll("a[href^='#']").forEach((link) => {
463 const originalHref = link.getAttribute("href");
464 link.setAttribute("data-href", originalHref);
465 link.style.cursor = "pointer";
466 // Remove default click behavior
467 link.removeAttribute("href");
468
469 // Add custom click handler

Callers 7

PluginIncludeFunction · 0.70
installFunction · 0.70
uninstallFunction · 0.70
handlerFunction · 0.70
refundFunction · 0.70
customTheme.jsFile · 0.50
editorFile.jsFile · 0.50

Calls 12

initHighlightingFunction · 0.90
highlightCodeBlockFunction · 0.90
viewFunction · 0.85
addMethod · 0.80
setTitleMethod · 0.80
appendMethod · 0.80
copyMethod · 0.65
renderMethod · 0.45
preventDefaultMethod · 0.45
stopPropagationMethod · 0.45
removeMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected