slacr_

Just to record my life and thoughts.
笔记/编程/杂乱/极简

[博客建设五]inside主题Markdown样式

Apr 5, 2023Blog968 words in 6 min

一些inside主题样式和hexo插件的测试

标题

h3

h6

提示:

点击右下角的功能键可以展开右侧目录, 也就是配置中的toc(table of content)

这里默认显示到h3, 并且是有序号的, 可以自行配置toc中的属性, 具体见作者教程

image-20230415022039527

链接

1. 文字链接

这是一条链接

1
<a href ="javascript:;">这是一条链接 </a> 

2. 图片链接

1
<a href="https://github.com/s1acr/s1acr.github.io" target="_blank"><img href = "https://github.com/favicon.ico"></img></a>

分隔线

<hr>:


列表

无序

  • 列表1
  • 列表1
    • 列表2
    • 列表2
      • 列表3
      • 列表3
  • 列表4

有序

  1. 列表1

  2. 列表1

    1. 列表2
    2. 列表2
      1. 列表3
      2. 列表3
  3. 列表4

勾选框

  • 吃饭
  • 睡觉
  • 上课
1
2
3
- [ ] 吃饭
- [ ] 睡觉
- [ ] 上课

表格

时间 地点 任务
早上 学校 上课
晚上 宿舍 睡觉

文字对齐

时间 地点 任务
早上 学校 上课
1
2
3
4
| 时间 | 地点  | 任务 |
| :--- | :---: | ---: |
| 早上 | 学校 | 上课 |
| 左 | 中 | 右 |

无头部表格

早上 学校 上课
1
2
3
4
| &nbsp; | &nbsp; | &nbsp; |
| :----- | :----: | -----: |
| 早上 | 学校 | 上课 |
| 左 | 中 | 右 |

typora中是github markdown风格, 不支持无头部的表格
hexo 中使用markdown-it解析markdown, 支持无表格头

长表格

(●’◡’●) ♪(´▽`) ( ̄︶ ̄)↗ ^____^ []~( ̄▽ ̄)~* ( •̀ ω •́ )✧ (✿◡‿◡) `(*>﹏<*)′ (^_^)

块引用

life is not bad

代码块

1
alert('nice')

加上头部
{% codeblock [title] [lang:language] [url] [link text] [additional options] %} code snippet {% endcodeblock %}

example.js javascriptdoc     
1
console.log('nice')
1
2
3
{% codeblock example.js lang: javascript https://hexo.io/docs/tag-plugins#Code-Block doc &nbsp;&nbsp;&nbsp;&nbsp;%}
console.log('nice')
{% endcodeblock %}

Gist

{% gist gist_id [filename] %}

gist 是github一个实用的子服务, 用来分享代码段 snippets, 需要开代理才能显示

jsfiddle

{% jsfiddle shorttag [tabs] [skin] [width] [height] %}

1
{% jsfiddle slacr_/d7h93152/2 js,html,result dark  %} 

生成如下:

image-20230415105643411

需要按照给定的格式书写, 没开代理不能访问
更简单的方式是直接插入jsfiddle给的script标签

MathJax(ssr)

文件路径不能包含中文, 否则会报错 Can't load MathJax
参见:https://github.com/GitbookIO/plugin-mathjax/issues/28

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

f(a) = \frac{1}{2\pi i} \oint\frac{f(z)}{z-a}dz

mathjax是一个用于latex、mathml和ascimath表示法的开源javascript显示引擎.

时间线

  • xxx 2020/04/10
  • xxx 2020/04/11
  • xxx 2020/04/12
  • xxx 2020/04/13
1
2
3
4
5
6
::: timeline
- xxx 2020/04/10
- xxx 2020/04/11
- xxx 2020/04/12
- xxx 2020/04/13
:::

可展开元素

点击展开

这个功能基于markdown-it-container模块实现

1
2
3
::: collapse 点击展开 
这个功能基于`markdown-it-container`模块实现
:::

等同于html标签

1
2
3
4
<details>
<summary>点击展开</summary>
<p>这个功能基于`markdown-it-container`模块实现 </p>
</details>

索引树

第一层
    第二层a
    • 第三层a
    • 第三层b
    第二层b
      第三层c
      • 第四层a
第一层
    第二层
    • 第三层
第一层
    第二层
    • 第三层
1
2
3
4
5
6
7
8
9
10
11
12
# 默认是square, 属性值还有arrow circle
# 每层增加一个tab制表位
::: tree icon:square
- 第一层
- 第二层a
- 第三层a
- 第三层b
- 第二层b
- 第三层c
- 第四层a

:::

darkMode

点击切换夜间模式

脚注和注释

发现并不能正常显示,
需要安装 hexo-footnote

第一条脚注[^1]
第二条脚注[^2]
第二条脚注[^3]


[^1]: 第一条的注释内容 [^2]: 第二条的注释内容 [^3]: 第三条的注释内容
  • Author:

    slacr_

  • Copyright:

  • Published:

    April 5, 2023

  • Updated:

    April 5, 2023

Buy me a cup of coffee ☕.

1000000