Based on this script
It fetches all the highlights and notes from your Apple Books SQLite files and converts them into a Markdown (.md).
What's the difference with the original script
This is a slightly modified version that drops the Date and the note context and groups the notes by chapter.
php ./book_notes_to_md.php