Bridgetown Readwise Curator
A Bridgetown plugin to curate and manage your Readwise highlights directly within your Bridgetown site.
Installation
Recommended: Automated Setup
Run the automation script for guided setup that handles everything automatically:
shell
bin/bridgetown apply https://github.com/pablojimeno/bridgetown_readwise_curator
This will: - Add the gem to your Gemfile - Install dotenv for environment variable management - Prompt for your Readwise API token - Set up all necessary configuration files - Create required directories
Manual Installation
Alternatively, you can install manually:
-
Add the gem to your Gemfile:
shell bundle add bridgetown_readwise_curator -
Set up environment variables:
Ensure READWISE_TOKEN is available in your environment using your preferred method (figaro, rails credentials, etc.)
For example, using dotenv:
shell
bundle add dotenv
Add your Readwise API token to .env:
READWISE_TOKEN=your_readwise_api_token_here
Add dotenv initializer to config/initializers.rb:
ruby
init :dotenv
-
Add to
config/boot.rb:ruby require "bridgetown_readwise_curator" -
Add the gem initializer to
config/initializers.rb:ruby init :bridgetown_readwise_curator -
Create required directories:
shell mkdir -p src/_data/readwise mkdir -p src/_books -
Run bundle install:
shell bundle install
Usage
CLI Commands
The plugin provides an interactive CLI accessible via:
shell
bin/bt readwise
This launches an interactive menu with options to: - Browse resources: Paginated view of your Readwise library - Search resources: Find books by title or author - Update Readwise data: Sync latest data from Readwise API - Quit: Exit the CLI
Features
- Interactive CLI for browsing and curating Readwise highlights
- Search functionality across your book library
- Pagination for large libraries
- Data synchronization with Readwise API
- JSON file generation of selected highlights
- Book page creation for curated highlights
Workflow
- Run
bin/bt readwiseto start the CLI - Choose “Update Readwise data” to sync your library
- Browse or search for books you want to curate
- Select highlights from the chosen book
- The plugin generates markdown files in
src/_books/with your curated highlights
Testing
- Run
bundle exec rake testto run the test suite - Or run
script/cibuildto validate with Rubocop and Minitest together.
Contributing
- Fork it (https://github.com/pablojimeno/bridgetown_readwise_curator/fork)
- Clone the fork using
git cloneto your local development machine. - 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