{"action":"opened","issue":{"url":"https://api.github.com/repos/nutterb/junkyard/issues/1","labels_url":"https://api.github.com/repos/nutterb/junkyard/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/nutterb/junkyard/issues/1/comments","events_url":"https://api.github.com/repos/nutterb/junkyard/issues/1/events","html_url":"https://github.com/nutterb/junkyard/issues/1","id":63140339,"number":1,"title":"Function to write the version number of a document","user":{"login":"nutterb","id":1848445,"avatar_url":"https://avatars.githubusercontent.com/u/1848445?v=3","gravatar_id":"","url":"https://api.github.com/users/nutterb","html_url":"https://github.com/nutterb","followers_url":"https://api.github.com/users/nutterb/followers","following_url":"https://api.github.com/users/nutterb/following{/other_user}","gists_url":"https://api.github.com/users/nutterb/gists{/gist_id}","starred_url":"https://api.github.com/users/nutterb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nutterb/subscriptions","organizations_url":"https://api.github.com/users/nutterb/orgs","repos_url":"https://api.github.com/users/nutterb/repos","events_url":"https://api.github.com/users/nutterb/events{/privacy}","received_events_url":"https://api.github.com/users/nutterb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-20T02:18:22Z","updated_at":"2015-03-20T02:18:22Z","closed_at":null,"body":"For a document in `path/filename_vx.ext`, it would be nice to have a way to increment the value of `x` everytime the document is built.  \r\n\r\nThe function itself would do the following\r\n\r\n1. search `path` for all files of the form `filename_vx.ext`\r\n2. extract `vx[.]` by a function such as `str_extract`\r\n3. select only the digists in `vx[.]` and convert to numeric\r\n4. increment `x` by 1\r\n5. reassemble the file path\r\n\r\nThe way I see this being implemented is to put a chunk at the end of my markdown document\r\n\r\n`{r, eval=FALSE}`\r\n`knit(input = [markdown file], output=increment_version(path, filename)`\r\n\r\nAfter determining that any changes to my document are adequate, (usually working in interactive) I can then manually run the code in that block to get the document built and increment the version automatically.\r\n"}}