MCPcopy Index your code
hub / github.com/markmap/markmap / transform

Function transform

packages/markmap-autoloader/src/index.ts:69–80  ·  view source on GitHub ↗
(transformer: Transformer, content: string)

Source from the content-addressed store, hash-verified

67export const ready = initialize();
68
69function transform(transformer: Transformer, content: string) {
70 const result = transformer.transform(content);
71 const keys = Object.keys(result.features).filter((key) => !enabled[key]);
72 keys.forEach((key) => {
73 enabled[key] = true;
74 });
75 const { styles, scripts } = transformer.getAssets(keys);
76 const { markmap } = window;
77 if (styles) markmap.loadCSS(styles);
78 if (scripts) markmap.loadJS(scripts);
79 return result;
80}
81
82export function render(el: HTMLElement) {
83 const { Transformer, Markmap, deriveOptions, Toolbar } = window.markmap;

Callers 1

doRenderFunction · 0.70

Calls 2

transformMethod · 0.80
getAssetsMethod · 0.80

Tested by

no test coverage detected