Convert Your Kindle highlight & Note to Markdown/JSON

Overview

kindle-highlight-to-markdown

Convert Your Kindle highlight & Note to Markdown/JSON

Install

Install with npm:

npm install kindle-highlight-to-markdown

Usage

Using Console script

const { parsePage, toMarkdown } = await import('https://cdn.skypack.dev/kindle-highlight-to-markdown');
const result = parsePage(window); // JSON Object
const markdown = toMarkdown(result); // Markdown
copy(markdown);

Using Bookmarklet

javascript:(function()%7B(async%20function()%7B%0Aconst%20%7B%20parsePage%2C%20toMarkdown%20%7D%20%3D%20await%20import('https%3A%2F%2Fcdn.skypack.dev%2Fkindle-highlight-to-markdown')%3B%0Aconst%20result%20%3D%20parsePage(window)%3B%20%2F%2F%20JSON%20Object%0Aconst%20markdown%20%3D%20toMarkdown(result)%3B%20%2F%2F%20Markdown%0Aawait%20navigator.clipboard.writeText(markdown)%3B%0A%7D)()%3B%7D)()%3B

Using Greasemonkey script

// ==UserScript==
// @name        Kindle Hightlight to Markdown- amazon.co.jp
// @namespace   My highlight to markdown
// @match       https://read.amazon.co.jp/notebook
// @grant       GM_setClipboard
// @version     1.0
// @author      azu
// ==/UserScript==


const h1 = document.querySelector("h1.kp-notebook-title");
h1.addEventListener("click", async () => {
  const { parsePage, toMarkdown } = await import('https://cdn.skypack.dev/kindle-highlight-to-markdown');
  const result = parsePage(window);
  console.log(result);
  const markdown = toMarkdown(result);
  console.log(markdown);
  GM_setClipboard(markdown);
});

Changelog

See Releases page.

Running tests

Install devDependencies and Run npm test:

npm test

Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

License

MIT © azu

You might also like...

A CSS stylesheet to quickly highlight a11y concerns.

A CSS stylesheet to quickly highlight a11y concerns.

Checka11y.css A CSS stylesheet to quickly highlight a11y concerns. Lightweight • Modern • Accessibile • Customisable • Simple The first line of defenc

Dec 25, 2022

Steam - Highlight specific friends who play

highlight-friends Steam Website - Highlight specific friends who play https://greasyfork.org/en/scripts/450409-highlight-specific-friends-who-play?loc

Nov 6, 2022

"Jira Search Helper" is a project to search more detail view and support highlight than original jira search

Jira Search Helper What is Jira Search Helper? "Jira Search Helper" is a project to search more detail view and support highlight than original jira s

Dec 23, 2022

Highlight the Web ✏️✨

Highlight the Web  ✏️✨

Marker is a Browser Add-On that lets you draw on any Website. Please first navigate to a website, then press on the toolbar button to activate the add

Nov 14, 2022

Convert JSON to human readable HTML

json.human.js: Json Formatting for Human Beings A small library to convert a JSON object into a human readable HTML representation that is easy to sty

Dec 3, 2022

jsonrawtoxlsx is library to convert json raw (array) into xlsx file

jsonrawtoxlsx is library to convert json raw (array) into xlsx file

Welcome to jsonrawtoxlsx 👋 ✨ What is jsonrawtoxlsx? jsonrawtoxlsx is library to convert json raw (array) into xlsx file ⚡️ Installation using npm npm

Dec 23, 2022

javascript library to convert a list of objects to a nested json output format, depending on the names in the list

formToNestedJson javascript "library" to convert a list of objects to a nested json output format, depending on the names in the list Basic usage Give

Aug 2, 2021

A markdown-it plugin that process images through the eleventy-img plugin. Can be used in any projects that uses markdown-it.

markdown-it-eleventy-img A markdown-it plugin that process images through the eleventy-img plugin. Can be used in any projects that use markdown-it. F

Dec 20, 2022

An obsidian plugin for uploading local images embedded in markdown to remote store and export markdown for publishing to static site.

An obsidian plugin for uploading local images embedded in markdown to remote store and export markdown for publishing to static site.

Obsidian Publish This plugin cloud upload all local images embedded in markdown to specified remote image store (support imgur only, currently) and ex

