标签: restructuredtext

如何在Sphinx文档中添加自定义页脚?(reStructuredText的)

如果我有一些文档,例如Galleria的文档,我该如何设置它以便在运行make html命令时它会在每个页面上添加一个自定义页脚?

我看到如果我将它输出为pdf格式,我可能会使用conf.py 的latex前言部分.

谢谢!

unix linux restructuredtext makefile python-sphinx

22
推荐指数
1
解决办法
5570
查看次数

如何在不创建任意标签的情况下在sphinx restructuredtext中创建标题的内部链接?

我有一份包含许多标题和小标题的文件.进一步在文本中我想链接回其中一个标题.如果没有:ref:标签的冗余,我怎么能这样做?内容似乎拿起标题就好了.我希望得到这样的东西:`#polled-data-retrieval`_.

restructuredtext python-sphinx

21
推荐指数
4
解决办法
1万
查看次数

是否有一个Sphinx reST Python docstring字段用于收益?

我正在尝试使用reST风格的文档字符串,即

def foo(bar):
    """a method that takes a bar

    :param bar: a Bar instance
    :type bar: Bar
Run Code Online (Sandbox Code Playgroud)

是否有标准的文件记录方式yields?我查看了http://sphinx-doc.org/domains.html#info-field-lists,a-la这个问题[ 使用javadoc for Python文档 ],但没有运气.我想象的是,

    :yields: transformed bars
    :yield type: Baz
Run Code Online (Sandbox Code Playgroud)

谢谢!

python documentation restructuredtext python-sphinx

21
推荐指数
2
解决办法
5636
查看次数

用于将rst转换为html的单个py文件

我有一个用reStructuredText编写的博客,当我创建一个新帖子时,我当前必须手动转换为HTML.

我正在使用Google App Engine编写一个新的博客系统,需要一种简单的方法将rst转换为HTML.

我不想使用,docutils因为它太大而复杂.有没有更简单(理想的单一python文件)的方式我可以做到这一点?

python google-app-engine restructuredtext

20
推荐指数
3
解决办法
2万
查看次数

如何在reStructuredText中加下划线?

当然,在网络上,下划线表示超链接,但是如果我需要下划线而不是超链接怎么办?

restructuredtext

20
推荐指数
1
解决办法
9250
查看次数

如何在第一个文档字符串中断链接以满足pep8?

我正在使用Sphinxdoc生成api文档,并且在编写docstring时遇到了pep8一致性问题.

如下所示,OWASP站点的链接在第105列结束,远远超过pep8规定的最大行长度

def handle_csrf(...):
    """The general recommendation by people in the know [OWASP]_, is
       'to implement the Synchronizer Token Pattern (STP_)'.

       .. [OWASP] The Open Web Application Security Project
          (https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet)
       .. _STP: http://www.corej2eepatterns.com/Design/PresoDesign.htm

    """
Run Code Online (Sandbox Code Playgroud)

有没有办法包装网址,同时仍然保持生成的文档中的URL?

插入反斜杠不起作用.

python restructuredtext pep8 python-sphinx

20
推荐指数
2
解决办法
3540
查看次数

reStructured Text中浮动图像的工作示例

我正在寻找最好的方法来在reStructured Text中显示带有文本的图像.我发现有几个网站声称它们是如何完成的,但没有一个显示实际的功能示例.有几个显示了看似失败的例子.我实际上正在使用Sphinx(v0.6.6)并希望避免变态它所带来的"原生"CSS.

谢谢.

css restructuredtext image css-float python-sphinx

19
推荐指数
2
解决办法
5390
查看次数

如何在Sphinx中创建全局角色/角色?

这是"ReST Strikethrough" ReST删除的后续行动,但是在Sphinx而不是ReST背景下.我的问题是,在sphinx中是否有一个中心位置放置一个"角色"指令,或者这个指令是否真的必须在sphinx docmentation中的每个第一个文件中重复.

更详细:

使用角色指令很容易为内联文本定义自定义CSS样式(请参阅ReST Strikethrough作为示例):

.. role:: custom
   :class: custom

This is an :custom:`inline text`.
Run Code Online (Sandbox Code Playgroud)

转换为html渲染

.. This is an <span class="custom">inline text</span>.  ..
Run Code Online (Sandbox Code Playgroud)

此外,可以轻松地将自定义样式表添加到sphinx(请参阅http://www.tinkerer.me/doc/theming.html),在其中添加CSS类选择器以控制"自定义"文本的呈现方式(颜色,删除线,字体大小...)

令我不安的是,在我的实验中,我不得不在每个使用自定义角色的ReST文件中重复角色指令.是否有一个"中心"的地方,我可以为整个网站定义一次?

restructuredtext python-sphinx

19
推荐指数
2
解决办法
5579
查看次数

如何在python中解析restructuredtext?

是否有任何模块可以将重构文本解析为树模型?

docutils或sphinx可以这样做吗?

python parsing dom restructuredtext

19
推荐指数
2
解决办法
6338
查看次数

reST/Sphinx中链接内的替换

我正在使用Sphinx来记录将部署在不同服务器中的Web服务.该文档中包含用户单击的URL示例,它们应该可以正常工作.我的问题是主机,端口和部署根目录会有所不同,必须为每个部署重新生成文档.

我尝试定义这样的替换:

|base_url|/path
.. |base_url| replace:: http://localhost:8080
Run Code Online (Sandbox Code Playgroud)

但生成的HTML不是我想要的(在生成的链接中不包括"/ path"):

<a href="http://localhost:8080">http://localhost:8080</a>/path
Run Code Online (Sandbox Code Playgroud)

有人知道如何解决这个问题吗?

python documentation restructuredtext substitution python-sphinx

18
推荐指数
2
解决办法
4378
查看次数