PomodoroScrapbox
「Pomodoro」という文字列を選択してトマトメニューを押すと下記のような記法になる
nishio.icon🍅03:27-03:52 Pomodoro
code:script.js
scrapbox.PopupMenu.addButton({
title: "🍅",
onClick: (text) => {
const name = "nishio";
const timeFormat = (d) => {
const h = d.getHours().toString().padStart(2, "0");
const m = d.getMinutes().toString().padStart(2, "0");
return ${h}:${m};
}
const now = new Date();
const end = new Date(now.getTime() + (1000 * 60 * 25));
return [${name}.icon]🍅${timeFormat(now)}-${timeFormat(end)} [" ${text}];
},
});