Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/open-rpc/docs-react
OpenRPC documentation as a react component.
https://github.com/open-rpc/docs-react
docs-react openrpc-documentation
Last synced: 30 days ago
JSON representation
OpenRPC documentation as a react component.
- Host: GitHub
- URL: https://github.com/open-rpc/docs-react
- Owner: open-rpc
- Created: 2019-03-21T18:00:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-03T19:20:36.000Z (over 3 years ago)
- Last Synced: 2024-10-29T20:18:38.614Z (about 1 month ago)
- Topics: docs-react, openrpc-documentation
- Language: TypeScript
- Homepage:
- Size: 2.08 MB
- Stars: 9
- Watchers: 3
- Forks: 8
- Open Issues: 35
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-json-rpc - open-rpc/docs-react - OpenRPC documentation as a react component. (Tools / Interface Description)
README
# docs-react
OpenRPC documentation as a react component#### What is this?
This is a react component that will render documentation for a given OpenRPC document.**Screenshot**:
![image](https://user-images.githubusercontent.com/364566/54795109-1b1f5b80-4c08-11e9-9ba9-cc2f2d96c692.png)
#### How do I use this?
##### Installation:
```
npm install --save @open-rpc/docs-react
```
##### Usage:
```
import Documentation from "@open-rpc/docs-react";
```
and then use it somewhere:```
```
##### Example in a new project:
###### create a new typescript project with `create-react-app`
```
npx create-react-app --typescript
``````
cd
npm install .
npm install @open-rpc/docs-react @open-rpc/meta-schema --save
```###### index.ts
```
import React from 'react';
import ReactDOM from 'react-dom';
import Documentation from "@open-rpc/docs-react";
import { OpenrpcDocument } from '@open-rpc/meta-schema';const schema: OpenrpcDocument = {
openrpc: "1.2.4",
info: {
"version": "0.0.0-development",
"title": "My New API"
},
methods: []
};ReactDOM.render(, document.getElementById("root"));
```
###### screenshot
![image](https://user-images.githubusercontent.com/364566/54797953-920e2180-4c13-11e9-9ff8-723a836d0e2c.png)