Skip to content

Instantly share code, notes, and snippets.

@zr-tex8r
Last active February 22, 2020 06:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zr-tex8r/e8c99f43f20a1b986d7d9c201e955661 to your computer and use it in GitHub Desktop.
Save zr-tex8r/e8c99f43f20a1b986d7d9c201e955661 to your computer and use it in GitHub Desktop.
Pandoc:新しいPandocでCSVをpandoc.readするテスト
function CodeBlock(block)
if block.classes:includes("csvin", 1) then
return pandoc.read(block.text, "csv").blocks[1]
end
end

CSVのテストです。

名称,特徴
Pandoc,ツイッタァーでRTが貰える
ぱんどっく,なんかカワイイ
パンドック,うわぁ

いかがでしたか?

<p>CSVのテストです。</p>
<table>
<thead>
<tr class="header">
<th>名称</th>
<th>特徴</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Pandoc</td>
<td>ツイッタァーでRTが貰える</td>
</tr>
<tr class="even">
<td>ぱんどっく</td>
<td>なんかカワイイ</td>
</tr>
<tr class="odd">
<td>パンドック</td>
<td>うわぁ</td>
</tr>
</tbody>
</table>
<p>いかがでしたか?</p>
@zr-tex8r
Copy link
Author

zr-tex8r commented Feb 22, 2020

CSVを内容とするcsvinクラス付きのコードブロックが表組に変換される。

pandoc test-in.md -L filter.lua -o test-out.html

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