(content, options, context)
| 25 | matchWord: 'ANALYTICS_DOCS', |
| 26 | transforms: { |
| 27 | API(content, options, context) { |
| 28 | let updatedContent = '' |
| 29 | const opts = options || {} |
| 30 | const basePath = path.dirname(context.originalPath) |
| 31 | const browserPath = opts.browser || path.join(basePath, 'src/browser.js') |
| 32 | const nodePath = opts.node || path.join(basePath, 'src/node.js') |
| 33 | |
| 34 | if (browserPath && fs.existsSync(browserPath)) { |
| 35 | const fileContents = fs.readFileSync(browserPath, 'utf-8') |
| 36 | const docBlocs = dox.parseComments(fileContents, { raw: true, skipSingleStar: true }) |
| 37 | docBlocs.forEach((data) => { |
| 38 | // console.log('data', data) |
| 39 | // updatedContent += `### ${data.ctx.name}\n\n` |
| 40 | updatedContent += `## Plugin Options\n\n` |
| 41 | // updatedContent += `${data.description.full}\n\n` |
| 42 | updatedContent += `${formatArguments(data.tags)}` |
| 43 | updatedContent += formatExample(data.tags).join('\n') |
| 44 | updatedContent += `\n` |
| 45 | }) |
| 46 | } |
| 47 | return updatedContent.replace(/^\s+|\s+$/g, '') |
| 48 | }, |
| 49 | USAGE(content, options, context) { |
| 50 | let updatedContent = '' |
| 51 | const opts = options || {} |
nothing calls this directly
no test coverage detected