mirror of
https://github.com/srid/nixos-config.git
synced 2026-01-07 16:47:23 +08:00
16 lines
485 B
Nix
16 lines
485 B
Nix
{ writeShellApplication, wl-clipboard, pandoc, ... }:
|
|
|
|
writeShellApplication {
|
|
name = "copy-md-as-html";
|
|
meta.description = ''
|
|
Convert the given Markdown to HTML (using pandoc) and copy it to the clipboard.
|
|
|
|
This is useful for pasting Markdown content into rich text editors or GUI email clients (like Gmail).
|
|
'';
|
|
runtimeInputs = [ wl-clipboard pandoc ];
|
|
text = ''
|
|
set -x
|
|
pandoc "$1" -t html | wl-copy -t text/html
|
|
echo "Copied HTML to clipboard"
|
|
'';
|
|
}
|