A Bridgetown plugin to curate and manage your Readwise highlights directly within your Bridgetown site.
Run the automation script for guided setup that handles everything automatically:
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
Alternatively, you can install manually:
- Add the gem to your Gemfile:
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:
bundle add dotenv
Add your Readwise API token to .env
:
READWISE_TOKEN=your_readwise_api_token_here
Add dotenv initializer to config/initializers.rb
:
init :dotenv
- Add to
config/boot.rb
:
require "bridgetown_readwise_curator"
- Add the gem initializer to
config/initializers.rb
:
init :bridgetown_readwise_curator
- Create required directories:
mkdir -p src/_data/readwise
mkdir -p src/_books
- Run bundle install:
bundle install
The plugin provides an interactive CLI accessible via:
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
- 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
- Run
bin/bt readwise
to 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
- Run
bundle exec rake test
to run the test suite - Or run
script/cibuild
to validate with Rubocop and Minitest together.
- Fork it (https://github.com/pablojimeno/bridgetown_readwise_curator/fork)
- Clone the fork using
git clone
to 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