RestructedText的格式

rstfmt的Python项目详细描述


不要与rustfmt混淆。在

实验性强,不稳定。现在不要依赖这个。

说明

rstfmt是一个自动格式化reStructuredText文件的工具 一致的方式。在

Black和{a4}一样,动机是提供一种 合理且最低配置,以防止团队浪费时间 关于样式讨论(或个人手动格式化 这件事)。在

目前,rstfmt处于非常早期的开发阶段。不是所有人都休息 结构被覆盖,接口或格式可能随时更改 没有警告的时间。在

要了解rstfmt的输出,请参见the sample file。在

使用

# Install directly from the repository.
pip install git+https://github.com/dzhu/rstfmt

# Install from PyPI.
pip install rstfmt

# Read a file from stdin and write the formatted version to stdout.
rstfmt

# Exit with a nonzero status code if any files are not formatted.
rstfmt --check <file>...

# Format the given files in place.
rstfmt <file>...

# Wrap paragraphs to the given line length (default 72).
rstfmt -w <width>

与Black的blackd一样,还有一个守护进程提供格式化 通过HTTP请求避免启动和导入所有内容的成本 每次跑步。在

^{pr2}$

编辑

从stdin读取和写入stdout的默认行为应该 与其他系统很好地集成,比如编辑器中的save hook。为 {这里包括两个配置} 独立和守护程序模式:

;; Run the standalone tool.(reformatter-definerstfmt:program"rstfmt")(add-hook'rst-mode-hook#'rstfmt-on-save-mode);; Query the daemon.(reformatter-defineclient-rstfmt:program"curl":args'("-fsS""http://localhost:5219""--data-binary""@/dev/stdin"))(add-hook'rst-mode-hook#'client-rstfmt-on-save-mode)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
使用Spring Security成功登录后,java服务器连接丢失   macos Java代码在应用程序中工作,而不是在Servlet中   java LWJGL矩形变得更宽   Android Studio java。lang.NullPointerException:   将自定义主题应用到ChoiceBox时,JavaFX出现java错误   Selenium中具有不同ID的java Click元素   尝试从MySQL查询解析JSON时出现java异常   java CyclicBarrier启动执行不同逻辑的并行线程   添加strutshtml时使用java。tld到jsp文件发生错误   jpa ClassNotFoundException:java。sql。在weblogic上创建SAP Hana数据源时的SQLType   当Rest请求URI过长时,通过apache Camel执行的java GET HTTP操作失败   java在spring数据实体中填充“已创建”列   java背景和按钮问题   单击筛选的RecyclerView项时显示错误数据的java