V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
wangzhe
V2EX  ›  Hexo

用 VPS+hexo 搭了个博客,如何让 hexo 支持复选框

  •  
  •   wangzhe · 2016-07-28 22:08:31 +08:00 · 3643 次点击
    这是一个创建于 2827 天前的主题,其中的信息可能已经有所发展或是发生改变。

    用作业部落的编辑器写的页面,有待办事项的复选框样式 - [ ] - [x] 如下图

    顺便放下博客地址 博客链接

    9 条回复    2016-08-30 15:29:07 +08:00
    oott123
        1
    oott123  
       2016-07-28 22:31:39 +08:00
    随便搜了下,应该是这个:

    https://github.com/hexojs/hexo-renderer-marked

    你设置 gfm:true 就行了。
    wangzhe
        2
    wangzhe  
    OP
       2016-07-28 22:47:11 +08:00
    @oott123 设置了的,但是并没有任何作用
    还是一样无法渲染
    DoraJDJ
        3
    DoraJDJ  
       2016-07-28 22:58:24 +08:00
    @Livid move to /go/hexo
    wangzhe
        4
    wangzhe  
    OP
       2016-07-28 23:01:14 +08:00
    yyfearth
        5
    yyfearth  
       2016-07-28 23:33:17 +08:00
    问题是 你就算渲染了 但是不能改有什么意义么
    你还得到 md 文件里面去修改
    github issues 里面你点击修改了状态是会保存的
    静态 hexo 不可能支持
    wangzhe
        6
    wangzhe  
    OP
       2016-07-28 23:36:40 +08:00
    @yyfearth 博客里想用这个功能记录下自己的技能树加点,并不想要在页面中更改
    只需要它能够渲染就行了,更改我会在 md 文件中自行更改,因为并不需要很频繁的更改
    zhidian
        7
    zhidian  
       2016-08-30 15:07:01 +08:00
    这个不叫复选框(那是控件),而这只是一个字符。这一个系列叫 ballot box 。在你的笔记里直接输入这些 8 或者 16 进制的 HTML 字符( HTML Entity )就可以了:

    ☐ (hex: ☐ / dec: ☐): ballot box (empty, that ’ s how it ’ s supposed to be)

    ☑ (hex: ☑ / dec: ☑): ballot box with check

    ☒ (hex: ☒ / dec: ☒): ballot box with x

    ✓ (hex: ✓ / dec: ✓): check mark, equivalent to ✓ and ✓ in most browsers

    ✔ (hex: ✔ / dec: ✔): heavy check mark

    ✗ (hex: ✗ / dec: ✗): ballot x

    ✘ (hex: ✘ / dec: ✘): heavy ballot x
    zhidian
        8
    zhidian  
       2016-08-30 15:09:53 +08:00
    你可以试试别的 renderer ,比如 pandoc 。
    zhidian
        9
    zhidian  
       2016-08-30 15:29:07 +08:00
    不好意思…… pandoc 的打开 GitHub Flavored Markdown 选项也不能用 - [ ] not done, - [x] done.

    外,上面的 8 和 16 进制的字符表示应该不算 HTML Entity (感觉 `♥` 这样才算),那个应该叫 code point 把。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5602 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 01:35 · PVG 09:35 · LAX 18:35 · JFK 21:35
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.