diff options
author | Fabio Berger <me@fabioberger.com> | 2017-12-22 05:45:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-22 05:45:22 +0800 |
commit | e884eb9882246398eb576b809e2d18e589ec5f51 (patch) | |
tree | 241b630db5044974cc17130f149ca64728d9c619 /packages/website/ts/pages/documentation/documentation.tsx | |
parent | cb3582289ff94857d5956bbd71dbf68ee3f42ecf (diff) | |
parent | e01c0f054d2dbb043aec8b4cb8e1c47f83bd5eb9 (diff) | |
download | dexon-sol-tools-e884eb9882246398eb576b809e2d18e589ec5f51.tar dexon-sol-tools-e884eb9882246398eb576b809e2d18e589ec5f51.tar.gz dexon-sol-tools-e884eb9882246398eb576b809e2d18e589ec5f51.tar.bz2 dexon-sol-tools-e884eb9882246398eb576b809e2d18e589ec5f51.tar.lz dexon-sol-tools-e884eb9882246398eb576b809e2d18e589ec5f51.tar.xz dexon-sol-tools-e884eb9882246398eb576b809e2d18e589ec5f51.tar.zst dexon-sol-tools-e884eb9882246398eb576b809e2d18e589ec5f51.zip |
Merge pull request #288 from 0xProject/fix/docLinks
Fix doc anchor link collisions
Diffstat (limited to 'packages/website/ts/pages/documentation/documentation.tsx')
-rw-r--r-- | packages/website/ts/pages/documentation/documentation.tsx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/packages/website/ts/pages/documentation/documentation.tsx b/packages/website/ts/pages/documentation/documentation.tsx index c0be882f8..1731c19fe 100644 --- a/packages/website/ts/pages/documentation/documentation.tsx +++ b/packages/website/ts/pages/documentation/documentation.tsx @@ -195,6 +195,7 @@ export class Documentation extends const typeDefs = _.map(sortedTypes, customType => { return ( <TypeDefinition + sectionName={sectionName} key={`type-${customType.name}`} customType={customType} docsInfo={this.props.docsInfo} @@ -203,7 +204,7 @@ export class Documentation extends }); const sortedProperties = _.sortBy(docSection.properties, 'name'); - const propertyDefs = _.map(sortedProperties, this._renderProperty.bind(this)); + const propertyDefs = _.map(sortedProperties, this._renderProperty.bind(this, sectionName)); const sortedMethods = _.sortBy(docSection.methods, 'name'); const methodDefs = _.map(sortedMethods, method => { @@ -217,6 +218,7 @@ export class Documentation extends <EventDefinition key={`event-${event.name}-${i}`} event={event} + sectionName={sectionName} docsInfo={this.props.docsInfo} /> ); @@ -311,14 +313,19 @@ export class Documentation extends </div> ); } - private _renderProperty(property: Property): React.ReactNode { + private _renderProperty(sectionName: string, property: Property): React.ReactNode { return ( <div key={`property-${property.name}-${property.type.name}`} className="pb3" > <code className="hljs"> - {property.name}: <Type type={property.type} docsInfo={this.props.docsInfo} /> + {property.name}: + <Type + type={property.type} + sectionName={sectionName} + docsInfo={this.props.docsInfo} + /> </code> {property.source && <SourceLink @@ -342,6 +349,7 @@ export class Documentation extends return ( <MethodBlock key={`method-${method.name}-${sectionName}`} + sectionName={sectionName} method={method} typeDefinitionByName={typeDefinitionByName} libraryVersion={this.props.docsVersion} |