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)
- 项目
标签: