What is Demo script?
This is just a demo script that shows you all the options you have using Tutorialbuilder
Example
Version
2.0
Authors
- Christian Heilmann
- John Doe
Tags
Download
Full source
- 1: helloWorld = function(){
- 2: var config = {
- 3: foo:'bar',
- 4: CSS:{
- 5: ids:{
- 6: menu:'menu',
- 7: footer:'footer'
- 8: },
- 9: classes:{
- 10: demo:'demo',
- 11: highlight:'current'
- 12: }
- 13: }
- 14: };
- 15: function init(){
- 16: if(window.console){
- 17: console.log('init was here');
- 18: alert('script executed!')
- 19: }
- 20: };
- 21: function otherStuff(){
- 22: if(window.console){
- 23: console.log('this would be other stuff');
- 24: }
- 25: };
- 26: return {
- 27: init:init
- 28: };
- 29: }();
- 30: helloWorld.init();
Explanations
We're using the revealing module pattern to define the main script. In this case, the main module name will be helloWorld
.
- 1: helloWorld = function(){
You can use both lists and definition lists:
foo
- this is a bar
CSS
- An object that contains CSS information
- list item 1
- list item 2
- list item 3
Text surrounded by linebreaks will be turned into paragraphs.
Each word enclosed in hashes will become code
, words in asterisks will become strong.
- 2: var config = {
- 3: foo:'bar',
- 4: CSS:{
- 5: ids:{
- 6: menu:'menu',
- 7: footer:'footer'
- 8: },
- 9: classes:{
- 10: demo:'demo',
- 11: highlight:'current'
- 12: }
- 13: }
- 14: };
Any comment in the code will intercept the code display and turned into explanations
- 15: function init(){
- 16: if(window.console){
- 17: console.log('init was here');
- 18: alert('script executed!')
- 19: }
- 20: };
If you want to highlight a certain line, add a double slash followed by a star at the end of it.
- 21: function otherStuff(){
- 22: if(window.console){
- 23: console.log('this would be other stuff');
- 24: }
- 25: };
- 26: return {
- 27: init:init
- 28: };
You can add links by adding words in quotes followed by a colon and the url
- 29: }();
- 30: helloWorld.init();