如何并排显示两个降价代码块

问题描述 投票:9回答:1

我想在重构之前和之后并排显示两个源代码块。是否可以并排创建两个代码块?如果不是,那么替代解决方案是什么?

markdown
1个回答
0
投票

无法使用通常的三个反引号语法```在单个表单元格中创建多行代码块-但您可以使用逐字HTML来完成此操作。这是带有并排代码的示例两列表(请注意,此HTML与Markdown的其余部分并排):

# Document Title

The usual [Markdown Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)
does not cover some of the more advanced Markdown tricks, but here
is one. You can include verbatim HTML in your Markdown document. 
This is particularly useful for tables. Check this out:

<table>
<tr>
<th>
Json 1
</th>
<th>
Json 2
</th>
</tr>

<tr>
<td>
<pre>
{
    "id": 1,
    "username": "joe",
    "email": "[email protected]",
    "order_id": "3544fc0"
}

</pre>
</td>
<td>
<pre>
{
    "id": 5,
    "username": "mary",
    "email": "[email protected]",
    "order_id": "f7177da"
}
</pre>
</td>
</tr>
</table>

呈现为:

rendered two-column markdown table

© www.soinside.com 2019 - 2024. All rights reserved.