Scrapbox Markdown



sb2md.js
Scrapbox markdown code

Scrapbox Markdown Code

エクスポートされた Scrapbox の JSON ファイルから、Markdown 形式のファイルを生成します。 対応している記法は以下。. Scrapbox (の一部) 記法 で書かれたScrapboxページの文章を,対応するMarkdownに変換するBookmarklet「Scrapbox2Markdown」を書きました.ひとまず必要な記法のみの変換コードを勢いにまかせて作ったので,まだ対応できていない変換も結構あります.いまのところ以下の記法に対して動. Trello, MediaWiki, Slite, Feedly, and Nuclino are the most popular alternatives and competitors to Scrapbox. 'Great for collaboration' is the primary reason why developers choose Trello. Great onboarding, the familiar interface in Slack style, useful shortcuts, nice code snippets, support of Markdown. Now writing instructions and team notes. Scrapbox - A new style of note-taking where ideas connect. (Productivity, Task Management, and Text Editors) Read the opinion of 27 influencers. Discover 6 alternatives like NotePlan for iOS. HackMD offers a great unified Markdown editor/preview which is familiar and well-suited to our needs. Our meeting records have improved a lot over a short period and as a result we are able to be better accountable to each other as a team. Bryan Van de Ven Co-creator and Project Lead of Bokeh.

Scrapbox Markdown Schedule

if(!Object.prototype.then){
Object.prototype.then=function(f){returnf.call(null,this);}
}
process.stdin.resume();
process.stdin.setEncoding('utf8');
letinput_string=';
process.stdin.on('data',chunk=>{
input_string+=chunk;
});
process.stdin.on('end',()=>{
consttext=input_string;
console.log(sb2md(text));
});
functionsb2md(text){
// code block
constescapeCodeBlocks=s=>s.replace(
/^code:(.+)$((n^[t].*$)+)/mg,
(_,p1,p2)=>
'```'+p1+p2.replace(/^[t]/mg,').replace(/r|n|rn/g,'+++')+'+++```'
);
constunescapeCodeBlocks=s=>s.replace(/+{3}/g,'n');
constreplaceLine=line=>
/^`{3}/.test(line) ? line :
// level 2 heading
line.replace(/^[[([^[]]+)]]$/,'## $1')
.replace(/^[*s+(S[^[]]*)]$/,'## $1')
// anchor link
.replace(/[(S.*)s+(https?://S+)]/g,'[$1]($2)')
.replace(/[(https?://S+)s+(S.*)]/g,'[$2]($1)')
// image block
.replace(/^[(https?://S+.(png|gif|jpe?g))]$/,'![]($1)')
.replace(/^[(https://gyazo.com/S+)]$/,'![]($1.png)')
// unordered list
.replace(/^s(S.*)$/,'- $1')
.replace(/^s{2}(S.*)$/,' - $1')
.replace(/^s{3}(S.*)$/,' - $1')
// bold text
.replace(/[[([^[]]+)]]/g,'**$1**')
.replace(/[*s+([^[]]+)]/g,'**$1**')
// italic text
.replace(/[/s+([^[]]+)]/g,'*$1*');
returntext
.then(escapeCodeBlocks)
.split(/r|n|rn/)
// first line is level 1 heading
.then(lines=>[lines[0].replace(/^(.+)$/,'# $1')].concat(lines.slice(1)))
.map(replaceLine)
.join('n')
.then(unescapeCodeBlocks);
}
Scrapbox Markdown

Scrapbox Markdown 変換

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment