Comments (6)
@leaxoy
最新会更新一下 exampleSite,里面会有使用流程图的文档,大致示例如下
{{< mermaid >}}
classDiagram
Animal <|-- Duck
Animal <|-- Fish
Animal <|-- Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
{{< /mermaid >}}
使用的是 mermaidjs 库
from loveit.
非常感谢!
from loveit.
另外这种办法的话,在Typora中是无法预览的, 有没有办法支持代码块的流程图呢 比如:
```mermaid
sequenceDiagram
participant Publisher
participant Broker
participant Subscriber
Publisher->>Broker: Publish
Publisher->>Publisher: Delete(Msg)
Broker->>Subscriber: Publish
Broker->>Broker: Delete(Msg)
from loveit.
哈喽,@leaxoy
类似 Typora 这种代码块的流程图目前无法做到,因为当前 Hugo 对代码块的渲染结果还无法修改。
不过,Hugo 在 v0.62.0 中改用 Goldmark
支持了 Markdown Render Hooks,但是目前仅可以自定义链接和图片。
并且,这两种 Hook 在这个主题中已经用到了,将来有望支持代码块的 Hook,从而可以实现类似功能。
from loveit.
哈喽,@leaxoy
这是 mermaid 的文档.
from loveit.
from loveit.
Related Issues (20)
- [FEATURE] disable theme switcher and order of params.social
- [BUG] _index.md worked fine with other theme/hugo version, not now HOT 2
- [BUG] Copy button in codeblock does not appear
- [BUG] Some problem...
- [FEATURE] Using local icons/svg in titile and menu ("pre") 如何使用本地SVG文件作为图标
- 我的博客内容部署后主页只显示两篇博客内容,其余的不显示
- [BUG] Deprecations
- [BUG] 网站主页配置头像未显示 HOT 1
- [BUG] 本地预览shortcodes有效,但是vercel部署过后shortcodes无法找到
- [BUG] Posts in the 'posts' directory but with type explicitly set to 'post' are not shown on the home page
- [FEATURE] Some feature
- [BUG] loveit 页面网页title渲染无效 HOT 2
- [FEATURE] 请问loveit主题怎么更换字体呢? HOT 2
- [BUG] 博客文章的中文子目录无法跳转 HOT 1
- [BUG] hugo giscus 评论区无法自动切换夜间模式 HOT 1
- [BUG] 為何我的Tag和Categories的英文字首會是大寫? HOT 1
- How to automatically configure the update time of articles
- [BUG] code代码样式不太对 HOT 1
- [FEATURE] 请问如给loveit主题的博客添加顶端阅读进度条呢?
- [FEATURE] Add support for simpler admonition sytax
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loveit.