MCPcopy Create free account
hub / github.com/DavidWells/analytics / jsDocRenderExample

Function jsDocRenderExample

scripts/docs.js:450–468  ·  view source on GitHub ↗
(example, allData)

Source from the content-addressed store, hash-verified

448}
449
450function jsDocRenderExample(example, allData) {
451 if (!example) {
452 return ''
453 }
454 const main = allData.data.jsdoc.find((doc) => Boolean(doc.examples))
455 const name = main.name
456 const code = `${generateImportStatement(name, allData.pkg.name)}
457
458const analytics = Analytics({
459 app: 'awesome-app',
460 plugins: [
461 ${example.replace(/^\s+|\s+$/g, '')}
462 ]
463})
464`
465 return `\`\`\`js
466${formatCode(code)}
467\`\`\``
468}
469
470function getPlatformNiceName(name) {
471 const lower = name.toLowerCase()

Callers 1

renderJsDocsFunction · 0.85

Calls 2

generateImportStatementFunction · 0.85
formatCodeFunction · 0.85

Tested by

no test coverage detected