Spherical forums

General Discussion => Site Comments => Topic started by: DaVince on June 23, 2013, 07:24:59 am

Title: Wiki: a way to support the examples
Post by: DaVince on June 23, 2013, 07:24:59 am
I recently added the columns template to the wiki, which means we can now put stuff on the wiki in columns.

The advantage of this is that you can, for example, put a block of code and some comments about the code side-to-side in code examples. For example, in this Font.drawText (http://wiki.spheredev.org/API:Font/drawText) article. The code is shown on the left, the supporting comments for each line are neatly separated and shown on the right.

I was thinking - is it an idea to do it like this on all the API pages with examples? It seems a bit more illustrative to do that.
Title: Re: Wiki: a way to support the examples
Post by: N E O on June 24, 2013, 05:23:12 pm
I think it's a very good idea, but text size on the web and therefore available screen dimension relies on so many different settings that it's not always a guarantee that we can get comments to line up properly using this columns method even if we stick to only using the monospace font stack that the <syntaxhighlight> tag's GeSHi is set to use.

This has now become one of those times where I wish I was more inclined to experiment with some JavaScript to basically take a syntax highlighted line and add some comment tooltipping in script. I could've sworn GitHub had per-line commenting on highlighted source that I could study...
Title: Re: Wiki: a way to support the examples
Post by: DaVince on June 24, 2013, 06:39:53 pm
Good point. The tooltipping sounds like a better idea; could also make it less cluttered.