[
    {
        "created": "20181208191734845",
        "text": "/*\\\n$:/MAS/reference/autoref.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to link an auto-incremented number to a tiddler\n\nParameter: tiddler\n\n  Tiddler to be accessed. Can also contain number of tiddler\n  when used with \"num\"\n\nParameter: action\n\n  \"link\" (to link a tiddler to a number) \n  \"ref\"  (to access the tiddler assigned to the number,\n   \tor number assigned to the tiddler)\n  \"max\" (to access the current max reference number)\n  Default is \"max\".\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"autoref\";\n\nexports.params = [\n\t{name:\"action\",default:\"max\"}, {name: \"tiddler\"}\n];\n\n/*\nRun the macro\n*/\nexports.run = function(action,tiddler) {\n\nvar cntref = \"MAS-REF-COUNTER\" ;\n\nif (! action ) {\n\treturn \"Must define action\";\n} \n\nif (typeof window.MAS_refs == 'undefined') {\n    window.MAS_refs = {} ;\n    window.MAS_refs[cntref] = 0 ;\n} \n\nif (action == \"link\") {\n  if (! tiddler) {\n    return \"Must specify tiddler\" ;\n  }\n  if (!window.MAS_refs.hasOwnProperty(tiddler)) {\n\tvar cnt = window.MAS_refs[cntref] ;\n    cnt += 1 ;\n    window.MAS_refs[tiddler] = cnt ;\n    window.MAS_refs[cnt.toString()] = tiddler ;\n    window.MAS_refs[cntref] = cnt ;\n  }\n  return window.MAS_refs[tiddler] ;\n}\n\nif (action == \"ref\") {\n  \tif (! tiddler) {\n    \treturn \"Must specify tiddler\" ;\n  \t}\n\tif (window.MAS_refs.hasOwnProperty(tiddler)) {\n\t\treturn window.MAS_refs[tiddler] ;\n  \t} else {\n     \treturn \"UNREFERENCED TIDDLER\" + tiddler ;\n  \t}\n}\n\n  \nif (action == \"max\") {\n\treturn window.MAS_refs[cntref] ;\n}\n\nreturn \"UNKNOWN ACTION\" ;\n\n};\n\n})();\n",
        "type": "application/javascript",
        "title": "$:/MAS/reference/autoref.js",
        "tags": "exportme",
        "module-type": "macro",
        "modified": "20181208224430432"
    },
    {
        "created": "20181208194332532",
        "text": "\\define showref(tid) \n<<autoref link \"\"\"$tid$\"\"\">>. {{$tid$!!description}}\n\\end\n\\define showbynum()\n<$vars curtid=<<autoref ref \"\"\"$(currentTiddler)$\"\"\">>>\n<<currentTiddler>>. <$view field=\"description\" tiddler=<<curtid>>/><br/>\n</$vars>\n\\end\n\\define numlink(tid)\n<$link to=\"\"\"$tid$\"\"\"><<autoref link \"\"\"$tid$\"\"\">></$link>\n\\end\n\nHere I want to make a reference to a numbered link: <<numlink \"WS-2016\">>\n\nBut here I want to describe the link with it's number: \n\n<<showref \"WS-2016\">>\n\nAnother quick reference to a different link by number: <<numlink \"SJ-2015\">>\n\nMAX LINKS I'VE SEEN: <<autoref \"max\">>\n\nNow I'll list what I've seen:\n\n<$list filter=\"[range<autoref>]\">\n<<showbynum>>\n</$list>\n\n",
        "title": "Autoref Test",
        "tags": "exportme",
        "modified": "20181208224340478"
    },
    {
        "created": "20181208210317187",
        "text": "",
        "title": "SJ-2015",
        "tags": "exportme",
        "pubdate": "2015",
        "modified": "20181208224407373",
        "description": "S.Johnson. Paper title. Publ. 2015"
    },
    {
        "created": "20181208210514139",
        "text": "",
        "title": "WS-2016",
        "tags": "exportme",
        "pubdate": "2016",
        "modified": "20181208224355615",
        "description": "W.Simpson. Another paper title. Publ. 2016"
    }
]