gpt4 book ai didi

rust - 有没有办法在 rustdoc 中嵌入序列图?

转载 作者:行者123 更新时间:2023-12-03 11:33:53 24 4
gpt4 key购买 nike

正如他们所说,一张照片值 1000 字。我想嵌入几个 sequence diagrams在我生成的rust documentation .有没有办法做到这一点?拥有 embedded image并没有真正起作用,更难维护,它是文档之外的 Assets ,等等。

最佳答案

最通用的方法只是非代码代码块中的基于文本的图表。

/// This module contains structs and functions for communicating to and from
/// the server. It is very important that you understand this diagram so you
/// will appreciate how much work has gone into this. Just look at it! Its
/// beautiful!
///
/// ```none
/// +------------+ +------------+
/// | Client | | Server |
/// +------------+ +------------+
/// | |
/// | request("/") |
/// +----------------------> |
/// | |
/// | response() |
/// | <----------------------+
/// | |
/// | |
/// v v
/// ```
///
/// Appreciating the diagram will give you a +1 to confidence for the rest of
/// the day.
pub mod connection {

}
最终会像这样渲染:
generated docs
这是否可以接受和/或实用取决于您。

关于rust - 有没有办法在 rustdoc 中嵌入序列图?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64348342/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com