mirror of
https://github.com/srid/nixos-config.git
synced 2026-05-11 17:36:07 +08:00
Add script to copy md as html
This commit is contained in:
parent
036e5d2d74
commit
00ba1f893c
3 changed files with 18 additions and 0 deletions
|
|
@ -30,6 +30,7 @@ in
|
|||
# Publishing
|
||||
asciinema
|
||||
twitter-convert
|
||||
copy-md-as-html
|
||||
|
||||
# Dev
|
||||
gh
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ self: super: {
|
|||
fuckport = self.callPackage "${packages}/fuckport.nix" { };
|
||||
twitter-convert = self.callPackage "${packages}/twitter-convert" { };
|
||||
sshuttle-via = self.callPackage "${packages}/sshuttle-via.nix" { };
|
||||
copy-md-as-html = self.callPackage "${packages}/copy-md-as-html.nix" { };
|
||||
ci = self.callPackage "${packages}/ci" { };
|
||||
touchpr = self.callPackage "${packages}/touchpr" { };
|
||||
actualism-app = inputs.actualism-app.packages.${self.system}.default;
|
||||
|
|
|
|||
16
packages/copy-md-as-html.nix
Normal file
16
packages/copy-md-as-html.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ 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"
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue