MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / constructor

Method constructor

plugins/grok-theme/index.mjs:60–1371  ·  view source on GitHub ↗
(theme, page, options)

Source from the content-addressed store, hash-verified

58
59class GrokThemeRenderContext extends MarkdownThemeContext {
60 constructor(theme, page, options) {
61 super(theme, page, options);
62 const superPartials = this.partials;
63
64 const superHasUsefulTypeDetails = this.helpers.hasUsefulTypeDetails;
65 this.helpers = {
66 ...this.helpers,
67 hasUsefulTypeDetails: (type) => {
68 // The asciiMath.delimiters property for some reason does not have a .visit property
69 if (!type.visit) return false;
70 return superHasUsefulTypeDetails(type);
71 },
72 };
73
74 this.templates = {
75 ...this.templates,
76 /**
77 * Template that maps to individual reflection models.
78 */
79 reflection: (page) => {
80 const md = [];
81
82 md.push(this.hook('page.begin', this).join('\n'));
83
84 if (!this.options.getValue('hidePageHeader')) {
85 md.push(this.partials.header());
86 }
87
88 if (!this.options.getValue('hideBreadcrumbs')) {
89 md.push(this.partials.breadcrumbs());
90 }
91
92 if (!this.options.getValue('hidePageTitle')) {
93 md.push(heading(1, this.partials.pageTitle()));
94 }
95
96 md.push(this.hook('content.begin', this).join('\n'));
97
98 // @custom
99 if (page.model.kind === ReflectionKind.Module) {
100 md.push(
101 this.partials.memberWithGroups(page.model, { headingLevel: 1 })
102 );
103 } else if (
104 [
105 // ReflectionKind.Module, // @custom
106 ReflectionKind.Namespace,
107 ReflectionKind.Enum,
108 ReflectionKind.Class,
109 ReflectionKind.Interface,
110 ].includes(page.model.kind)
111 ) {
112 md.push(
113 this.partials.memberWithGroups(page.model, { headingLevel: 2 })
114 );
115 } else {
116 md.push(
117 this.partials.memberContainer(page.model, { headingLevel: 1 })

Callers

nothing calls this directly

Calls 9

headingFunction · 0.85
backTicksFunction · 0.85
fullAnchorFunction · 0.85
escapeCharsFunction · 0.85
codeBlockFunction · 0.85
indentBlockFunction · 0.85
mapMethod · 0.65
sliceMethod · 0.65
assignMethod · 0.65

Tested by

no test coverage detected