1
\$\begingroup\$

I've written a function that facilitates abbreviated system names in postscript code. And I'd like to "host" the code in an answer to the Postscript tips question.

Is there a way to auto-insert the revision number into the post (ideally into the code block itself)?

In the event that improvements/changes are made, I want all copies of the function to identify themselves as to where they came from.

| |
\$\endgroup\$
  • 2
    \$\begingroup\$ I've never heard of one, and I can't think of many use cases...unless we start thinking of SE posts as effectively VC repositories (which is what you are suggesting, more or less). Perhaps the team will be interested. \$\endgroup\$ – dmckee --- ex-moderator kitten Aug 30 '13 at 19:18
  • \$\begingroup\$ Yeah. Getting it into the code block would take their help. But I suspect it could be done with javascript in the text of the post. I could add instructions to the user: "%Copy this line, too! Rev ##". \$\endgroup\$ – luser droog Aug 30 '13 at 19:22
  • \$\begingroup\$ Answers should be self contained. If the repo hosting the code disappears some time in the future, the mods would probably have to end up deleting the answer. This is already a problem with answers containing ordinary urls. \$\endgroup\$ – gnibbler Aug 31 '13 at 20:39
  • \$\begingroup\$ Perhaps I didn't explain clearly, but there is no external repo. The code-block in the answer text itself would be the repo. But as all tips questions are CW, it might be edited and improved by other users (good!), but this could lead to multiple inconsistent unidentified versions (bad!). Ideally the user could highlight/copy/paste the code block into a text file, and if necessary the user can inspect the file to discover the exact version they have (== revision number of the PPCG.SE Answer). \$\endgroup\$ – luser droog Aug 31 '13 at 20:45
1
\$\begingroup\$

This is a sort-of sandbox answer, to better illustrate what I'm talking about.


This is revision 3 of the code.

URL: http://meta.codegolf.stackexchange.com/revisions/660/3
Here is my code.
For all to enjoy.
| |
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .