├── Demo.html ├── LICENSE ├── README.md └── tutorial-maker-plugin.tid /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 A.B. Samma 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TW5-tutorial-maker-plugin 2 | This plugins enables the creation of interactive tutorials in TiddlyWiki using HopScotchjs. 3 | 4 | [Checkout the demo](https://cdn.rawgit.com/abesamma/TW5-tutorial-maker-plugin/d430d740/Demo.html) 5 | -------------------------------------------------------------------------------- /tutorial-maker-plugin.tid: -------------------------------------------------------------------------------- 1 | author: Abraham Samma 2 | created: 20180901220338215 3 | description: Create tutorials for TiddlyWiki 4 | list: readme license 5 | modified: 20180902163658787 6 | plugin-type: plugin 7 | tags: 8 | title: $:/plugins/tutorial-maker 9 | type: application/json 10 | version: 0.0.18 11 | 12 | { 13 | "tiddlers": { 14 | "$:/plugins/tutorial-maker/tutorial.js": { 15 | "created": "20180902101508937", 16 | "text": "(function () {\n /*jslint node: true, browser: true */\n /*global $tw: false */\n \"use strict\";\n\n var Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\n var TutorialWidget = function(parseTreeNode,options) {\n this.initialise(parseTreeNode,options);\n };\n\n /*\n Inherit from the base widget class\n */\n TutorialWidget.prototype = new Widget();\n \n TutorialWidget.prototype.render = function (parent,nextSibling) {\n this.parentDomNode = parent;\n this.computeAttributes();\n this.execute();\n };\n \n TutorialWidget.prototype.execute = function () {\n var t = this.getAttribute(\"tiddler\");\n var trigger = this.getAttribute(\"trigger\") || \"start-tutorial\";\n var o = $tw.wiki.getTiddlerData(t) || {};\n $tw.rootWidget.addEventListener(trigger, function () {\n try {\n hopscotch.startTour(o);\n } catch (err) {\n return $tw.utils.error(err);\n }\n });\n };\n \n TutorialWidget.prototype.refresh = function (changedTiddlers) {\n this.refreshSelf();\n return true;\n };\n \n exports.tutorial = TutorialWidget;\n})();", 17 | "type": "application/javascript", 18 | "title": "$:/plugins/tutorial-maker/tutorial.js", 19 | "tags": "", 20 | "module-type": "widget", 21 | "modified": "20180902160020077" 22 | }, 23 | "$:/plugins/tutorial-maker/hopscotch.js": { 24 | "created": "20180902124949628", 25 | "text": "", 26 | "title": "$:/plugins/tutorial-maker/hopscotch.js", 27 | "tags": "$:/tags/RawMarkup", 28 | "modified": "20180902125231313" 29 | }, 30 | "$:/plugins/tutorial-maker/hopscotch.css": { 31 | "created": "20180902124832216", 32 | "text": "", 33 | "title": "$:/plugins/tutorial-maker/hopscotch.css", 34 | "tags": "$:/tags/RawMarkup", 35 | "modified": "20180902124941258" 36 | }, 37 | "$:/plugins/tutorial-maker/readme": { 38 | "created": "20180902153847242", 39 | "text": "This plugin creates a widget that accepts a single tiddler that defines an interactive tutorial for using ~TiddlyWiki using JSON.\n\n__Widget Attributes__\n\n|!Attribute|!Description|\n|''Tiddler''|Name of tiddler containing JSON tutorial|\n|''Trigger''|The widget message that will trigger this tutorial. Defaults to //start-tutorial//|\n\n__Basic Usage__\n\nThe widget accepts a \n\n# tiddler that contains a JSON object that instructs ~HopScotchjs, a framework product tours, how to step through a tutorial. The documentation for ~HopScotch's API can be found [[here|http://linkedin.github.io/hopscotch/]].\n# A trigger message that the widget should listen out for to start the defined tutorial. This is usually sent by a button widget.\n\nTriggering the tutorial requires a simple `start-tutorial` or any other defined, custom widget message.\n\n__Example__\n\n```\n<$button message=\"start-this-tutorial\">\nStart Tutorial\n\n\n<$tutorial tiddler=\"Example\" message=\"start-this-tutorial\" />\n```\n", 40 | "title": "$:/plugins/tutorial-maker/readme", 41 | "tags": "", 42 | "modified": "20180902161144881" 43 | }, 44 | "$:/plugins/tutorial-maker/license": { 45 | "created": "20180902163113894", 46 | "text": "The Tutorial Maker plugin is covered by the following licenses:\n\nMIT License\n\nCopyright (c) 2018 Abraham B. Samma\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", 47 | "title": "$:/plugins/tutorial-maker/license", 48 | "tags": "", 49 | "modified": "20180902163219905" 50 | } 51 | } 52 | } --------------------------------------------------------------------------------