Giter VIP home page Giter VIP logo

html2zim's Introduction

html2zim

html到zim wiki语法格式转换工具, 使zim能像evernote一样用于网页剪辑.

  • 图片引用链接将会显式输出
  • 由于从剪贴板读取, 相对路径内容将不会被解析

建议配合klipper等剪贴板工具使用, 对剪贴板内容命令使用:

clipcli text/html | html2zim -k path-to-where-you-store-zim-images

参数

html2zim [-k/-w pathToStore] [html_file]

不指定html_file则从stdin读入
-k使用kio下载图片, -w使用wget下载图片, 不指定则用alt属性的文本表示

html2zim

Convert html to Zim wiki syntax, you can now use zim as a web clipper.

  • href in <img> or <a><img></img> will be explicit given as screenshot
  • Resources in relative paths will not be converted

It is recommend to use klipper or other clipboard utilities for auto conversion with commandline:

clipcli text/html | html2zim -k path-to-where-you-store-zim-images

Parameters

html2zim [-k/-w pathToStore] [html_file]

Read from stdin if no html_file given.
-k to download with kio, -w with wget, otherwise to extract text from attribute 'alt'

Screenshot (page from http://www.wikiwand.com/en/Ball_tree (Edited))

Screenshot

html2zim's People

Contributors

macrobull avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

html2zim's Issues

Creating too many newlines in resulting output

For example, the following HTML code:

<ul>
<li>wl_egl_window_create()</li>
<li>wl_egl_window_destroy()</li>
<li>wl_egl_window_resize()</li>
<li>wl_egl_window_get_attached_size()</li>
</ul>

... gets converted into:

    *   wl_egl_window_create()

    *   wl_egl_window_destroy()

    *   wl_egl_window_resize()

    *   wl_egl_window_get_attached_size()

Would be nice if your script reduce the number of newlines it produces :)

Note: It's similar for other HTML tags.

html2zim error

clipcli is working fine. When I do the following command (under Ubuntu Linux), I have a good result:

$ ./clipcli.py text/html
��<pre><code>clipcli text/html</code></pre>

But html2zim doesn't work.

$ ./clipcli.py text/html -f ./index.html | ./html2zim.py -w /home/charles ./index.html
Traceback (most recent call last):
  File "./html2zim.py", line 432, in <module>
    sys.exit(main())
  File "./html2zim.py", line 424, in main
    buf = open(sys.argv[1]).read().decode('utf-8')
  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 0: invalid start byte

Any idea?

A short install guide?

Hi,
First of all, thanks for this work.
Could you provide a short documentation how to install html2zim?

I copied the files into ~/.local/share/zim/plugins/
And created a "Custom tool" in zim with the command "clipcli text/html | html2zim -k pathtoimages"
But it doesn't appear to work...

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.