<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sugarlabs.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Petergijsels</id>
	<title>Sugar Labs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sugarlabs.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Petergijsels"/>
	<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/go/Special:Contributions/Petergijsels"/>
	<updated>2026-06-30T01:51:17Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Karma/Future_Direction&amp;diff=53530</id>
		<title>Karma/Future Direction</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Karma/Future_Direction&amp;diff=53530"/>
		<updated>2010-06-22T11:05:55Z</updated>

		<summary type="html">&lt;p&gt;Petergijsels: /* Git Repositories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We have now converted around 80 lessons to Karma, so this might be a good time to look back and evaluate what we have done so far. The focus on this page will be on things that can be improved and possible future directions we could explore.&lt;br /&gt;
&lt;br /&gt;
==Issues in the Current Incarnation of Karma==&lt;br /&gt;
# If you look at the current Karma activities you&#039;ll see a lot of duplication:&lt;br /&gt;
#* a number of lessons are variations on a theme. E.g. the 2_English_Vocabulary* lessons are all very similar. The only thing that varies are the pictures, positions and words.&lt;br /&gt;
#* the html of a lot of lessons is very similar except for the title and maybe one or two JavaScript libraries. Html lacks the abstraction mechanisms to remove this duplication.&lt;br /&gt;
# You get very few errors if there is something wrong in your html (e.g. missing DOCTYPE declaration or wrong path to a JavaScript or CSS file). This is very painful if you are not familiar with web development.&lt;br /&gt;
# CSS is a big pain for layouts if you want to be able to resize them (CSS is ok if you only use absolute positioning).&lt;br /&gt;
&lt;br /&gt;
==Generating Lessons==&lt;br /&gt;
Most of these issues can be alleviated if we generate html, css and (part of) the JavaScript from a higher level description.&lt;br /&gt;
&lt;br /&gt;
I would propose a stratified design with two layers.&lt;br /&gt;
&lt;br /&gt;
===Base layer===&lt;br /&gt;
At the lowest level you would have a description language embedded in Python. This approach of embedding a language in Python is also used by SCons (www.scons.org), a replacement for Make. I have very good experience with it except for the speed in large projects (which is not a concern for us). &lt;br /&gt;
&lt;br /&gt;
To give you an idea of what such a description could look like:&lt;br /&gt;
  lesson_title(&#039;My lesson&#039;)&lt;br /&gt;
  java_script(&#039;jQuery&#039;)&lt;br /&gt;
  java_script(&#039;jQuery.UI&#039;)&lt;br /&gt;
  java_script(&#039;karma&#039;)&lt;br /&gt;
  #...&lt;br /&gt;
  # Some code to configure header and footer&lt;br /&gt;
  #...&lt;br /&gt;
  css(&#039;JQuery.UI&#039;)&lt;br /&gt;
  #...&lt;br /&gt;
  for img in files_in(&#039;assets/images&#039;): karma_preload(img)&lt;br /&gt;
  #...&lt;br /&gt;
  div(id=&#039;div1&#039;, left=10, top=20, width=30, height=40)&lt;br /&gt;
  #...&lt;br /&gt;
&lt;br /&gt;
The base layer provides a number of primitives like: lesson_title, java_script, css,... You can combine and abstract them using the mechanisms built into Python.&lt;br /&gt;
&lt;br /&gt;
Notice that in the above description there is no mention of the specific version nor location of the javascript files. We can e.g. easily switch between minimized/non-minimized versions at generation time.&lt;br /&gt;
&lt;br /&gt;
Since it is embedded in Python, we can use the full power of Python (e.g. the for loop over all images in the assets/image directory).&lt;br /&gt;
&lt;br /&gt;
You can develop your complete lesson on this layer if you want to.&lt;br /&gt;
&lt;br /&gt;
Notice that you still have to write the logic of your lesson in JavaScript (what is now in lesson.js) and can still style your lesson with CSS (lesson.css).&lt;br /&gt;
&lt;br /&gt;
For many lessons a couple of divs in the body of the html suffice; the rest can be done in JavaScript. If you need more complex html you can use the markup library to generate html from Python or include the contents of an html file in the generated html.&lt;br /&gt;
&lt;br /&gt;
===Higher layer===&lt;br /&gt;
On top of the base layer you can create a template lesson. E.g. a generic multiple choice quiz. Everything that is generic you put here (generic CSS and JavaScript code) and a small amount of Python code to read in a configuration file (xml, json) containing the questions and their answers.&lt;br /&gt;
&lt;br /&gt;
For the layout, one of the requests I got from the team here is a way to visually lay out the divs, because CSS is so difficult to work with (I agree). One way to do this is to make a small layout editor that runs in the browser and that generates the div part of the base layer description above.&lt;br /&gt;
&lt;br /&gt;
Similarly you can make a GUI where you can just check some checkboxes for which JavaScript and CSS files you want for your lessons and which assets you want Karma to preload.&lt;br /&gt;
&lt;br /&gt;
===Output from the Generator===&lt;br /&gt;
The generator would generate:&lt;br /&gt;
* a (big part of) the html. Everything in the &amp;lt;head&amp;gt; part can be generated. The header and footer can be generated (other deployments than OLEN can easily plug in another header/footer). The divs in the body can be generated.&lt;br /&gt;
* a javascript file that contains a call to the Karma constructor to tell Karma about the assets that need to be preloaded&lt;br /&gt;
* a css file that contains the positions of the divs.&lt;br /&gt;
* optionally it can copy some js files (e.g. when it is a template lesson)&lt;br /&gt;
* it can do some of the things our current deployment script does. I am not familiar with it, but I imagine it does things like adjust paths, minimize js files, share resources between lessons, etc. The advantage would be that it doesn&#039;t have to grovel through the html files to adjust paths, but starts from the python description.&lt;br /&gt;
&lt;br /&gt;
===CSS Positioning===&lt;br /&gt;
I would simplify our life and go for a fixed resolution (1200x900) and absolute positioning in CSS. The positioning of the elements would be done in the CSS editor, so at generation time we can always scale all coordinates with a fixed scale factor (flash does a similar thing).&lt;br /&gt;
&lt;br /&gt;
==Comparison with the eXe framework==&lt;br /&gt;
Mike Dawson is using it in Afghanistan and he seems quite happy with it. There are some similarities and differences to the approach above (called KarmaNT below):&lt;br /&gt;
* we both have a higher (than html) level description of a lesson.&lt;br /&gt;
* we both have support for template lessons.&lt;br /&gt;
* we both generate (part of) the html, css, js.&lt;br /&gt;
* eXe is very focussed on the GUI part and is lacking the clear lowest layer that KarmaNT has. In my experience that is a big drawback (e.g. in VisualWorks you have a GUI to define GUIs, but the base layer is not really well designed and documented which leads to big problems when you want to reuse or generate parts of GUIs from code instead of using the provided GUI). A stratified design is much more robust.&lt;br /&gt;
* the GUI is a bit off-putting, with non-standard controls and lots of superfluous controls (probably due to XUL). You probably get used to it, but my first impression was not very positive. I&#039;m not sure though that our GUI will be much better.&lt;br /&gt;
* eXe is quite big and I&#039;m not sure it would be easy to tailor it to our specific needs. I envision something much smaller for KarmaNT.&lt;br /&gt;
* eXe is more mature and plugs into a number of other tools (IMS, SCORM,...)&lt;br /&gt;
&lt;br /&gt;
==Git Repositories==&lt;br /&gt;
* http://github.com/pg42/karma-generator : a simple generator for a lesson, with an example of a template lesson &lt;br /&gt;
* http://github.com/pg42/karma-editor : a sketch of a gui to edit karma lessons&lt;/div&gt;</summary>
		<author><name>Petergijsels</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Karma/Future_Direction&amp;diff=53529</id>
		<title>Karma/Future Direction</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Karma/Future_Direction&amp;diff=53529"/>
		<updated>2010-06-22T11:02:30Z</updated>

		<summary type="html">&lt;p&gt;Petergijsels: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We have now converted around 80 lessons to Karma, so this might be a good time to look back and evaluate what we have done so far. The focus on this page will be on things that can be improved and possible future directions we could explore.&lt;br /&gt;
&lt;br /&gt;
==Issues in the Current Incarnation of Karma==&lt;br /&gt;
# If you look at the current Karma activities you&#039;ll see a lot of duplication:&lt;br /&gt;
#* a number of lessons are variations on a theme. E.g. the 2_English_Vocabulary* lessons are all very similar. The only thing that varies are the pictures, positions and words.&lt;br /&gt;
#* the html of a lot of lessons is very similar except for the title and maybe one or two JavaScript libraries. Html lacks the abstraction mechanisms to remove this duplication.&lt;br /&gt;
# You get very few errors if there is something wrong in your html (e.g. missing DOCTYPE declaration or wrong path to a JavaScript or CSS file). This is very painful if you are not familiar with web development.&lt;br /&gt;
# CSS is a big pain for layouts if you want to be able to resize them (CSS is ok if you only use absolute positioning).&lt;br /&gt;
&lt;br /&gt;
==Generating Lessons==&lt;br /&gt;
Most of these issues can be alleviated if we generate html, css and (part of) the JavaScript from a higher level description.&lt;br /&gt;
&lt;br /&gt;
I would propose a stratified design with two layers.&lt;br /&gt;
&lt;br /&gt;
===Base layer===&lt;br /&gt;
At the lowest level you would have a description language embedded in Python. This approach of embedding a language in Python is also used by SCons (www.scons.org), a replacement for Make. I have very good experience with it except for the speed in large projects (which is not a concern for us). &lt;br /&gt;
&lt;br /&gt;
To give you an idea of what such a description could look like:&lt;br /&gt;
  lesson_title(&#039;My lesson&#039;)&lt;br /&gt;
  java_script(&#039;jQuery&#039;)&lt;br /&gt;
  java_script(&#039;jQuery.UI&#039;)&lt;br /&gt;
  java_script(&#039;karma&#039;)&lt;br /&gt;
  #...&lt;br /&gt;
  # Some code to configure header and footer&lt;br /&gt;
  #...&lt;br /&gt;
  css(&#039;JQuery.UI&#039;)&lt;br /&gt;
  #...&lt;br /&gt;
  for img in files_in(&#039;assets/images&#039;): karma_preload(img)&lt;br /&gt;
  #...&lt;br /&gt;
  div(id=&#039;div1&#039;, left=10, top=20, width=30, height=40)&lt;br /&gt;
  #...&lt;br /&gt;
&lt;br /&gt;
The base layer provides a number of primitives like: lesson_title, java_script, css,... You can combine and abstract them using the mechanisms built into Python.&lt;br /&gt;
&lt;br /&gt;
Notice that in the above description there is no mention of the specific version nor location of the javascript files. We can e.g. easily switch between minimized/non-minimized versions at generation time.&lt;br /&gt;
&lt;br /&gt;
Since it is embedded in Python, we can use the full power of Python (e.g. the for loop over all images in the assets/image directory).&lt;br /&gt;
&lt;br /&gt;
You can develop your complete lesson on this layer if you want to.&lt;br /&gt;
&lt;br /&gt;
Notice that you still have to write the logic of your lesson in JavaScript (what is now in lesson.js) and can still style your lesson with CSS (lesson.css).&lt;br /&gt;
&lt;br /&gt;
For many lessons a couple of divs in the body of the html suffice; the rest can be done in JavaScript. If you need more complex html you can use the markup library to generate html from Python or include the contents of an html file in the generated html.&lt;br /&gt;
&lt;br /&gt;
===Higher layer===&lt;br /&gt;
On top of the base layer you can create a template lesson. E.g. a generic multiple choice quiz. Everything that is generic you put here (generic CSS and JavaScript code) and a small amount of Python code to read in a configuration file (xml, json) containing the questions and their answers.&lt;br /&gt;
&lt;br /&gt;
For the layout, one of the requests I got from the team here is a way to visually lay out the divs, because CSS is so difficult to work with (I agree). One way to do this is to make a small layout editor that runs in the browser and that generates the div part of the base layer description above.&lt;br /&gt;
&lt;br /&gt;
Similarly you can make a GUI where you can just check some checkboxes for which JavaScript and CSS files you want for your lessons and which assets you want Karma to preload.&lt;br /&gt;
&lt;br /&gt;
===Output from the Generator===&lt;br /&gt;
The generator would generate:&lt;br /&gt;
* a (big part of) the html. Everything in the &amp;lt;head&amp;gt; part can be generated. The header and footer can be generated (other deployments than OLEN can easily plug in another header/footer). The divs in the body can be generated.&lt;br /&gt;
* a javascript file that contains a call to the Karma constructor to tell Karma about the assets that need to be preloaded&lt;br /&gt;
* a css file that contains the positions of the divs.&lt;br /&gt;
* optionally it can copy some js files (e.g. when it is a template lesson)&lt;br /&gt;
* it can do some of the things our current deployment script does. I am not familiar with it, but I imagine it does things like adjust paths, minimize js files, share resources between lessons, etc. The advantage would be that it doesn&#039;t have to grovel through the html files to adjust paths, but starts from the python description.&lt;br /&gt;
&lt;br /&gt;
===CSS Positioning===&lt;br /&gt;
I would simplify our life and go for a fixed resolution (1200x900) and absolute positioning in CSS. The positioning of the elements would be done in the CSS editor, so at generation time we can always scale all coordinates with a fixed scale factor (flash does a similar thing).&lt;br /&gt;
&lt;br /&gt;
==Comparison with the eXe framework==&lt;br /&gt;
Mike Dawson is using it in Afghanistan and he seems quite happy with it. There are some similarities and differences to the approach above (called KarmaNT below):&lt;br /&gt;
* we both have a higher (than html) level description of a lesson.&lt;br /&gt;
* we both have support for template lessons.&lt;br /&gt;
* we both generate (part of) the html, css, js.&lt;br /&gt;
* eXe is very focussed on the GUI part and is lacking the clear lowest layer that KarmaNT has. In my experience that is a big drawback (e.g. in VisualWorks you have a GUI to define GUIs, but the base layer is not really well designed and documented which leads to big problems when you want to reuse or generate parts of GUIs from code instead of using the provided GUI). A stratified design is much more robust.&lt;br /&gt;
* the GUI is a bit off-putting, with non-standard controls and lots of superfluous controls (probably due to XUL). You probably get used to it, but my first impression was not very positive. I&#039;m not sure though that our GUI will be much better.&lt;br /&gt;
* eXe is quite big and I&#039;m not sure it would be easy to tailor it to our specific needs. I envision something much smaller for KarmaNT.&lt;br /&gt;
* eXe is more mature and plugs into a number of other tools (IMS, SCORM,...)&lt;br /&gt;
&lt;br /&gt;
==Git Repositories==&lt;br /&gt;
http://github.com/pg42/karma-generator&lt;br /&gt;
http://github.com/pg42/karma-editor&lt;/div&gt;</summary>
		<author><name>Petergijsels</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Karma/Future_Direction&amp;diff=53311</id>
		<title>Karma/Future Direction</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Karma/Future_Direction&amp;diff=53311"/>
		<updated>2010-06-16T03:49:46Z</updated>

		<summary type="html">&lt;p&gt;Petergijsels: /* Base layer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We have now converted around 80 lessons to Karma, so this might be a good time to look back and evaluate what we have done so far. The focus on this page will be on things that can be improved and possible future directions we could explore.&lt;br /&gt;
&lt;br /&gt;
==Issues in the Current Incarnation of Karma==&lt;br /&gt;
# If you look at the current Karma activities you&#039;ll see a lot of duplication:&lt;br /&gt;
#* a number of lessons are variations on a theme. E.g. the 2_English_Vocabulary* lessons are all very similar. The only thing that varies are the pictures, positions and words.&lt;br /&gt;
#* the html of a lot of lessons is very similar except for the title and maybe one or two JavaScript libraries. Html lacks the abstraction mechanisms to remove this duplication.&lt;br /&gt;
# You get very few errors if there is something wrong in your html (e.g. missing DOCTYPE declaration or wrong path to a JavaScript or CSS file). This is very painful if you are not familiar with web development.&lt;br /&gt;
# CSS is a big pain for layouts if you want to be able to resize them (CSS is ok if you only use absolute positioning).&lt;br /&gt;
&lt;br /&gt;
==Generating Lessons==&lt;br /&gt;
Most of these issues can be alleviated if we generate html, css and (part of) the JavaScript from a higher level description.&lt;br /&gt;
&lt;br /&gt;
I would propose a stratified design with two layers.&lt;br /&gt;
&lt;br /&gt;
===Base layer===&lt;br /&gt;
At the lowest level you would have a description language embedded in Python. This approach of embedding a language in Python is also used by SCons (www.scons.org), a replacement for Make. I have very good experience with it except for the speed in large projects (which is not a concern for us). &lt;br /&gt;
&lt;br /&gt;
To give you an idea of what such a description could look like:&lt;br /&gt;
  lesson_title(&#039;My lesson&#039;)&lt;br /&gt;
  java_script(&#039;jQuery&#039;)&lt;br /&gt;
  java_script(&#039;jQuery.UI&#039;)&lt;br /&gt;
  java_script(&#039;karma&#039;)&lt;br /&gt;
  #...&lt;br /&gt;
  # Some code to configure header and footer&lt;br /&gt;
  #...&lt;br /&gt;
  css(&#039;JQuery.UI&#039;)&lt;br /&gt;
  #...&lt;br /&gt;
  for img in files_in(&#039;assets/images&#039;): karma_preload(img)&lt;br /&gt;
  #...&lt;br /&gt;
  div(id=&#039;div1&#039;, left=10, top=20, width=30, height=40)&lt;br /&gt;
  #...&lt;br /&gt;
&lt;br /&gt;
The base layer provides a number of primitives like: lesson_title, java_script, css,... You can combine and abstract them using the mechanisms built into Python.&lt;br /&gt;
&lt;br /&gt;
Notice that in the above description there is no mention of the specific version nor location of the javascript files. We can e.g. easily switch between minimized/non-minimized versions at generation time.&lt;br /&gt;
&lt;br /&gt;
Since it is embedded in Python, we can use the full power of Python (e.g. the for loop over all images in the assets/image directory).&lt;br /&gt;
&lt;br /&gt;
You can develop your complete lesson on this layer if you want to.&lt;br /&gt;
&lt;br /&gt;
Notice that you still have to write the logic of your lesson in JavaScript (what is now in lesson.js) and can still style your lesson with CSS (lesson.css).&lt;br /&gt;
&lt;br /&gt;
For many lessons a couple of divs in the body of the html suffice; the rest can be done in JavaScript. If you need more complex html you can use the markup library to generate html from Python or include the contents of an html file in the generated html.&lt;br /&gt;
&lt;br /&gt;
===Higher layer===&lt;br /&gt;
On top of the base layer you can create a template lesson. E.g. a generic multiple choice quiz. Everything that is generic you put here (generic CSS and JavaScript code) and a small amount of Python code to read in a configuration file (xml, json) containing the questions and their answers.&lt;br /&gt;
&lt;br /&gt;
For the layout, one of the requests I got from the team here is a way to visually lay out the divs, because CSS is so difficult to work with (I agree). One way to do this is to make a small layout editor that runs in the browser and that generates the div part of the base layer description above.&lt;br /&gt;
&lt;br /&gt;
Similarly you can make a GUI where you can just check some checkboxes for which JavaScript and CSS files you want for your lessons and which assets you want Karma to preload.&lt;br /&gt;
&lt;br /&gt;
===Output from the Generator===&lt;br /&gt;
The generator would generate:&lt;br /&gt;
* a (big part of) the html. Everything in the &amp;lt;head&amp;gt; part can be generated. The header and footer can be generated (other deployments than OLEN can easily plug in another header/footer). The divs in the body can be generated.&lt;br /&gt;
* a javascript file that contains a call to the Karma constructor to tell Karma about the assets that need to be preloaded&lt;br /&gt;
* a css file that contains the positions of the divs.&lt;br /&gt;
* optionally it can copy some js files (e.g. when it is a template lesson)&lt;br /&gt;
* it can do some of the things our current deployment script does. I am not familiar with it, but I imagine it does things like adjust paths, minimize js files, share resources between lessons, etc. The advantage would be that it doesn&#039;t have to grovel through the html files to adjust paths, but starts from the python description.&lt;br /&gt;
&lt;br /&gt;
===CSS Positioning===&lt;br /&gt;
I would simplify our life and go for a fixed resolution (1200x900) and absolute positioning in CSS. The positioning of the elements would be done in the CSS editor, so at generation time we can always scale all coordinates with a fixed scale factor (flash does a similar thing).&lt;br /&gt;
&lt;br /&gt;
==Comparison with the eXe framework==&lt;br /&gt;
Mike Dawson is using it in Afghanistan and he seems quite happy with it. There are some similarities and differences to the approach above (called KarmaNT below):&lt;br /&gt;
* we both have a higher (than html) level description of a lesson.&lt;br /&gt;
* we both have support for template lessons.&lt;br /&gt;
* we both generate (part of) the html, css, js.&lt;br /&gt;
* eXe is very focussed on the GUI part and is lacking the clear lowest layer that KarmaNT has. In my experience that is a big drawback (e.g. in VisualWorks you have a GUI to define GUIs, but the base layer is not really well designed and documented which leads to big problems when you want to reuse or generate parts of GUIs from code instead of using the provided GUI). A stratified design is much more robust.&lt;br /&gt;
* the GUI is a bit off-putting, with non-standard controls and lots of superfluous controls (probably due to XUL). You probably get used to it, but my first impression was not very positive. I&#039;m not sure though that our GUI will be much better.&lt;br /&gt;
* eXe is quite big and I&#039;m not sure it would be easy to tailor it to our specific needs. I envision something much smaller for KarmaNT.&lt;br /&gt;
* eXe is more mature and plugs into a number of other tools (IMS, SCORM,...)&lt;/div&gt;</summary>
		<author><name>Petergijsels</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Karma/Future_Direction&amp;diff=53271</id>
		<title>Karma/Future Direction</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Karma/Future_Direction&amp;diff=53271"/>
		<updated>2010-06-15T08:20:04Z</updated>

		<summary type="html">&lt;p&gt;Petergijsels: Created page with &amp;#039;We have now converted around 80 lessons to Karma, so this might be a good time to look back and evaluate what we have done so far. The focus on this page will be on things that c...&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We have now converted around 80 lessons to Karma, so this might be a good time to look back and evaluate what we have done so far. The focus on this page will be on things that can be improved and possible future directions we could explore.&lt;br /&gt;
&lt;br /&gt;
==Issues in the Current Incarnation of Karma==&lt;br /&gt;
# If you look at the current Karma activities you&#039;ll see a lot of duplication:&lt;br /&gt;
#* a number of lessons are variations on a theme. E.g. the 2_English_Vocabulary* lessons are all very similar. The only thing that varies are the pictures, positions and words.&lt;br /&gt;
#* the html of a lot of lessons is very similar except for the title and maybe one or two JavaScript libraries. Html lacks the abstraction mechanisms to remove this duplication.&lt;br /&gt;
# You get very few errors if there is something wrong in your html (e.g. missing DOCTYPE declaration or wrong path to a JavaScript or CSS file). This is very painful if you are not familiar with web development.&lt;br /&gt;
# CSS is a big pain for layouts if you want to be able to resize them (CSS is ok if you only use absolute positioning).&lt;br /&gt;
&lt;br /&gt;
==Generating Lessons==&lt;br /&gt;
Most of these issues can be alleviated if we generate html, css and (part of) the JavaScript from a higher level description.&lt;br /&gt;
&lt;br /&gt;
I would propose a stratified design with two layers.&lt;br /&gt;
&lt;br /&gt;
===Base layer===&lt;br /&gt;
At the lowest level you would have a description language embedded in Python. This approach of embedding a language in Python is also used by SCons (www.scons.org), a replacement for Make. I have very good experience with it except for the speed in large projects (which is not a concern for us). &lt;br /&gt;
&lt;br /&gt;
To give you an idea of what such a description could look like:&lt;br /&gt;
  lesson_title(&#039;My lesson&#039;)&lt;br /&gt;
  java_script(&#039;jQuery&#039;)&lt;br /&gt;
  java_script(&#039;jQuery.UI&#039;)&lt;br /&gt;
  java_script(&#039;karma&#039;)&lt;br /&gt;
  #...&lt;br /&gt;
  # Some code to configure header and footer&lt;br /&gt;
  #...&lt;br /&gt;
  css(&#039;JQuery.UI&#039;)&lt;br /&gt;
  #...&lt;br /&gt;
  for img in files_in(&#039;assets/images&#039;): karma_preload(img)&lt;br /&gt;
  #...&lt;br /&gt;
  div(id=&#039;div1&#039;, left=10, top=20, width=30, height=40)&lt;br /&gt;
  #...&lt;br /&gt;
&lt;br /&gt;
The base layer provides a number of primitives like: lesson_title, java_script, css,... You can combine and abstract them using the mechanisms built into Python.&lt;br /&gt;
&lt;br /&gt;
Notice that in the above description there is no mention of the specific version nor location of the javascript files. We can e.g. easily switch between minimized/non-minimized versions at generation time.&lt;br /&gt;
&lt;br /&gt;
Since it is embedded in Python, we can use the full power of Python (e.g. the for loop over all images in the assets/image directory).&lt;br /&gt;
&lt;br /&gt;
You can develop your complete lesson on this layer if you want to.&lt;br /&gt;
&lt;br /&gt;
Notice that you still have to write the logic of your lesson in JavaScript (what is now in lesson.js) and can still style your lesson with CSS (lesson.css).&lt;br /&gt;
&lt;br /&gt;
===Higher layer===&lt;br /&gt;
On top of the base layer you can create a template lesson. E.g. a generic multiple choice quiz. Everything that is generic you put here (generic CSS and JavaScript code) and a small amount of Python code to read in a configuration file (xml, json) containing the questions and their answers.&lt;br /&gt;
&lt;br /&gt;
For the layout, one of the requests I got from the team here is a way to visually lay out the divs, because CSS is so difficult to work with (I agree). One way to do this is to make a small layout editor that runs in the browser and that generates the div part of the base layer description above.&lt;br /&gt;
&lt;br /&gt;
Similarly you can make a GUI where you can just check some checkboxes for which JavaScript and CSS files you want for your lessons and which assets you want Karma to preload.&lt;br /&gt;
&lt;br /&gt;
===Output from the Generator===&lt;br /&gt;
The generator would generate:&lt;br /&gt;
* a (big part of) the html. Everything in the &amp;lt;head&amp;gt; part can be generated. The header and footer can be generated (other deployments than OLEN can easily plug in another header/footer). The divs in the body can be generated.&lt;br /&gt;
* a javascript file that contains a call to the Karma constructor to tell Karma about the assets that need to be preloaded&lt;br /&gt;
* a css file that contains the positions of the divs.&lt;br /&gt;
* optionally it can copy some js files (e.g. when it is a template lesson)&lt;br /&gt;
* it can do some of the things our current deployment script does. I am not familiar with it, but I imagine it does things like adjust paths, minimize js files, share resources between lessons, etc. The advantage would be that it doesn&#039;t have to grovel through the html files to adjust paths, but starts from the python description.&lt;br /&gt;
&lt;br /&gt;
===CSS Positioning===&lt;br /&gt;
I would simplify our life and go for a fixed resolution (1200x900) and absolute positioning in CSS. The positioning of the elements would be done in the CSS editor, so at generation time we can always scale all coordinates with a fixed scale factor (flash does a similar thing).&lt;br /&gt;
&lt;br /&gt;
==Comparison with the eXe framework==&lt;br /&gt;
Mike Dawson is using it in Afghanistan and he seems quite happy with it. There are some similarities and differences to the approach above (called KarmaNT below):&lt;br /&gt;
* we both have a higher (than html) level description of a lesson.&lt;br /&gt;
* we both have support for template lessons.&lt;br /&gt;
* we both generate (part of) the html, css, js.&lt;br /&gt;
* eXe is very focussed on the GUI part and is lacking the clear lowest layer that KarmaNT has. In my experience that is a big drawback (e.g. in VisualWorks you have a GUI to define GUIs, but the base layer is not really well designed and documented which leads to big problems when you want to reuse or generate parts of GUIs from code instead of using the provided GUI). A stratified design is much more robust.&lt;br /&gt;
* the GUI is a bit off-putting, with non-standard controls and lots of superfluous controls (probably due to XUL). You probably get used to it, but my first impression was not very positive. I&#039;m not sure though that our GUI will be much better.&lt;br /&gt;
* eXe is quite big and I&#039;m not sure it would be easy to tailor it to our specific needs. I envision something much smaller for KarmaNT.&lt;br /&gt;
* eXe is more mature and plugs into a number of other tools (IMS, SCORM,...)&lt;/div&gt;</summary>
		<author><name>Petergijsels</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Karma&amp;diff=53270</id>
		<title>Karma</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Karma&amp;diff=53270"/>
		<updated>2010-06-15T07:18:32Z</updated>

		<summary type="html">&lt;p&gt;Petergijsels: /* Project Roadmap */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{GoogleTrans-en}}{{TOCleft}}&lt;br /&gt;
