restructuredtext

reStructuredText: README.rst not parsing on PyPI

独自空忆成欢 提交于 2019-12-05 01:30:42
I have a Python project that is hosted on both Github and PyPI. On Github: https://github.com/sloria/TextBlob/blob/master/README.rst On PyPi: https://pypi.python.org/pypi/textblob My README.rst doesn't seem to be formatting correctly on PyPI, but it looks fine on Github. I have already read this , but I don't have any in-page links, so that's not the problem. You are using a newer text role, :code: . PyPI appears to only support docutils 0.8, with code and code-block added to the PyPI parser directly, which means that :code: is not supported. GitHub uses a newer version of docutils (0.9 or 0

reST: inline links with arbitrary titles?

旧时模样 提交于 2019-12-04 14:05:11
If I've defined an internal hyperlink target, how can I link to it using arbitrary text as the link title? For example: _`This is a very long internal link target`. ... A `short reference`_ to the very long link target. How could I make the “short reference” target the “very long internal target”? Edit : Another example: Widgets ======= ... Use a `widget`_. How can I make “widget” (singular) link to the “Widgets” (plural) heading? (of course, I realize that this could be done using `widget`_\s … But that doesn't solve the general problem) I haven't found a way to do this using "standard" reST.

Compare and contrast the lightweight markup languages [closed]

不羁岁月 提交于 2019-12-04 07:21:04
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Please identify the most popular lightweight markup languages and compare their strengths and weaknesses. These languages should be

RestructuredText - adding title attributes to links

强颜欢笑 提交于 2019-12-04 05:44:56
I am trying to use a jQuery lightBox implementation on my website that is generated from reStructuredText. The lightBox takes the title of the link around the images as the caption of the image in the lightBox display. However, I can't seem to find a way in reStructuredText of providing a title attribute on a link - does anyone know of a way of doing this? My images are defined like so: .. image:: image001.thumb.jpg :alt: Some alt text here :target: image001.jpg So I can add an alt attribute, but not a title. A possible alternative may be to use a target as the reference like so: .. image::

How to create floating figures in reStructuredText / Sphinx?

て烟熏妆下的殇ゞ 提交于 2019-12-04 04:58:31
I want to have a figure with text wrapped around it. This is what I'm saying: Installation of Optional Accessories ==================================== .. warning:: Never plug in or unplug a Hand Robot or a Grasp Sensor while the robot is turned on, as the system will not function properly and damage to the robot could occur. Installing a Hand Robot ----------------------- .. _`fig-attach-hand-robot`: .. figure:: attach-hand-robot.* :scale: 40% :align: right Attach Hand Robot Make sure the robot is turned off as described in the section :ref:`turn-off-robot`. Take the hand robot out of the

Sphinx: Linking to Embedded Binary Files (PDFs)

≡放荡痞女 提交于 2019-12-04 04:39:32
问题 I'm using sphinx and RST to generate some tech documentation as HTML and having issues getting a local PDF reference to work as a hyperlink. I've seen people use :download: to link to local PDFs, but I'm embedding the PDFs inside a /docs directory for reference. I don't like :download: because it doesn't display the PDF inline in the browser which requires an extra step on the users' behalf for consumption. sphinx-build -b html does not copy any files unless they are specified in config.py

In Sphinx, is there a way to document parameters along with declaring them?

萝らか妹 提交于 2019-12-04 02:55:02
I prefer to document each parameter (as needed) on the same line where I declare the parameter in order to apply D.R.Y. If I have code like this: def foo( flab_nickers, # a series of under garments to process has_polka_dots=False, needs_pressing=False # Whether the list of garments should all be pressed ): ... How can I avoid repeating the parameters in the doc string and retain the parameter explanations? I want to avoid: def foo( flab_nickers, # a series of under garments to process has_polka_dots=False, needs_pressing=False # Whether the list of garments should all be pressed ): '''Foo does

editors for tables in Sphinx/reStructuredText?

孤街醉人 提交于 2019-12-04 02:32:59
I'm looking at using Sphinx / reStructuredText for documentation, and it looks very promising, except tables look like a pain to do. Is there an editor that can help? Emacs acts as the default (or the most natural choice) for editing reStructuredText. With that in mind table mode meshes pretty well with the way reST do tables. ReSTedit is good and simple if you're using a Mac. The Wikipedia page lists others. 来源: https://stackoverflow.com/questions/1716232/editors-for-tables-in-sphinx-restructuredtext

Sphinx inline code highlight

北城以北 提交于 2019-12-04 02:07:10
I use Sphinx to make a website that contains code samples. I'm successful using the .. code-block directive to get syntax highlighting. But I can't get inline syntax highlighting using this code: .. role:: bash(code) :language: bash Test inline: :bash:`export FOO="bar"`. .. code-block:: bash export FOO="bar" which produces this output i.e. inline code not highlighted while block code is: Problem to me is that the generated HTML for inline code contains long class names while it does not for code blocks. Here is the output HTML (indented for readability): <p>Test inline: <tt class="code bash

Applying CSS and roles for text blocks instead of inline spans in Sphinx

旧时模样 提交于 2019-12-04 00:51:03
There is a previous question that explains how to add a color span to some reStructuredText. To recap the procedure: First, you have the role. .. role:: red An example of using :red:`interpreted text` It translates into as follows. <p>An example of using <span class="red">interpreted text</span></p> Now, you have the red class, you can use CSS for changing colors. .red { color:red; } How do you do this if you want text that spans multiple lines? For example: .. role:: red :red:`paragraph 1 paragraph 2 paragraph 3` Where paragraph 1, 2, & 3 would all be "red". If I try to do this I get the