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

Function EVENT_DOCS

scripts/docs.js:152–172  ·  view source on GitHub ↗
(content, options)

Source from the content-addressed store, hash-verified

150 return sorted
151 },
152 EVENT_DOCS(content, options) {
153 const fileContents = fs.readFileSync(path.join(__dirname, '..', 'packages/analytics-core/src/events.js'), 'utf-8')
154 const docBlocs = dox.parseComments(fileContents, { raw: true, skipSingleStar: true })
155
156 const events = docBlocs.filter((d) => {
157 return !d.description.summary.match(/^\*\*/)
158 })
159 let md = '| Event | Description |\n'
160 md += '|:------|:-------|\n'
161 events.forEach((data) => {
162 const eventName = data.description.summary.match(/^`(.*)`/)
163 let desc = data.description.summary.replace(eventName[0], '')
164 /* remove prefixed “ - whatever" */
165 desc = desc.replace(/^[\s|-]-?\s/, '')
166 /* replace \n with <br> tags */
167 desc = desc.replace(/\n/g, '<br/>')
168 // console.log('data', data)
169 md += `| **\`${eventName[1]}\`** | ${desc} |\n`
170 })
171 return md.replace(/^\s+|\s+$/g, '')
172 },
173 PLUGIN_DOCS: async (content, options, instance) => {
174 let pluginDocs = ''
175 let pluginData

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected