User:Waldo:Creating XPCOM Components d11n Style
From MDC
Note that there's next to no organization here. I'll try to rectify this, but it's not a top priority - getting the info on here is more important, as is completing the migration of Creating XPCOM Components (CXC) itself.
Contents |
[edit] Images
Images used are the original ones from the HTML version of the book with some modifications. The biggest modification is to color. In all the originals, what should have been the color white was actually full transparency. As a result, all the original images would break on a page with a non-white background (which could be any page whatsoever if the user specifies a default background color that's not white). The versions used on this site have been changed so that "white" areas are really white. Most of the images have been cropped to eliminate whitespace and reduce download size. Also, all images have been converted to PNG format (the preferred format for this wiki). Finally, in some cases bits of text in the images have been redone to be more readable, primarily to make such text readable when it is on a transparent background.
[edit] Tables
All tables use HTML table markup. This is far more readable to the person migrating CXC, and it's a good deal more portable than using wiki markup. When appropriate, table cells use class="header" to denote header cells.
[edit] Code
Code will usually be titled (with Template:block-title). Small snippets are less likely to be titled, but if another page refers to one, that snippet will always be titled. <pre/> elements will act as containers for code, although in the future it is hoped that some other method which makes downloading the code easier will be used.
[edit] Code Style
Variables must always be declared (even in languages such as JavaScript which do not require it).
Formatting Examples
if (truthStatement)
{
commands;
}
while (truthStatement)
{
commands;
}
function foo (bar, baz)
{
return;
}
// dots are lined up
var x = Components.classes["@mozilla.org/network/simple-uri;1"]
.createInstance(Components.interfaces.nsISimpleURI);
[edit] In-Book References
...will be links. The original quoted them, which clearly works for that medium, but on the web we can do better. Note that links require a header (==) or a {{block-title}} to work properly.
[edit] Footnotes
See the footnote templates documentation for for how footnotes are implemented. The name for each footnote should be somehow descriptive of the footnote subject matter, but beyond that it could be anything. That said, hyphenated footnote names are the standard.