mirror of
https://github.com/pmret/papermario.git
synced 2024-11-08 12:02:30 +01:00
9574baebaf
* fix rename.py * update doxygen EVT_CALL->Call * support passing files to rename.py * remove EVT macro prefix and make them PascalCase * rename PlayEffect function to PlayEffect_impl so it doesn't conflict with macro * dead_PlayEffect_impl
50 lines
1.7 KiB
JavaScript
50 lines
1.7 KiB
JavaScript
// Make @evtapi prototype use Call and params
|
|
for (const item of document.querySelectorAll(".memitem:has(.evtapi)")) {
|
|
// <a id="..." /> appears 2 children before item
|
|
const id = item.previousElementSibling.previousElementSibling.id
|
|
|
|
const tbody = item.querySelector(".memproto tbody")
|
|
|
|
const name = tbody.querySelector("td.memname").childNodes[1].textContent.trim()
|
|
const params = [`<a class="el" href="#${id}">${name}</a>`]
|
|
|
|
for (const param of item.querySelectorAll(".params:not(.vars) .paramname")) {
|
|
params.push(param.textContent.trim())
|
|
}
|
|
|
|
const proto = `Call(${params.join(", ")})`
|
|
tbody.innerHTML = `<tr>${proto}</tr>`
|
|
|
|
// Find its link
|
|
const tr = document.getElementById(`r_${id}`)
|
|
tr.innerHTML = `<td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom">${proto}</td>`
|
|
}
|
|
|
|
// Combine @vars tables
|
|
for (const table of document.querySelectorAll("table.vars + table.vars")) {
|
|
const tbody = table.querySelector("tbody")
|
|
table.previousElementSibling.querySelector("tbody").append(...tbody.childNodes)
|
|
table.remove()
|
|
}
|
|
|
|
// Wrap @vars tables in a description
|
|
for (const table of document.querySelectorAll("table.vars")) {
|
|
const dl = document.createElement("dl")
|
|
|
|
const dt = document.createElement("dt")
|
|
dt.textContent = "Variables"
|
|
dl.appendChild(dt)
|
|
|
|
const dd = document.createElement("dd")
|
|
dd.innerHTML = table.outerHTML // makes copy of table
|
|
dl.appendChild(dd)
|
|
|
|
table.replaceWith(dl)
|
|
}
|
|
|
|
// Remove spaces in [in]/[out]/[in,out]
|
|
// These can appear because of spaces between the @vars arg separators
|
|
for (const paramdir of document.querySelectorAll("table.vars .paramdir")) {
|
|
paramdir.textContent = paramdir.textContent.replace(/\s/g, "")
|
|
}
|