徽章图像类
badges的Python项目详细描述
安装
$ [sudo] pip install badges
功能
- md,rst支持
- 使用实例和类变量自动格式化字符串
- 极简设计,易于子类化
- Circleci,Travis,…徽章类
示例
# format attributes - {attrname}>>>classCustomBadge(badges.Badge):branch="master"link="https://site.com/{fullname}"image="https://site.com/{fullname}?branch={branch}.svg">>>CustomBadge(fullname="owner/repo")'[![](https://site.com/owner/repo?branch=master.svg)](https://site.com/owner/repo)'# format @property - {0.propname}>>>classCustomBadge(badges.Badge):branch="master"link="https://site.com/{0.fullname}"image="https://site.com/{0.fullname}?branch={branch}.svg"@propertydeffullname(self):return"/".join(os.getcwd().split("/")[-2:])>>>CustomBadge()'[![](https://site.com/owner/repo?branch=master.svg)](https://site.com/owner/repo)'