Skip to content

Commit

Permalink
docs: update usage (#214)
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Henrique Dias <[email protected]>
  • Loading branch information
hacdias authored Jun 5, 2021
1 parent f79075a commit e8586b3
Show file tree
Hide file tree
Showing 4 changed files with 214 additions and 197 deletions.
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ipfs-deploy

[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
[![standard-readme
compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
[![](https://img.shields.io/github/workflow/status/ipfs-shipyard/ipfs-deploy/Node.js%20CI/master?style=flat-square)](https://github.com/ipfs-shipyard/ipfs-deploy/actions/workflows/ci.yaml)
Expand All @@ -11,13 +12,12 @@
<img src="https://user-images.githubusercontent.com/5447088/62481739-220bcc80-b7ab-11e9-8a9e-25f23ed92768.gif">
</p>

The goal of `ipfs-deploy` is to make it as easy as possible to
**deploy a static website to IPFS.**
The goal of `ipfs-deploy` is to make it as easy as possible to **deploy a static
website to IPFS.**

- [Install](#install)
- [Usage](#usage)
- [API](#api)
- [Security](#security)
- [Contributing](#contributing)
- [Users](#users)
- [License](#license)
Expand All @@ -35,7 +35,8 @@ ipd public/
ipfs-deploy public/
```

You can run it directly with [npx](https://www.npmjs.com/package/npx 'npx') so you don't need to install it:
You can run it directly with [npx](https://www.npmjs.com/package/npx 'npx') so
you don't need to install it:

```bash
npx ipfs-deploy _site
Expand All @@ -50,12 +51,9 @@ Please check [md/usage.md](md/usage.md) for further information!

## API

There is an API so, however it is somewhat unstable and subject to change. Please check [md/api.md](md/api.md) for further information!
> There is an API so, however it is somewhat unstable and subject to change.
## Security

- We use `dotenv` to handle credentials. Never commit your `.env` file to source control.
- By default, we do **not** upload hidden files (dot files) to IPFS. If you are sure you want them to be added, use the flag `-H, --hidden`.
Please check [md/api.md](md/api.md) for further information!

## Contributing

Expand All @@ -70,8 +68,8 @@ Please check [md/contributing.md](md/contributing.md) for further information!
- _Your website here_

If you use this package to deploy your website, please send a pull request so I
can add it to the [Users](#users) section in the README. (I reserve the right
to exercise discretion.)
can add it to the [Users](#users) section in the README. (I reserve the right to
exercise discretion.)

## License

Expand Down
4 changes: 2 additions & 2 deletions md/api.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Library API

We've been trying to make `ipfs-deploy` more friendly as a library. However, we have
no documentation yet.
We've been trying to make `ipfs-deploy` more friendly as a library. However, we
have no documentation yet.

```javascript
const { deploy, dnsLinkers, dnsLinkersMap, pinners, pinnersMap} = require('ipfs-deploy')
Expand Down
42 changes: 22 additions & 20 deletions md/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@
- [Adding a Pinning Service](#adding-a-pinning-service)
- [Adding a DNS Provider](#adding-a-dns-provider)

This project was initially started by [@agentofuser](https://github.com/agentofuser),
who made a lot of awesome work in here. Posteriorly, it was transferred to ipfs-shipyard.
Thanks for starting this awesome project!
This project was initially started by
[@agentofuser](https://github.com/agentofuser), who made a lot of awesome work
in here. Posteriorly, it was transferred to ipfs-shipyard. Thanks for starting
this awesome project!

Everyone is welcome to contribute and add new features!
[See everyone who has contributed](https://github.com/ipfs-shipyard/ipfs-deploy/graphs/contributors)!
Everyone is welcome to contribute and add new features! [See everyone who has
contributed](https://github.com/ipfs-shipyard/ipfs-deploy/graphs/contributors)!

## Note about SDKs

Most services offer Node.js SDKs in the format of a library that we can just import.
Although they are extremely handy, we recommend to try relying on pure HTTP APIs
to avoid the growth of this repository in size.
Most services offer Node.js SDKs in the format of a library that we can just
import. Although they are extremely handy, we recommend to try relying on pure
HTTP APIs to avoid the growth of this repository in size.

## Adding a Pinning Service

To add support for a new pinning service, you should start by creating a file with the
name of the pinning service. Let's say it's called `PinningService`: create a file at
`src/pinners/pinning-service.js` with the following contents:
To add support for a new pinning service, you should start by creating a file
with the name of the pinning service. Let's say it's called `PinningService`:
create a file at `src/pinners/pinning-service.js` with the following contents:

```javascript
'use strict'
Expand Down Expand Up @@ -55,17 +56,17 @@ class PinningService {
module.exports = PinningService
```

Where `options` in the constructor are the required parameters to connect to such service.
You will also need to add the service to the list `pinners` at `src/pinners/index.js`, as well
as adding the required options in `src/cli.js`.
Where `options` in the constructor are the required parameters to connect to
such service. You will also need to add the service to the list `pinners` at
`src/pinners/index.js`, as well as adding the required options in `src/cli.js`.

Also, do not forget to add documentation!

## Adding a DNS Provider

To add support for a new DNS Provider, you should start by creating a file with the
name of the DNS provider. Let's say it's called `DNS Provider`: create a file at
`src/dnslinkers/dns-provider.js` with the following contents:
To add support for a new DNS Provider, you should start by creating a file with
the name of the DNS provider. Let's say it's called `DNS Provider`: create a
file at `src/dnslinkers/dns-provider.js` with the following contents:

```javascript
class DNSProvider {
Expand Down Expand Up @@ -98,8 +99,9 @@ module.exports = DNSProvider

```

Where `options` in the constructor are the required parameters to connect to such provider.
You will also need to add the provider to the list `dnsLinkers` at `src/dnslinkers/index.js`, as well
as adding the required options in `src/cli.js`.
Where `options` in the constructor are the required parameters to connect to
such provider. You will also need to add the provider to the list `dnsLinkers`
at `src/dnslinkers/index.js`, as well as adding the required options in
`src/cli.js`.

Also, do not forget to add documentation!
Loading

0 comments on commit e8586b3

Please sign in to comment.