{"action":"closed","issue":{"url":"https://api.github.com/repos/jgm/pandoc/issues/3126","repository_url":"https://api.github.com/repos/jgm/pandoc","labels_url":"https://api.github.com/repos/jgm/pandoc/issues/3126/labels{/name}","comments_url":"https://api.github.com/repos/jgm/pandoc/issues/3126/comments","events_url":"https://api.github.com/repos/jgm/pandoc/issues/3126/events","html_url":"https://github.com/jgm/pandoc/issues/3126","id":178791204,"number":3126,"title":"[Feature Request] Preprocess recursively defined YAML variable references","user":{"login":"DaveJarvis","id":2131950,"avatar_url":"https://avatars.githubusercontent.com/u/2131950?v=3","gravatar_id":"","url":"https://api.github.com/users/DaveJarvis","html_url":"https://github.com/DaveJarvis","followers_url":"https://api.github.com/users/DaveJarvis/followers","following_url":"https://api.github.com/users/DaveJarvis/following{/other_user}","gists_url":"https://api.github.com/users/DaveJarvis/gists{/gist_id}","starred_url":"https://api.github.com/users/DaveJarvis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaveJarvis/subscriptions","organizations_url":"https://api.github.com/users/DaveJarvis/orgs","repos_url":"https://api.github.com/users/DaveJarvis/repos","events_url":"https://api.github.com/users/DaveJarvis/events{/privacy}","received_events_url":"https://api.github.com/users/DaveJarvis/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-23T05:54:35Z","updated_at":"2016-10-01T08:38:22Z","closed_at":"2016-10-01T08:38:22Z","body":"# Background\r\n\r\n[YAMLP](https://bitbucket.org/djarvis/yamlp) is a pre-processor related to issue #1950. Given a YAML file with delimited variable references such as (`variables.yaml`):\r\n\r\n    ---\r\n    a: A\r\n    b: $a$ B\r\n    c: $b$ C $b$\r\n    ...\r\n\r\n\r\nYAMLP writes new YAML file to standard output with the references substituted using corresponding YAML path values from within the document:\r\n\r\n    ---\r\n    a: A\r\n    b: A B\r\n    c: A B C A B\r\n    ...\r\n\r\nThe [algorithm](https://bitbucket.org/djarvis/yamlp/src/master/src/main/java/com/whitemagicsoftware/yamlp/Main.java?fileviewer=file-view-default#Main.java-227) that performs this feat is relatively [trivial](https://bitbucket.org/djarvis/yamlp/src/master/src/main/java/com/whitemagicsoftware/yamlp/Main.java#Main.java-268).\r\n\r\nThe output from YAMLP can then be used by pandoc:\r\n\r\n    java -jar yamlp.jar --input variables.yaml > v.yaml\r\n    pandoc --template v.yaml filename.md ...\r\n\r\n# Request\r\n\r\nI'd like to eliminate YAMLP from my tool chain, if possible. That is, it would be great if pandoc could support the following:\r\n\r\n    pandoc --dereference-variables --template variables.yaml filename.md\r\n\r\nWhere `--dereference-variables` causes pandoc to first perform a recursive replacement of all variables within `variables.yaml` before it begins processing the Markdown file.\r\n\r\n# Bonus Request\r\n\r\nYAMLP also has options to show when delimited references (e.g., `$a$`) refer to non-existent values. My understanding is that this is difficult to do with the way pandoc is currently implemented. If the pre-processing happened before any other behaviour, then it might be possible to \"shim\" this feature as I've shown with the code for YAMLP."}}
{"actor":{"display_login":"jgm"}}