convert
Scrapbox 記法と Markdown を相互変換します。
書式
cos convert --from <fmt> --to <fmt> [--from-file <path>] [--to-file <path>]
フラグ
--from <fmt> — 入力形式: scrapbox / md、必須
--to <fmt> — 出力形式: scrapbox / md、必須
--from-file <path> — 入力ファイル (- で stdin、未指定時も stdin)
--to-file <path> — 出力ファイル (未指定時は stdout)
--bold-style <style> — Markdown 出力時の太字スタイル: auto / heading / emphasis
使用例
code:bash
# Scrapbox → Markdown
cos convert --from=scrapbox --to=md --from-file input.txt
# stdin から変換
echo "*太字 とリンク ページ名" | cos convert --from=scrapbox --to=md --from-file - # Markdown → Scrapbox
cos convert --from=md --to=scrapbox --from-file input.md --to-file output.txt
# 見出しスタイルを指定
cos convert --from=scrapbox --to=md --bold-style=heading --from-file input.txt
備考
--json の影響を受けず、常に純粋テキストを出力します。
関連ページ