gpt4 book ai didi

rust - 在文档中将长表行分成多行

转载 作者:行者123 更新时间:2023-11-29 07:57:58 24 4
gpt4 key购买 nike

我想记录我的 crate 并在文档中包含一个表格:

//! Demonstrating MarkDown tables.
//!
//! | Foo | Bar | Baz | Qux |
//! | --- | --- | --- | --- |
//! | Hail the turbofish `::<>` | Ferris for president 🦀 | I can't think of any more "funny" things | oopsie |
//!

cargo doc 渲染它会导致:

correct table

这就是我想要的。但是,您可能已经注意到,一个源代码行很长。事实上,超过 100 个字符长。像许多 Rust 项目一样,我希望所有行的长度都在 100 个字符以下。所以我试图以某种方式打破这条线。

所有这些版本:

//! | Foo | Bar | Baz | Qux |
//! | --- | --- | --- | --- |
//! | Hail the turbofish `::<>` | Ferris for president 🦀
//! I can't think of any more "funny" things | oopsie |

//! | Foo | Bar | Baz | Qux |
//! | --- | --- | --- | --- |
//! | Hail the turbofish `::<>` | Ferris for president 🦀 |
//! I can't think of any more "funny" things | oopsie |

//! | Foo | Bar | Baz | Qux |
//! | --- | --- | --- | --- |
//! | Hail the turbofish `::<>` | Ferris for president 🦀
//! | I can't think of any more "funny" things | oopsie |

//! | Foo | Bar | Baz | Qux |
//! | --- | --- | --- | --- |
//! | Hail the turbofish `::<>` | Ferris for president 🦀 |
//! | I can't think of any more "funny" things | oopsie |

//! | Foo | Bar | Baz | Qux |
//! | --- | --- | --- | --- |
//! | Hail the turbofish `::<>` | Ferris for president 🦀 \
//! I can't think of any more "funny" things | oopsie |

结果:

enter image description here

在不违反行长度限制的情况下,我有哪些选择可以在我的文档中包含长表行?

最佳答案

使用 HTML 标记。

//! Demonstrating HTML tables.
//!
//! <table>
//! <thead>
//! <tr>
//! <th>Foo</th>
//! <th>Bar</th>
//! <th>Baz</th>
//! <th>Quux</th>
//! </tr>
//! </thead>
//! <tbody>
//! <tr>
//! <td>Hail the turbofish <code>::&lt;></code></td>
//! <td>Ferris for president 🦀</td>
//! <td>
//! I can't think of any
//! more "funny" things
//! </td>
//! <td>oopsie</td>
//! </tr>
//! </tbody>
//! </table>

关于rust - 在文档中将长表行分成多行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55324887/

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