diff --git a/server/pages/Api.js b/server/pages/Api.js index c30430097..063aa9dab 100644 --- a/server/pages/Api.js +++ b/server/pages/Api.js @@ -4,12 +4,9 @@ import Grid from 'styled-components-grid'; import { Helmet } from 'react-helmet'; import styled from 'styled-components'; import Header from './components/Header'; +import Content from './components/Content'; const Container = styled.div` - max-width: 720px; - margin: 0 auto; - padding: 0 2em; - pre { padding: 0.5em 1em; background: #f9fbfc; @@ -49,7 +46,11 @@ const Container = styled.div` h3 { code { - font-size: 1.08em; + font-size: 1em; + padding: 2px 4px; + background: #333; + border-radius: 4px; + color: #fff; } } `; @@ -64,612 +65,665 @@ export default function Pricing() {

Developers

Outline is built on an open, best-in-class, API

- -

- As developers, it’s our mission to make the API as great as possible. - While Outline is still in public beta, we might make small - adjustments, including breaking changes to the API. -

-

Making requests

-

- Outline’s API follows simple RPC style conventions where each API - endpoint is a method on{' '} - https://www.getoutline.com/api/<METHOD>. Both{' '} - GET and POST methods are supported but it’s - recommeded that you make all call using POST. Only HTTPS - is supported in production. -

+ + + + + + + +

+ As developers, it’s our mission to make the API as great as + possible. While Outline is still in public beta, we might make + small adjustments, including breaking changes to the API. +

-

- For GET requests query string parameters are expected - (e.g. - /api/document.info?id=...&token=...). When making{' '} - POST requests, request parameters are parsed depending on{' '} - Content-Type header. To make a call using JSON payload, - one must pass Content-Type: application/json header: -

+

Making requests

+

+ Outline’s API follows simple RPC style conventions where each + API endpoint is a method on{' '} + https://www.getoutline.com/api/<METHOD>. Both{' '} + GET and POST methods are supported but + it’s recommeded that you make all call using POST. + Only HTTPS is supported in production. +

-

- Example POST request: -

-
-          
-            {`curl https://www.getoutline.com/api/documents.info
+              

+ For GET requests query string parameters are + expected (e.g. + /api/document.info?id=...&token=...). When making{' '} + POST requests, request parameters are parsed + depending on Content-Type header. To make a call + using JSON payload, one must pass{' '} + Content-Type: application/json header: +

+ +

+ Example POST request: +

+
+                
+                  {`curl https://www.getoutline.com/api/documents.info
   -X POST
   -H 'authorization: Bearer API_KEY'
   -H 'content-type: application/json'
   -H 'accept: application/json'
   -d '{"id": "outline-api-NTpezNwhUP"}'
 `}
-          
-        
+
+
-

- Example GET request: -

-
-          
-            {`curl https://www.getoutline.com/api/documents.info?id=outline-api-NTpezNwhUP&token=API_KEY
+              

+ Example GET request: +

+
+                
+                  {`curl https://www.getoutline.com/api/documents.info?id=outline-api-NTpezNwhUP&token=API_KEY
 `}
-          
-        
+
+
-

Authentication

+

Authentication

-

- To access private API endpoints, you must provide a valid API key. You - can create new API keys in your{' '} - account settings. Be - careful when handling your keys as they give access to all of your - documents. -

+

+ To access private API endpoints, you must provide a valid API + key. You can create new API keys in your{' '} + account settings. Be + careful when handling your keys as they give access to all of + your documents. +

-

- To authenticate with Outline API, you can supply the API key as a - header (Authorization: Bearer YOUR_API_KEY) or as part of - the payload using token parameter. If you’re making{' '} - GET requests, header based authentication is recommended - so that your keys don’t leak into logs. -

+

+ To authenticate with Outline API, you can supply the API key as + a header (Authorization: Bearer YOUR_API_KEY) or as + part of the payload using token parameter. If + you’re making GET requests, header based + authentication is recommended so that your keys don’t leak into + logs. +

-

- Some API endpoints allow unauhenticated requests for public resources - and they can be called without an API key. -

+

+ Some API endpoints allow unauhenticated requests for public + resources and they can be called without an API key. +

-

Errors

+

Errors

-

- All successful API requests will be returned with 200{' '} - status code and ok: true in the response payload. If - there’s an error while making the request, appropriate status code is - returned with the error message: -

+

+ All successful API requests will be returned with{' '} + 200 status code and ok: true in the + response payload. If there’s an error while making the request, + appropriate status code is returned with the error{' '} + message: +

-
-          
-            {`{
+              
+                
+                  {`{
   "ok": false,
   "error: "Not Found"
 }
 `}
-          
-        
+
+
+
+
-

Methods

- - - - This method returns the user and team info for the user identified - by the token. - - - + + + + This method returns the user and team info for the user + identified by the token. + + + - - List all of the users in the team. - - + + List all of the users in the team. + + - - - This method returns the profile info for the user identified by - the token. - - - - - + + + This method returns the profile info for the user identified by + the token. + + + + + - - - You can upload small files and images as part of your documents. - All files are stored using Amazon S3. Instead of uploading files - to Outline, you need to upload them directly to S3 with special - credentials which can be obtained through this endpoint. - - - - - - - + + + You can upload small files and images as part of your documents. + All files are stored using Amazon S3. Instead of uploading files + to Outline, you need to upload them directly to S3 with special + credentials which can be obtained through this endpoint. + + + + + + + - - - Promote a user to be a team admin. This endpoint is only available - for admin users. - - - - - + + + Promote a user to be a team admin. This endpoint is only + available for admin users. + + + + + - - - Demote existing team admin if there are more than one as one admin - is always required. This endpoint is only available for admin - users. - - - - - + + + Demote existing team admin if there are more than one as one + admin is always required. This endpoint is only available for + admin users. + + + + + - - - Admin can suspend users to reduce the number of accounts on their - billing plan or prevent them from accessing documention. - - - - - + + + Admin can suspend users to reduce the number of accounts on + their billing plan or prevent them from accessing documention. + + + + + - - - Admin can re-active a suspended user. This will update the billing - plan and re-enable their access to the documention. - - - - - + + + Admin can re-active a suspended user. This will update the + billing plan and re-enable their access to the documention. + + + + + - - List all your document collections. - - + + List all your document collections. + + - - - Returns detailed information on a document collection. - - - - - + + + Returns detailed information on a document collection. + + + + + - - Creates a new document collection. - - - - - + + Creates a new document collection. + + + + + - - - This method allows you to modify already created document. - - - - - - - + + + This method allows you to modify already created document. + + + + + + + - - - Delete a collection and all of its documents. This action can’t be - undone so please be careful. - - - - - + + + Delete a collection and all of its documents. This action can’t + be undone so please be careful. + + + + + - - List all published documents. - - - - + + List all published documents. + + + + - - List all your draft documents. - + + List all your draft documents. + - - -

- This method returns information for a document with a specific - ID. The following identifiers are allowed: -

-
    -
  • - UUID - id field of the document -
  • -
  • - URI identifier - Human readable identifier used in Outline - URLs (e.g. outline-api-i48ZEZc5zjXndcP) -
  • -
-
- - - - -
+ + +

+ This method returns information for a document with a specific + ID. The following identifiers are allowed: +

+
    +
  • + UUID - id field of the document +
  • +
  • + URI identifier - Human readable identifier used in Outline + URLs (e.g. outline-api-i48ZEZc5zjXndcP) +
  • +
+
+ + + + +
- - - This methods allows you to search all of your documents with - keywords. - - - - - + + + This methods allows you to search all of your documents with + keywords. + + + + + - - - This method allows you to publish a new document under an existing - collection. By default a document is set to the parent collection - root. If you want to create a subdocument, you can pass{' '} - parentDocument to set parent document. - - - - ID of the collection to which the document is - created - - } - required - /> - - - - ID of the parent document within the collection - - } - /> - - true by default. Pass false to - create a draft. - - } - /> - - + + + This method allows you to publish a new document under an + existing collection. By default a document is set to the parent + collection root. If you want to create a subdocument, you can + pass parentDocument to set parent document. + + + + ID of the collection to which the document is + created + + } + required + /> + + + + ID of the parent document within the + collection + + } + /> + + true by default. Pass false to + create a draft. + + } + /> + + - - - This method allows you to modify already created document. - - - - - - - Pass true to publish a draft. - - } - /> - - Pass true to signify an autosave. This skips - creating a revision. - - } - /> - - Pass true to signify the end of an editing - session. This will trigger documents.update hooks. - - } - /> - - + + + This method allows you to modify already created document. + + + + + + + Pass true to publish a draft. + + } + /> + + Pass true to signify an autosave. This skips + creating a revision. + + } + /> + + Pass true to signify the end of an editing + session. This will trigger documents.update hooks. + + } + /> + + - - - Move a document into a new location inside the collection. This is - easily done by defining the parent document ID. If no parent - document is provided, the document will be moved to the collection - root. - - - - - - + + + Move a document into a new location inside the collection. This + is easily done by defining the parent document ID. If no parent + document is provided, the document will be moved to the + collection root. + + + + + + - - - Delete a document and all of its child documents if any. - - - - - + + + Delete a document and all of its child documents if any. + + + + + - - - Get a document with its ID or URL identifier from user’s - collections. - - - - - + + + Get a document with its ID or URL identifier from user’s + collections. + + + + + - - - Restores a document to a previous revision by creating a new - revision with the contents of the given revisionId. - - - - - - + + + Restores a document to a previous revision by creating a new + revision with the contents of the given revisionId. + + + + + + - - - Pins a document to the collection home. The pinned document is - visible to all members of the team. - - - - - + + + Pins a document to the collection home. The pinned document is + visible to all members of the team. + + + + + - - - Unpins a document from the collection home. It will still remain - in the collection itself. - - - - - + + + Unpins a document from the collection home. It will still remain + in the collection itself. + + + + + - - - Star (favorite) a document for authenticated user. - - - - - + + + Star (favorite) a document for authenticated user. + + + + + - - - Unstar a starred (favorited) document for authenticated user. - - - - - + + + Unstar a starred (favorited) document for authenticated user. + + + + + - - - Return recently viewed documents for the authenticated user - - - + + + Return recently viewed documents for the authenticated user + + + - - - Return recently starred documents for the authenticated user - - - + + + Return recently starred documents for the authenticated user + + + - - Return pinned documents for a collection - - + + + Return pinned documents for a collection + + + - - Return a specific revision of a document. - - - - - + + + Return a specific revision of a document. + + + + + + - - - Return revisions for a document. Upon each edit, a new revision is - stored. - - - - - + + + Return revisions for a document. Upon each edit, a new revision + is stored. + + + + + - - - List all your currently shared document links. - - - + + + List all your currently shared document links. + + + - - - Creates a new share link that can be used by anyone to access a - document. If you request multiple shares for the same document - with the same user the same share will be returned. - - - - - + + + Creates a new share link that can be used by anyone to access a + document. If you request multiple shares for the same document + with the same user the same share will be returned. + + + + + - - - Makes the share link inactive so that it can no longer be used to - access the document. - - - - - -
-
+ + + Makes the share link inactive so that it can no longer be used + to access the document. + + + + + + +
+ ); } -const MethodList = styled.ul` - margin-bottom: 80px; +const MenuItem = styled.a` + display: flex; + align-items: center; + font-size: 16px; + color: ${props => props.theme.text}; +`; + +const List = styled.ul` + list-style: none; + margin: 0; + padding: 0; `; const Methods = (props: { children: React.Node }) => { @@ -677,16 +731,26 @@ const Methods = (props: { children: React.Node }) => { const methods = children.map(child => child.props.method); return ( -
- - {methods.map(method => ( -
  • - {method} -
  • - ))} -
    - {children} -
    + + + + + + {children} + + ); }; @@ -741,7 +805,7 @@ const Method = (props: MethodProps) => { return (

    - {props.method} - {props.label} + {props.method} {props.label}

    {description}
    HTTP request & arguments diff --git a/server/pages/Changelog.js b/server/pages/Changelog.js index 6dcfdacb1..e7ca70d7d 100644 --- a/server/pages/Changelog.js +++ b/server/pages/Changelog.js @@ -30,9 +30,7 @@ function Changelog({ releases }: Props) {

    Changelog

    -

    - We’re building in public. Here’s what we’ve been changing recently. -

    +

    We’re building in public. Here’s what has changed recently.

    diff --git a/server/pages/components/Header.js b/server/pages/components/Header.js index c17908cf1..c82cec15b 100644 --- a/server/pages/components/Header.js +++ b/server/pages/components/Header.js @@ -32,8 +32,8 @@ const Wrapper = styled.div` content: ''; position: absolute; top: 0; - left: -10%; - width: 120%; + left: -30px; + width: 100vw; height: 100%; background: ${props => props.background || 'transparent'}; z-index: -10;