Testing code block in FixIt theme.
Multiple modes
1
2
3
4
// Classic mode
function add ( a , b ) {
return a + b
}
1
2
3
4
// Mac mode
function add ( a , b ) {
return a + b
}
1
2
3
4
// Simple mode
function add ( a , b ) {
return a + b
}
Code title
1
2
3
4
5
(r=()=>setInterval(t=>{for(j=o="\n",y=5;y--;document.body["inn"
+"erHTML"]="<pre><"+(S="script>\n")+o+"\n\n</"+S)for(x=-01;
63-!y>x++;o+=`(r=${r})()`[j++].fontcolor(c?'#FF0':"#444"))c=x/2
%4<3&&parseInt("odRFacb67o2vi5gmOZmwFNteohbOh3sw".slice(i="9"<(
D=Date()[16+(x/8|0)])?30:D*3,i+3),36)&1<<(x/2|0)%4+3*y},100))()
Code File Name
1
2
3
4
5
6
7
8
function hello ( x = 'world' ) {
console . log ( `Hello, ${ x } !` )
}
hello ()
// Hello, world!
hello ( 'FixIt' )
// Hello, FixIt!
Shadow
Always Hover Never 1
2
3
function hello ( x = 'world' ) {
console . log ( `Hello, ${ x } !` )
}
1
2
3
function hello ( x = 'world' ) {
console . log ( `Hello, ${ x } !` )
}
1
2
3
function hello ( x = 'world' ) {
console . log ( `Hello, ${ x } !` )
}
Collapsed/Expanded
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
eval(z = 'p="<"+"pre>"/* ,.oq#+ ,._, */;for(y in n="zw24l6k\
4e3t4jnt4qj24xh2 x/* =<,m#F^ A W###q. */42kty24wrt413n243n\
9h243pdxt41csb yz/* #K q##H######Am */43iyb6k43pk7243nm\
r24".split(4)){/* dP cpq#q##########b, */for(a in t=pars\
eInt(n[y],36)+/* p##@###YG=[#######y */(e=x=r=[]))for\
(r=!r,i=0;t[a/* d#qg `*PWo##q#######D */]>i;i+=.05)wi\
th(Math)x-= /* aem1k.com Q###KWR#### W[ */.05,0>cos(o=\
new Date/1e3/* .Q#########Md#.###OP A@ , */+x/PI)&&(e[~\
~(32*sin(o)*/* , (W#####Xx######.P^ T % */sin(.5+y/7))\
+60] =-~ r);/* #y `^TqW####P###BP */for(x=0;122>\
x;)p+=" *#"/* b. OQ####x#K */[e[x++]+e[x++\
]]||(S=("eval"/* l `X#####D , */+"(z=\'"+z.spl\
it(B = "\\\\")./* G####B" # */join(B+B).split\
(Q="\'").join(B+Q/* VQBP` */)+Q+")//m1k")[x/2\
+61*y-1]).fontcolor/* TP */(/\\w/.test(S)&&"#\
03B");document.body.innerHTML=p+=B+"\\n"}setTimeout(z)')//
1
2
3
```lang {.is-collapsed}
// This code block will be collapsed by default.
` ``
1
2
3
```lang {.is-expanded}
// This code block will be expanded regardless of its length.
` ``
No wrapper
Set wrapper=false to disable code wrapper.
1
2
3
function add ( a , b ) {
return a + b
}
function add ( a , b ) {
return a + b
} lineNos=false
function add ( a , b ) {
return a + b
} lineNumbersInTable=false
1 function add ( a , b ) {
2 return a + b
3 } Diff Code
1
2
3
- theme = "LoveIt"
+ theme = "FixIt"
! enhancements and fixes
Long Code
1
< p > Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi. Labore officiis his ex, soluta officiis concludaturque ei qui, vide sensibus vim ad.</ p >
<p>Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi. Labore officiis his ex, soluta officiis concludaturque ei qui, vide sensibus vim ad.</p>
Code Toggle
1
2
3
4
5
6
7
[ params ]
description = ''
keywords = []
[ params . codeblock ]
mode = 'classic'
wrapper = true
1
2
3
4
5
6
params :
codeblock :
mode : classic
wrapper : true
description : ''
keywords : []
1
2
3
4
5
6
7
8
9
10
{
"params" : {
"codeblock" : {
"mode" : "classic" ,
"wrapper" : true
},
"description" : "" ,
"keywords" : []
}
}
Mermaid
flowchart TD
A[Start] --> B{Is it?}
B -->|Yes| C[OK]
C --> D[Rethink]
D --> B
B ---->|No| E[End] flowchart TD
A[Start] --> B{Is it?}
B -->|Yes| C[OK]
C --> D[Rethink]
D --> B
B ---->|No| E[End] flowchart TD
A[Start] --> B{Is it?}
B -->|Yes| C[OK]
C --> D[Rethink]
D --> B
B ---->|No| E[End] 1
2
3
4
5
6
flowchart TD
A[Start] --> B{Is it?}
B -->|Yes| C[OK]
C --> D[Rethink]
D --> B
B ---->|No| E[End]
ECharts
{"grid":{"bottom":"5%","containLabel":true,"left":"5%","right":"5%","top":"20%"},"legend":{"data":["Email Marketing","Affiliate Advertising","Video Advertising","Direct View","Search Engine"],"top":"10%"},"series":[{"data":[120,132,101,134,90,230,210],"name":"Email Marketing","stack":"Total","type":"line"},{"data":[220,182,191,234,290,330,310],"name":"Affiliate Advertising","stack":"Total","type":"line"},{"data":[150,232,201,154,190,330,410],"name":"Video Advertising","stack":"Total","type":"line"},{"data":[320,332,301,334,390,330,320],"name":"Direct View","stack":"Total","type":"line"},{"data":[820,932,901,934,1290,1330,1320],"name":"Search Engine","stack":"Total","type":"line"}],"title":{"left":"center","text":"Summary Line Chart","top":"2%"},"toolbox":{"feature":{"saveAsImage":{"title":"Save as Image"}},"left":"left"},"tooltip":{"trigger":"axis"},"xAxis":{"boundaryGap":false,"data":["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],"type":"category"},"yAxis":{"type":"value"}} Timeline
Success
2024-07-11
Approved
2024-07-13
Event start
2024-07-15
JSON
File Tree
Code block inside other blocks
Note
1
2
3
function add ( a , b ) {
return a + b
}
public class HelloWorld {
public static void main ( String [] args ) {
System . out . println ( "Hello World" );
}
} Code Block inside Details 1
2
3
function add ( a , b ) {
return a + b
}
Highlighting
Highlighting in code fences is enabled by default.
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
/**
* check if a string is a JS object string
* @example isObjectLiteral("{a:1,b:2}") // true
* @param {string} str string to check
* @returns {boolean} whether the string is a JS object string
*/
function isObjectLiteral ( str ) {
if ( typeof str !== 'string' ) {
return false
}
str = str . replace ( /\s+/g , ' ' ). trim (). replace ( /;$/ , '' )
if ( str . startsWith ( '{' ) && str . endsWith ( '}' )) {
return true
}
return false
}
Highlighting in shortcode highlight.
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
/**
* check if a string is a JS object string
* @example isObjectLiteral("{a:1,b:2}") // true
* @param {string} str string to check
* @returns {boolean} whether the string is a JS object string
*/
function isObjectLiteral ( str ) {
if ( typeof str !== 'string' ) {
return false
}
str = str . replace ( /\s+/g , ' ' ). trim (). replace ( /;$/ , '' )
if ( str . startsWith ( '{' ) && str . endsWith ( '}' )) {
return true
}
return false
}
Gist Embed