My favorites | Sign in
Project Logo
                
Search
for
Updated Apr 08, 2008 by daz4126
CodeModule  
Notes on the Code Module.

Links Module

Location

/stylesheets/modules/code.css

Source Code

http://code.google.com/p/sparkl/source/browse/trunk/stylesheets/modules/code.css

Summary

The links module sets some basic styles for pre-formatted code to make it look as though it was written in your favourite text editor.

HTML Design Pattern

<pre>
<code class='html'>
<span class='tag'>&lt;h1&gt;</span>
The code module
<span class='tag'>&lt;/h1&gt;</span>
</code>
</pre>

Description

The code module makes pre-formatted code look more like code by using a monospaced font and a darker background to give it the look of a terminal. Classes are provided so that code can be formatted depending on the language used.

Why It's Bulletproof

No reason in particular, really!

How it works

A class is added to the <code> tag that states the language. <span> tags can then be placed around parts of the code to indicate different parts of the code and have it styled accordingly. For example, in html, use the code following code to create an html paragraph tag that will be in bold blue type:

<span class='tag'>&lt;/p&gt;</span>

IE Fixes

None needed.

Issues

The only language featured at the moment is html, with the only style being that of 'tag'. This module has the potential to be expanded to support lots of languages in the future.

Further Reading

http://www.htmldog.com/reference/htmltags/pre/

Other Modules


Sign in to add a comment
Hosted by Google Code