Coder Social home page Coder Social logo

kindle-highlight-to-markdown's Introduction

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

Add Cookie to .cookie file

and Edit test/node.ts and Run tests

npm run debug

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

kindle-highlight-to-markdown's People

Contributors

azu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

kindle-highlight-to-markdown's Issues

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.