我有一个休息格式化的表格,其中一些细胞中含有大段文字(即多个段落或项目符号列表)和他们得到定期更新,例如:
+-------+-----------------------+
|Cat | Chunk that is updated |
| | periodically. |
| | |
| | Line #2, #3, etc |
+-------+-----------------------+
|Dog | Substitution means |
| | table boilplat static |
| | |
| | Line #2, #3, etc |
+-------+-----------------------+
为了避免表样板每次更新,我第一次尝试的维修替代 ,但仅适用于内置指令(如图像)和单行文本...不是多个段落:
.. |cellb1| replace:: Chunk that is updated periodically via copy-and-paste
.. |cellb3| replace:: Substitution means table boilerplate can remain static
+-------+-----------------------+
|Cat | |cellb1| |
+-------+-----------------------+
|Dog | |cellb3| |
+-------+-----------------------+
第二种方法是..包括::指令。 该工程罚款多个段落,但在复杂的成本(内容在多个外部文本文件现在脱臼)。
+-------+-----------------------+
|Cat | .. include:: xr1.txt |
+-------+-----------------------+
|Dog | .. include:: xr3.txt |
+-------+-----------------------+
名单表没有帮助,也不会CSV表 (因为内容包括逗号和引号字符)。
.. csv-table:: Test csv-table with multi-paragraph
:header: "a", "b", "c"
Cat,"Chunk that is updated periodically via copy-and-paste.
Line #2, #3, etc", "Kitten"
Dog,"Substitution means table boilerplate can remain static.
Line #2, #3, etc", "Puppy"
注:A面发出与作物了csv-table
,压痕和列数影响狮身人面像解析器,所以内容被格式化为块引用或定义列表。 [ 编辑 :见下文回答-由于不一致压痕:header:
线]
有没有更好的办法?