-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] API browser and "see" JSDoc tag support (#2041)
- Loading branch information
Showing
17 changed files
with
171 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright 2017 Palantir Technologies, Inc. All rights reserved. | ||
* | ||
* Licensed under the terms of the LICENSE file distributed with this project. | ||
*/ | ||
|
||
import { IProps } from "@blueprintjs/core"; | ||
import * as React from "react"; | ||
import { DocumentationContextTypes, IDocumentationContext } from "../../common/context"; | ||
|
||
export interface IApiLinkProps extends IProps { | ||
children?: never; | ||
name: string; | ||
} | ||
|
||
/** | ||
* Renders a link to open a symbol in the API Browser. | ||
*/ | ||
export class ApiLink extends React.PureComponent<IApiLinkProps> { | ||
public static contextTypes = DocumentationContextTypes; | ||
public context: IDocumentationContext; | ||
|
||
public render() { | ||
const { className, name } = this.props; | ||
return ( | ||
<a className={className} href={`#api/${name}`} onClick={this.handleClick}> | ||
{name} | ||
</a> | ||
); | ||
} | ||
|
||
private handleClick = (evt: React.MouseEvent<HTMLAnchorElement>) => { | ||
evt.preventDefault(); | ||
this.context.showApiDocs(this.props.name); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2017 Palantir Technologies, Inc. All rights reserved. | ||
// Licensed under the terms of the LICENSE file distributed with this project. | ||
|
||
@import "variables"; | ||
|
||
.docs-api-dialog { | ||
width: auto; | ||
height: 80vh; | ||
padding: 0; | ||
|
||
.docs-modifiers { | ||
display: flex; | ||
flex-direction: column; | ||
margin: 0; | ||
width: $content-width; | ||
|
||
> * { | ||
padding: $pt-grid-size ($pt-grid-size * 2); | ||
} | ||
} | ||
|
||
.docs-interface-header { | ||
flex: 0 0 auto; | ||
margin: 0; | ||
} | ||
|
||
.docs-interface-table { | ||
overflow: auto; | ||
padding-bottom: $pt-grid-size * 2; | ||
} | ||
} | ||
|
||
.docs-code { | ||
font-family: $pt-font-family-monospace; | ||
font-weight: 600; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright 2017 Palantir Technologies, Inc. All rights reserved. | ||
* | ||
* Licensed under the terms of the LICENSE file distributed with this project. | ||
*/ | ||
|
||
import { ITag } from "documentalist/dist/client"; | ||
import * as React from "react"; | ||
import { DocumentationContextTypes, IDocumentationContext } from "../common/context"; | ||
|
||
export const SeeTag: React.SFC<ITag> = ({ value }, { renderType }: IDocumentationContext) => ( | ||
<p>See: {renderType(value)}</p> | ||
); | ||
SeeTag.contextTypes = DocumentationContextTypes; | ||
SeeTag.displayName = "Docs.SeeTag"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
1d2ec47
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[docs] API browser and "see" JSDoc tag support (#2041)
Preview: documentation | landing | table