在Markdown中,你如何highlight code
< ---就像那样。我不知道如何搜索它,因为我不确定它叫什么。我也不知道这些小破折号是什么。我尝试过做我在SO中做的事情,但它只是将其视为普通文本
更新
这就是我所拥有的:
foo
在SO中它实际上显示了朦胧
bar
而在iPython Notebook中,它不会改变fontstyle 答案 0 :(得分:5)
您正在制作< \ code>部分。它们的风格与SO不同。将此单元格添加到笔记本中,它们将具有类似的样式。
%%HTML
<style> code {background-color : lightgrey !important;} </style>
如果您想要更具体,请在自定义样式表中使用.rendered_html code{...
。
答案 1 :(得分:1)
迟到的答案,但反引号 `
是要走的路,就像在这里一样。
答案 2 :(得分:0)
简而言之:使用<code
>标签
在通常情况下,反引号适用于highlighting
文本,但是在html列表中时会以打印为文字字符。
使用markdown编写的tensorflow tutorial的一部分
Training the neural network model requires the following steps:
<ol>
<li>Feed the training data into the model. In this example, the training data is in the <code>train_images</code> and <code>train_labels</code> arrays.</li>
<li>The model learns to associate the images and labels.</li>
<li>You ask the model to make predictions about a test set -- in this example the test_images array.</li>
<li>Verify the predictions match the labels from the <code>test_labels</code> array.</li>
</ol>
(在jupyter笔记本中看到)
训练神经网络模型需要执行以下步骤:
train_images
和train_labels
数组中。test_labels
数组中的标签匹配。