我想记录我的箱子并在文档中包含一个表格:
//! 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
结果如下:
这就是我要的。但是,您可能已经注意到一个源代码行很长。事实上,超过 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 |
结果是:
在不违反行长限制的情况下,我必须在我的文档中包含长表行的哪些选项?