()
| 164 | } |
| 165 | |
| 166 | private _buildHtml() { |
| 167 | const otherAssets = mergeAssets( |
| 168 | this.options.toolbar ? toolbarAssets : null, |
| 169 | { |
| 170 | scripts: [ |
| 171 | { |
| 172 | type: 'iife', |
| 173 | data: { |
| 174 | fn: (options) => { |
| 175 | window.markmap.cliOptions = options; |
| 176 | }, |
| 177 | getParams: () => [this.options], |
| 178 | }, |
| 179 | }, |
| 180 | ], |
| 181 | }, |
| 182 | ); |
| 183 | const assets = mergeAssets(this.transformer.getAssets(), { |
| 184 | scripts: otherAssets.scripts?.map((item) => |
| 185 | this.transformer.resolveJS(item), |
| 186 | ), |
| 187 | styles: otherAssets.styles?.map((item) => |
| 188 | this.transformer.resolveCSS(item), |
| 189 | ), |
| 190 | }); |
| 191 | // Note: `client.js` must be loaded after `mm` is ready |
| 192 | const html = |
| 193 | fillTemplate(null, assets, { |
| 194 | urlBuilder: this.transformer.urlBuilder, |
| 195 | }) + '<script src="/~client.js"></script>'; |
| 196 | return html; |
| 197 | } |
| 198 | |
| 199 | async setup() { |
| 200 | if (this.serverInfo) throw new Error('Server already set up'); |
no test coverage detected