1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-09-10 23:06:06 +00:00

Plugin for syntax highlighting with highlight.js from Ivan Sagalaev

This commit is contained in:
João Bolila
2014-01-05 09:58:01 +00:00
parent e0f428b9b2
commit a1d2e70307
13 changed files with 227 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
title: $:/DefaultTiddlers
[[HelloThere]]
[[HighlightExample]]

View File

@@ -0,0 +1,9 @@
title: HelloThere
This is a demo of TiddlyWiki5 incorporating a plugin for the [[highlight.js|https://github.com/isagalaev/highlight.js]] Syntax highlighting for the Web from Ivan Sagalaev.
The HighlightExample tiddler have fenced blocks of code.
To add the plugin to your own TiddlyWiki5, just drag this link to the browser window:
[[$:/plugins/tiddlywiki/highlight]]

View File

@@ -0,0 +1,51 @@
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
```

View File

@@ -0,0 +1,3 @@
title: SiteSubtitle
a demo of the Highlight plugin for TiddlyWiki5

View File

@@ -0,0 +1,3 @@
title: SiteTitle
highlightdemo

View File

@@ -0,0 +1,13 @@
{
"plugins": [
"tiddlywiki/highlight"
],
"themes": [
"tiddlywiki/vanilla",
"tiddlywiki/snowwhite"
],
"doNotSave": [
],
"includeWikis": [
]
}