Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worked on FIRESDK-23 (Add Events in the table of content) #62

Open
wants to merge 5 commits into
base: next
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion util/docs/macros/index.mjs
Expand Up @@ -109,10 +109,13 @@ function insertMacros(data = '', moduleJson = {}, templates = {}, schemas = {},
regex = /\$\{events\}/
if (match = data.match(regex)) {
let eventsBlock = ''
let eventsList = ''
events.forEach(method => {
eventsBlock += insertMethodMacros(match[0], method, moduleJson, schemas, templates, options)
eventsList += ' - [' + method.name[2].toLowerCase() + method.name.substr(3) + '](#' + method.name.substr(2).toLowerCase() + ')' + '\n'
})
data = data.replace(regex, eventsBlock)
data = data.replace(/\$\{toc.events\}/g, eventsList)
}
}

Expand Down Expand Up @@ -297,7 +300,7 @@ function insertMacros(data = '', moduleJson = {}, templates = {}, schemas = {},
if (methods) {
data = data
.replace(/\$\{toc.methods\}/g, methods.filter(isTocMethod).map(m => ' - [' + m.name + '](#' + m.name.toLowerCase() + ')').join('\n'))
.replace(/\$\{toc.events\}/g, methods.filter(m => isEvent(m) && !isProviderMethod(m)).map(m => ' - [' + m.name[2].toLowerCase() + m.name.substr(3) + '](#' + m.name.substr(2).toLowerCase() + ')').join('\n'))
// .replace(/\$\{toc.events\}/g, methods.filter(m => isEvent(m) && !isProviderMethod(m)).map(m => ' - [' + m.name[2].toLowerCase() + m.name.substr(3) + '](#' + m.name.substr(2).toLowerCase() + ')').join('\n'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you just remove this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

.replace(/\$\{toc.providers\}/g, capabilities.map(c => ` - [${getProviderName(c, moduleJson, schemas)}](#${getProviderName(c, moduleJson, schemas).toLowerCase()})`).join('\n'))
}

Expand Down