Skip to content

seapagan/react-github-readme-button

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-github-readme-button

A React component to display the README from a specific repository in a modal popup with all Markdown translated and using the correct GitHub styling.

NPM Version CodeQL

It even properly shows GitHub emojis like :tada: 🎉

Installation

npm install react-github-readme-button

or

yarn add react-github-readme-button

How to use

import { GitHubReadmeButton } from react-github-readme-button

<GitHubReadmeButton
  repo="seapagan/react-guithub-readme-button" // required
  branch="main" // optional, defaults to 'main'
  fileName="README.md" // optional, defaults to 'README.md'
  className="button-style" // optional but recommended, style the button
  buttonText = "View README" // Button text, optional, defaults to 'View README'
/>

Test Web app

A test app is available at https://seapagan.github.io/react-github-readme-button/ or from a local clone of the repository on http://localhost:3000. This uses the local code of the component, so is good to use during development.

Test app Limitations

  • only fetches README.md
  • only fetches from the main branch.

The component has the ability to fetch from any branch and any name however. If these are not specified it defaults to the most common README.md and the main branch

Contributing

Contributions to this project, especially Bug Reports or fixes are very welcome.

  1. Fork it
  2. Install the development dependencies (npm install or yarn install)
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request

Using the test Application

Run npm start or yarn start from the project root which will serve up a test React app on http://localhost:3000

Hacking on the component

All the actual component code is in the components directory.

TODO List

See the TODO list for future plans.

Current Bugs

See BUGS.md

About

A React component to display a Markdown-formatted README file in a modal popup

Topics

Resources

License

Stars

Watchers

Forks

Languages