こぼたん
https://scrapbox.io/files/62d13305dc273e0023833fa8.jpg
こぼたん.icon私だ。
主な活動場所
ツイキャス 本読んでるよ
こぼチャンネル
作っていくもの(これから)
一切経蔵
一切経蔵チャンネル
傾向
多角的・複合的視点
重層的・階層的構築
*何がどこでどう繋がっているのか?
*どうしてこうなったのか?
やりたいこと
一切経読破
十巻章素読
四書素読
好きなこと(読書以外で)→創作状況
サムネイル→インスタ pixiv *でもイマイチ使いづらい…
書道
欲しいもの
iPad
読みたい本
春秋
戦国策
世説論語
読んでる本
律蔵の研究
論語
読んだ本 主なやつ
弘法大師全集
60巻華厳経
史記
日本書紀
続日本紀
古事記
*****
*****
見出し
code:script.js
(function () {
scrapbox.PageMenu.addMenu({
title: '見出し',
image: 'https://gyazo.com/bc38721e0980f2188f1c831754ac8da4/raw',
onClick: () => {
scrapbox.PageMenu('見出し').removeAllItems()
for (let line of scrapbox.Page.lines) {
if (!line.section.start) continue
const image = line.nodes && getIconUrl(line.nodes)
const noIcon = !!image
const title = line.nodes ? renderPlainText(line.nodes, {noIcon}) : line.text
const onClick = () => location.hash = line.id
scrapbox.PageMenu('見出し').addItem({title, image, onClick})
}
}
})
function renderPlainText (node, options) {
if (node instanceof Array) return node.map(node => renderPlainText(node, options)).join('')
if (typeof node === 'string') return node
switch (node.type) {
case 'icon':
case 'strong-icon':
return options.noIcon ? ' ' : node.unit.page
}
return renderPlainText(node.children, options)
}
function getIconUrl (node) {
if (/icon/.test(node.type)) {
return /api/pages/${node.unit.project||scrapbox.Project.name}/${node.unit.page}/icon
}
if (node instanceof Array) {
return node.map(getIconUrl).find(img => img)
}
if (node.children) return getIconUrl(node.children)
return null
}
})()
転送
code:script.js
// 転送用のスクリプト
scrapbox.PopupMenu.addButton({
title: 'こぼたんへ',
onClick: text => {
const projectName = 'kbsabzou' // ここに転送先URL末尾を入れる
let title = text.split('\n')0;
title = encodeURIComponent(window.prompt(タイトルを入力してください(${projectName}に転送),title));
if (title=="null") return; // キャンセルだと何もしない
text = encodeURIComponent(text);
const url = /${projectName}/${title}?body=${text};
window.open(url);
return [/${projectName}/${decodeURIComponent(title)}];
}
})
code:script.js
// 転送用のスクリプト
scrapbox.PopupMenu.addButton({
title: '一切経蔵へ',
onClick: text => {
const projectName = 'SutraPitaka' // ここに転送先URL末尾を入れる
let title = text.split('\n')0;
title = encodeURIComponent(window.prompt(タイトルを入力してください(${projectName}に転送),title));
if (title=="null") return; // キャンセルだと何もしない
text = encodeURIComponent(text);
const url = /${projectName}/${title}?body=${text};
window.open(url);
return [/${projectName}/${decodeURIComponent(title)}];
}
})
ページ転送
code:script.js
export function exportPage(projectName) {
// scrapbox以外のページとapiのページはexport対象から外す
if(document.domain != 'scrapbox.io') return;
if(!scrapbox || scrapbox.Layout !== 'page') return;
const currentProjectName = scrapbox.Project.name;
const currentPageName = encodeURIComponent(scrapbox.Page.title);
let date_ob = new Date();
let date = ("0" + date_ob.getDate()).slice(-2);
let month = ("0" + (date_ob.getMonth() + 1)).slice(-2);
let year = ("" + date_ob.getFullYear());
// タイトル以外の行を取得する
const body = encodeURIComponent(scrapbox.Page.lines.slice(1).map(l => l.text).join('\n'));
const newLine = "%0A"
const url = https://scrapbox.io/${projectName}/${currentPageName}?body=${body}${newLine}${newLine}original : [/<こぼたん'sPROJECT>/${currentPageName}];
console.log(url)
window.open(url);
}
scrapbox.PageMenu.addMenu({
title: 'export',
image: 'https://scrapbox.io/files/625adf8a4c0915001f07be1d.jpg'
});
const projectList = "kbsanzou"
projectList.forEach( (project) => {
scrapbox.PageMenu('export').addItem({
title: export this page to /${project},
onClick: () => exportPage(project),
});
});
今日のページ
code:script.js
// 今日のページを開く
function todayPageOpen() {
const date = new Date();
const today = date.toLocaleDateString();
location = today; /kbsanzou-01726689/${today} // 変更点
}
// ボタンの設定
scrapbox.PageMenu.addMenu({
title: '今日のページ',
image: 'https://i.gyazo.com/44321dc33243ae3658a1342536bff0b0.png',
onClick: ()=> todayPageOpen()
});
code:script.js
(async () => {
const {runPremy} = await import("/api/code/hata6502/premy/index.js");
runPremy();
})();
ついった投稿
code:script.js
scrapbox.PageMenu.addItem({
title: 'Tweet',
image: 'https://twitter.com/favicon.ico',
onClick: () => window.open(https://twitter.com/intent/tweet?url=${encodeURIComponent(location.href)}&text=${encodeURIComponent(window.scrapbox.Page.title)})
})
文字カウント
code:script.js
scrapbox.PageMenu.addItem({
title: () => {
if (!scrapbox.Page.lines) return
const chars = scrapbox.Page.lines.map(line => line.text.length).reduce((a,b) => a + b)
const words = scrapbox.Page.lines.map(line => line.text.split(/\s+/).length).reduce((a,b) => a + b)
return ${chars}文字 ${words}単語 ${scrapbox.Page.lines.length}行
},
onClick: () => null
})
TOPに飛ぶ
code:script.js
import "/api/code/scrasobox/ピンしてるページにジャンプするメニュー/script.js"
this is こぼたん’s page