GithubHelp home page GithubHelp logo

edgartaor / kindleserver Goto Github PK

View Code? Open in Web Editor NEW
155.0 3.0 3.0 17 KB

This project serve HTML files (and a few more) saved in your computer with a UI suitable for Kindle web browser. On top of that, it include a Read Mode (thanks to ReadabiliPy) to display the text in a comfortable size without have to use the 'Article Mode' in Kindle web browser.

Python 63.69% HTML 36.31%
kindle flask python readability webserver readabilipy

kindleserver's Introduction

WebServer for Kindle

I save articles into HTML files with TagSpaces or SingleFile to read them later but I could not find a way to serve them easily to a Kindle Paperwhite and read them there.

This project serve HTML files (and a few more) saved in your computer with a UI suitable for Kindle web browser. On top of that, it include a Read Mode (thanks to ReadabiliPy) to display the text in a comfortable size without have to use the 'Article Mode' in Kindle web browser.

This app does not use Javascript or any database (the files themselves are the database). To serve the file it uses Whitenoise, so it does not need a nginx o apache server.

Disclaimer: I use this app only accessible in my LAN, running flask run -h 192.168.1.100 -p 8000 is enough for my use case. If you need a public instance over the Internet, please setup a proper web server.

Demo

Kindleserver.Demo-2.mp4

Install

git clone https://github.com/edgartaor/kindleServer.git
cd kindleServer
pip install -r requirements.txt
flask run -h 0.0.0.0 -p 8000

Important: In the config.py file change SAVED_WEBPAGES_DIR to the path where the HTML files are stored.

Customize

You can customize some aspects in the config.py file.

# The files that are gonna be listed, 
# compatibility depends on the browser and the device
# Usually if a file it is not compatible in the browser
# it will prompt to download 
# Kindle Paperwhite currently can download .AZW, .PRC and .MOBI with the web browser
# and can display html and txt (pdf is not compatible though)
# other files had not being tested
FILE_TYPES_ALLOWED = ('html', 'txt', 'md', 'pdf', "azw3", "azw",
                        'prc', 'mobi')

# Files that are compatible with the Read Mode
# It support html files and any plain text files
READ_MODE_FILES_COMPATIBLE = ('html', 'txt', 'md')

# Path where the webpages are saved
SAVED_WEBPAGES_DIR = "/mnt/c/Users/Edgar/Documents/Saved webpages/"

# Number of files to show per page
PER_PAGE = 10

# SORT_BY options are 
# 'CREATION' = Creation date
# 'MODIFIED' = Last modification date
# 'FILENAME' = Alphabetical order
SORT_BY = 'CREATION'

# Reverse the order of the files after being sorted
REVERSE_ORDER = True

# Set USE_READABILITY to True if you have a nodejs instance installed
# If mozilla/readability is not found it will fallback to a pure-python parser included in ReadabiliPy
# https://github.com/alan-turing-institute/ReadabiliPy#installation 
USE_READABILITY = True

You can also customize the font size, font family and any aspect in the template files

kindleserver's People

Contributors

edgartaor avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

kindleserver's Issues

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.