MCPcopy Index your code
hub / github.com/code-hike/codehike / getStepOutput

Function getStepOutput

packages/codehike/tests/md.test.tsx:118–247  ·  view source on GitHub ↗
(
  file: MDFile,
  step: string,
  chConfig: CodeHikeConfig,
  render: any,
)

Source from the content-addressed store, hash-verified

116}
117
118async function getStepOutput(
119 file: MDFile,
120 step: string,
121 chConfig: CodeHikeConfig,
122 render: any,
123) {
124 switch (step) {
125 case "before-remark":
126 return await compileAST(file, (X) => ({
127 remarkPlugins: [X],
128 }))
129 case "after-remark":
130 return await compileAST(file, (X) => ({
131 remarkPlugins: [[remarkCodeHike, chConfig], X],
132 }))
133 case "after-rehype":
134 return await compileAST(file, (X) => ({
135 remarkPlugins: [[remarkCodeHike, chConfig]],
136 rehypePlugins: [X],
137 }))
138 case "before-recma-compiled-js":
139 return await compileJS(file, {
140 jsx: false,
141 remarkPlugins: [[remarkCodeHike, chConfig]],
142 })
143 case "before-recma-compiled-jsx":
144 return await compileJS(file, {
145 jsx: true,
146 remarkPlugins: [[remarkCodeHike, chConfig]],
147 })
148 case "before-recma-compiled-function":
149 return await compileJS(file, {
150 jsx: true,
151 outputFormat: "function-body",
152 remarkPlugins: [[remarkCodeHike, chConfig]],
153 })
154 case "before-recma-js":
155 return await compileAST(file, (X) => ({
156 jsx: false,
157 remarkPlugins: [[remarkCodeHike, chConfig]],
158 recmaPlugins: [X],
159 }))
160 case "before-recma-js-dev":
161 return await compileAST(file, (X) => ({
162 jsx: false,
163 development: true,
164 remarkPlugins: [[remarkCodeHike, chConfig]],
165 recmaPlugins: [X],
166 }))
167 case "after-recma-js":
168 return await compileAST(file, (X) => ({
169 jsx: false,
170 remarkPlugins: [[remarkCodeHike, chConfig]],
171 recmaPlugins: [[recmaCodeHike, chConfig], X],
172 }))
173 case "after-recma-js-dev":
174 return await compileAST(file, (X) => ({
175 jsx: false,

Callers 1

md.test.tsxFile · 0.85

Calls 4

compileASTFunction · 0.90
compileJSFunction · 0.90
parsedJSFunction · 0.90
renderHTMLFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…