Skip to content

Conversation

@dangjinghao
Copy link
Contributor

描述

添加了mermaid支持,通过将代码块的类型设置为mermaid来绘制。
使用时需要在文章的front-matter中设置mermaid: true并在主题的_config.yml中配置排除mermaid的语法高亮。
通过Javascript动态设置居中、padding等格式,以避免污染到未开启mermaid支持时的代码块。
需要注意的是,经过我的测试,在主题的_config.yml中配置排除mermaid的语法高亮可能是必须的,无论highlight是否开启:

highlight:
  enable: true
  theme: a11y-dark
  line_number: true
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: true
  exclude_languages:
    - mermaid # 这里

另外我对CSS开发并不了解,对于我动态添加的样式,希望能审查一下是否存在潜在问题。

效果

image image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant