Tweak plugin badges

This commit is contained in:
Chris de Graaf 2017-08-15 09:19:37 -05:00
parent 419e8c9f64
commit ffdf06d441
6 changed files with 11 additions and 10 deletions

View File

@ -1,4 +1,5 @@
# PkgTemplates
[![stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://christopher-dG.github.io/PkgTemplates.jl/stable)
[![latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://christopher-dG.github.io/PkgTemplates.jl/latest)
[![Build Status](https://travis-ci.org/christopher-dG/PkgTemplates.jl.svg?branch=master)](https://travis-ci.org/christopher-dG/PkgTemplates.jl)

View File

@ -89,7 +89,7 @@ function gen_readme(pkg_dir::AbstractString, t::Template)
ordering = [GitHubPages, TravisCI, AppVeyor, CodeCov]
for plugin_type in ordering
if haskey(t.plugins, plugin_type)
text *= join(badges(t.plugins[plugin_type], t, pkg_name), "\n") * "\n"
text *= "\n" * join(badges(t.plugins[plugin_type], t, pkg_name), "\n")
end
end

View File

@ -39,7 +39,7 @@ Returns an array of Markdown badges.
function badges(_::AppVeyor, t::Template, pkg_name::AbstractString)
user = strip(URI(t.remote_prefix).path, '/')
return [
"[![Build status](https://ci.appveyor.com/api/projects/status/github/$user/$pkg_name.jl?svg=true)](https://ci.appveyor.com/project/$user/$pkg_name-jl)"
"[![Build Status](https://ci.appveyor.com/api/projects/status/github/$user/$pkg_name.jl?svg=true)](https://ci.appveyor.com/project/$user/$pkg_name-jl)"
]
end

View File

@ -39,7 +39,7 @@ Returns an array of Markdown badges.
function badges(_::CodeCov, t::Template, pkg_name::AbstractString)
user = strip(URI(t.remote_prefix).path, '/')
return [
"[![codecov](https://codecov.io/gh/$user/$pkg_name.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/$user/$pkg_name.jl)"
"[![CodeCov](https://codecov.io/gh/$user/$pkg_name.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/$user/$pkg_name.jl)"
]
end

View File

@ -33,11 +33,11 @@ function gen_plugin(plugin::Documenter, template::Template, pkg_name::AbstractSt
# assets/file2,
# ]
const TAB = repeat(" ", 4)
assets = "[\n"
for file in plugin.assets
assets *= """$(TAB^2)"assets/$(basename(file))",\n"""
assets_string = "[\n"
for asset in plugin.assets
assets_string *= """$(TAB^2)"assets/$(basename(asset))",\n"""
end
assets *= "$TAB]"
assets_string *= "$TAB]"
else
assets = "[]"
@ -55,7 +55,7 @@ function gen_plugin(plugin::Documenter, template::Template, pkg_name::AbstractSt
repo="$(template.remote_prefix)$pkg_name.jl/blob/{commit}{path}#L{line}",
sitename="$pkg_name.jl",
authors="$(template.authors)",
assets=$assets,
assets=$assets_string,
)
"""

View File

@ -36,8 +36,8 @@ Returns an array of Markdown badges.
function badges(_::GitHubPages, t::Template, pkg_name::AbstractString)
user = strip(URI(t.remote_prefix).path, '/')
return [
"[![stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://$user.github.io/$pkg_name.jl/stable)"
"[![latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://$user.github.io/$pkg_name.jl/latest)"
"[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://$user.github.io/$pkg_name.jl/stable)"
"[![Latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://$user.github.io/$pkg_name.jl/latest)"
]
end