Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎么嵌入流程图呢 #20

Closed
leaxoy opened this issue Dec 16, 2019 · 6 comments
Closed

怎么嵌入流程图呢 #20

leaxoy opened this issue Dec 16, 2019 · 6 comments
Labels
documentation Improvements or additions to documentation

Comments

@leaxoy
Copy link

leaxoy commented Dec 16, 2019

有没有一个比较详细的嵌入流程图的文档呢

@dillonzq
Copy link
Owner

dillonzq commented Feb 5, 2020

@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

@dillonzq dillonzq added the documentation Improvements or additions to documentation label Feb 8, 2020
@leaxoy
Copy link
Author

leaxoy commented Feb 28, 2020

非常感谢!

@leaxoy
Copy link
Author

leaxoy commented Feb 28, 2020

另外这种办法的话,在Typora中是无法预览的, 有没有办法支持代码块的流程图呢 比如:

```mermaid
sequenceDiagram
    participant Publisher
    participant Broker
    participant Subscriber
    Publisher->>Broker: Publish
    Publisher->>Publisher: Delete(Msg)
    Broker->>Subscriber: Publish
    Broker->>Broker: Delete(Msg)

@dillonzq
Copy link
Owner

dillonzq commented Mar 2, 2020

哈喽,@leaxoy
类似 Typora 这种代码块的流程图目前无法做到,因为当前 Hugo 对代码块的渲染结果还无法修改。
不过,Hugo 在 v0.62.0 中改用 Goldmark 支持了 Markdown Render Hooks,但是目前仅可以自定义链接和图片。
并且,这两种 Hook 在这个主题中已经用到了,将来有望支持代码块的 Hook,从而可以实现类似功能。

@dillonzq
Copy link
Owner

dillonzq commented Mar 8, 2020

哈喽,@leaxoy
这是 mermaid 的文档.

@dillonzq dillonzq closed this as completed Mar 8, 2020
@mmfei
Copy link

mmfei commented May 27, 2021

@see #605

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants