{"action":"created","issue":{"url":"https://api.github.com/repos/jgm/pandoc/issues/2019","labels_url":"https://api.github.com/repos/jgm/pandoc/issues/2019/labels{/name}","comments_url":"https://api.github.com/repos/jgm/pandoc/issues/2019/comments","events_url":"https://api.github.com/repos/jgm/pandoc/issues/2019/events","html_url":"https://github.com/jgm/pandoc/issues/2019","id":63600387,"number":2019,"title":"dump metadata along with document fragment","user":{"login":"zackw","id":325899,"avatar_url":"https://avatars.githubusercontent.com/u/325899?v=3","gravatar_id":"","url":"https://api.github.com/users/zackw","html_url":"https://github.com/zackw","followers_url":"https://api.github.com/users/zackw/followers","following_url":"https://api.github.com/users/zackw/following{/other_user}","gists_url":"https://api.github.com/users/zackw/gists{/gist_id}","starred_url":"https://api.github.com/users/zackw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zackw/subscriptions","organizations_url":"https://api.github.com/users/zackw/orgs","repos_url":"https://api.github.com/users/zackw/repos","events_url":"https://api.github.com/users/zackw/events{/privacy}","received_events_url":"https://api.github.com/users/zackw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-03-23T01:46:01Z","updated_at":"2015-03-24T19:23:30Z","closed_at":null,"body":"I am looking for a way to get pandoc to dump out metadata along with a document fragment.  This should behave as follows:\r\n\r\n* There should be some unambiguous syntactic mechanism to distinguish the metadata from the document fragment.  I don't care what that is.\r\n* All metadata should be dumped, not just what is meaningful to pandoc itself or a template.\r\n* It should be dumped out as JSON, faithfully reproducing whatever data structure was read in (for instance, YAML lists should be preserved)\r\n* Strings should be rendered using the same markup as the document fragment.\r\n\r\nAn example would probably help: given\r\n\r\n    ---\r\n    authors: [joe bloggs, fred mbogo]\r\n    title: This title contains *emphasis* and $m$-ath\r\n    ...\r\n\r\n    This is the body of the document\r\n\r\n`pandoc -t html5+metadata --mathml` should produce something like\r\n\r\n    <!-- metadata:\r\n    {\"authors\":[\"joe bloggs\",\"fred mbogo\"],\"title\":\"This title contains <em>emphasis</em> and <math><mrow><mi>m</mi></mrow></math>-ath\"}\r\n    :metadata -->\r\n    <p>This is the body of the document</p>\r\n\r\nIt's quite possible that there's already a way to do something like this and I just can't find it, in which case I would appreciate a pointer.\r\n\r\nA way to dump *only* the metadata, but still applying a rendering, would also be useful."},"comment":{"url":"https://api.github.com/repos/jgm/pandoc/issues/comments/85656256","html_url":"https://github.com/jgm/pandoc/issues/2019#issuecomment-85656256","issue_url":"https://api.github.com/repos/jgm/pandoc/issues/2019","id":85656256,"user":{"login":"jgm","id":3044,"avatar_url":"https://avatars.githubusercontent.com/u/3044?v=3","gravatar_id":"","url":"https://api.github.com/users/jgm","html_url":"https://github.com/jgm","followers_url":"https://api.github.com/users/jgm/followers","following_url":"https://api.github.com/users/jgm/following{/other_user}","gists_url":"https://api.github.com/users/jgm/gists{/gist_id}","starred_url":"https://api.github.com/users/jgm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgm/subscriptions","organizations_url":"https://api.github.com/users/jgm/orgs","repos_url":"https://api.github.com/users/jgm/repos","events_url":"https://api.github.com/users/jgm/events{/privacy}","received_events_url":"https://api.github.com/users/jgm/received_events","type":"User","site_admin":false},"created_at":"2015-03-24T19:23:30Z","updated_at":"2015-03-24T19:23:30Z","body":"+++ Nikolay Yakimov [Mar 24 15 07:28 ]:\n>>  I am reluctant to require the Haskell compiler or the Pandoc libraries; the current code uses only the command-line tool.\n>\n>Look, in absolute majority of cases, if pandoc is installed, so is haskell runtime.\n\nMany people install pandoc with the binary packages, which don't install\nHaskell runtime.  Of course, you can always shell out to pandoc in your\nfilter.\n\n"}}