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.
It even properly shows GitHub emojis like :tada:
🎉
Relative file links (README.md) and folders (src/) should work properly too, though files and folders should NOT have a preceeding forward-slash:
Wrong:
[file.py](/file.py)
[folder](/folder)
Correct:
[file.py](file.py)
[folder](folder)
npm install react-github-readme-button
or
yarn add react-github-readme-button
import { GitHubReadmeButton } from react-github-readme-button
<GitHubReadmeButton
repo="seapagan/react-github-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'
/>
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.
- 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
Contributions to this project, especially Bug Reports or fixes are very welcome.
- Fork it
- Install the development dependencies (
npm install
oryarn install
) - Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Run npm install
or yarn install
to install all required dependencies.
Runnpm start
or yarn start
from the project root which will serve up a test
React app on http://localhost:3000
All the actual component code is in the components directory.
See the TODO list for future plans.
See BUGS.md