mvdkwast / obsidian-copy-as-html

Obsidian plugin: copy document as HTML, including images
MIT License
42 stars 11 forks source link

Copy Document as HTML

Plugin for Obsidian that copies the current document to the clipboard, so it can be pasted into HTML aware application like gmail.

This plugin exposes the Copy document as HTML command, which can be bound to keyboard shortcuts (see below). Content can also be copied from the file explorer view.

image

Features

Commands

copy-as-html-actions

The commands can be bound to keyboard shortcuts from the hotkeys menu, or run using the commands menu (Ctrl+P)

Copy selection or document to clipboard : If text is selected, it will copied as HTML into the clipboard. If no text is selected, the entire document is copied. This should probably be your default keyboard shortcut. (suggestion: Ctrl+Shift+C)

Copy entire document to clipboard : Copy the entire document

Copy current selection to clipboard : Copy the selected text only

Media support

Currently working with :

image

Styling

By default, simple styling is applied to the document. The stylesheet can be customized through the plugin settings, eg. to customize how tables or quotes look. Feel free to improve the current style and show it the world !

image

Advanced

Implementation

The plugin converts image references to data urls, so no references to the vault are included in the HTML.

Known issues

Also see the issues section on github, and feel free to ask anything here.

Install

Look for Copy document as HTML in the community plugin section in the Obsidian settings.

Don't be afraid to report or ask if anything seems wrong !

Development

Please see the Obsidian sample plugin.

Credits