Skip to content

Commit 69176a2

Browse files
authored
docs: publish tsdocs for this module (#75)
Publishes tsdocs to the gh-pages branch.
1 parent c132f87 commit 69176a2

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ dist/
33
coverage/
44
.coverage/
55
package-lock.json
6+
.docs

README.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
# @ipld/dag-pb <!-- omit in toc -->
22

33
[![codecov](https://img.shields.io/codecov/c/github/ipld/js-dag-pb.svg?style=flat-square)](https://codecov.io/gh/ipld/js-dag-pb)
4-
[![CI](https://img.shields.io/github/workflow/status/ipld/js-dag-pb/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/ipld/js-dag-pb/actions/workflows/js-test-and-release.yml)
4+
[![CI](https://img.shields.io/github/actions/workflow/status/ipld/js-dag-pb/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/ipld/js-dag-pb/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)
55

66
> JS implementation of DAG-PB
77
88
## Table of contents <!-- omit in toc -->
99

1010
- [Install](#install)
11+
- [Browser `<script>` tag](#browser-script-tag)
1112
- [Overview](#overview)
1213
- [Example](#example)
1314
- [Usage](#usage)
1415
- [`prepare()`](#prepare)
15-
- [`createNode()` & `createLink()`](#createnode--createlink)
16+
- [`createNode()` \& `createLink()`](#createnode--createlink)
17+
- [API Docs](#api-docs)
1618
- [License](#license)
1719
- [Contribute](#contribute)
1820

@@ -22,6 +24,14 @@
2224
$ npm i @ipld/dag-pb
2325
```
2426

27+
### Browser `<script>` tag
28+
29+
Loading this module through a script tag will make it's exports available as `IpldDagPb` in the global namespace.
30+
31+
```html
32+
<script src="https://unpkg.com/@ipld/dag-pb/dist/index.min.js"></script>
33+
```
34+
2535
## Overview
2636

2737
An implementation of the [DAG-PB spec](https://github.com/ipld/specs/blob/master/block-layer/codecs/dag-pb.md) for JavaScript designed for use with [multiformats](https://github.com/multiformats/js-multiformats) or via the higher-level `Block` abstraction in [@ipld/block](https://github.com/ipld/js-block).
@@ -123,6 +133,7 @@ run().catch((err) => console.error(err))
123133

124134
Results in:
125135

136+
```
126137
{
127138
Data: Uint8Array(5) [ 0, 1, 2, 3, 4 ],
128139
Links: [
@@ -142,6 +153,11 @@ Results in:
142153
Encoded: 122d0a2212207521fe19c374a97759226dc5c0c8e674e73950e81b211f7dd3b6b30883a08a511205
143154
6c696e6b31186412300a2401711220a47a29adb950ee698ae0f272019ae902b6aa06ee5f53bc3da2
144155
ebea6fac27583d12056c696e6b3218c8010a050001020304
156+
```
157+
158+
## API Docs
159+
160+
- <https://ipld.github.io/js-dag-pb>
145161

146162
## License
147163

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
},
149149
"scripts": {
150150
"clean": "aegir clean",
151+
"docs": "aegir docs",
151152
"lint": "aegir lint",
152153
"build": "aegir build",
153154
"release": "aegir release",

0 commit comments

Comments
 (0)