docutils

ReST strikethrough

随声附和 提交于 2019-11-27 11:06:51
Is it possible to strike text through in Restructured Text? Something that for example renders as a <strike> tag when converted to HTML, like: ReSTructuredText gozzilli I checked the docs better, as suggested by Ville Säävuori, and I decided to add the strikethrough like this: .. role:: strike :class: strike In the document, this can be applied as follows: :strike:`This text is crossed out` Then in my css file I have an entry: .strike { text-decoration: line-through; } There is at least three ways of doing it: .. role:: strike An example of :strike:`strike through text`. .. container:: strike

Parsing reStructuredText into HTML

别来无恙 提交于 2019-11-27 09:28:29
问题 I'm making a framework in which I let developers describe their package using reStructuredText. I want to parse that reStructuredText into HTML so I can show it in a GUI. I'm familiar with the excellent Sphinx, but I've never otherwise parsed reStructuredText. I imagined something like a function that takes a string of reStructuredText, and possibly several additional arguments, and returns a string of HTML. So I looked into Docutils, which is responsible for parsing reStructuredText. I