{"action":"created","issue":{"url":"https://api.github.com/repos/jgm/pandoc/issues/2308","labels_url":"https://api.github.com/repos/jgm/pandoc/issues/2308/labels{/name}","comments_url":"https://api.github.com/repos/jgm/pandoc/issues/2308/comments","events_url":"https://api.github.com/repos/jgm/pandoc/issues/2308/events","html_url":"https://github.com/jgm/pandoc/issues/2308","id":95713670,"number":2308,"title":"Feature request: Quit the pandoc application only after the second consecutive EOF","user":{"login":"MathieuDuponchelle","id":1278273,"avatar_url":"https://avatars.githubusercontent.com/u/1278273?v=3","gravatar_id":"","url":"https://api.github.com/users/MathieuDuponchelle","html_url":"https://github.com/MathieuDuponchelle","followers_url":"https://api.github.com/users/MathieuDuponchelle/followers","following_url":"https://api.github.com/users/MathieuDuponchelle/following{/other_user}","gists_url":"https://api.github.com/users/MathieuDuponchelle/gists{/gist_id}","starred_url":"https://api.github.com/users/MathieuDuponchelle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MathieuDuponchelle/subscriptions","organizations_url":"https://api.github.com/users/MathieuDuponchelle/orgs","repos_url":"https://api.github.com/users/MathieuDuponchelle/repos","events_url":"https://api.github.com/users/MathieuDuponchelle/events{/privacy}","received_events_url":"https://api.github.com/users/MathieuDuponchelle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-17T18:17:44Z","updated_at":"2015-07-17T20:02:44Z","closed_at":null,"body":"My use case is as follows:\r\n\r\nI parse a large number of source code comments, formatted in markdown + a custom extension (can be over 1000 separate fragments)\r\n\r\nI want to translate these fragments to json (doing this from python), do some processing, and pass that native representation to potential subclasses for further processing.\r\n\r\nThe problem I have with pypandoc is that it starts a new subprocess for each conversion. Ideally, I would like to be able to start pandoc as a subprocess with no input file a single time, send some data to it, send an EOF, read from the subprocess, process the data, and start over again, closing the subprocess by sending a second EOF immediately after the last fragment.\r\n\r\nThis would allow me to use pandoc as a \"server\", without the overhead of having to start a new process for each conversion job.\r\n\r\nAlternatively, it could also be argued that pandoc could detect when a json input is done, and output without waiting for the EOF,  but that would be less generic."},"comment":{"url":"https://api.github.com/repos/jgm/pandoc/issues/comments/122396988","html_url":"https://github.com/jgm/pandoc/issues/2308#issuecomment-122396988","issue_url":"https://api.github.com/repos/jgm/pandoc/issues/2308","id":122396988,"user":{"login":"MathieuDuponchelle","id":1278273,"avatar_url":"https://avatars.githubusercontent.com/u/1278273?v=3","gravatar_id":"","url":"https://api.github.com/users/MathieuDuponchelle","html_url":"https://github.com/MathieuDuponchelle","followers_url":"https://api.github.com/users/MathieuDuponchelle/followers","following_url":"https://api.github.com/users/MathieuDuponchelle/following{/other_user}","gists_url":"https://api.github.com/users/MathieuDuponchelle/gists{/gist_id}","starred_url":"https://api.github.com/users/MathieuDuponchelle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MathieuDuponchelle/subscriptions","organizations_url":"https://api.github.com/users/MathieuDuponchelle/orgs","repos_url":"https://api.github.com/users/MathieuDuponchelle/repos","events_url":"https://api.github.com/users/MathieuDuponchelle/events{/privacy}","received_events_url":"https://api.github.com/users/MathieuDuponchelle/received_events","type":"User","site_admin":false},"created_at":"2015-07-17T20:02:44Z","updated_at":"2015-07-17T20:02:44Z","body":"It would, but it seems a bit more involved than my solution on pandoc's side, while my solution requires the application side to be able to deal with a subprocess in a nice way (python's subprocess.POpen for instance)\r\n"}}