Custom HTML Classes

There were scripting errors on this page. While those are being addressed by site editors, you can view partial content below.

var el = env.locale; HTML class needed I think we should be able to have code decorated beyond the current state of arts. I'm working on XPIDL:Syntax and I would like to have the XPIDL BNF with links from non-terminal references to its declaration. Currently I'm managing this by using style attribute for div, but then P tags (wiki generated P tags) are too separated from each other. I'm proposing a new class for divs which is fine for code writting and also lets wiki text to be used (templates, links, an so on) it would be like this:

  div.code {
     display: block;
     border: 1px dashed black;
     padding: 3px;
     background-color:#EEEEEE;
     white-space: pre;
     font-family: monospace;
     font-size: 1.2em;
  }

  div.code p {
     margin: 1em 3px; /* Or whatever looks good for code */
  }

This way we can do something like

  <div class="code">
       {{ xpidl-bnf-decl|xpidl-comment }} := '/*' {{ xpidl|any-char }} '*/'
  </div>

And it would generate code just like (but spaced better):

xpidl-comment := '/*' any-char '*/'

Manu 17:16, 6 October 2005 (PDT)

If you want your wiki markup to work in codeblocks, instead of using "pre", just indent the entire block (including any whitespace) by 1 space. Like so:

xpidl-comment := '/*' any-char '*/'

Hope that helps.

-- dria 18:32, 6 October 2005 (PDT)


Yes, it works. I thought that indenting would do the same as "pre" -- Manu 19:38, 7 October 2005 (PDT)

Caution

While migrating the NSPR API Reference a class of "caution" could be used, even in the meantime just a mirror of the note class, so that, in the future we can change style with it if needed and have no semantically considered styles affected. --Callek 16:15, 7 February 2006 (PST)

We already have 'note' and 'warning', is it not enough? --Nickolay 04:52, 8 February 2006 (PST)

"Bad Example" class

How about a "bad example" class, to highlight that a given example is not the way to do things? Example:

This is not the way to do it:

  bad code example

I could use "warning", but it's not exactly right, is it?

beaufour 09:13, 17 April 2006 (PDT)

Table header formatting

The current rule set for headers of tables with classes standard-table and fullwidth-table is as follows:

table.standard-table td.header, table.standard-table th {
background:none repeat scroll 0 0 #EEEEEE;
border:1px solid #BBBBBB;
font-weight:bold;
padding:0 5px;
text-align:left;
}

and

table.fullwidth-table td.header, table.fullwidth-table th {
background:none repeat scroll 0 0 #EEEEEE;
border:1px solid #BBBBBB;
font-size:1.05em;
font-weight:bold;
padding:0 5px;
text-align:left;
}

When headers are set to "both" in table properties (first row and first column) this produces the following:

Table 1.2: JavaScript versions and ECMAScript editions
JavaScript version Relationship to ECMAScript edition
JavaScript 1.1 ECMA-262, Edition 1 is based on JavaScript 1.1.
JavaScript 1.2 ECMA-262 was not complete when JavaScript 1.2 was released. JavaScript 1.2 is not fully compatible with ECMA-262, Edition 1, for the following reasons:
  • Netscape developed additional features in JavaScript 1.2 that were not considered for ECMA-262.
  • ECMA-262 adds two new features: internationalization using Unicode, and uniform behavior across all platforms. Several features of JavaScript 1.2, such as the Date object, were platform-dependent and used platform-specific behavior.

JavaScript 1.3

JavaScript 1.3 is fully compatible with ECMA-262, Edition 1.

JavaScript 1.3 resolved the inconsistencies that JavaScript 1.2 had with ECMA-262, while keeping all the additional features of JavaScript 1.2 except == and !=, which were changed to conform with ECMA-262.

JavaScript 1.4

JavaScript 1.4 is fully compatible with ECMA-262, Edition 1.

The third version of the ECMAScript specification was not finalized when JavaScript 1.4 was released.

JavaScript 1.5 JavaScript 1.5 is fully compatible with ECMA-262, Edition 3.

I suggest changing the selectors in the above rules to something like this:

table.standard-table td.header, table.standard-table thead th

and

table.fullwidth-table td.header, table.fullwidth-table thead th

user01 20 May 2010

Document Tags and Contributors

Contributors to this page: teoli, user01, Beaufour, Nickolay, Callek, Dria, Manu
Last updated by: teoli,