Skip to content

Commit

Permalink
upgrade documentalist, include index in renderType (#2510)
Browse files Browse the repository at this point in the history
  • Loading branch information
giladgray authored May 16, 2018
1 parent a866049 commit 50ee677
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/docs-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@blueprintjs/core": "^3.0.0-beta.0",
"@blueprintjs/docs-theme": "^3.0.0-beta.0",
"documentalist": "^1.2.0",
"documentalist": "^1.3.2",
"glob": "^7.1.2",
"highlights": "^3.1.1",
"marked": "^0.3.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@blueprintjs/core": "^3.0.0-beta.0",
"@blueprintjs/select": "^3.0.0-beta.0",
"classnames": "^2.2",
"documentalist": "^1.2.0",
"documentalist": "^1.3.2",
"fuzzaldrin-plus": "^0.5.0",
"tslib": "^1.9.0"
},
Expand Down
13 changes: 4 additions & 9 deletions packages/docs-theme/src/components/documentation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ export class Documentation extends React.PureComponent<IDocumentationProps, IDoc
return {
getDocsData: () => docs,
renderBlock: block => renderBlock(block, this.props.tagRenderers),
renderType: this.renderType,
renderType: hasTypescriptData(docs)
? type =>
linkify(type, docs.typescript, (name, _d, idx) => <ApiLink key={`${name}-${idx}`} name={name} />)
: type => type,
renderViewSourceLinkText: Utils.isFunction(renderViewSourceLinkText)
? renderViewSourceLinkText
: () => "View source",
Expand Down Expand Up @@ -236,14 +239,6 @@ export class Documentation extends React.PureComponent<IDocumentationProps, IDoc
Utils.safeInvoke(this.props.onComponentUpdate, activePageId);
}

private renderType = (type: string) => {
const { docs } = this.props;
let index = 0;
return hasTypescriptData(docs)
? linkify(type, docs.typescript, name => <ApiLink key={`${name}-${index++}`} name={name} />)
: type;
};

private updateHash() {
// update state based on current hash location
this.handleNavigation(location.hash.slice(1));
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2111,9 +2111,9 @@ dns-txt@^2.0.2:
dependencies:
buffer-indexof "^1.0.0"

documentalist@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/documentalist/-/documentalist-1.2.0.tgz#0c543d812e27e15ba665b76cf0bb143b36d3acce"
documentalist@^1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/documentalist/-/documentalist-1.3.2.tgz#26f9a053c00e918d02c3f6865c8b314487427c71"
dependencies:
"@types/kss" "^3.0.0"
glob "^7.1.1"
Expand Down

1 comment on commit 50ee677

@blueprint-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upgrade documentalist, include index in renderType (#2510)

Preview: documentation | landing | table

Please sign in to comment.