极简主义风格的短裙
bibL的Python项目详细描述
圣经
bibL是BibTeX文件的一个最小的linter(样式检查器)。 bibL没有自带BibTeX解析器,而是利用了pybtex解析器。在
安装
pip install bibl
使用
使用以下命令在BibTeX文件上运行bibl
^{pr2}$或者作为一个python模块
python -m bibl lint bibliography1.bib bibliography2.bib ...
bibl将检查这些文件中是否存在各种样式问题和BibTeX规范(http://www.bibtex.org/Format/,https://en.wikipedia.org/wiki/BibTeX)的偏差。 每一种可能的问题都是作为一种规则来制定的。每个规则都由一个唯一的代码标识。一些规则的例子是
Rule ID | Rule description |
---|---|
^{ | Entry not in alphabetical order by ke |
^{ | Non-ascii character |
^{ | Keys of published works should have format AuthorYEARa |
^{ | Incorrect doi format |
^{ | Non-standard whitespace at beginning of line (indents should be 4 spaces) |
^{ | Missing required field ^{ |
... | ... |
此链接提供list of all available rules
规则id的第一个字符表示规则类别,例如,E
表示输入值问题,T
表示文本
.bib
文件等出现问题。
可以使用--select
或--ignore
指定要检查的规则。允许使用通配符。--select
将仅
启用指定的规则,禁用所有其他规则,--ignore
将禁用除指定规则之外的所有规则。
--select
和{
bibl --select "D*,E06,T01" lint bibliography.lint
只检查以D开头的所有规则,规则E06和规则T01
bibl --ignore "D*,E06,T01" lint bibliography.lint
将检查除以D开头的所有规则、规则E06和规则T01之外的所有规则
配置
除了--select
和--ignore
,还可以通过cli提供其他配置选项,如--max-line-length
指定在超出时应报告问题的行长度。完整列表见下文。在
也可以在yaml格式的配置文件中指定配置,该文件由--config
选项提供。
如果没有提供配置文件,并且当前工作目录中存在.bibl.yml
文件,则此文件将
用作配置文件。
命令行选项配置将覆盖文件提供的配置。
请参阅默认配置.bibl.yml,了解配置文件中可以覆盖的所有值。在
一些规则,如各种M01*
、M02*
和{type_spec
设置按程序生成的。
此设置指定应存在哪些条目和字段类型,并且可以修改为更容易忽略生成的项和字段类型
特定条目类型或字段的规则,或添加自定义字段或应为其发出警告的条目类型
同时进行皮棉。在
命令行接口
Usage: bibl [OPTIONS] COMMAND [ARGS]... Options: -c, --config TEXT Custom configuration file path. --select TEXT Comma separated list of enabled rules, all other rules will be disabled. --ignore TEXT Comma separated list of disabled rules, all other rules will be enabled. --indent-spaces INTEGER Number of trailing whitespaces for indented line, used by TO1. --max-line-length INTEGER Max line length before wrap recommended, used by T03. --abbreviation-dot Abbreviate middle names with dot. --help Show this message and exit. Commands: lint Lint a BibTeX bibliography file. list-all Show all available rules. list-enabled Show all rules enabled by the configuration. version Show the package version.
Usage: bibl lint [OPTIONS][BIBLIOGRAPHY]... Lint a BibTeX bibliography file. Options: --help Show this message and exit.
Usage: bibl list-all [OPTIONS] Show all available rules. Options: -m Format rules as markdown table. --help Show this message and exit.
Usage: bibl list-enabled [OPTIONS] Show all rules enabled by the configuration. Options: -m Format rules as markdown table. --help Show this message and exit.
- 项目
标签: