如何并排显示两个Markdown代码块 [英] How to disply two markdown code blocks side by side

查看:70
本文介绍了如何并排显示两个Markdown代码块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I would like to display two blocks of a source codes side by side -before refactoring and after. Is it possible to create two code blocks side by side? If not then what is the alternative solution?

推荐答案

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

There is no way to create multi-line code blocks in a single table cell using bare Markdown syntax - but you can use verbatim HTML to accomplish this. Here is an example two-column table with side-by-side code (note that this HTML goes side-by-side with the rest of your 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 combine verbatim HTML with your Markdown. 
This is particularly useful for tables.
Notice that with **empty separating lines** we can use Markdown inside HTML:

<table>
<tr>
<th>Json 1</th>
<th>Markdown</th>
</tr>
<tr>
<td>
<pre>
{
  "id": 1,
  "username": "joe",
  "email": "joe@example.com",
  "order_id": "3544fc0"
}
</pre>
</td>
<td>

```json
{
  "id": 5,
  "username": "mary",
  "email": "mary@example.com",
  "order_id": "f7177da"
}
```

</td>
</tr>
</table>

显示为:

这篇关于如何并排显示两个Markdown代码块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