Dec 13, 2022
Comments
  • Feature request: The option to include highlights that cannot be displayed in the parsed results.

    Feature request: The option to include highlights that cannot be displayed in the parsed results.

    Description

    I would like the option to include highlights that cannot be displayed in the analysis results.

    Background

    I believe the main use case for this tool is to transcribe Kindle highlights to a personal notes tool or similar so that they can be easily referenced from there. With the current behavior of skipping highlights that cannot be displayed, I could not track which highlights were skipped, and ended up having to go to the "Notes and Highlights" page.

    Even if we don't know the contents of the highlights, we would like to have an option to not skip content that cannot be displayed, because if we know the location, etc., we will be able to follow it from the transcribed memo tool.

    Type: Feature 
    opened by sitogi 2
  • feat: add `defaultHighlightMessage` option

    feat: add `defaultHighlightMessage` option

    • Support getting empty highlight.
    • toMarkdown render it as "**CAN NOT SHOW THE HIGHLIGHT**" by default
      • It can be changed by defaultHighlightMessage option
    image

    fix #3

    opened by azu 0
Releases(v1.2.0)
Owner
azu
Creator of @textlint, @secretlint, @honkit and @almin. Editor of @efcl, @jser and @ecmascript-daily. Author of @js-primer. (Don't send me email-ad.)
azu
A Plugin which converts .md Files from Obsidian to your Kindle

Project 2: obsidian-kindle-export An Obsidian-Plugin which sends your Notes to your Kindle as .mobi File This is the exported .mobi File Introduction

Simerl 21 Dec 26, 2022
Allows users to quickly search highlighted items on Wikipedia. Inspired by the "search Wikipedia" function on the kindle mobile app.

wikipedia-search Allows users to quickly search highlighted items on Wikipedia. Inspired by the "search Wikipedia" function on the kindle mobile app.

Laith Alayassa 18 Aug 15, 2022
Syntax highlight using VSCode's json/plist as is.

WIP dps-vsctm.vim Syntax highlight using VSCode's json/plist as is. Requirements denops.vim Usage First, the grammar definition file must be placed in

NAKAI Tsuyoshi 68 Dec 26, 2022
A Hackable Markdown Note Application for Programmers. Version control, AI completion, mind map, documents encryption, code snippet running, integrated terminal, chart embedding, HTML applets, plug-in, and macro replacement.

Yank Note A hackable markdown note application for programmers Download | Try it Online >>> Not ecommended English | 中文说明 [toc]{level: [2]} Highlights

洋子 4.3k Dec 31, 2022
Markdown note maker (with Git sync) using Tauri.

Mediocre Markdown note maker (with Git sync) using Tauri. Screens Tech Stack Frontend Monaco Editor for the editor interface Chakra UI library Redux T

Nilay Savant 14 Dec 6, 2022
JCS (JSON Canonicalization Scheme), JSON digests, and JSON Merkle hashes

JSON Hash This package contains the following JSON utilties for Deno: digest.ts provides cryptographic hash digests of JSON trees. It guarantee that d

Hong Minhee (洪 民憙) 13 Sep 2, 2022
Package fetcher is a bot messenger which gather npm packages by uploading either a json file (package.json) or a picture representing package.json. To continue...

package-fetcher Ce projet contient un boilerplate pour un bot messenger et l'executable Windows ngrok qui va permettre de créer un tunnel https pour c

AILI Fida Aliotti Christino 2 Mar 29, 2022
convert markdown to html in under 5kb

convert markdown to HTML in under 5kb take a look at the to PHP translated version: https://github.com/SimonWaldherr/micromarkdown.php about License:

Simon Waldherr 201 Dec 8, 2022
Convert MDX to Markdown.

mdx-to-md Convert MDX to Markdown. Why? This library is most useful for generating README.md files like the one you're reading. Install yarn add mdx-t

Travis Arnold 39 Dec 1, 2022
A plugin for obsidian to focus and highlight on a specific heading in Reading mode.

Focus and Highlight A plugin for obsidian to focus on a specific paragraph in Reading mode. Features Focus on a specific heading and its children when

Bo-Yi Tsai 22 Dec 21, 2022