Giter VIP home page Giter VIP logo

portable-wisdom's People

Contributors

jacobbudin avatar

Stargazers

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

Watchers

 avatar  avatar

portable-wisdom's Issues

Support Pocket as a source

Portable Wisdom would support Pocket, but its "article view" API is restricted:

Pocket's Article View API will return article content and relevant meta data on any provided URL.

The Pocket Article View API is currently only open to partners that are integrating Pocket specific features or full-fledged Pocket clients. For example, building a Pocket client for X platform.

Since it's unlikely individual users of Portable Wisdom would be provided this special access, using Pocket as a source will not be supported.

Add transformers

Two examples:

  • strip_links โ€” remove <a> but keep their contents
  • beautify_hr โ€” replace * * * and similar with <hr>

[PyPI] ModuleNotFoundError: No module named 'portable_wisdom'

When I executed "portable-wisdom -h" after installing the package via pip, I got the "Module not found" error.
It looks all the codes of this library are located right under "site-packages" directory.
After creating "portable_wisdom" directory under "site-packages" and coping the codes to the directory, it became functional.
Could you confirm if it's reproducible on your side?
My environment is Linux/Python 3.11/venv.

ebooklib cannot generate navigation for articles with emojis

ebooklib._get_nav fails when any article contains an emoji:

lxml.etree.ParserError: Document is empty

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/portable_wisdom/wisdom.py", line 86, in <module>
    main()
  File "/portable_wisdom/wisdom.py", line 80, in main
    epub.write_epub(filename, book, {})
  File "/venv/lib/python3.10/site-packages/ebooklib/epub.py", line 1746, in write_epub
    epub.write()
  File "/venv/lib/python3.10/site-packages/ebooklib/epub.py", line 1369, in write
    self._write_items()
  File "/venv/lib/python3.10/site-packages/ebooklib/epub.py", line 1356, in _write_items
    self.out.writestr('%s/%s' % (self.book.FOLDER_NAME, item.file_name), self._get_nav(item))
  File "/venv/lib/python3.10/site-packages/ebooklib/epub.py", line 1212, in _get_nav
    inserted_pages = get_pages_for_items([item for item in self.book.get_items_of_type(ebooklib.ITEM_DOCUMENT)   File "/venv/lib/python3.10/site-packages/ebooklib/utils.py", line 119, in get_pages_for_items
    pages_from_docs = [get_pages(item) for item in items]
  File "/venv/lib/python3.10/site-packages/ebooklib/utils.py", line 119, in <listcomp>
    pages_from_docs = [get_pages(item) for item in items]
  File "/venv/lib/python3.10/site-packages/ebooklib/utils.py", line 96, in get_pages
    body = parse_html_string(item.get_body_content())
  File "/venv/lib/python3.10/site-packages/ebooklib/utils.py", line 48, in parse_html_string
    html_tree = html.document_fromstring(s, parser=utf8_parser)
  File "/venv/lib/python3.10/site-packages/lxml/html/__init__.py", line 761, in document_fromstring
    raise etree.ParserError(
lxml.etree.ParserError: Document is empty

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.