Fix Broken Docs References (#5436)

This commit is contained in:
Arr00
2025-01-24 04:12:16 -05:00
committed by GitHub
parent a55fabc405
commit 6dc9242937
21 changed files with 49 additions and 59 deletions

View File

@ -2,6 +2,10 @@
:{{name}}: pass:normal[xref:#{{anchor}}[`++{{name}}++`]]
{{/each}}
{{#each functions}}
:{{fullname}}: pass:normal[xref:#{{anchor}}[`++{{name}}++`]]
{{/each}}
[.contract]
[[{{anchor}}]]
=== `++{{name}}++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v{{oz-version}}/{{__item_context.file.absolutePath}}[{github-icon},role=heading-link]

View File

@ -17,6 +17,22 @@ module.exports.anchor = function anchor({ item, contract }) {
return res;
};
module.exports.fullname = function fullname({ item }) {
let res = '';
res += item.name;
if ('parameters' in item) {
const signature = item.parameters.parameters.map(v => v.typeName.typeDescriptions.typeString).join(',');
res += slug('(' + signature + ')');
}
if (isNodeType('VariableDeclaration', item)) {
res += '-' + slug(item.typeName.typeDescriptions.typeString);
}
if (res.charAt(res.length - 1) === '-') {
return res.slice(0, -1);
}
return res;
};
module.exports.inheritance = function ({ item, build }) {
if (!isNodeType('ContractDefinition', item)) {
throw new Error('used inherited-items on non-contract');