igsha / pandoc-pipe

Pipe CodeBlock to an external program and insert its output

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pandoc-pipe

Pipe CodeBlock inside special Div to an external program and insert its output as raw html.

$ pandoc -f rst -t json
.. class:: sometype
    :execute:
    :command: ["echo", "123"]

    ::

        another word
        to fight
            spaces

        new line
<Ctrl-D>
{
  "blocks": [
    {
      "t": "Div",
      "c": [
        [
          "",
          [
            "sometype"
          ],
          [
            [
              "execute",
              ""
            ],
            [
              "command",
              "[\"echo\", \"123\"]"
            ]
          ]
        ],
        [
          {
            "t": "CodeBlock",
            "c": [
              [
                "",
                [],
                []
              ],
              "another word\nto fight\n    spaces\n\nnew line"
            ]
          }
        ]
      ]
    }
  ],
  "pandoc-api-version": [
    1,
    17,
    5,
    1
  ],
  "meta": {}
}

About

Pipe CodeBlock to an external program and insert its output

License:MIT License


Languages

Language:Python 64.6%Language:Shell 21.9%Language:Nix 13.5%