Coloring links: Difference between revisions

From EdX Copyright Online Course
Jump to navigation Jump to search
[unchecked revision][checked revision]
(initial revision)
 
(updated formatting)
Line 7: Line 7:


<pre><nowiki>
<pre><nowiki>
  [http://cyber.law.harvard.edu/ Berkman((me home))]
[http://cyber.law.harvard.edu/ Berkman((me home))]
</nowiki></pre>
</nowiki></pre>


The above would be converted to the following link:
The above would be converted to the following link:


<source lang=html4strict>
<a href="http://cyber.law.harvard.edu/" rel="me home" class="external">Berkman</a>
  <a href="http://cyber.law.harvard.edu/" rel="me home" class="external">Berkman</a>
</source>


==class attribute==
==class attribute==
Line 20: Line 18:


<pre><nowiki>
<pre><nowiki>
  [http://cyber.law.harvard.edu/ Berkman((me .class1 home .class2))]
[http://cyber.law.harvard.edu/ Berkman((me .class1 home .class2))]
</nowiki></pre>
</nowiki></pre>


Becomes:
Becomes:


<source lang=html4strict>
<a href="http://cyber.law.harvard.edu/" rel="me home" class="external class1 class2">Berkman</a>
  <a href="http://cyber.law.harvard.edu/" rel="me home" class="external class1 class2">Berkman</a>
</source>


==rev attrribute==
==rev attrribute==
Line 36: Line 32:


<pre><nowiki>
<pre><nowiki>
  [http://cyber.law.harvard.edu/ Berkman((me -.external home))]
[http://cyber.law.harvard.edu/ Berkman((me -.external home))]
</nowiki></pre>
</nowiki></pre>


Becomes:
Becomes:


<source lang=html4strict>
<a href="http://cyber.law.harvard.edu/" rel="me home">Berkman</a>
  <a href="http://cyber.law.harvard.edu/" rel="me home">Berkman</a>
</source>


==caveats==
==caveats==

Revision as of 16:15, 23 February 2010

This wiki supports the rel, rev and class attributes on links.

The syntax is a little unorthodox but is set using the following:

rel attribute

To set the rel attribute, place one or more tokens in double-parentheses at the end of the link title. e.g.:

[http://cyber.law.harvard.edu/ Berkman((me home))]

The above would be converted to the following link:

<a href="http://cyber.law.harvard.edu/" rel="me home" class="external">Berkman</a>

class attribute

To set the class attribute, the same syntax is used, but tokens which represent classes are prefixed with a dot:

[http://cyber.law.harvard.edu/ Berkman((me .class1 home .class2))]

Becomes:

<a href="http://cyber.law.harvard.edu/" rel="me home" class="external class1 class2">Berkman</a>

rev attrribute

Similar to the class attribute, prefixing with a tilde (~) sets the rev attribute.

removing attributes

Tokens may be prefixed by a minus sign (-) to indicate that you don't want to add the token, but remove it. For example:

[http://cyber.law.harvard.edu/ Berkman((me -.external home))]

Becomes:

<a href="http://cyber.law.harvard.edu/" rel="me home">Berkman</a>

caveats

Colorization of links only works on external links for the moment so internal wiki links in the form of:

[[Internal_Page|Link]]

will not work - these will need to be converted to external links in the form of:

[http://hostname.domainname.tld/Internal_Page Link((.class))]

examples

[http://www.google.com/ This((.link_red))] is a link in red.
[http://www.google.com/ This((.link_green))] is a link in green.
[http://www.google.com/ This((.link_blue))] is a link in blue.
[http://www.google.com/ This((.link_yellow))] is a link in yellow.


[http://cyber.law.harvard.edu/cfl/Main_Page This((.link_green))] is a green link.