elecdeer
https://lh3.googleusercontent.com/a-/AOh14GivaCrrLcwfy7NFlud7cpDrDzQ1MouSh4DwfgsZBA=s96-c#.png
書いてる人
人?
Userscript
Stronger
code:script.js
scrapbox.PopupMenu.addButton({
title: 'Stronger',
onClick: text => {
return '' + text + '';
}
})
Mark
code:script.js
scrapbox.PopupMenu.addButton({
title: 'Mark',
onClick: text => {
return ' ' + text + '';
}
})
補足
code:script.js
scrapbox.PopupMenu.addButton({
title: '#',
onClick: text => {
return '' + text + '';
}
})
強調
code:script.js
scrapbox.PopupMenu.addButton({
title: '+',
onClick: text => {
return '' + text + '';
}
})
Badge
code:script.js
scrapbox.PopupMenu.addButton({
title: 'O',
onClick: text => {
return '' + text + '';
}
})
Badge
code:script.js
scrapbox.PopupMenu.addButton({
title: 'B',
onClick: text => {
return '' + text + '';
}
})
画像50%
code:script.js
scrapbox.PopupMenu.addButton({
title: '50%',
onClick: text => {
return '' + text + '';
}
})
tex
code:script.js
scrapbox.PopupMenu.addButton({
title: 'Tex',
onClick: text => {
return '$ ' + text + '';
}
})
shape mathpix
code:script.js
const checkInMathBrackRegex = /\[\$(?<tex>\s\S*)\]/ const nlRegex = /\r\n|\n|\r/g;
const lBreakRegex = /\[/g;
const rBreakRegex = /\]/g;
console.log("shape mathpix");
const mathpixShaper = (text) => {
return text.replace(nlRegex, "").replace(lBreakRegex, "\\lbrack").replace(rBreakRegex, "\\rbrack");
}
scrapbox.PopupMenu.addButton({
title: 'ShapeMathpix',
onClick: text => {
const mathBrackTest = checkInMathBrackRegex.exec(text);
if(mathBrackTest){
return [$ ${mathpixShaper(mathBrackTest.groups.tex)}];
}else{
return mathpixShaper(text);
}
}
});
prettier整形
code:script.js
import('/api/code/takker/prettier-on-scrapbox/script.js');