有没有办法在markdown中格式化对话?

时间:2019-09-30 14:50:59

标签: markdown pandoc

我正在用markdown编写文档,该文档打算由Pandoc格式化。我想在该文档中的两个或多个人之间进行对话,其中每个句子都以短划线作为前缀,或者至少在其自己的行上不​​会引起新的段落缩进或多余的跳行;有没有标记的标准方法?

类似这样的东西:

enter image description here

1 个答案:

答案 0 :(得分:1)

HTML5标准mentions conversations,建议仅对每个人使用常规的<p>元素。似乎最好的方法是在每个人之间使用空行,并使用围栏div等标记会话:

These two causes made him answer in a very low and hesitating voice;
whereupon a gentleman in a white waistcoat said he was a fool. Which
was a capital way of raising his spirits, and putting him quite at
his ease.

::: {.conversation}
'Boy,' said the gentleman in the high chair, 'listen to me.
You know you're an orphan, I suppose?'

'What's that, sir?' inquired poor Oliver.

'The boy _is_ a fool---I thought he was,' said the gentleman in the
white waistcoat.
:::

然后可以使用CSS缩进代码并根据需要减小间距。在定位其他格式(例如通过LaTeX的PDF)时,可以使用Lua filter来调整输出。

相关问题