Tweak plugin badges
This commit is contained in:
parent
419e8c9f64
commit
ffdf06d441
@ -1,4 +1,5 @@
|
||||
# PkgTemplates
|
||||
|
||||
[](https://christopher-dG.github.io/PkgTemplates.jl/stable)
|
||||
[](https://christopher-dG.github.io/PkgTemplates.jl/latest)
|
||||
[](https://travis-ci.org/christopher-dG/PkgTemplates.jl)
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 [
|
||||
"[](https://ci.appveyor.com/project/$user/$pkg_name-jl)"
|
||||
"[](https://ci.appveyor.com/project/$user/$pkg_name-jl)"
|
||||
]
|
||||
end
|
||||
|
||||
|
@ -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 [
|
||||
"[](https://codecov.io/gh/$user/$pkg_name.jl)"
|
||||
"[](https://codecov.io/gh/$user/$pkg_name.jl)"
|
||||
]
|
||||
end
|
||||
|
||||
|
@ -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,
|
||||
)
|
||||
"""
|
||||
|
||||
|
@ -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 [
|
||||
"[](https://$user.github.io/$pkg_name.jl/stable)"
|
||||
"[](https://$user.github.io/$pkg_name.jl/latest)"
|
||||
"[](https://$user.github.io/$pkg_name.jl/stable)"
|
||||
"[](https://$user.github.io/$pkg_name.jl/latest)"
|
||||
]
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user