proskomma-react-hooks
v2.4.0-rc.1
Published
A collection of React Hooks that provide a way to simplify the implementation of Proskomma into your React projects.
Downloads
435
Maintainers
Keywords
Readme
About The Project
Purpose: A collection of React Hooks that provide a way to simplify the implementation of Proskomma into your React projects.
Problem: Proskomma.js is a very powerful tool but has a fairly steep learning curve to setup and get running.
Scope: This project aims to simplify the implementing of Proskomma.js into our projects and especially the common use cases. It includes bootstrapping, importing and common queries/filters of Proskomma.
This project does not cover the downloading or obtaining of files to import.
Background: We implemented Proskomma.js in a few early projects but found it taking too long to setup and too much specific domain knowledge to make it useful. We kept refactoring our common use cases into this project as custom hooks and have a single place to maintain them.
Architecture and Design Principles: See ARCHITECTURE.md for details on architecture and design principles for this project.
Built With
Getting Started
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
Prerequisites
Data The source of the data to import into Proskomma are scripture files such as USFM.
Testing files can be generated using Lorem Ipsum USFM.
Real USFM files can be found in multiple places such as:
This is an example of how to list things you need to use the software and how to install them.
- npm
npm install npm@latest -g
Installation/First Steps
- Setup a React app using
Create React App
orReact Styleguidist
.
npx create-react-app proskomma-react-hooks-app
- Add it to your React app or component library (inside your project path):
- yarn
yarn add proskomma-react-hooks
- npm
npm i proskomma-react-hooks
- Bootstrap inside App.jsx with useProskomma.
- Import: Create a new component for Importing data useImport.
- Passage: Create a new component for Passage Lookup and use custom hook inside it via usePassage.
- Search: Create a new component for Search and use custom hook inside it via useSearchForPassages
- Customize and run your own query useQuery
Usage/Integration
Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.
For more examples, please refer to the Styleguidist.
Roadmap
- [ ] Return
data
inuseSearchForPassages
anduseSearchForPassagesByBookCodes
just likeuseSearchForPassagesByBookCode
- [ ] Import Serialized JSON for faster importing/resuming of previous Proskomma state
- [ ] Enable editing of data through mutations
- [ ] Importing of non-USFM sources such as USX
- [ ] Rendering to Epub, PDF, HTML, and React via pk-render
See the open issues for a full list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. Guidelines for external contributions.
You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
If you would like to fork the repo and create a pull request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
Chris Klapp aka Klappy - [email protected]
Project Link: https://github.com/unfoldingWord/proskomma-react-hooks