1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-06-28 00:27:59 +02:00
docs/README.md

134 lines
5.0 KiB
Markdown
Raw Normal View History

2018-11-09 22:59:22 +01:00
[![banner](https://raw.githubusercontent.com/oceanprotocol/art/master/github/repo-banner%402x.png)](https://docs.oceanprotocol.com)
2018-11-07 11:25:05 +01:00
<h1 align="center">docs</h1>
2021-01-05 09:29:13 +01:00
> 🐬 Ocean Protocol documentation. https://docs.oceanprotocol.com
2018-11-07 11:25:05 +01:00
[![Build Status](https://travis-ci.com/oceanprotocol/docs.svg?token=3psqw6c8KMDqfdGQ2x6d&branch=master)](https://travis-ci.com/oceanprotocol/docs)
2019-09-18 11:03:20 +02:00
[![Maintainability](https://api.codeclimate.com/v1/badges/d39837421591f0bc2550/maintainability)](https://codeclimate.com/github/oceanprotocol/docs/maintainability)
2018-11-07 12:24:53 +01:00
[![js oceanprotocol](https://img.shields.io/badge/js-oceanprotocol-7b1173.svg)](https://github.com/oceanprotocol/eslint-config-oceanprotocol)
2018-11-10 15:04:16 +01:00
[![css bigchaindb](https://img.shields.io/badge/css-bigchaindb-39BA91.svg)](https://github.com/bigchaindb/stylelint-config-bigchaindb)
2018-11-07 13:05:13 +01:00
[![Greenkeeper badge](https://badges.greenkeeper.io/oceanprotocol/docs.svg?token=2757ede2de02f4679c4dfc6597a331a26f2f206fed53bfeb708c64cbe3d5f55f&ts=1541590505792)](https://greenkeeper.io/)
2018-11-07 12:24:53 +01:00
---
2018-11-09 12:46:43 +01:00
**These docs are meant to be viewed on [docs.oceanprotocol.com](https://docs.oceanprotocol.com). You can still browse them here but links or images might not work in some places.**
2018-11-11 11:25:14 +01:00
**If you want to contribute to these docs, then keep reading.**
2018-11-11 04:02:34 +01:00
2018-11-09 12:46:43 +01:00
---
2019-09-18 11:03:20 +02:00
- [Content](#content)
- [Development](#development)
- [Linting & Formatting](#linting--formatting)
- [Editor Setup: VS Code](#editor-setup-vs-code)
- [Deployment](#deployment)
- [License](#license)
2018-11-07 11:25:05 +01:00
## Content
2019-07-16 11:52:12 +02:00
To write or update content, refer to the documentation of the documentation:
2018-11-07 11:25:05 +01:00
2019-07-16 11:52:12 +02:00
- [**Documentation: Content →**](docs/content.md)
- [**Documentation: API References →**](docs/apis.md)
- [**Documentation: GitHub Data Fetching →**](docs/github.md)
- [**Documentation: Repository Component →**](docs/repositories.md)
2018-11-07 11:25:05 +01:00
## Development
2019-07-16 11:52:12 +02:00
The site is a React app built with [Gatsby](https://www.gatsbyjs.org), pulling its content from local and external Markdown files, and from various APIs.
2019-07-16 11:52:12 +02:00
To start, clone this repo and set your `GITHUB_TOKEN` (see [GitHub GraphQL API](docs/github.md#GitHub-GraphQL-API)):
2018-11-07 12:24:53 +01:00
2018-11-07 11:25:05 +01:00
```bash
git clone --recurse-submodules git@github.com:oceanprotocol/docs.git
2018-11-07 12:24:53 +01:00
cd docs/
2018-11-11 04:02:34 +01:00
# add GITHUB_TOKEN
cp .env.sample .env
vi .env
2019-07-16 11:52:12 +02:00
```
2018-11-11 04:02:34 +01:00
2019-07-16 11:52:12 +02:00
Then install dependencies and start up the development server:
```bash
2018-11-07 11:25:05 +01:00
npm i
npm start
```
2019-07-16 11:52:12 +02:00
Alternatively, you can use [Docker Compose](https://docs.docker.com/compose/) to do the same, but without using your local system:
2018-11-10 14:47:09 +01:00
```bash
docker-compose up
```
2019-07-16 11:52:12 +02:00
Either one of these commands will expose a hot-reloading server under:
- [localhost:8000](http://localhost:8000)
- [localhost:8000/\_\_\_graphql](http://localhost:8000/___graphql)
2018-11-10 14:47:09 +01:00
## Linting & Formatting
2018-11-12 12:39:11 +01:00
To enforce a consistent code style, linting is setup for pretty much every file. Linting is part of the test suite, meaning builds on Travis will fail in case of linting errors.
In this repo the following tools are setup for that:
2018-11-12 12:45:10 +01:00
- ESLint with [eslint-config-oceanprotocol](https://github.com/oceanprotocol/eslint-config-oceanprotocol)
2018-11-12 12:39:11 +01:00
- [markdownlint](https://github.com/DavidAnson/markdownlint)
- [Prettier](https://prettier.io)
```bash
# only run linting checks
npm run lint
# auto-formatting of all js, css, md, yml files
npm run format
```
### Editor Setup: VS Code
2018-11-12 13:00:41 +01:00
If you use VS Code as your editor, you can install those extensions to get linting as you type, and auto-formatting as you save:
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
- [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint)
2018-11-16 11:12:28 +01:00
## Deployment
Automatic deployments are triggered upon successful tests & builds on Travis:
2020-12-03 18:35:45 +01:00
- push to `main` initiates a live deployment
2019-07-16 11:52:12 +02:00
→ [docs.oceanprotocol.com](https://docs.oceanprotocol.com)
2018-11-16 11:12:28 +01:00
- any Pull Request, and subsequent pushes to it, initiates a beta deployment
2019-07-16 11:52:12 +02:00
→ [betadocs.oceanprotocol.com](https://betadocs.oceanprotocol.com)
2018-11-16 11:12:28 +01:00
The deploy command simply calls the [`scripts/deploy.sh`](scripts/deploy.sh) script, syncing the contents of the `public/` folder to S3:
```bash
npm run deploy
```
Requires authorization against AWS with [one of the various ways](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-credentials-node.html), on Travis this is done with those environment variables:
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
- `AWS_DEFAULT_REGION`
2018-11-07 11:25:05 +01:00
## License
2018-11-11 11:25:14 +01:00
```text
Copyright 2020 Ocean Protocol Foundation Ltd.
2018-11-07 11:25:05 +01:00
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
2018-11-07 12:24:53 +01:00
```