Skip to content

Commit

Permalink
fix a load of spacing issues in frontend content (#9281)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris48s committed Jun 18, 2023
1 parent 50ea706 commit a5f91a4
Show file tree
Hide file tree
Showing 27 changed files with 183 additions and 254 deletions.
8 changes: 3 additions & 5 deletions services/amo/amo-downloads.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import { redirector } from '../index.js'
import { BaseAmoService, keywords } from './amo-base.js'

const documentation = `
<p>
Previously <code>amo/d</code> provided a &ldquo;total downloads&rdquo; badge. However,
<a href="https://github.com/badges/shields/issues/3079">updates to the v3 API</a> only
give us weekly downloads. The route <code>amo/d</code> redirects to <code>amo/dw</code>.
</p>
Previously \`amo/d\` provided a &ldquo;total downloads&rdquo; badge. However,
[updates to the v3 API](https://github.com/badges/shields/issues/3079)
only give us weekly downloads. The route \`amo/d\` redirects to \`amo/dw\`.
`

class AmoWeeklyDownloads extends BaseAmoService {
Expand Down
25 changes: 11 additions & 14 deletions services/azure-devops/azure-devops-build.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,20 @@ const queryParamSchema = Joi.object({
})

const documentation = `
<p>
A badge requires three pieces of information: <code>ORGANIZATION</code>,
<code>PROJECT_ID</code> and <code>DEFINITION_ID</code>.
</p>
<p>
To start, edit your build definition and look at the url:
</p>
A badge requires three pieces of information:
\`ORGANIZATION\`, \`PROJECT_ID\` and \`DEFINITION_ID\`.
To start, edit your build definition and look at the url:
<img
src="https://user-images.githubusercontent.com/3749820/47259976-e2d9ec80-d4b2-11e8-92cc-7c81089a7a2c.png"
alt="ORGANIZATION is after the dev.azure.com part, PROJECT_NAME is right after that, DEFINITION_ID is at the end after the id= part." />
<p>
Then use the Azure DevOps REST API to translate the
<code>PROJECT_NAME</code> to a <code>PROJECT_ID</code>.
</p>
<p>
Navigate to <code>https://dev.azure.com/ORGANIZATION/_apis/projects/PROJECT_NAME</code>
</p>
Then use the Azure DevOps REST API to translate the
\`PROJECT_NAME\` to a \`PROJECT_ID\`.
Navigate to \`https://dev.azure.com/ORGANIZATION/_apis/projects/PROJECT_NAME\`
<img
src="https://user-images.githubusercontent.com/3749820/47266325-1d846900-d535-11e8-9211-2ee72fb91877.png"
alt="PROJECT_ID is in the id property of the API response." />
Expand Down
27 changes: 12 additions & 15 deletions services/azure-devops/azure-devops-coverage.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,22 @@ import AzureDevOpsBase from './azure-devops-base.js'
import { keywords } from './azure-devops-helpers.js'

const documentation = `
<p>
To obtain your own badge, you need to get 3 pieces of information:
<code>ORGANIZATION</code>, <code>PROJECT</code> and <code>DEFINITION_ID</code>.
</p>
<p>
First, you need to select your build definition and look at the url:
</p>
To obtain your own badge, you need to get 3 pieces of information:
\`ORGANIZATION\`, \`PROJECT_ID\` and \`DEFINITION_ID\`.
First, you need to select your build definition and look at the url:
<img
src="https://user-images.githubusercontent.com/3749820/47259976-e2d9ec80-d4b2-11e8-92cc-7c81089a7a2c.png"
alt="ORGANIZATION is after the dev.azure.com part, PROJECT is right after that, DEFINITION_ID is at the end after the id= part." />
<p>
Your badge will then have the form:
<code>https://img.shields.io/azure-devops/coverage/ORGANIZATION/PROJECT/DEFINITION_ID.svg</code>.
</p>
<p>
Optionally, you can specify a named branch:
<code>https://img.shields.io/azure-devops/coverage/ORGANIZATION/PROJECT/DEFINITION_ID/NAMED_BRANCH.svg</code>.
</p>
Your badge will then have the form:
\`https://img.shields.io/azure-devops/coverage/ORGANIZATION/PROJECT/DEFINITION_ID.svg\`.
Optionally, you can specify a named branch:
\`https://img.shields.io/azure-devops/coverage/ORGANIZATION/PROJECT/DEFINITION_ID/NAMED_BRANCH.svg\`.
`

const buildCodeCoverageSchema = Joi.object({
coverageData: Joi.array()
.items(
Expand Down
21 changes: 9 additions & 12 deletions services/azure-devops/azure-devops-release.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,18 @@ import { BaseSvgScrapingService } from '../index.js'
import { keywords, fetch } from './azure-devops-helpers.js'

const documentation = `
<p>
To obtain your own badge, you need to get 4 pieces of information:
<code>ORGANIZATION</code>, <code>PROJECT_ID</code>, <code>DEFINITION_ID</code> and <code>ENVIRONMENT_ID</code>.
</p>
<p>
First, you need to enable badges for each required environments in the options of your release definition.
Once you have save the change, look at badge url:
</p>
To obtain your own badge, you need to get 4 pieces of information:
\`ORGANIZATION\`, \`PROJECT_ID\`, \`DEFINITION_ID\` and \`ENVIRONMENT_ID\`.
First, you need to enable badges for each required environments in the options of your release definition.
Once you have save the change, look at badge url:
<img
src="https://user-images.githubusercontent.com/3749820/47266694-7f939d00-d53a-11e8-9224-c2371dd2d0c9.png"
alt="ORGANIZATION is after the dev.azure.com part, PROJECT_ID is after the badge part, DEFINITION_ID and ENVIRONMENT_ID are right after that." />
<p>
Your badge will then have the form:
<code>https://img.shields.io/vso/release/ORGANIZATION/PROJECT_ID/DEFINITION_ID/ENVIRONMENT_ID.svg</code>.
</p>
Your badge will then have the form:
\`https://img.shields.io/vso/release/ORGANIZATION/PROJECT_ID/DEFINITION_ID/ENVIRONMENT_ID.svg\`.
`

export default class AzureDevOpsRelease extends BaseSvgScrapingService {
Expand Down
27 changes: 12 additions & 15 deletions services/azure-devops/azure-devops-tests.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,21 @@ const commonAttrs = {
compact_message: null,
},
documentation: `
<p>
To obtain your own badge, you need to get 3 pieces of information:
<code>ORGANIZATION</code>, <code>PROJECT</code> and <code>DEFINITION_ID</code>.
</p>
<p>
First, you need to select your build definition and look at the url:
</p>
To obtain your own badge, you need to get 3 pieces of information:
\`ORGANIZATION\`, \`PROJECT_ID\`, \`DEFINITION_ID\`.
First, you need to select your build definition and look at the url:
<img
src="https://user-images.githubusercontent.com/3749820/47259976-e2d9ec80-d4b2-11e8-92cc-7c81089a7a2c.png"
alt="ORGANIZATION is after the dev.azure.com part, PROJECT is right after that, DEFINITION_ID is at the end after the id= part." />
<p>
Your badge will then have the form:
<code>https://img.shields.io/azure-devops/tests/ORGANIZATION/PROJECT/DEFINITION_ID.svg</code>.
</p>
<p>
Optionally, you can specify a named branch:
<code>https://img.shields.io/azure-devops/tests/ORGANIZATION/PROJECT/DEFINITION_ID/NAMED_BRANCH.svg</code>.
</p>
Your badge will then have the form:
\`https://img.shields.io/azure-devops/tests/ORGANIZATION/PROJECT/DEFINITION_ID.svg\`.
Optionally, you can specify a named branch:
\`https://img.shields.io/azure-devops/tests/ORGANIZATION/PROJECT/DEFINITION_ID/NAMED_BRANCH.svg\`.
${commonDocumentation}
`,
}
Expand Down
6 changes: 3 additions & 3 deletions services/endpoint/endpoint.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ const description = `<p>
<tr>
<td><code>namedLogo</code></td>
<td>
Default: none. One of the named logos supported by Shields or
<a href="https://simpleicons.org/">simple-icons</a>. Can be overridden
by the query string.
Default: none. One of the named logos supported by Shields
or <a href="https://simpleicons.org/">simple-icons</a>. Can be
overridden by the query string.
</td>
</tr>
<tr>
Expand Down
11 changes: 5 additions & 6 deletions services/github/github-all-contributors.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import { fetchJsonFromRepo } from './github-common-fetch.js'
import { documentation as commonDocumentation } from './github-helpers.js'

const documentation = `
<p>
The All Contributors service allows you to recognize all your project
contributors, including those that don't push code. See
<a href="https://allcontributors.org">https://allcontributors.org</a>
for more information.
</p>
The All Contributors service allows you to recognize all your project
contributors, including those that don't push code. See
[https://allcontributors.org](https://allcontributors.org)
for more information.
${commonDocumentation}
`

Expand Down
41 changes: 17 additions & 24 deletions services/github/github-hacktoberfest.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,24 @@ import {
} from './github-helpers.js'

const documentation = `
<p>
This badge is designed for projects hosted on GitHub which are
participating in
<a href="https://hacktoberfest.digitalocean.com">Hacktoberfest</a>,
an initiative to encourage participating in open-source projects. The
badge can be added to the project readme to encourage potential
contributors to review the suggested issues and to celebrate the
contributions that have already been made.
The badge displays three pieces of information:
<ul>
<li>
The number of suggested issues. By default this will count open
issues with the <strong>hacktoberfest</strong> label, however you
can pick a different label (e.g.
<code>?suggestion_label=good%20first%20issue</code>).
</li>
<li>
The number of pull requests opened in October. This excludes any
PR with the <strong>invalid</strong> label.
</li>
<li>The number of days left of October.</li>
</ul>
</p>
This badge is designed for projects hosted on GitHub which are
participating in
[Hacktoberfest](https://hacktoberfest.digitalocean.com),
an initiative to encourage participating in open-source projects. The
badge can be added to the project readme to encourage potential
contributors to review the suggested issues and to celebrate the
contributions that have already been made.
The badge displays three pieces of information:
${githubDocumentation}
- The number of suggested issues. By default this will count open
issues with the <strong>hacktoberfest</strong> label, however you
can pick a different label (e.g.
\`?suggestion_label=good%20first%20issue\`).
- The number of pull requests opened in October. This excludes any
PR with the <strong>invalid</strong> label.
- The number of days left of October.
${githubDocumentation}
`

const schema = Joi.object({
Expand Down
10 changes: 4 additions & 6 deletions services/github/github-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ import { colorScale } from '../color-formatters.js'
import { InvalidResponse, NotFound } from '../index.js'

const documentation = `
<p>
If your GitHub badge errors, it might be because you hit GitHub's rate limits.
You can increase Shields.io's rate limit by
<a href="https://img.shields.io/github-auth">adding the Shields GitHub
application</a> using your GitHub account.
</p>
If your GitHub badge errors, it might be because you hit GitHub's rate limits.
You can increase Shields.io's rate limit by
[adding the Shields GitHub application](https://img.shields.io/github-auth)
using your GitHub account.
`

function issueStateColor(s) {
Expand Down
46 changes: 19 additions & 27 deletions services/github/github-pipenv.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,25 @@ import { documentation as githubDocumentation } from './github-helpers.js'
const keywords = ['pipfile']

const documentation = `
<p>
<a href="https://github.com/pypa/pipenv">Pipenv</a> is a dependency
manager for Python which manages a
<a href="https://virtualenv.pypa.io/en/latest/">virtualenv</a> for
projects. It adds/removes packages from your <code>Pipfile</code> as
you install/uninstall packages and generates the ever-important
<code>Pipfile.lock</code>, which can be checked in to source control
in order to produce deterministic builds.
</p>
<p>
The GitHub Pipenv badges are intended for applications using Pipenv
which are hosted on GitHub.
</p>
<p>
When <code>Pipfile.lock</code> is checked in, the <strong>GitHub Pipenv
locked dependency version</strong> badge displays the locked version of
a dependency listed in <code>[packages]</code> or
<code>[dev-packages]</code> (or any of their transitive dependencies).
</p>
<p>
Usually a Python version is specified in the <code>Pipfile</code>, which
<code>pipenv lock</code> then places in <code>Pipfile.lock</code>. The
<strong>GitHub Pipenv Python version</strong> badge displays that version.
</p>
[Pipenv](https://github.com/pypa/pipenv) is a dependency
manager for Python which manages a
[virtualenv](https://virtualenv.pypa.io/en/latest/) for
projects. It adds/removes packages from your \`Pipfile\` as
you install/uninstall packages and generates the ever-important
\`Pipfile.lock\`, which can be checked in to source control
in order to produce deterministic builds.
The GitHub Pipenv badges are intended for applications using Pipenv
which are hosted on GitHub.
When \`Pipfile.lock\` is checked in, the <strong>GitHub Pipenv
locked dependency version</strong> badge displays the locked version of
a dependency listed in \`[packages]\` or
\`[dev-packages]\` (or any of their transitive dependencies).
Usually a Python version is specified in the \`Pipfile\`, which
\`pipenv lock\` then places in \`Pipfile.lock\`.
The <strong>GitHub Pipenv Python version</strong> badge displays that version.
${githubDocumentation}
`
Expand Down
8 changes: 1 addition & 7 deletions services/gitlab/gitlab-forks.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Joi from 'joi'
import { optionalUrl, nonNegativeInteger } from '../validators.js'
import { metric } from '../text-formatters.js'
import GitLabBase from './gitlab-base.js'
import { documentation } from './gitlab-helper.js'

const schema = Joi.object({
forks_count: nonNegativeInteger,
Expand All @@ -11,13 +12,6 @@ const queryParamSchema = Joi.object({
gitlab_url: optionalUrl,
}).required()

const documentation = `
<p>
You may use your GitLab Project Id (e.g. 278964) or your Project Path (e.g. gitlab-org/gitlab ).
Note that only internet-accessible GitLab instances are supported, for example https://jihulab.com, https://gitlab.gnome.org, or https://gitlab.com/.
</p>
`

export default class GitlabForks extends GitLabBase {
static category = 'social'

Expand Down
14 changes: 6 additions & 8 deletions services/gitlab/gitlab-helper.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
const documentation = `
<p>
You may use your GitLab Project Id (e.g. 278964) or your Project Path (e.g.
<a href="https://gitlab.com/gitlab-org/gitlab" target="_blank" >gitlab-org/gitlab</a> ).
Note that only internet-accessible GitLab instances are supported, for example
<a href="https://jihulab.com" target="_blank" >https://jihulab.com</a>,
<a href="https://gitlab.gnome.org" target="_blank" >https://gitlab.gnome.org</a>, or
<a href="https://gitlab.com" target="_blank" >https://gitlab.com</a>.
</p>
You may use your GitLab Project Id (e.g. 278964) or your Project Path (e.g.
[gitlab-org/gitlab](https://gitlab.com/gitlab-org/gitlab) ).
Note that only internet-accessible GitLab instances are supported, for example
[https://jihulab.com](https://jihulab.com),
[https://gitlab.gnome.org](https://gitlab.gnome.org), or
[https://gitlab.com](https://gitlab.com).
`

function httpErrorsFor(notFoundMessage = 'project not found') {
Expand Down
8 changes: 1 addition & 7 deletions services/gitlab/gitlab-stars.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Joi from 'joi'
import { optionalUrl, nonNegativeInteger } from '../validators.js'
import { metric } from '../text-formatters.js'
import GitLabBase from './gitlab-base.js'
import { documentation } from './gitlab-helper.js'

const schema = Joi.object({
star_count: nonNegativeInteger,
Expand All @@ -11,13 +12,6 @@ const queryParamSchema = Joi.object({
gitlab_url: optionalUrl,
}).required()

const documentation = `
<p>
You may use your GitLab Project Id (e.g. 278964) or your Project Path (e.g. gitlab-org/gitlab ).
Note that only internet-accessible GitLab instances are supported, for example https://jihulab.com, https://gitlab.gnome.org, or https://gitlab.com/.
</p>
`

export default class GitlabStars extends GitLabBase {
static category = 'social'

Expand Down
19 changes: 8 additions & 11 deletions services/hsts/hsts.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,14 @@ const schema = Joi.object({
}).required()

const documentation = `
<p>
<a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security">
<code>Strict-Transport-Security</code> is an HTTP response header</a> that signals that browsers should
only access the site using HTTPS.
</p>
<p>
For a higher level of security, it's possible for a domain owner to
<a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security#Preloading_Strict_Transport_Security">preload
this behavior into participating web browsers</a>. Chromium maintains the <a href="https://www.chromium.org/hsts">HSTS preload list</a>, which
is the de facto standard that has been adopted by several browsers. This service checks a domain's status in that list.
</p>
[\`Strict-Transport-Security\` is an HTTP response header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security)
that signals that browsers should only access the site using HTTPS.
For a higher level of security, it's possible for a domain owner to
[preload this behavior into participating web browsers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security#Preloading_Strict_Transport_Security).
Chromium maintains the [HSTS preload list](https://www.chromium.org/hsts), which
is the de facto standard that has been adopted by several browsers.
This service checks a domain's status in that list.
`

export default class HSTS extends BaseJsonService {
Expand Down

0 comments on commit a5f91a4

Please sign in to comment.