Skip to content

7MS8/pastefromhtml

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pastefromhtml

pastefromhtml is a Zim plugin that lets you paste lists, links, text, images, and LaTeX/MathML equations from HTML clipboard data.

Installation

You can install pastefromhtml by creating a folder with files htmlcdparser.py and __init__.py in your zim/plugins directory.

For installation in Linux, place the folder in ~/.local/share/zim/plugins.

You can also install by cloning the repository:

cd ~/.local/share/zim/plugins
git clone https://github.com/cetinkaya/pastefromhtml.git

To enable the plugin, click on Edit / Preferences, then go to the Plugins tab.

Dependencies

For basic use (text, links, images) no additional dependencies are needed.

For LaTeX/KaTeX equation rendering (e.g. when pasting from Claude.ai) the following must be installed:

  • latex and dvipng (from TeX Live)

For MathML equation rendering (e.g. when pasting from GitHub Copilot) additionally:

  • python-pypandoc and pandoc

On Arch/Manjaro:

sudo pacman -S texlive dvipng python-pypandoc

On Debian/Ubuntu:

sudo apt install texlive dvipng pandoc python3-pypandoc

If the dependencies are not installed, equations are silently skipped and the rest of the content is pasted normally.

Use

pastefromhtml adds menu entries (Tools / Paste from HTML, Edit / Paste from HTML) and a right-click context-menu entry, as well as a keyboard shortcut (ctrl + shift + v) in Zim.

After you copy content in your browser, paste it into Zim by clicking on the menu entry or by using the shortcut ctrl + shift + v.

Equations are automatically rendered to PNG and embedded as images in the page's attachments folder.

Configuration

To access the configuration options, click on Edit / Preferences, navigate to the Plugins tab, select Paste from HTML, and click the Configure button.

Available options:

  • Images inside anchor tags – when pasting <img> tags inside <a> tags, paste the image instead of the link URL
  • Reload page after pasting – reload the page after pasting to apply formatting
  • LaTeX equation font size – font size in pt for rendered equations (default: 14)
  • LaTeX equation image DPI – resolution of rendered equation images (default: 200)
  • LaTeX dark mode – use white font color for equations (for dark Zim themes)

About

pastefromhtml is a Zim plugin that lets you paste lists, links, and text from html clipboard data.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%