jerryc127 / hexo-theme-butterfly

🦋 A Hexo Theme: Butterfly
https://butterfly.js.org
Apache License 2.0
6.8k stars 1.24k forks source link

[Feature]: butterfly中的mermaid 语法格式与 Typora中的不一致,希望能改成代码块的格式 #1479

Closed heyanming closed 2 months ago

heyanming commented 2 months ago

想要的功能 | What feature do you want?

` ### Typora中的语法格式:


  classDiagram
  Class01 <|-- AveryLongClass : Cool
  Class03 *-- Class04
  Class05 o-- Class06
  Class07 .. Class08
  Class09 --> C2 : Where am i?
  Class09 --* C3
  Class09 --|> Class07
  Class07 : equals()
  Class07 : Object[] elementData
  Class01 : size()
  Class01 : int chimp
  Class01 : int gorilla
  Class08 <--> C2: Cool label

### butterfly中的语法格式: {% mermaid %} 内容 {% endmermaid %}

`

mermaid也属于一种语言,觉得放在代码块里面呈现更合适一些,期望大佬予以考虑这一建议

jerryc127 commented 2 months ago

下个版本支持 但是有前提

  1. hexo 版本需要 7.0 或以上

  2. hexo 的配置文件 要添加 exclude_languages: ['mermaid']

    syntax_highlighter: 'highlight.js'
    highlight:
    # enable: true
    line_number: true
    auto_detect: false
    tab_replace: ''
    wrap: true
    hljs: false
    exclude_languages: ['mermaid']
    prismjs:
    # enable: false
    preprocess: true
    line_number: true
    tab_replace: ''
    exclude_languages: ['mermaid']
  3. butterfly的配置文件中 mermaid 的 code_write 设为 true

jerryc127 commented 2 months ago

https://github.com/jerryc127/hexo-theme-butterfly/discussions/1152 https://github.com/jerryc127/hexo-theme-butterfly/issues/1228 https://github.com/jerryc127/hexo-theme-butterfly/discussions/1107