python sphinx线长自动修正
通常,与 sphinx 相关的最佳实践要求您必须将行长度限制为少于 80 个字符。
所以我想要一种方法来自动将行长度限制为少于 80 个字符(没有连字符),并且当发生更正时,它必须放置正确的缩进(如果可能)。 我见过的唯一一个似乎有点合适的功能是 Textwrap http://docs.python .org/library/textwrap.html 有人有这方面的经验吗?也许有更好的主意?该功能已经捆绑在 sphinx 中,但我没有找到它?我错过了 stackoverflow 中的某个主题?
欢迎任何意见。
Usually, best practices related to sphinx says that you must limit the line length to less than 80 characters.
So I want a way to automatically limit my line length to less than 80 characters (with no hyphens) and when the correction happens, it has to put the correct indent (if possible).
The only function I've seen who seems to fit a bit is the Textwrap http://docs.python.org/library/textwrap.html
Someone has some experiences with this? a better idea maybe? The function is already bundle in sphinx but I don't find it ? I miss a topic in stackoverflow?
Any input is welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要的是血统编辑器。
例如,在 vim 中,这是通过执行以下操作来处理的:
然后您所要做的就是开始输入,vim 将继续下一行。
标记文本并根据“textwidth”变量的设置执行
gq
重新格式化所选内容。前任。
在设置
tw=30
后的 vim 中,选择文本并执行gq
:A descent editor is what you need.
In vim for example this is handled by doing:
Then all you have to do is start typing and vim will continue on the nextline.
Marking text and doing a
gq
reformats the selection according to the setting of the "textwidth" variable.Ex.
In vim after setting
tw=30
, selecting text and doing agq
: