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:
4
editions/highlightdemo/tiddlers/DefaultTiddlers.tid
Normal file
4
editions/highlightdemo/tiddlers/DefaultTiddlers.tid
Normal file
@@ -0,0 +1,4 @@
|
||||
title: $:/DefaultTiddlers
|
||||
|
||||
[[HelloThere]]
|
||||
[[HighlightExample]]
|
9
editions/highlightdemo/tiddlers/HelloThere.tid
Normal file
9
editions/highlightdemo/tiddlers/HelloThere.tid
Normal 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]]
|
51
editions/highlightdemo/tiddlers/HighlightExample.tid
Normal file
51
editions/highlightdemo/tiddlers/HighlightExample.tid
Normal 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
|
||||
```
|
3
editions/highlightdemo/tiddlers/SiteSubtitle.tid
Normal file
3
editions/highlightdemo/tiddlers/SiteSubtitle.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: SiteSubtitle
|
||||
|
||||
a demo of the Highlight plugin for TiddlyWiki5
|
3
editions/highlightdemo/tiddlers/SiteTitle.tid
Normal file
3
editions/highlightdemo/tiddlers/SiteTitle.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: SiteTitle
|
||||
|
||||
highlightdemo
|
13
editions/highlightdemo/tiddlywiki.info
Normal file
13
editions/highlightdemo/tiddlywiki.info
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"plugins": [
|
||||
"tiddlywiki/highlight"
|
||||
],
|
||||
"themes": [
|
||||
"tiddlywiki/vanilla",
|
||||
"tiddlywiki/snowwhite"
|
||||
],
|
||||
"doNotSave": [
|
||||
],
|
||||
"includeWikis": [
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user