Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Apr 30, 2019
1 parent 2e695dc commit a1aba59
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 13 deletions.
3 changes: 2 additions & 1 deletion docs/src/components/api.js
@@ -1,7 +1,7 @@
import React, { Component } from "react"
import apiStyles from './api.module.css'
import ApiSubMenu from "../components/api-sub-menu"
import EndPointGroup from "../components/end-point-group"
import EndPointGroup from "../components/endpoint-group"

export default class Api extends Component {

Expand Down Expand Up @@ -72,6 +72,7 @@ export default class Api extends Component {
</ol>
</nav>
<main className={apiStyles.container}>
<h1>octokit/rest.js</h1>
{this.props.data.staticMethods.edges.map(({ node }) => {
return <React.Fragment key={node.id}>
<h2 id={node.fields.idName}>{node.frontmatter.title}</h2>
Expand Down
@@ -1,5 +1,5 @@
import React, { Component } from "react"
import EndPoint from "../components/end-point"
import EndPoint from "../components/endpoint"

export default class EndPointGroup extends Component {
constructor(props) {
Expand Down
Expand Up @@ -44,7 +44,13 @@ export default class EndPoint extends Component {
return (
<React.Fragment>
<h3 id={method.id} ref={this.headlineRef}>{method.name}</h3>

<div dangerouslySetInnerHTML={{ __html: marked(method.description) }} />

<div className="gatsby-highlight" data-language="js">
<pre className="language-js"><code className="language-js" dangerouslySetInnerHTML={{ __html: Prism.highlight(method.example, Prism.languages.javascript, 'javascript') }} ></code></pre>
</div>

<h4>Parameters</h4>
<div className={apiStyles.table}>
<table>
Expand All @@ -66,9 +72,6 @@ export default class EndPoint extends Component {
</tbody>
</table>
</div>
<div className="gatsby-highlight" data-language="js">
<pre className="language-js"><code className="language-js" dangerouslySetInnerHTML={{ __html: Prism.highlight(method.example, Prism.languages.javascript, 'javascript') }} ></code></pre>
</div>
</React.Fragment>
)
}
Expand Down
2 changes: 0 additions & 2 deletions docs/src/components/index-page.js
Expand Up @@ -41,8 +41,6 @@ export default class IndexPage extends Component {
const data = this.props.data
return <div>
<header className={layoutStyles.header}>
<h1>octokit/rest.js</h1>

<StaticQuery
query={graphql`
query SearchIndexQuery {
Expand Down
18 changes: 17 additions & 1 deletion docs/src/components/layout.js
Expand Up @@ -2,7 +2,23 @@ import React, { Component } from 'react'

class Layout extends Component {
render() {
return this.props.children
return (

<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>

<title>
octokit/rest.js
</title>
</head>
<body>
{this.props.children}
</body>
</html>
)
}
}

Expand Down
8 changes: 3 additions & 5 deletions docs/src/pages/api/00_introduction.md
Expand Up @@ -2,9 +2,7 @@
title: "Introduction"
---

### Usage

#### Node
### Node

Install with `npm install @octokit/rest`.

Expand All @@ -20,7 +18,7 @@ octokit.repos.getForOrg({
})
```

#### Browser
### Browser

1. Download `octokit-rest.min.js` from the latest release: https://github.com/octokit/rest.js/releases

Expand All @@ -44,7 +42,7 @@ octokit.repos.getForOrg({
})
```

#### Client options
### Client options

All available client options with default values

Expand Down
1 change: 1 addition & 0 deletions docs/src/pages/index.js
Expand Up @@ -37,6 +37,7 @@ export const query = graphql`
name
description
example
documentationUrl
params {
name
required
Expand Down

0 comments on commit a1aba59

Please sign in to comment.