polyglot.markdown.kindle_notebook module

Convert the HTML export of kindle notebooks (from kindle apps) to markdown

Author:David Young
Date Created:October 17, 2016
class polyglot.markdown.kindle_notebook.kindle_notebook(log, kindleExportPath, outputPath)[source]

convert the HTML export of kindle notebooks (from kindle apps) to markdown

Key Arguments:
  • log – logger
  • kindleExportPath – path to the exported kindle HTML file
  • outputPath – the output path to the md file.

Usage:

To convert the exported HTML file of annotation and notes from a kindle book or document to markdown, run the code:

from polyglot.markdown import kindle_notebook
nb = kindle_notebook(
    log=log,
    kindleExportPath="/path/to/kindle_export.html",
    outputPath="/path/to/coverted_annotations.md"
)
nb.convert()

The colours of the annotations convert to markdown attributes via the following key:

clean(text)[source]
convert()[source]

convert the kindle_notebook object

Return:
  • kindle_notebook

Usage: .. todo:

- add usage info
- create a sublime snippet for usage
- update the package tutorial if needed
usage code 
convertToMD(kindleNote)[source]
find_component(divtag, annotations)[source]