From ffdf06d441ac9d4d98ccbf8aaa070c6075ec2b43 Mon Sep 17 00:00:00 2001 From: Chris de Graaf Date: Tue, 15 Aug 2017 09:19:37 -0500 Subject: [PATCH] Tweak plugin badges --- README.md | 1 + src/generate.jl | 2 +- src/plugins/appveyor.jl | 2 +- src/plugins/codecov.jl | 2 +- src/plugins/documenter.jl | 10 +++++----- src/plugins/githubpages.jl | 4 ++-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 140e849..4c44e3c 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/src/generate.jl b/src/generate.jl index 418ef26..0610df1 100644 --- a/src/generate.jl +++ b/src/generate.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 diff --git a/src/plugins/appveyor.jl b/src/plugins/appveyor.jl index d387678..088676e 100644 --- a/src/plugins/appveyor.jl +++ b/src/plugins/appveyor.jl @@ -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 diff --git a/src/plugins/codecov.jl b/src/plugins/codecov.jl index f3084c1..c798d32 100644 --- a/src/plugins/codecov.jl +++ b/src/plugins/codecov.jl @@ -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 diff --git a/src/plugins/documenter.jl b/src/plugins/documenter.jl index e95ef9a..a86dd6c 100644 --- a/src/plugins/documenter.jl +++ b/src/plugins/documenter.jl @@ -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, ) """ diff --git a/src/plugins/githubpages.jl b/src/plugins/githubpages.jl index f3d1f58..7c51d9f 100644 --- a/src/plugins/githubpages.jl +++ b/src/plugins/githubpages.jl @@ -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