开发者

Sphinx for writing "parallel text"

开发者 https://www.devze.com 2023-01-30 18:43 出处:网络
Problem: I am trying to write \"parallel text\" using reStructuredText.By \"parallel text\", I mean something like annotated works of fiction, where the text is in two columns.The left column contains

Problem: I am trying to write "parallel text" using reStructuredText. By "parallel text", I mean something like annotated works of fiction, where the text is in two columns. The left column contains the main text, and the right column contains commentary. I will be using sphinx for generating HTML and Latex documentation from it.

I have the following requirements:

  1. As mentioned above, I should be able to typeset text in two columns, one for the main text and one for the annotations.
  2. The annotations can be "sentence level", and will n开发者_开发技巧ot always be "paragraph level". I.e., I want to be able to annotate different sentences in a paragraph, or the whole paragraph.
  3. It will be great to have a mode where all the annotations are turned off, so the output HTML and Latex only contains the main text. In this case, I would like to be able to use the whole "real estate" of the medium, rather than just a column.
  4. It will be very nice to have a "list of annotations" feature if possible.

I am pretty new to reStructuredText and to Sphinx, but have considerable experience with Python. I am looking for some ideas about how to do what I want to do. I have been reading about reStructuredText and also about writing Sphinx extensions, so writing an extension to Sphinx is not out of question.

Has anyone done something similar before?

Thanks!


These seem very similar to footnotes? I would suggest having a look at http://ignorethecode.net/blog/2010/04/20/footnotes/

If they suit your purpose, integrating them should not be too difficult. Sphinx outputs footnotes with a special class. Replacing the

$("a[rel='footnote']")

in the code, with a jquery css selector of your choice should give you what you desire.

0

精彩评论

暂无评论...
验证码 换一张
取 消