#!/usr/bin/env python # # Executes python-readability on current page and opens the summary as new tab. # # Depends on the python-readability package, or its fork: # # - https://github.com/buriy/python-readability # - https://github.com/bookieio/breadability # # Usage: # :spawn --userscript readability # from __future__ import absolute_import import codecs, os tmpfile = os.path.join( os.environ.get('QUTE_DATA_DIR', os.path.expanduser('~/.local/share/qutebrowser')), 'userscripts/readability.html') if not os.path.exists(os.path.dirname(tmpfile)): os.makedirs(os.path.dirname(tmpfile)) # Styling for dynamic window margin scaling and line height HEADER = """