Tweak plugin badges
This commit is contained in:
parent
419e8c9f64
commit
ffdf06d441
@ -1,4 +1,5 @@
|
|||||||
# PkgTemplates
|
# PkgTemplates
|
||||||
|
|
||||||
[](https://christopher-dG.github.io/PkgTemplates.jl/stable)
|
[](https://christopher-dG.github.io/PkgTemplates.jl/stable)
|
||||||
[](https://christopher-dG.github.io/PkgTemplates.jl/latest)
|
[](https://christopher-dG.github.io/PkgTemplates.jl/latest)
|
||||||
[](https://travis-ci.org/christopher-dG/PkgTemplates.jl)
|
[](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]
|
ordering = [GitHubPages, TravisCI, AppVeyor, CodeCov]
|
||||||
for plugin_type in ordering
|
for plugin_type in ordering
|
||||||
if haskey(t.plugins, plugin_type)
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ Returns an array of Markdown badges.
|
|||||||
function badges(_::AppVeyor, t::Template, pkg_name::AbstractString)
|
function badges(_::AppVeyor, t::Template, pkg_name::AbstractString)
|
||||||
user = strip(URI(t.remote_prefix).path, '/')
|
user = strip(URI(t.remote_prefix).path, '/')
|
||||||
return [
|
return [
|
||||||
"[](https://ci.appveyor.com/project/$user/$pkg_name-jl)"
|
"[](https://ci.appveyor.com/project/$user/$pkg_name-jl)"
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ Returns an array of Markdown badges.
|
|||||||
function badges(_::CodeCov, t::Template, pkg_name::AbstractString)
|
function badges(_::CodeCov, t::Template, pkg_name::AbstractString)
|
||||||
user = strip(URI(t.remote_prefix).path, '/')
|
user = strip(URI(t.remote_prefix).path, '/')
|
||||||
return [
|
return [
|
||||||
"[](https://codecov.io/gh/$user/$pkg_name.jl)"
|
"[](https://codecov.io/gh/$user/$pkg_name.jl)"
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -33,11 +33,11 @@ function gen_plugin(plugin::Documenter, template::Template, pkg_name::AbstractSt
|
|||||||
# assets/file2,
|
# assets/file2,
|
||||||
# ]
|
# ]
|
||||||
const TAB = repeat(" ", 4)
|
const TAB = repeat(" ", 4)
|
||||||
assets = "[\n"
|
assets_string = "[\n"
|
||||||
for file in plugin.assets
|
for asset in plugin.assets
|
||||||
assets *= """$(TAB^2)"assets/$(basename(file))",\n"""
|
assets_string *= """$(TAB^2)"assets/$(basename(asset))",\n"""
|
||||||
end
|
end
|
||||||
assets *= "$TAB]"
|
assets_string *= "$TAB]"
|
||||||
|
|
||||||
else
|
else
|
||||||
assets = "[]"
|
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}",
|
repo="$(template.remote_prefix)$pkg_name.jl/blob/{commit}{path}#L{line}",
|
||||||
sitename="$pkg_name.jl",
|
sitename="$pkg_name.jl",
|
||||||
authors="$(template.authors)",
|
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)
|
function badges(_::GitHubPages, t::Template, pkg_name::AbstractString)
|
||||||
user = strip(URI(t.remote_prefix).path, '/')
|
user = strip(URI(t.remote_prefix).path, '/')
|
||||||
return [
|
return [
|
||||||
"[](https://$user.github.io/$pkg_name.jl/stable)"
|
"[](https://$user.github.io/$pkg_name.jl/stable)"
|
||||||
"[](https://$user.github.io/$pkg_name.jl/latest)"
|
"[](https://$user.github.io/$pkg_name.jl/latest)"
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user