Elmore Cheng

The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts.

Sep 5, 2018


Inside Theme Showcase

Heading

h2

h3

h4

h5
h6

Image (click to zoom in/out)

1
2
3
<!-- new line -->
![space](https://.../nh-pluto-moonlight.jpg)
<!-- new line -->

space

Inline image

Not bad.yes

  • Travis CI build status: build-img
  • Lastest release: release-img
  • License: license-img

List

Unordered list

  • list item
  • list item
    • list item
    • list item
      • list item
      • list item
  • list item

Ordered list

  1. list item
  2. list item
    1. list item
    2. list item
      1. list item
      2. list item
  3. list item

Checklist

  • Get up at 7:00 AM
  • Eat breakfast
  • Go to bet before 11:00 PM

Table

Hear no evilSpeak no evilSee no evil
๐Ÿ™‰๐Ÿ™Š๐Ÿ™ˆ

Text align

Hear no evilSpeak no evilSee no evil
๐Ÿ™‰๐Ÿ™Š๐Ÿ™ˆ

Headless

Type SPACE or &nbsp;.

1
2
3
 | | &nbsp;
:-:|:-:|:-:
๐Ÿ™‰|๐Ÿ™Š|๐Ÿ™ˆ
๐Ÿ™‰๐Ÿ™Š๐Ÿ™ˆ

Long table

Sun With FaceGrinning FaceSmiling FaceGrinning Face With Big EyesSmiling Face With Smiling EyesFull Moon FaceGrinning Face With Smiling EyesFace With MonocleCowboy Hat FaceThinking FaceFace Vomiting
๐ŸŒž๐Ÿ˜€โ˜บ๏ธ๐Ÿ˜ƒ๐Ÿ˜Š๐ŸŒ๐Ÿ˜„๐Ÿง๐Ÿค ๐Ÿค”๐Ÿคฎ

Blockquote

(https://hexo.io/docs/tag-plugins#Block-Quote)

Every interaction is both precious and an opportunity to delight.

NEW: DevDocs now comes with syntax highlighting. http://devdocs.io

Code Block

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class Utils {
animate(element: Element, attr: string, change: { from: number, to: number, duration?: number }, onEnd?: () => void) {
if (change.from === change.to) return;

if (!change.duration)
element[attr] = change.to;

const easing = (t, b, c, d) => c * ((t = t / d - 1) * t * t + 1) + b,
{ from, to } = change,
during = Math.ceil((change.duration || 300) / 17) || 1;

let start = 0,
instance = null;

step();

function step() {
const value = Math.ceil(easing(start, from, to - from, during));

start++;
if (start <= during) {
element[attr] = value;
instance = requestAnimationFrame(step);
}
else {
if (onEnd) onEnd();
cancelAnimationFrame(instance);
}
}
}
}

With caption

(https://hexo.io/docs/tag-plugins#Code-Block)

_.compactUnderscore.js
1
2
_.compact([0, 1, false, 2, '', 3]);
// [1, 2, 3]

Gist

(https://hexo.io/docs/tag-plugins#Gist)

JSFiddle

(https://hexo.io/docs/tag-plugins#jsFiddle)

<script> โš 

1
2
3
4
5
6
7
8
9
stars: <span id="stargazers_count"></span>

<script>
fetch('https://api.github.com/repos/elmorec/hexo-theme-inside')
.then(function(res) { return res.json() })
.then(function(json) {
document.getElementById('stargazers_count').innerHTML = json.stargazers_count;
});
</script>

stars:

For the lastest ES grammar and code minification.
Run the following command in the root directory of Hexo (not themes/inside):

1
npm install babel-core babel-preset-env html-minifier uglify-js --save

Canvas โš 

Syntax๏ผš

1
2
3
4
{% canvas [width] [height] %}
ctx.fillStyle = 'red';
ctx.fillRect(0, 0, w, h);
{% endcanvas %}

width is default to 300, height is default to 150๏ผŒalso the following constants are available in the scope:

constant 
ctxCanvasRenderingContext2D
wCanvas width
hCanvas height

For example:

1
2
3
4
5
6
{% canvas 100 100 %}
const r = w / 2;
ctx.fillStyle = 'antiquewhite';
ctx.arc(r, r, r, 0, Math.PI * 2);
ctx.fill();
{% endcanvas %}

MathJax

layout/index.ejs
1
2
3
4
5
6
7
8
9
10
11
<!-- optional -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
showProcessingMessages: false,
messageStyle: 'none',
tex2jax: {
inlineMath: [['%','%']],
displayMath: [['%%','%%']]
}
})
</script>
post.md
1
2
3
4
5
6
7
8
9
10
11
When %a \ne 0%, there are two solutions to %ax^2 + bx + c = 0% and they are

%%x = {-b \pm \sqrt{b^2-4ac} \over 2a}.%%

<script>
if (!window.MathJax || !MathJax.Hub) {
const script = document.createElement('script');
script.src='//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML';
document.head.appendChild(script);
} else MathJax.Hub.Queue(['Typeset', MathJax.Hub, document.querySelector('main')]);
</script>

When %a \ne 0%, there are two solutions to %ax^2 + bx + c = 0% and they are

%%x = {-b \pm \sqrt{b^2-4ac} \over 2a}.%%

See also

Buy me a cup of coffee โ˜•.

Load Disqus