docs: Syntax highlight parameter arg names

This commit is contained in:
michael-grunder
2025-11-10 20:57:23 -08:00
committed by Michael Grunder
parent 5fe0862109
commit d5b1576e27
15 changed files with 405 additions and 225 deletions
+27 -15
View File
@@ -252,27 +252,39 @@
} }
table.querySelectorAll('tr').forEach(function (row) { table.querySelectorAll('tr').forEach(function (row) {
var typeCell = row.querySelector('td'); var cells = row.querySelectorAll('td');
if (!typeCell || typeCell.querySelector('code.parameter-type')) { if (!cells.length) {
return; return;
} }
var typeText = typeCell.textContent.trim(); enhanceParameterCell(cells[0], 'parameter-type');
if (!typeText) {
return; if (cells.length > 1) {
enhanceParameterCell(cells[1], 'parameter-name');
} }
var meta = collectLinkMetadata(typeCell, typeText);
var code = document.createElement('code');
code.className = 'parameter-type language-php';
code.textContent = typeText;
typeCell.innerHTML = '';
typeCell.appendChild(code);
highlightAndRestore(code, meta);
}); });
}); });
function enhanceParameterCell(cell, className) {
if (!cell || cell.querySelector('code.' + className)) {
return;
}
var cellText = cell.textContent.trim();
if (!cellText) {
return;
}
var meta = collectLinkMetadata(cell, cellText);
var code = document.createElement('code');
code.className = className + ' language-php';
code.textContent = cellText;
cell.innerHTML = '';
cell.appendChild(code);
highlightAndRestore(code, meta);
}
} }
function highlightApiIndex() { function highlightApiIndex() {
+27 -15
View File
@@ -252,27 +252,39 @@
} }
table.querySelectorAll('tr').forEach(function (row) { table.querySelectorAll('tr').forEach(function (row) {
var typeCell = row.querySelector('td'); var cells = row.querySelectorAll('td');
if (!typeCell || typeCell.querySelector('code.parameter-type')) { if (!cells.length) {
return; return;
} }
var typeText = typeCell.textContent.trim(); enhanceParameterCell(cells[0], 'parameter-type');
if (!typeText) {
return; if (cells.length > 1) {
enhanceParameterCell(cells[1], 'parameter-name');
} }
var meta = collectLinkMetadata(typeCell, typeText);
var code = document.createElement('code');
code.className = 'parameter-type language-php';
code.textContent = typeText;
typeCell.innerHTML = '';
typeCell.appendChild(code);
highlightAndRestore(code, meta);
}); });
}); });
function enhanceParameterCell(cell, className) {
if (!cell || cell.querySelector('code.' + className)) {
return;
}
var cellText = cell.textContent.trim();
if (!cellText) {
return;
}
var meta = collectLinkMetadata(cell, cellText);
var code = document.createElement('code');
code.className = className + ' language-php';
code.textContent = cellText;
cell.innerHTML = '';
cell.appendChild(code);
highlightAndRestore(code, meta);
}
} }
function highlightApiIndex() { function highlightApiIndex() {
+27 -15
View File
@@ -252,27 +252,39 @@
} }
table.querySelectorAll('tr').forEach(function (row) { table.querySelectorAll('tr').forEach(function (row) {
var typeCell = row.querySelector('td'); var cells = row.querySelectorAll('td');
if (!typeCell || typeCell.querySelector('code.parameter-type')) { if (!cells.length) {
return; return;
} }
var typeText = typeCell.textContent.trim(); enhanceParameterCell(cells[0], 'parameter-type');
if (!typeText) {
return; if (cells.length > 1) {
enhanceParameterCell(cells[1], 'parameter-name');
} }
var meta = collectLinkMetadata(typeCell, typeText);
var code = document.createElement('code');
code.className = 'parameter-type language-php';
code.textContent = typeText;
typeCell.innerHTML = '';
typeCell.appendChild(code);
highlightAndRestore(code, meta);
}); });
}); });
function enhanceParameterCell(cell, className) {
if (!cell || cell.querySelector('code.' + className)) {
return;
}
var cellText = cell.textContent.trim();
if (!cellText) {
return;
}
var meta = collectLinkMetadata(cell, cellText);
var code = document.createElement('code');
code.className = className + ' language-php';
code.textContent = cellText;
cell.innerHTML = '';
cell.appendChild(code);
highlightAndRestore(code, meta);
}
} }
function highlightApiIndex() { function highlightApiIndex() {
+27 -15
View File
@@ -252,27 +252,39 @@
} }
table.querySelectorAll('tr').forEach(function (row) { table.querySelectorAll('tr').forEach(function (row) {
var typeCell = row.querySelector('td'); var cells = row.querySelectorAll('td');
if (!typeCell || typeCell.querySelector('code.parameter-type')) { if (!cells.length) {
return; return;
} }
var typeText = typeCell.textContent.trim(); enhanceParameterCell(cells[0], 'parameter-type');
if (!typeText) {
return; if (cells.length > 1) {
enhanceParameterCell(cells[1], 'parameter-name');
} }
var meta = collectLinkMetadata(typeCell, typeText);
var code = document.createElement('code');
code.className = 'parameter-type language-php';
code.textContent = typeText;
typeCell.innerHTML = '';
typeCell.appendChild(code);
highlightAndRestore(code, meta);
}); });
}); });
function enhanceParameterCell(cell, className) {
if (!cell || cell.querySelector('code.' + className)) {
return;
}
var cellText = cell.textContent.trim();
if (!cellText) {
return;
}
var meta = collectLinkMetadata(cell, cellText);
var code = document.createElement('code');
code.className = className + ' language-php';
code.textContent = cellText;
cell.innerHTML = '';
cell.appendChild(code);
highlightAndRestore(code, meta);
}
} }
function highlightApiIndex() { function highlightApiIndex() {
+27 -15
View File
@@ -252,27 +252,39 @@
} }
table.querySelectorAll('tr').forEach(function (row) { table.querySelectorAll('tr').forEach(function (row) {
var typeCell = row.querySelector('td'); var cells = row.querySelectorAll('td');
if (!typeCell || typeCell.querySelector('code.parameter-type')) { if (!cells.length) {
return; return;
} }
var typeText = typeCell.textContent.trim(); enhanceParameterCell(cells[0], 'parameter-type');
if (!typeText) {
return; if (cells.length > 1) {
enhanceParameterCell(cells[1], 'parameter-name');
} }
var meta = collectLinkMetadata(typeCell, typeText);
var code = document.createElement('code');
code.className = 'parameter-type language-php';
code.textContent = typeText;
typeCell.innerHTML = '';
typeCell.appendChild(code);
highlightAndRestore(code, meta);
}); });
}); });
function enhanceParameterCell(cell, className) {
if (!cell || cell.querySelector('code.' + className)) {
return;
}
var cellText = cell.textContent.trim();
if (!cellText) {
return;
}
var meta = collectLinkMetadata(cell, cellText);
var code = document.createElement('code');
code.className = className + ' language-php';
code.textContent = cellText;
cell.innerHTML = '';
cell.appendChild(code);
highlightAndRestore(code, meta);
}
} }
function highlightApiIndex() { function highlightApiIndex() {
+27 -15
View File
@@ -252,27 +252,39 @@
} }
table.querySelectorAll('tr').forEach(function (row) { table.querySelectorAll('tr').forEach(function (row) {
var typeCell = row.querySelector('td'); var cells = row.querySelectorAll('td');
if (!typeCell || typeCell.querySelector('code.parameter-type')) { if (!cells.length) {
return; return;
} }
var typeText = typeCell.textContent.trim(); enhanceParameterCell(cells[0], 'parameter-type');
if (!typeText) {
return; if (cells.length > 1) {
enhanceParameterCell(cells[1], 'parameter-name');
} }
var meta = collectLinkMetadata(typeCell, typeText);
var code = document.createElement('code');
code.className = 'parameter-type language-php';
code.textContent = typeText;
typeCell.innerHTML = '';
typeCell.appendChild(code);
highlightAndRestore(code, meta);
}); });
}); });
function enhanceParameterCell(cell, className) {
if (!cell || cell.querySelector('code.' + className)) {
return;
}
var cellText = cell.textContent.trim();
if (!cellText) {
return;
}
var meta = collectLinkMetadata(cell, cellText);
var code = document.createElement('code');
code.className = className + ' language-php';
code.textContent = cellText;
cell.innerHTML = '';
cell.appendChild(code);
highlightAndRestore(code, meta);
}
} }
function highlightApiIndex() { function highlightApiIndex() {
+27 -15
View File
@@ -252,27 +252,39 @@
} }
table.querySelectorAll('tr').forEach(function (row) { table.querySelectorAll('tr').forEach(function (row) {
var typeCell = row.querySelector('td'); var cells = row.querySelectorAll('td');
if (!typeCell || typeCell.querySelector('code.parameter-type')) { if (!cells.length) {
return; return;
} }
var typeText = typeCell.textContent.trim(); enhanceParameterCell(cells[0], 'parameter-type');
if (!typeText) {
return; if (cells.length > 1) {
enhanceParameterCell(cells[1], 'parameter-name');
} }
var meta = collectLinkMetadata(typeCell, typeText);
var code = document.createElement('code');
code.className = 'parameter-type language-php';
code.textContent = typeText;
typeCell.innerHTML = '';
typeCell.appendChild(code);
highlightAndRestore(code, meta);
}); });
}); });
function enhanceParameterCell(cell, className) {
if (!cell || cell.querySelector('code.' + className)) {
return;
}
var cellText = cell.textContent.trim();
if (!cellText) {
return;
}
var meta = collectLinkMetadata(cell, cellText);
var code = document.createElement('code');
code.className = className + ' language-php';
code.textContent = cellText;
cell.innerHTML = '';
cell.appendChild(code);
highlightAndRestore(code, meta);
}
} }
function highlightApiIndex() { function highlightApiIndex() {
+27 -15
View File
@@ -252,27 +252,39 @@
} }
table.querySelectorAll('tr').forEach(function (row) { table.querySelectorAll('tr').forEach(function (row) {
var typeCell = row.querySelector('td'); var cells = row.querySelectorAll('td');
if (!typeCell || typeCell.querySelector('code.parameter-type')) { if (!cells.length) {
return; return;
} }
var typeText = typeCell.textContent.trim(); enhanceParameterCell(cells[0], 'parameter-type');
if (!typeText) {
return; if (cells.length > 1) {
enhanceParameterCell(cells[1], 'parameter-name');
} }
var meta = collectLinkMetadata(typeCell, typeText);
var code = document.createElement('code');
code.className = 'parameter-type language-php';
code.textContent = typeText;
typeCell.innerHTML = '';
typeCell.appendChild(code);
highlightAndRestore(code, meta);
}); });
}); });
function enhanceParameterCell(cell, className) {
if (!cell || cell.querySelector('code.' + className)) {
return;
}
var cellText = cell.textContent.trim();
if (!cellText) {
return;
}
var meta = collectLinkMetadata(cell, cellText);
var code = document.createElement('code');
code.className = className + ' language-php';
code.textContent = cellText;
cell.innerHTML = '';
cell.appendChild(code);
highlightAndRestore(code, meta);
}
} }
function highlightApiIndex() { function highlightApiIndex() {
+27 -15
View File
@@ -252,27 +252,39 @@
} }
table.querySelectorAll('tr').forEach(function (row) { table.querySelectorAll('tr').forEach(function (row) {
var typeCell = row.querySelector('td'); var cells = row.querySelectorAll('td');
if (!typeCell || typeCell.querySelector('code.parameter-type')) { if (!cells.length) {
return; return;
} }
var typeText = typeCell.textContent.trim(); enhanceParameterCell(cells[0], 'parameter-type');
if (!typeText) {
return; if (cells.length > 1) {
enhanceParameterCell(cells[1], 'parameter-name');
} }
var meta = collectLinkMetadata(typeCell, typeText);
var code = document.createElement('code');
code.className = 'parameter-type language-php';
code.textContent = typeText;
typeCell.innerHTML = '';
typeCell.appendChild(code);
highlightAndRestore(code, meta);
}); });
}); });
function enhanceParameterCell(cell, className) {
if (!cell || cell.querySelector('code.' + className)) {
return;
}
var cellText = cell.textContent.trim();
if (!cellText) {
return;
}
var meta = collectLinkMetadata(cell, cellText);
var code = document.createElement('code');
code.className = className + ' language-php';
code.textContent = cellText;
cell.innerHTML = '';
cell.appendChild(code);
highlightAndRestore(code, meta);
}
} }
function highlightApiIndex() { function highlightApiIndex() {
+27 -15
View File
@@ -252,27 +252,39 @@
} }
table.querySelectorAll('tr').forEach(function (row) { table.querySelectorAll('tr').forEach(function (row) {
var typeCell = row.querySelector('td'); var cells = row.querySelectorAll('td');
if (!typeCell || typeCell.querySelector('code.parameter-type')) { if (!cells.length) {
return; return;
} }
var typeText = typeCell.textContent.trim(); enhanceParameterCell(cells[0], 'parameter-type');
if (!typeText) {
return; if (cells.length > 1) {
enhanceParameterCell(cells[1], 'parameter-name');
} }
var meta = collectLinkMetadata(typeCell, typeText);
var code = document.createElement('code');
code.className = 'parameter-type language-php';
code.textContent = typeText;
typeCell.innerHTML = '';
typeCell.appendChild(code);
highlightAndRestore(code, meta);
}); });
}); });
function enhanceParameterCell(cell, className) {
if (!cell || cell.querySelector('code.' + className)) {
return;
}
var cellText = cell.textContent.trim();
if (!cellText) {
return;
}
var meta = collectLinkMetadata(cell, cellText);
var code = document.createElement('code');
code.className = className + ' language-php';
code.textContent = cellText;
cell.innerHTML = '';
cell.appendChild(code);
highlightAndRestore(code, meta);
}
} }
function highlightApiIndex() { function highlightApiIndex() {
+27 -15
View File
@@ -252,27 +252,39 @@
} }
table.querySelectorAll('tr').forEach(function (row) { table.querySelectorAll('tr').forEach(function (row) {
var typeCell = row.querySelector('td'); var cells = row.querySelectorAll('td');
if (!typeCell || typeCell.querySelector('code.parameter-type')) { if (!cells.length) {
return; return;
} }
var typeText = typeCell.textContent.trim(); enhanceParameterCell(cells[0], 'parameter-type');
if (!typeText) {
return; if (cells.length > 1) {
enhanceParameterCell(cells[1], 'parameter-name');
} }
var meta = collectLinkMetadata(typeCell, typeText);
var code = document.createElement('code');
code.className = 'parameter-type language-php';
code.textContent = typeText;
typeCell.innerHTML = '';
typeCell.appendChild(code);
highlightAndRestore(code, meta);
}); });
}); });
function enhanceParameterCell(cell, className) {
if (!cell || cell.querySelector('code.' + className)) {
return;
}
var cellText = cell.textContent.trim();
if (!cellText) {
return;
}
var meta = collectLinkMetadata(cell, cellText);
var code = document.createElement('code');
code.className = className + ' language-php';
code.textContent = cellText;
cell.innerHTML = '';
cell.appendChild(code);
highlightAndRestore(code, meta);
}
} }
function highlightApiIndex() { function highlightApiIndex() {
+27 -15
View File
@@ -252,27 +252,39 @@
} }
table.querySelectorAll('tr').forEach(function (row) { table.querySelectorAll('tr').forEach(function (row) {
var typeCell = row.querySelector('td'); var cells = row.querySelectorAll('td');
if (!typeCell || typeCell.querySelector('code.parameter-type')) { if (!cells.length) {
return; return;
} }
var typeText = typeCell.textContent.trim(); enhanceParameterCell(cells[0], 'parameter-type');
if (!typeText) {
return; if (cells.length > 1) {
enhanceParameterCell(cells[1], 'parameter-name');
} }
var meta = collectLinkMetadata(typeCell, typeText);
var code = document.createElement('code');
code.className = 'parameter-type language-php';
code.textContent = typeText;
typeCell.innerHTML = '';
typeCell.appendChild(code);
highlightAndRestore(code, meta);
}); });
}); });
function enhanceParameterCell(cell, className) {
if (!cell || cell.querySelector('code.' + className)) {
return;
}
var cellText = cell.textContent.trim();
if (!cellText) {
return;
}
var meta = collectLinkMetadata(cell, cellText);
var code = document.createElement('code');
code.className = className + ' language-php';
code.textContent = cellText;
cell.innerHTML = '';
cell.appendChild(code);
highlightAndRestore(code, meta);
}
} }
function highlightApiIndex() { function highlightApiIndex() {
+27 -15
View File
@@ -252,27 +252,39 @@
} }
table.querySelectorAll('tr').forEach(function (row) { table.querySelectorAll('tr').forEach(function (row) {
var typeCell = row.querySelector('td'); var cells = row.querySelectorAll('td');
if (!typeCell || typeCell.querySelector('code.parameter-type')) { if (!cells.length) {
return; return;
} }
var typeText = typeCell.textContent.trim(); enhanceParameterCell(cells[0], 'parameter-type');
if (!typeText) {
return; if (cells.length > 1) {
enhanceParameterCell(cells[1], 'parameter-name');
} }
var meta = collectLinkMetadata(typeCell, typeText);
var code = document.createElement('code');
code.className = 'parameter-type language-php';
code.textContent = typeText;
typeCell.innerHTML = '';
typeCell.appendChild(code);
highlightAndRestore(code, meta);
}); });
}); });
function enhanceParameterCell(cell, className) {
if (!cell || cell.querySelector('code.' + className)) {
return;
}
var cellText = cell.textContent.trim();
if (!cellText) {
return;
}
var meta = collectLinkMetadata(cell, cellText);
var code = document.createElement('code');
code.className = className + ' language-php';
code.textContent = cellText;
cell.innerHTML = '';
cell.appendChild(code);
highlightAndRestore(code, meta);
}
} }
function highlightApiIndex() { function highlightApiIndex() {
+27 -15
View File
@@ -252,27 +252,39 @@
} }
table.querySelectorAll('tr').forEach(function (row) { table.querySelectorAll('tr').forEach(function (row) {
var typeCell = row.querySelector('td'); var cells = row.querySelectorAll('td');
if (!typeCell || typeCell.querySelector('code.parameter-type')) { if (!cells.length) {
return; return;
} }
var typeText = typeCell.textContent.trim(); enhanceParameterCell(cells[0], 'parameter-type');
if (!typeText) {
return; if (cells.length > 1) {
enhanceParameterCell(cells[1], 'parameter-name');
} }
var meta = collectLinkMetadata(typeCell, typeText);
var code = document.createElement('code');
code.className = 'parameter-type language-php';
code.textContent = typeText;
typeCell.innerHTML = '';
typeCell.appendChild(code);
highlightAndRestore(code, meta);
}); });
}); });
function enhanceParameterCell(cell, className) {
if (!cell || cell.querySelector('code.' + className)) {
return;
}
var cellText = cell.textContent.trim();
if (!cellText) {
return;
}
var meta = collectLinkMetadata(cell, cellText);
var code = document.createElement('code');
code.className = className + ' language-php';
code.textContent = cellText;
cell.innerHTML = '';
cell.appendChild(code);
highlightAndRestore(code, meta);
}
} }
function highlightApiIndex() { function highlightApiIndex() {
+27 -15
View File
@@ -238,27 +238,39 @@
} }
table.querySelectorAll('tr').forEach(function (row) { table.querySelectorAll('tr').forEach(function (row) {
var typeCell = row.querySelector('td'); var cells = row.querySelectorAll('td');
if (!typeCell || typeCell.querySelector('code.parameter-type')) { if (!cells.length) {
return; return;
} }
var typeText = typeCell.textContent.trim(); enhanceParameterCell(cells[0], 'parameter-type');
if (!typeText) {
return; if (cells.length > 1) {
enhanceParameterCell(cells[1], 'parameter-name');
} }
var meta = collectLinkMetadata(typeCell, typeText);
var code = document.createElement('code');
code.className = 'parameter-type language-php';
code.textContent = typeText;
typeCell.innerHTML = '';
typeCell.appendChild(code);
highlightAndRestore(code, meta);
}); });
}); });
function enhanceParameterCell(cell, className) {
if (!cell || cell.querySelector('code.' + className)) {
return;
}
var cellText = cell.textContent.trim();
if (!cellText) {
return;
}
var meta = collectLinkMetadata(cell, cellText);
var code = document.createElement('code');
code.className = className + ' language-php';
code.textContent = cellText;
cell.innerHTML = '';
cell.appendChild(code);
highlightAndRestore(code, meta);
}
} }
function highlightApiIndex() { function highlightApiIndex() {