https://github.com/taehwanno/react-github-renderer
:octocat: A react custom renderer for Github
https://github.com/taehwanno/react-github-renderer
custom-renderer react react-renderer
Last synced: 8 months ago
JSON representation
:octocat: A react custom renderer for Github
- Host: GitHub
- URL: https://github.com/taehwanno/react-github-renderer
- Owner: taehwanno
- License: mit
- Created: 2017-11-26T09:49:23.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-28T15:50:23.000Z (about 8 years ago)
- Last Synced: 2025-05-07T16:11:25.181Z (8 months ago)
- Topics: custom-renderer, react, react-renderer
- Language: JavaScript
- Homepage: https://npm.im/react-github-renderer
- Size: 112 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - react-github-renderer
README
# react-github-renderer [](https://circleci.com/gh/taehwanno/react-github-renderer/tree/master) [](https://badge.fury.io/js/react-github-renderer)
> A react custom renderer for Github :octocat:
**Table of contents**
- [Installation](#installation)
- [Motivation](#motivation)
- [API](#api)
- [Renderer](#renderer)
- `ReactGithub.render(element)`
- [Components](#components)
- [Gists](#gists)
- ``
- ``
- [Releases](#releases)
- ``
- [Examples](#examples)
# Installation
```bash
$ npm install --save react-github-renderer
```
Alternatively, using yarn.
```bash
$ yarn add react-github-renderer
```
# Motivation
Just for fun. I have wanted to look into react implementation (renderer, reconciler).
# API
## Renderer
- `ReactGithub.render(element)`
## Components
- ### Gists
```jsx
```
```jsx
```
- `description` (*String*): a description of the gist (Default: `''`)
- `isPublic` (*Boolean*): indicates whether the gist is public. (Default: `false`)
```jsx
```
- `name` (*String*, **Required**): name of file
- `children` (*String*, **Required**): contents of file
- ### Releases
```jsx
```
- `tagName` (*String*, **Required**): the name of the tag
- `targetCommitish` (*String*): the commitish value that determines where the Git tag is created from (Default: `master`)
- `name` (*String*): the name of the release
- `draft` (*Boolean*): `true` to create a draft (unpublished) release, `false` to create a published one. (Default: `false`)
- `prerelease` (*Boolean*): `true` to identify the release as a prerelease. `false` to identify the release as a full release. (Default: `false`)
- `children` (*String*): text describing the contents of the tag
# Examples
- ## [Gists](./examples/Gists/README.md)
```jsx
import React from 'react';
import ReactGithub, { Gist, File } from 'react-github-renderer';
import GithubClient from './GithubClient';
const gist = ReactGithub.render(
function fn() {}
contents of file2.txt
);
GithubClient.createGist(gist);
```
- ## [Releases](./examples/Releases/README.md)
```jsx
import React from 'react';
import ReactGithub, { Release } from 'react-github-renderer';
import GithubClient from './GithubClient';
const release = ReactGithub.render(
- Update dependencies version (#15)
);
GithubClient.createRelease(release);
```
# Thanks
- [@nitin42](https://github.com/nitin42): for [helpful tutorial](https://github.com/nitin42/Making-a-custom-React-renderer)
- [@iamdustan](https://github.com/iamdustan): for [tiny-react-renderer](https://github.com/iamdustan/tiny-react-renderer) with a brief implementation
- [@CentaurWarchief](https://github.com/CentaurWarchief): for inspiration from [react-slack-renderer](https://github.com/CentaurWarchief/react-slack-renderer)
# License
MIT © [Taehwan, No (taehwanno)](https://github.com/taehwanno)