Popup Menu に井戸端の全ての記法を追加するUserScript
このページをみんなで好きなだけ書き換えてね(はーと)
UserScript.icon
種類が多すぎるから数種類のヴァリアントがあって然るべきだと思うのNrem.icon
bg.icon
./script.js
ハイライト
code:script.js
scrapbox.PopupMenu.addButton({
title: 'ハイライト',
onClick: text => text.split('\n').map(line => [[${line}]]).join('\n')
})
太字
code:script.js
scrapbox.PopupMenu.addButton({
title: '太字',
onClick: text => text.split('\n').map(line => [* ${line}]).join('\n')
})
太字*4
code:script.js
scrapbox.PopupMenu.addButton({
title: '太字*4',
onClick: text => text.split('\n').map(line => [**** ${line}]).join('\n')
})
太字*10
code:script.js
scrapbox.PopupMenu.addButton({
title: '太字*10',
onClick: text => text.split('\n').map(line => [********** ${line}]).join('\n')
})
斜体
code:script.js
scrapbox.PopupMenu.addButton({
title: '斜体',
onClick: text => text.split('\n').map(line => [/ ${line}]).join('\n')
})
strike through
code:script.js
scrapbox.PopupMenu.addButton({
title: '打ち消し線',
onClick: text => text.split('\n').map(line => [- ${line}]).join('\n')
})
下線
code:script.js
scrapbox.PopupMenu.addButton({
title: '下線',
onClick: text => text.split('\n').map(line => [_ ${line}]).join('\n')
})
赤波線
code:script.js
scrapbox.PopupMenu.addButton({
title: '赤波線',
onClick: text => text.split('\n').map(line => [_~ ${line}]).join('\n')
})
モザイク
code:script.js
scrapbox.PopupMenu.addButton({
title: 'モザイク',
onClick: text => text.split('\n').map(line => [~ ${line}]).join('\n')
})
引用
code:script.js
scrapbox.PopupMenu.addButton({
title: '> 引用',
onClick: text => text.split(/\n/).map(line => > ${line}).join('\n')
});
インライン引用
検索に引っかからないのが不便なので記法を>_の方に
code:script.js
scrapbox.PopupMenu.addButton({
title: 'インライン引用',
onClick: text => text.split('\n').map(line => [>_ ${line}]).join('\n')
})
code:script.js
scrapbox.PopupMenu.addButton({
title: 'リンクを添え字形式にする',
onClick: text => text.split('\n').map(line => [. ${line}]).join('\n')
})
code
code:script.js
scrapbox.PopupMenu.addButton({
title: 'code',
onClick: text => text.split('\n').map(line => \`${line}\`).join('\n')
})
$ TeX
code:script.js
scrapbox.PopupMenu.addButton({
title: 'TeX',
onClick: text => text.split('\n').map(line => [$ ${line}]).join('\n')
})
サファイアルビ
code:script.js
scrapbox.PopupMenu.addButton({
title: 'ルビ',
onClick: text => text.split('\n').map(line => [< ${line}]).join('\n')
})
リンクの直前にページ.iconを挿入する
code:script.js
scrapbox.PopupMenu.addButton({
title: 'ユーザーフラッグとして挿入',
onClick: text => text.split('\n').map(line => [> [${line}]]).join('\n')
})
井戸端を検索
code:script.js
// 選択された文字列をScrapboxプロジェクト内で検索する
// Scapbox検索ボックスを使ったときと同じ結果ページを開く
scrapbox.PopupMenu.addButton({
title: '🔍️project内検索',
onClick: function (text) {
var projectName = 'villagepump';
}
});
bg.icon
./script2.js
. /script の拡張版
ハイライト
code:script2.js
scrapbox.PopupMenu.addButton({
title: 'ハイライト',
onClick: text => text.split('\n').map(line => [[${line}]]).join('\n')
})
太字
code:script2.js
scrapbox.PopupMenu.addButton({
title: '太字',
onClick: text => text.split('\n').map(line => [* ${line}]).join('\n')
})
太字*4
code:script2.js
scrapbox.PopupMenu.addButton({
title: '太字*4',
onClick: text => text.split('\n').map(line => [**** ${line}]).join('\n')
})
太字*10
code:script2.js
scrapbox.PopupMenu.addButton({
title: '太字*10',
onClick: text => text.split('\n').map(line => [********** ${line}]).join('\n')
})
斜体
code:script2.js
scrapbox.PopupMenu.addButton({
title: '斜体',
onClick: text => text.split('\n').map(line => [/ ${line}]).join('\n')
})
code:script2.js
scrapbox.PopupMenu.addButton({
title: '明朝体',
onClick: text => text.split('\n').map(line => [+! ${line}]).join('\n')
})
strike through
code:script2.js
scrapbox.PopupMenu.addButton({
title: '打ち消し線',
onClick: text => text.split('\n').map(line => [- ${line}]).join('\n')
})
下線
code:script2.js
scrapbox.PopupMenu.addButton({
title: '下線',
onClick: text => text.split('\n').map(line => [_ ${line}]).join('\n')
})
赤波線
code:script2.js
scrapbox.PopupMenu.addButton({
title: '赤波線',
onClick: text => text.split('\n').map(line => [_~ ${line}]).join('\n')
})
モザイク
code:script2.js
scrapbox.PopupMenu.addButton({
title: 'モザイク',
onClick: text => text.split('\n').map(line => [~ ${line}]).join('\n')
})
黒塗り
code:script2.js
scrapbox.PopupMenu.addButton({
title: '黒塗り',
onClick: text => text.split('\n').map(line => [& ${line}]).join('\n')
})
引用
code:script2.js
scrapbox.PopupMenu.addButton({
title: '> 引用',
onClick: text => text.split(/\n/).map(line => > ${line}).join('\n')
});
インライン引用
検索に引っかからないのが不便なので記法を>_の方に
code:script2.js
scrapbox.PopupMenu.addButton({
title: 'インライン引用',
onClick: text => text.split('\n').map(line => [>_ ${line}]).join('\n')
})
code:script2.js
scrapbox.PopupMenu.addButton({
title: 'リンクを添え字形式にする',
onClick: text => text.split('\n').map(line => [. ${line}]).join('\n')
})
code
code:script2.js
scrapbox.PopupMenu.addButton({
title: 'code',
onClick: text => text.split('\n').map(line => \`${line}\`).join('\n')
})
$ TeX
code:script2.js
scrapbox.PopupMenu.addButton({
title: 'TeX',
onClick: text => text.split('\n').map(line => [$ ${line}]).join('\n')
})
サファイアルビ
code:script2.js
scrapbox.PopupMenu.addButton({
title: 'ルビ',
onClick: text => text.split('\n').map(line => [< ${line}]).join('\n')
})
'_
code:script2.js
scrapbox.PopupMenu.addButton({
title: 'ラベル付きセパレーター',
onClick: text => text.split('\n').map(line => ['_ ${line}]).join('\n')
})
code:script2.js
scrapbox.PopupMenu.addButton({
title: 'hr.iconの挿入',
onClick: text => text.split('\n').map(line => [hr.icon]${line}).join('\n')
})
code:script2.js
scrapbox.PopupMenu.addButton({
title: 'bg.iconの挿入',
onClick: text => text.split('\n').map(line => [bg.icon]${line}).join('\n')
})
'
code:script2.js
scrapbox.PopupMenu.addButton({
title: '中央添え',
onClick: text => text.split('\n').map(line => [' ${line}]).join('\n')
})
bg.icon
非常に特殊な用途
ジョークやイースターエッグの類
code:something.js
scrapbox.PopupMenu.addButton({
title: '動くユーザーフラッグ記法',
onClick: text => text.split('\n').map(line => [+> ${line}]).join('\n')
})
bg.icon
正直全部覚えていられないし、UserScript化すればそもそも覚える必要がないですねNrem.icon
もしかしたら既にあるのかもしれないが、とりあえずすぐには見つからないようなので、このページによって適当な共有財にしておこうと思う。project固有の記法を使うためのUserScriptを利用者が各自で用意しなければいけないのだとすれば、それは不合理極まりないことだと思う