Fix Broken Docs References (#5436)
This commit is contained in:
4
docs/templates/contract.hbs
vendored
4
docs/templates/contract.hbs
vendored
@ -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]
|
||||
|
||||
16
docs/templates/properties.js
vendored
16
docs/templates/properties.js
vendored
@ -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');
|
||||
|
||||
Reference in New Issue
Block a user