Giter VIP home page Giter VIP logo

obsidian-copy-as-html's Introduction

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: Copy the current document to clipboard command, which can be bound to a keyboard shortcut.

image

Features

Simple styling is applied to the document.

Currently working with :

  • ✅ images
  • ✅ plantuml
  • ✅ diagrams
  • ✅ obsidian-tasks
  • ✅ obsidian-dataview - for large dataview blocks the content may not be complete
  • ✅ Excalidraw - rendering as bitmap solves pasting in gmail
  • ✅ Mermaid

Advanced

  • You may choose whether you want to embed external links (http, https) or not. If you don't (default), you will need internet access to view the document, and the linked image may be taken offline. If you do your documents will be larger.
  • It is possible to customize or replace the stylesheet in the settings dialog.
  • The default is to convert SVG to bitmap for better compatibility at the cost of potential quality loss. If you know that you are pasting into an application with good .svg support, you can disable the Convert SVG to bitmap setting.
  • It is possible to render code and callouts to HTML tables. This makes them ugly except in Google Docs where they make the document slightly prettier.

Implementation

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

Known issues

  • No mobile support
  • Special fields (double-colon attributes, ...) are not removed. (front-matter is)
  • data-uris can use a lot of memory for big/many pictures
  • transclusions with block references are not supported (transclusions with headings are)

Install

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

Don't be afraid to comment if anything seems wrong !

Development

Please see the Obsidian sample plugin.

Credits

  • Oliver Balfour for his obsidian-pandoc plugin, which helped me solve some rendering issues.
  • TfTHacker for his BRAT plugin which makes beta-testing a breeze.
  • PJ Eby for his Hot-reload plugins which makes plugin development fast and fun.
  • jkunczik for enabling transclusions to work with heading references

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.