From e0a0b25f6586cdf1b1284d97bedadfce5535ba96 Mon Sep 17 00:00:00 2001 From: s-ol Date: Thu, 3 Dec 2020 17:38:43 +0100 Subject: move plugins into root --- .../twitter/converts: text$moonscript -> table.moon | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 root/$mmm/plugins/twitter/converts: text$moonscript -> table.moon (limited to 'root/$mmm/plugins/twitter') diff --git a/root/$mmm/plugins/twitter/converts: text$moonscript -> table.moon b/root/$mmm/plugins/twitter/converts: text$moonscript -> table.moon new file mode 100644 index 0000000..4821823 --- /dev/null +++ b/root/$mmm/plugins/twitter/converts: text$moonscript -> table.moon @@ -0,0 +1,21 @@ +import div, blockquote, a from require 'mmm.dom' +import iframe from require 'mmm.dom' + +{ + { + inp: 'URL -> twitter/tweet' + out: 'mmm/dom' + cost: -4 + transform: (href) => + user, id = assert (href\match 'twitter.com/([^/]-)/status/(%d*)'), "couldn't parse twitter/tweet URL: '#{href}'" + + iframe { + width: 550 + height: 560 + border: 0 + frameBorder: 0 + allowfullscreen: true + src: "//twitframe.com/show?url=https%3A%2F%2Ftwitter.com%2F#{user}%2F#{id}" + } + } +} -- cgit v1.2.3