[[Category:GSoC]]&lt;br /&gt;
[[Category:Project]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
[[Image:Karma.png|right]]&lt;br /&gt;
&lt;br /&gt;
== The Karma Project ==&lt;br /&gt;
&lt;br /&gt;
Karma is a framework for creating educational software using JavaScript, html5, and SVG. The Karma team is primarily focused on developing Sugar activities but you can also Karma to create lessons that run in any web browser that supports html5. The best ways to get involved are to join the [http://groups.google.com/group/karmajs mailing list] and [http://git.olenepal.org/karma/karma get the code]&lt;br /&gt;
&lt;br /&gt;
=== Rationale ===&lt;br /&gt;
&lt;br /&gt;
Anyone with a modern standards-compliant web browser and a text editor should be able to create learning activities that can be used by anyone with a computer. Sugar should not be a walled garden that only allows learning activities expressly designed for it and it alone but rather gives extra power and depth to learning activities. Karma uses a specialized vocabulary that features a number of specialized terms. Please refer to the [[Karma/Dictionary|Karma Dictionary]] early and often.&lt;br /&gt;
&lt;br /&gt;
=== Status ===&lt;br /&gt;
&lt;br /&gt;
Karma is a sub-project of Sugar Labs that is under active development. The latest examples can be seen at [http://karma.sugarlabs.org http://karma.sugarlabs.org]. You can also check out the [http://karmaproject.wordpress.com Karma Project blog] for updates.&lt;br /&gt;
&lt;br /&gt;
To try out the karma examples you need to have an html5-capable browser. The Browse activity within Sugar does not currently support html5. To try out karma within Sugar you need to install [http://dev.laptop.org/~bobbyp/surf/Surf-106.xo Surf] and its webkit dependencies or run Firefox 3.5 from the command-line (yum install pywebkitgtk WebKit-gtk gnome-python2-gconf).&lt;br /&gt;
&lt;br /&gt;
The current focus of development is to convert Nepal&#039;s set of lessons coded in Squeak smalltalk. You can find the list of lessons to be converted [http://spreadsheets.google.com/pub?key=tweUJyn1BkEciHqVtSvCYDA&amp;amp;output=html here]. This is a good place for new contributors to get started&lt;br /&gt;
&lt;br /&gt;
=== What Karma Is ===&lt;br /&gt;
&lt;br /&gt;
* Karma is a simple framework to create simple interactive learning activities primarily for Sugar but also to be viewable through any web browser that supports html5&lt;br /&gt;
* Karma is used to create simple activities that run off-line w/out access to the Internet&lt;br /&gt;
* Karma is for web developers who want to contribute to Sugar using their current skills&lt;br /&gt;
* Karma is built on top of open web standards such as html5, javascript, and CSS.&lt;br /&gt;
* Karma is built to run on top of web browsers that support html5, particularly the canvas element.&lt;br /&gt;
* Karma is built around the concept of individual &amp;quot;lessons&amp;quot; and multiple lessons can be aggregated into a sugar activity&lt;br /&gt;
* Karma is the evolution of OLE Nepal&#039;s work on the EPaath suite of lessons in Nepal&lt;br /&gt;
* Karma is designed with pervasive and easy internationalizaton in mind and integration with moodle, particularly for monitoring student progress&lt;br /&gt;
* Karma is pedagogically agnostic. Pedagogical choices are left to the lesson author.&lt;br /&gt;
&lt;br /&gt;
=== What Karma Isn&#039;t ===&lt;br /&gt;
&lt;br /&gt;
* Karma is not compatible with Internet Explorer because Internet Explorer does not support html5 apis such as canvas, svg, localStorage, etc.&lt;br /&gt;
* Karma is not meant to replace pyGTK as the dominant toolset for creating Sugar activities&lt;br /&gt;
* Karma is not a tool for creating activities with complex 3D graphics. Karma is a tool for creating activities with simple 2D graphics&lt;br /&gt;
* Karma is not meant as a basis for a WYSIWG programming environment like TurtleArt, EToys, or Logo&lt;br /&gt;
* Karma is not built to support browsers that do not support html5, such as Internet Explorer and Firefox &amp;lt; version 3.5 &lt;br /&gt;
* Karma is not intended to teach programming to children though it could be used as such&lt;br /&gt;
&lt;br /&gt;
=== Design Philosophy ===&lt;br /&gt;
&lt;br /&gt;
A Karma lesson is composed of a valid html5 document, javascript code, and css stylesheets and optional assets such as images, audio, video and lesson plans. Karma should be very easy for inexperienced developers to understand and work with. Even non-programmers should be able to make visible changes by tweaking the code and liberal use of cut-and-paste. Complexities such as integration with pootle, local storage, and certain types of animation should be abstracted so that novice developers don&#039;t have to understand them in order to effectively use Karma. Karma strictly adheres to the Model-View-Controller Pattern and similarly to unobtrusive JavaScript. In essence. you should be able to substantially change the look and feel of a Karma lesson by modifying the CSS or you could translate the activity, without having to understand the JavaScript code.&lt;br /&gt;
&lt;br /&gt;
=== Design Goals ===&lt;br /&gt;
* Unobtrusive JavaScript&lt;br /&gt;
* No globals&lt;br /&gt;
* No extension of native objects&lt;br /&gt;
&lt;br /&gt;
=== Technical Architecture ===&lt;br /&gt;
&lt;br /&gt;
* Run-time - Karma will work with basic functionality on any W3C standards-compliant browser that supports HTML5 tags canvas, audio, and svg. This notably excludes Microsoft&#039;s Internet Explorer. Karma will be particularly tailored to work with Sugar&#039;s Journal and collaboration through Telepathy. Longer-term we hope to extend Karma to take advantage of Sugar&#039;s collaboration features.&lt;br /&gt;
* Primary Programming language - [https://developer.mozilla.org/en/New_in_JavaScript_1.6 Javascript 1.6] &lt;br /&gt;
* [[Karma/i18n|i18n]] -- Pervasive internationalization is a critical part of Karma&lt;br /&gt;
** Supported types of i18n  -- ToDo&lt;br /&gt;
*** Output of Native Digits&lt;br /&gt;
*** Image switching per locale&lt;br /&gt;
*** Regular text, though it is unclear how to support plural forms, grammar shifts, and gender&lt;br /&gt;
*** Audio switching per locale&lt;br /&gt;
** Integration with pootle&lt;br /&gt;
* [[Karma/Utilities|Utilities]] -- we primarily use [http://www.narwhaljs.org narwhal] for command-line scripting and [http://code.google.com/p/jsdoc-toolkit/ jsdoc] for documentation&lt;br /&gt;
* Journal, Telepathy Integration -- method to be determined, perhaps using html5&#039;s offline storage feature, some resources [https://developer.mozilla.org/en/Offline_resources_in_Firefox here] and [http://www.weboshelp.net/webos-tutorials/156-palm-webos-html5-database-storage-tutorial here] &lt;br /&gt;
* Moodle Integration -- method to be determined&lt;br /&gt;
* [[Karma/Bundle_layout|Repo and Bundle layout]]&lt;br /&gt;
* UI Widgets&lt;br /&gt;
** [[Scoreboard]]&lt;br /&gt;
** Dialog -- use standard jQuery UI one?&lt;br /&gt;
&lt;br /&gt;
=== Conventions ===&lt;br /&gt;
&lt;br /&gt;
* [[Karma:Anatomy_of_Lesson|Anatomy of a Karma Lesson]]&lt;br /&gt;
* The [[Karma/Dictionary|Karma Dictionary]]&lt;br /&gt;
* [[Karma/Specifications|Karma Specifications]] (early draft)&lt;br /&gt;
* [[Karma/Anti-conventions|Anti-Conventions]] -- coding no-nos&lt;br /&gt;
* [[Karma/Layout_Converted_Squeak_Lessons|Layout for converted Squeak Lessons]]&lt;br /&gt;
* Source Code stored in http://git.olenepal.org/karma/karma&lt;br /&gt;
* Each lesson must be in a folder named according to the schema &amp;quot;karma_Grade_Maths_title_WeekNo&amp;quot; where the week number is optional &lt;br /&gt;
  The following are valid names&lt;br /&gt;
  karma_3_Maths_LargestNumber_15&lt;br /&gt;
  karma_2_English_MatchingPuzzle&lt;br /&gt;
  karma_6_Maths_AddingUpTo10_4&lt;br /&gt;
* Version Control and repository management see the [[Karma#Version_Control|Version Control]] section of this page&lt;br /&gt;
* Unit testing is required for the karma.js library but not for individual lessons http://karma.sugarlabs.org/tests/&lt;br /&gt;
* Project Documentation kept in the Sugar Labs wiki&lt;br /&gt;
* Coding conventions: Based on [http://www.dojotoolkit.org/developer/StyleGuide Dojo Style Guide] &lt;br /&gt;
** Use sadCamelCase for function names and variables&lt;br /&gt;
** Exception to above -- object constructors should start with a capital letter&lt;br /&gt;
** boolean variables should be prefixed with &amp;quot;is&amp;quot;, &amp;quot;has&amp;quot;, &amp;quot;can&amp;quot;, or &amp;quot;should&amp;quot;&lt;br /&gt;
** counters should be prefixed with &amp;quot;num&amp;quot; or &amp;quot;count&amp;quot;&lt;br /&gt;
** Whenever possible, use [http://www.jslint.com/ jslint]&lt;br /&gt;
* File naming conventions: lowercase letters, underscore instead of spaces  (need to write more about it)&lt;br /&gt;
* Coding Pattern - We generally try to follow this coding pattern as it makes it easier to browse your code&lt;br /&gt;
 Put code in following order&lt;br /&gt;
 1) variable declarations&lt;br /&gt;
 2) method declarations&lt;br /&gt;
 3) method calls&lt;br /&gt;
&lt;br /&gt;
== Version Control == &lt;br /&gt;
Currently all lessons are stored in the examples/ folder of [http://git.olenepal.org/karma/karma main karma repository]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
Here is how you can use the karma_lesson template to create a new repository from scratch&lt;br /&gt;
&lt;br /&gt;
  $ git clone git://git.sugarlabs.org/karma_lesson/mainline.git&lt;br /&gt;
  $ mkdir ../karma_3_English_3  # create a new lesson directory following our naming convention&lt;br /&gt;
  $ cp -r * ../karma_3_English_3  &lt;br /&gt;
  $ cd ../karma_3_English_3&lt;br /&gt;
  $ rm -r .git     # make sure you get rid of the old git directory&lt;br /&gt;
  $ git init&lt;br /&gt;
  $ git add .&lt;br /&gt;
  $ git commit -a -m &amp;quot;first commit&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now go to the http://git.sugarlabs.org/projects/new, make sure you are logged in&lt;br /&gt;
Create a new project, use the same name as you did for your lesson&#039;s main folder&lt;br /&gt;
then,&lt;br /&gt;
  $ git remote add origin git://...   # the pubic push url&lt;br /&gt;
&lt;br /&gt;
Then on to coding your lesson ;)&lt;br /&gt;
&lt;br /&gt;
From then on &lt;br /&gt;
 $ git push origin master   # will sync your local tree w/ the server&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tagging&#039;&#039;&#039; -- a karma lesson can be in only one of two states, stable or unstable. Any commit tagged &#039;stable&#039; is the stable version of your code. Every other version of your code is unstable. We will not use numeric versioning such as 0.1, 1.0, 1.2, etc. for the foreseeable future.&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Meetings ==&lt;br /&gt;
[[Karma:Meeting 21 December 2009]]&lt;br /&gt;
&lt;br /&gt;
== GSoC Project ==&lt;br /&gt;
&lt;br /&gt;
Karma started as a GSoC project with Felipe Lopez Toledo &amp;quot;SubZero&amp;quot; as the student participant and [[USER:BryanWB| Bryan Berry]] as mentor. &lt;br /&gt;
&lt;br /&gt;
=== GSoC Meetings ===&lt;br /&gt;
&lt;br /&gt;
Notes from GSoC meetings - kept for archival purposes&lt;br /&gt;
* [[Karma:Meeting 12 May 2009]]&lt;br /&gt;
* [[Karma:Meeting 02 Jun 2009]]&lt;br /&gt;
* [[Karma:Meeting 09 Jun 2009]]&lt;br /&gt;
* [[Karma:Meeting 23 Jun 2009]]&lt;br /&gt;
* [[Karma:Meeting 30 Jun 2009]]&lt;br /&gt;
* [[Karma:Meeting 21 Jul 2009]]&lt;br /&gt;
* [[Karma:Meeting 4 Aug 2009]]&lt;br /&gt;
* [[Karma:Meeting 11 Aug 2009]]&lt;br /&gt;
* [[Karma:Meeting 18 Aug 2009]]&lt;br /&gt;
* [[Karma:Meeting 24 Aug 2009]]&lt;br /&gt;
* [[Karma:Meeting 08 Sep 2009]]&lt;br /&gt;
* [[Karma:Meeting 14 Sep 2009]]&lt;br /&gt;
* [[Karma:Meeting 21 Sep 2009]]&lt;br /&gt;
&lt;br /&gt;
== Project Roadmap ==&lt;br /&gt;
&lt;br /&gt;
==== 0.1 &amp;quot;Osito&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
Was completed September 11, 2009&lt;br /&gt;
&lt;br /&gt;
* 1 Working example in &amp;quot;adding_up_to_10&amp;quot;&lt;br /&gt;
* cleaned up documentation with jsdocs api documentation and cleaned up README.txt&lt;br /&gt;
* integrate chakra and &amp;quot;adding_up_to_10&amp;quot; and knavbar&lt;br /&gt;
* adding_up_to_10 works on the XO&lt;br /&gt;
** Surf&lt;br /&gt;
** Browse&lt;br /&gt;
&lt;br /&gt;
==== 0.2 &amp;quot;Gatito&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
Completed mid-December 2009&lt;br /&gt;
&lt;br /&gt;
* unit testing added to karma.js using QUnit&lt;br /&gt;
* API documented w/ jsdoc-toolkit&lt;br /&gt;
* support for SVG and canvas animation &lt;br /&gt;
* 3 working examples&lt;br /&gt;
** Adding_Up_to_10 using both SVG and canvas&lt;br /&gt;
** Quadrilaterals &lt;br /&gt;
** &amp;quot;Conozco A Uruguay&amp;quot; done with karma  -- 50% done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 0.3 &amp;quot;niño&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
Due 31 March 2010&lt;br /&gt;
&lt;br /&gt;
* Full i18n support&lt;br /&gt;
* All Squeak lessons converted to Karma&lt;br /&gt;
* Integrate all of the existing E-Paath lesson into chakra &lt;br /&gt;
* narwhal build script to build one giant karma bundle w/ all the E-Paath lessons inside it and chakra&lt;br /&gt;
* At least 6 lessons ready that have been translated into 3 languages each&lt;br /&gt;
* Version 0.1 draft of karma specification done&lt;br /&gt;
&lt;br /&gt;
==== Future Direction of Karma ====&lt;br /&gt;
&lt;br /&gt;
No schedule yet.&lt;br /&gt;
&lt;br /&gt;
[[Karma/Future Direction|This page]] has more information.&lt;br /&gt;
&lt;br /&gt;
=== Library ===&lt;br /&gt;
&lt;br /&gt;
here lies a lot of links to resources specific to karma&lt;br /&gt;
&lt;br /&gt;
UI&lt;br /&gt;
* Iphone Human Interface Guide http://developer.apple.com/iphone/library/documentation/userexperience/conceptual/mobilehig/MobileHIG.pdf&lt;br /&gt;
* Palm Pre interface guide http://developer.palm.com/images/palm/pdf/palm_webos_hi_guidelines.pdf&lt;br /&gt;
* 30 Usability Issues To Be Aware Of http://www.smashingmagazine.com/2007/10/09/30-usability-issues-to-be-aware-of/&lt;br /&gt;
* 10 Usability Nightmares You Should Be Aware Of http://www.smashingmagazine.com/2007/09/27/10-usability-nightmares-you-should-be-aware-of/&lt;br /&gt;
* &amp;quot;The Design of Everyday Things&amp;quot; book by Don Norman&lt;br /&gt;
* &amp;quot;Don&#039;t Make me think&amp;quot; by Steve Krug, guide to usability for web apps&lt;br /&gt;
&lt;br /&gt;
HTML5&lt;br /&gt;
* http://www.smashingmagazine.com/2009/07/16/html5-and-the-future-of-the-web/&lt;br /&gt;
* http://www.w3.org/TR/html5-diff/  Differences between html4 and html5&lt;br /&gt;
* [http://diveintohtml5.org/ Dive Into HTML5]&lt;br /&gt;
&lt;br /&gt;
General Web Design&lt;br /&gt;
* &amp;quot;Web Design in a Nutshell&amp;quot; from O&#039;Reilly&lt;br /&gt;
* Apple &amp;quot;Web Page Development: Best Practices&amp;quot; http://developer.apple.com/internet/webcontent/bestwebdev.html&lt;br /&gt;
&lt;br /&gt;
Canvas&lt;br /&gt;
* demos: http://html5demos.com/&lt;br /&gt;
* basics: http://dev.opera.com/articles/view/html-5-canvas-the-basics/&lt;br /&gt;
* painting web app: http://dev.opera.com/articles/view/html5-canvas-painting/&lt;br /&gt;
* mozilla canvas tutorial: https://developer.mozilla.org/en/Canvas_tutorial&lt;br /&gt;
* using canvas on webkit: http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSProgTopics/Tasks/Canvas.html&lt;br /&gt;
* http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html&lt;br /&gt;
&lt;br /&gt;
SVG&lt;br /&gt;
* The [http://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html SVG Primer] a very detailed and in-depth resource&lt;br /&gt;
* [http://raphaeljs.com/reference.html Raphaeljs documentation]&lt;br /&gt;
* https://developer.mozilla.org/en/svg&lt;br /&gt;
&lt;br /&gt;
Javascript&lt;br /&gt;
* [http://eloquentjavascript.net Eloquent Javascript] best beginning javascript resource&lt;br /&gt;
* &amp;quot;Javascript: The Good Parts&amp;quot; book by Doug Crockford&lt;br /&gt;
* &amp;quot;jQuery in Action&amp;quot; book&lt;br /&gt;
* &amp;quot;Pro Javascript Techniques&amp;quot; by john resig&lt;br /&gt;
* All the tutorials at www.ejohn.org, esp.&lt;br /&gt;
** http://ejohn.org/blog/how-javascript-timers-work/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Coding Tools and Conventions&lt;br /&gt;
* Firebug  --- http://www.getfirebug.com&lt;br /&gt;
* Web-Inspector --- webkit&#039;s answer to firebug&lt;br /&gt;
* Browsers --- We primarily work with Chromium and Firefox &amp;gt; 3.5&lt;br /&gt;
* For emacs users -- nxhtml mode and magit.el for working w/ git&lt;br /&gt;
* [http://www.jslint.com/ jslint]&lt;br /&gt;
* [http://www.inkscape.org inkscape]&lt;br /&gt;
* [http://narwhaljs.org narwhal]&lt;br /&gt;
&lt;br /&gt;
== Subpages ==&lt;br /&gt;
&lt;br /&gt;
{{Special:PrefixIndex/{{PAGENAMEE}}/}}&lt;/div&gt;</summary>
		<author><name>Petergijsels</name></author>
	</entry>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Karma/i18n&amp;diff=49433</id>
		<title>Karma/i18n</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Karma/i18n&amp;diff=49433"/>
		<updated>2010-03-07T16:16:14Z</updated>

		<summary type="html">&lt;p&gt;Petergijsels: /* General Strategy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Rough plan for implementing i18n for Karma&lt;br /&gt;
&lt;br /&gt;
=== Requirements === &lt;br /&gt;
* Integrate with pootle&lt;br /&gt;
* Handle strings inside code and html markup&lt;br /&gt;
  Examples &lt;br /&gt;
  $(&amp;quot;#someDiv&amp;quot;).text(gettext(&amp;quot;Hello World&amp;quot;));&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;div&amp;gt;Hello &amp;lt;strong&amp;gt;W&amp;lt;/strong&amp;gt;orld&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* All strings stored in one file per locale, messages.json&lt;br /&gt;
* All message identifiers must be unique within an a lesson&lt;br /&gt;
* Accommodating numeric, currency, and date formatting is not an immediate requirement&lt;br /&gt;
&lt;br /&gt;
=== General Strategy ===&lt;br /&gt;
====JavaScript Strings====&lt;br /&gt;
We try to follow a subset of the [http://www.gnu.org/software/gettext/manual/gettext.html#gettext gettext api] quite closely. After including jquery.i18n.js you can use the following gettext functions in your javascript scripts:&lt;br /&gt;
* $.i18n.gettext(&#039;text to be translated&#039;) or $. _(&#039;text to be translated&#039;): to translate a simple string&lt;br /&gt;
* $.i18n.ngettext(&#039;a car&#039;, &#039;multiple cars&#039;, n): to choose a pluralized form depending on n&lt;br /&gt;
* $.i18n.pgettext(&#039;context&#039;, &#039;text to be translated&#039;): this is useful if you are writing plugins. E.g. in ui.kFooter.js the context is &#039;$.ui.kFooter&#039;.&lt;br /&gt;
&lt;br /&gt;
Remarks:&lt;br /&gt;
* you can add  the statement  var _ = $._; at the beginning of your $(document).ready function and then use _(&#039;message&#039;) without needing to add the $. However the name of the function you are calling should be _, gettext, ngettext or pgettext. Otherwise the strings can not be automatically be extracted with xgettext.&lt;br /&gt;
* the arguments to the different calls should be string literals. Otherwise xgettext will not be able to extract the messages to be translated.&lt;br /&gt;
&lt;br /&gt;
The lesson examples/6_Maths_matchingAnglesAndShapes/ contains an example.&lt;br /&gt;
&lt;br /&gt;
====HTML Strings====&lt;br /&gt;
We will try to use the [http://en.wikipedia.org/wiki/Internationalization_Tag_Set Internationalization Tag Set] for handling strings inline with html. The [http://okapi.sourceforge.net/ Okapi] tool may be able to parse out strings marked with ITS.&lt;br /&gt;
&lt;br /&gt;
There is first attempt at internationalizing html without using ITS. It will be in git under karma/i18n.&lt;br /&gt;
* You annotate the tags of elements that need translation with a class attribute: class=&amp;quot;translate&amp;quot;.&lt;br /&gt;
* i18n/html2po.py is the equivalent of xgettext for html.&lt;br /&gt;
* i18n/translate-html.py translates an html page.&lt;br /&gt;
&lt;br /&gt;
Have a look at karma/i18n/example for an example.&lt;br /&gt;
&lt;br /&gt;
The following is no longer true (translate-html.py generates a static translated html page), but can be implemented if needed:&lt;br /&gt;
* For the immediate future we will dynamically change out strings per locale on page load&lt;/div&gt;</summary>
		<author><name>Petergijsels</name></author>
	</entry>
</feed>