restructuredtext

Inline code highlighting in reStructuredText

一曲冷凌霜 提交于 2019-11-26 23:55:11
问题 I know reStructuredText has this directive: .. code:: bash gedit pohl.m which renders a code block. Is there some way to get syntax highlighting for inline snippets like this: Do edit the file, type ``gedit pohl.m`` into a terminal. The backticks mark it as code, but I'd like to highlight it with pygments like the block. Is this possible? 回答1: Having looked into this some more I stumbled upon the document reStructuredText Interpreted Text Roles. From this document: Interpreted text uses

Open a link in a new window in reStructuredText

给你一囗甜甜゛ 提交于 2019-11-26 23:11:52
问题 I want to open a link in a new window using reStucturedText. Is this possible? This opens link in the same window: You can `check your location here. <http://geoiptool.com>`_ 回答1: To open a page in a new window or tag you can add the attribute target="_blank" to your hyperlink although I'm not sure how you can add attributes to inline hyperlinks in reStructuredText. However, from the Docutils FAQ, is nested inline markup possible, you can use the raw directive to include raw HTML into your

How to use Python to programmatically generate part of Sphinx documentation

梦想与她 提交于 2019-11-26 19:44:37
问题 I am using Sphinx to generate the documentation for a project of mine. In this project, I describe a list of available commands in a yaml file which, once loaded, results in a dictionary in the form {command-name : command-description} for example: commands = {"copy" : "Copy the highlighted text in the clipboard", "paste" : "Paste the clipboard text to cursor location", ...} What I would like to know, is if there is a method in sphinx to load the yaml file during the make html cycle,

Format text in a link in reStructuredText

こ雲淡風輕ζ 提交于 2019-11-26 06:29:20
问题 How do you format text within a denoted link in reStructuredText? Specifically, I wish to generate the following HTML from my rst: <a href=\"http://docs.python.org/library/optparse.html\"><tt>optparse.OptionParser</tt> documentation documentation</a> The result should look like this: optparse.OptionParser documentation where the \"optparse.OptionParser\" portion is in fixed-width font. I tried ```optparse.OptionParser`` <http://docs.python.org/library/optparse.html>`_ however, this gave <tt

Easiest way to merge a release into one JAR file

狂风中的少年 提交于 2019-11-26 01:37:22
问题 Is there a tool or script which easily merges a bunch of JAR files into one JAR file? A bonus would be to easily set the main-file manifest and make it executable. The concrete case is a Java restructured text tool. I would like to run it with something like: java -jar rst.jar As far as I can tell, it has no dependencies which indicates that it shouldn\'t be an easy single-file tool, but the downloaded ZIP file contains a lot of libraries. 0 11-30-07 10:01 jrst-0.8.1/ 922 11-30-07 09:53 jrst