How to handle two dashes in ReST

别说谁变了你拦得住时间么 提交于 2019-11-29 13:21:29

This is a configuration option in Sphinx that is on by default: the html_use_smartypants option (http://sphinx-doc.org/config.html?highlight=dash#confval-html_use_smartypants).

If you turn off the option, then you will have to use the Unicode character '–' if you want an en-dash.

With

**-\\-region**  <region_name>

it should work.

To add two dashes, add the following:

.. include:: <isotech.txt>

|minus|\ |minus|\ region

Note the backward-slash and the space. This avoids having a space between the minus signs and the name of the parameter.

You only need to include isotech.txt once per page.

With this solution, you can keep the extension smartypants and write two dashes in every part of the text you need. Not just in option lists or literals.

In Sphinx 1.6 html_use_smartypants has been deprecated, and it is no longer necessary to set html_use_smartypants = False in your conf.py or as an argument to sphinx-build. Instead you should use smart_quotes = False.

If you want to use the transformations formerly provided by html_use_smartypants, instead it is recommended to use smart_quotes, e.g., smart_quotes = True.

Note that at the time of this writing Read the Docs pins sphinx==1.5.3, which does not support the smart_quotes option. Until then, you'll need to continue using html_use_smartypants.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!