TiddlyWiki5/editions/highlightdemo/tiddlers/HighlightExample.tid

52 wiersze
800 B
Plaintext
Czysty Zwykły widok Historia

title: HighlightExample
''Javascript'' fenced code:
```
(function(a,b){
var result = a+b;
return result;
})(10,20)
```
''CSS'' fenced code:
```
* { margin: 0; padding: 0; } /* micro reset */
html { font-size: 62.5%; }
body { font-size: 14px; font-size: 1.4rem; } /* =14px */
h1 { font-size: 24px; font-size: 2.4rem; } /* =24px */
```
''Perl'' fenced code:
```
package Name;
my $singleton;
BEGIN {
$singleton = {
attribute => 'value',
another => 'something',
};
bless $singleton, "Name";
}
sub new {
my $class = shift;
return $singleton;
}
```
''Python'' fenced code:
```
class Singleton:
__single = None
def __init__( self ):
if Singleton.__single:
raise Singleton.__single
Singleton.__single = self
```