Bridgetown Readwise Curator

A Bridgetown plugin to curate and manage your Readwise highlights directly within your Bridgetown site.

Installation

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:

  1. Add the gem to your Gemfile: shell bundle add bridgetown_readwise_curator

  2. 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

  1. Add to config/boot.rb: ruby require "bridgetown_readwise_curator"

  2. Add the gem initializer to config/initializers.rb: ruby init :bridgetown_readwise_curator

  3. Create required directories: shell mkdir -p src/_data/readwise mkdir -p src/_books

  4. 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

  1. Run bin/bt readwise to start the CLI
  2. Choose “Update Readwise data” to sync your library
  3. Browse or search for books you want to curate
  4. Select highlights from the chosen book
  5. The plugin generates markdown files in src/_books/ with your curated highlights

Testing

  • Run bundle exec rake test to run the test suite
  • Or run script/cibuild to validate with Rubocop and Minitest together.

Contributing

  1. Fork it (https://github.com/pablojimeno/bridgetown_readwise_curator/fork)
  2. Clone the fork using git clone to your local development machine.
  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