1
0
mirror of https://github.com/badges/shields.git synced 2025-04-18 19:44:04 +03:00

upgrade to docusaurus 3 (#9820)

* update packages

* add plugin to strip autolinks in code blocks

* fix all the documentation for MDXv3

* remove check-docusaurus-versions

in docusaurus 3 this is now a hard error, not just a warning

* port upstream change to Curl component

fixes performing the 'execute' action when pressing enter
This commit is contained in:
chris48s 2024-03-23 19:54:57 +00:00 committed by GitHub
parent df8049a765
commit bd3a11b4b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
46 changed files with 5339 additions and 3863 deletions

View File

@ -1,16 +0,0 @@
#!/bin/bash
set -euo pipefail
# Docusaurus outputs some important errors as log messages
# but doesn't actually fail
# https://github.com/facebook/docusaurus/blob/v2.4.3/packages/docusaurus/src/server/siteMetadata.ts#L75-L92
# this script runs `docusaurus build`. If it outputs any [ERROR]s, we exit with 1
if ( npm run build 2>&1 | grep '\[ERROR\]' )
then
echo "You probably need to run: npm update @docusaurus/preset-classic"
exit 1
else
exit 0
fi

View File

@ -1,23 +0,0 @@
name: Check Docusaurus Plugin Versions
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches-ignore:
- 'gh-pages'
- 'dependabot/**'
jobs:
check-docusaurus-versions:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
with:
node-version: 20
cypress: true
- run: .github/scripts/check-docusaurus-versions.sh

View File

@ -1,5 +1,6 @@
const lightCodeTheme = require('prism-react-renderer').themes.github
const darkCodeTheme = require('prism-react-renderer').themes.dracula
const stripCodeBlockLinks = require('./src/plugins/strip-code-block-links')
/** @type {import('@docusaurus/types').Config} */
const config = {
@ -24,6 +25,14 @@ const config = {
],
],
markdown: {
mdx1Compat: {
comments: true,
admonitions: true,
headingIds: true,
},
},
presets: [
[
'docusaurus-preset-openapi',
@ -43,6 +52,7 @@ const config = {
api: {
path: 'categories',
routeBasePath: 'badges',
rehypePlugins: [stripCodeBlockLinks],
},
}),
],

View File

@ -8,14 +8,10 @@ Shields.io is possible thanks to the people and companies who donate money, serv
<ul>
<li>
<a href="https://nodeping.com/">
NodePing
</a>
<a href="https://nodeping.com/">NodePing</a>
</li>
<li>
<a href="https://sentry.io/">
Sentry
</a>
<a href="https://sentry.io/">Sentry</a>
</li>
</ul>
@ -24,7 +20,7 @@ Shields.io is possible thanks to the people and companies who donate money, serv
<p>
<object
data="https://opencollective.com/shields/tiers/sponsor.svg?avatarHeight=80&width=600"
class="opencollective-image"
className="opencollective-image"
></object>
</p>
@ -35,7 +31,7 @@ Shields.io is possible thanks to the people and companies who donate money, serv
<p>
<object
data="https://opencollective.com/shields/tiers/backer.svg?width=600"
class="opencollective-image">
className="opencollective-image">
</object>
</p>
@ -46,7 +42,7 @@ Shields.io is possible thanks to the people and companies who donate money, serv
<p>
<object
data="https://opencollective.com/shields/contributors.svg?width=600"
class="opencollective-image"
className="opencollective-image"
></object>
</p>

View File

@ -0,0 +1,30 @@
const { visit } = require('unist-util-visit')
function stripCodeBlockLinks() {
/*
Docusaurus 3 uses [remark-gfm](https://github.com/remarkjs/remark-gfm)
One of the "features" of remark-gfm is that it automatically looks for URLs
and email addresses, and automatically wraps them in <a> tags.
This happens even if the URL is inside a <code> block.
This behaviour is
a) mostly unhelpful and
b) non-configurable
This plugin removes <a> tags which appear inside a <code> block.
*/
return tree => {
visit(tree, ['mdxJsxTextElement', 'mdxJsxFlowElement', 'element'], node => {
if (node.name === 'code' || node.tagName === 'code') {
const links = node.children.filter(child => child.tagName === 'a')
links.forEach(link => {
const linkText = link.children.map(child => child.value).join('')
const linkIndex = node.children.indexOf(link)
node.children.splice(linkIndex, 1, { type: 'text', value: linkText })
})
}
})
}
}
module.exports = stripCodeBlockLinks

View File

@ -234,6 +234,7 @@ function Curl({ postman, codeSamples }) {
)}
key={lang.tabName || lang.label}
onClick={() => setLanguage(lang)}
type="button"
>
{lang.tabName || lang.label}
</button>

8510
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -144,9 +144,9 @@
]
},
"devDependencies": {
"@docusaurus/core": "^2.4.3",
"@docusaurus/core": "^3.1.1",
"@easyops-cn/docusaurus-search-local": "^0.40.1",
"@mdx-js/react": "^1.6.21",
"@mdx-js/react": "^3.0.1",
"@typescript-eslint/parser": "^7.0.2",
"c8": "^9.1.0",
"caller": "^1.1.0",
@ -161,7 +161,7 @@
"cypress-wait-for-stable-dom": "^0.1.0",
"danger": "^11.3.1",
"deepmerge": "^4.3.1",
"docusaurus-preset-openapi": "0.6.4",
"docusaurus-preset-openapi": "0.7.3",
"eslint": "8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard": "17.1.0",
@ -199,8 +199,8 @@
"portfinder": "^1.0.32",
"prettier": "3.2.5",
"prism-react-renderer": "^2.3.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"read-all-stdin-sync": "^1.0.5",
"rimraf": "^5.0.5",
"sazerac": "^2.0.0",

View File

@ -19,10 +19,8 @@ const schema = Joi.object({
}).required()
const description = `
<p>
Use the <code>baseUrl</code> query parameter to target different Bugzilla deployments.
If your Bugzilla badge errors, it might be because you are trying to load a private bug.
</p>
Use the <code>baseUrl</code> query parameter to target different Bugzilla deployments.
If your Bugzilla badge errors, it might be because you are trying to load a private bug.
`
export default class Bugzilla extends BaseJsonService {

View File

@ -19,9 +19,7 @@ const bundlejs =
'<a href="https://bundlejs.com/" target="_blank" rel="noopener">bundlejs</a>'
const description = `
<p>
View ${esbuild} minified and ${denoflate} gzipped size of a javascript package or selected exports, via ${bundlejs}.
</p>
View ${esbuild} minified and ${denoflate} gzipped size of a javascript package or selected exports, via ${bundlejs}.
`
export default class BundlejsPackage extends BaseJsonService {

View File

@ -11,14 +11,12 @@ const circleSchema = Joi.object({ message: isBuildStatus }).required()
const queryParamSchema = Joi.object({ token: Joi.string() }).required()
const tokenDescription = `
<p>
You may specify an optional token to get the status for a private repository.
<br />
If you need to use a token, please use a <b>Project Token</b> and only assign your token the 'Status' permission. Never use a <b>Personal Token</b> as they grant full read write permissions to your projects.
<br />
For more information about managing Circle CI tokens, please read this <a target="_blank" href="https://circleci.com/docs/2.0/managing-api-tokens">article</a>.
</p>
`
You may specify an optional token to get the status for a private repository.
If you need to use a token, please use a <b>Project Token</b> and only assign your token the 'Status' permission. Never use a <b>Personal Token</b> as they grant full read write permissions to your projects.
For more information about managing Circle CI tokens, please read this <a target="_blank" href="https://circleci.com/docs/2.0/managing-api-tokens">article</a>.
`
const vcsTypeMap = { gh: 'gh', github: 'gh', bb: 'bb', bitbucket: 'bb' }

View File

@ -36,12 +36,9 @@ const svgValueMatcher = />(\d{1,3}%|unknown)<\/text><\/g>/
const badgeTokenPattern = /^\w{10}$/
const description = `
<p>
You may specify a Codecov badge token to get coverage for a private repository.
</p>
<p>
You can find the token under the badge section of your project settings page, in this url: <code>https://codecov.io/&#60;vcsName&#62;/&#60;user&#62;/&#60;repo&#62;/settings/badge</code>.
</p>
You may specify a Codecov badge token to get coverage for a private repository.
You can find the token under the badge section of your project settings page, in this url: <code>https://codecov.io/[vcsName]/[user]/[repo]/settings/badge</code>.
`
export default class Codecov extends BaseSvgScrapingService {

View File

@ -15,14 +15,12 @@ const schema = Joi.object({
}).required()
const description = `
<p>
The CurseForge badge requires the <code>Project ID</code> in order access the
<a href="https://docs.curseforge.com/#get-mod" target="_blank">CurseForge API</a>.
</p>
<p>
The <code>Project ID</code> is different from the URL slug and can be found in the 'About Project' section of your
CurseForge mod page.
</p>
The CurseForge badge requires the <code>Project ID</code> in order access the
<a href="https://docs.curseforge.com/#get-mod" target="_blank">CurseForge API</a>.
The <code>Project ID</code> is different from the URL slug and can be found in the 'About Project' section of your
CurseForge mod page.
<img src="https://github.com/badges/shields/assets/1098773/0d45b5fa-2cde-415d-8152-b84c535a1535"
alt="The Project ID in the 'About Projection' section on CurseForge." />
`

View File

@ -2,9 +2,7 @@ import { formatRelativeDate } from '../text-formatters.js'
import { BaseService, pathParams } from '../index.js'
const description = `
<p>
Supply a unix timestamp in seconds to display the relative time from/to now
</p>
Supply a unix timestamp in seconds to display the relative time from/to now
`
export default class Date extends BaseService {

View File

@ -7,19 +7,17 @@ const schema = Joi.object({
}).required()
const description = `
<p>
The Discord badge requires the <code>SERVER ID</code> in order access the Discord JSON API.
</p>
<p>
The <code>SERVER ID</code> can be located in the url of the channel that the badge is accessing.
</p>
The Discord badge requires the <code>SERVER ID</code> in order access the Discord JSON API.
The <code>SERVER ID</code> can be located in the url of the channel that the badge is accessing.
<img
src="https://user-images.githubusercontent.com/6025893/39329897-b08f8290-4997-11e8-8f8f-7b85ff61882f.png"
alt="SERVER ID is after the channel part at the end of the url" />
<p>
To use the Discord badge a Discord server admin must enable the widget setting on the server.
</p>
<iframe src="https://player.vimeo.com/video/364220040" width="640" height="210" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe>
To use the Discord badge a Discord server admin must enable the widget setting on the server.
<iframe src="https://player.vimeo.com/video/364220040" width="640" height="210" frameBorder="0" allow="autoplay; fullscreen" allowFullScreen></iframe>
`
export default class Discord extends BaseJsonService {

View File

@ -3,6 +3,11 @@ import { BaseJsonService, queryParams } from '../index.js'
import { createRoute } from './dynamic-helpers.js'
import jsonPath from './json-path.js'
const description = `
The Dynamic JSON Badge allows you to extract an arbitrary value from any
JSON Document using a JSONPath selector and show it on a badge.
`
export default class DynamicJson extends jsonPath(BaseJsonService) {
static enabledMetrics = [MetricNames.SERVICE_RESPONSE_SIZE]
static route = createRoute('json')
@ -10,10 +15,7 @@ export default class DynamicJson extends jsonPath(BaseJsonService) {
'/badge/dynamic/json': {
get: {
summary: 'Dynamic JSON Badge',
description: `<p>
The Dynamic JSON Badge allows you to extract an arbitrary value from any
JSON Document using a JSONPath selector and show it on a badge.
</p>`,
description,
parameters: queryParams(
{
name: 'url',

View File

@ -3,6 +3,11 @@ import { BaseTomlService, queryParams } from '../index.js'
import { createRoute } from './dynamic-helpers.js'
import jsonPath from './json-path.js'
const description = `
The Dynamic TOML Badge allows you to extract an arbitrary value from any
TOML Document using a JSONPath selector and show it on a badge.
`
export default class DynamicToml extends jsonPath(BaseTomlService) {
static enabledMetrics = [MetricNames.SERVICE_RESPONSE_SIZE]
static route = createRoute('toml')
@ -10,10 +15,7 @@ export default class DynamicToml extends jsonPath(BaseTomlService) {
'/badge/dynamic/toml': {
get: {
summary: 'Dynamic TOML Badge',
description: `<p>
The Dynamic TOML Badge allows you to extract an arbitrary value from any
TOML Document using a JSONPath selector and show it on a badge.
</p>`,
description,
parameters: queryParams(
{
name: 'url',

View File

@ -3,6 +3,11 @@ import { BaseYamlService, queryParams } from '../index.js'
import { createRoute } from './dynamic-helpers.js'
import jsonPath from './json-path.js'
const description = `
The Dynamic YAML Badge allows you to extract an arbitrary value from any
YAML Document using a JSONPath selector and show it on a badge.
`
export default class DynamicYaml extends jsonPath(BaseYamlService) {
static enabledMetrics = [MetricNames.SERVICE_RESPONSE_SIZE]
static route = createRoute('yaml')
@ -10,10 +15,7 @@ export default class DynamicYaml extends jsonPath(BaseYamlService) {
'/badge/dynamic/yaml': {
get: {
summary: 'Dynamic YAML Badge',
description: `<p>
The Dynamic YAML Badge allows you to extract an arbitrary value from any
YAML Document using a JSONPath selector and show it on a badge.
</p>`,
description,
parameters: queryParams(
{
name: 'url',

View File

@ -11,18 +11,17 @@ const queryParamSchema = Joi.object({
url: optionalUrl.required(),
}).required()
const description = `<p>
Using the endpoint badge, you can provide content for a badge through
a JSON endpoint. The content can be prerendered, or generated on the
fly. To strike a balance between responsiveness and bandwidth
utilization on one hand, and freshness on the other, cache behavior is
configurable, subject to the Shields minimum. The endpoint URL is
provided to Shields through the query string. Shields fetches it and
formats the badge.
</p>
<p>
The endpoint badge takes a single required query param: <code>url</code>, which is the URL to your JSON endpoint
</p>
const description = `
Using the endpoint badge, you can provide content for a badge through
a JSON endpoint. The content can be prerendered, or generated on the
fly. To strike a balance between responsiveness and bandwidth
utilization on one hand, and freshness on the other, cache behavior is
configurable, subject to the Shields minimum. The endpoint URL is
provided to Shields through the query string. Shields fetches it and
formats the badge.
The endpoint badge takes a single required query param: <code>url</code>, which is the URL to your JSON endpoint
<div>
<h2>Example JSON Endpoint Response</h2>
<code>&#123; "schemaVersion": 1, "label": "hello", "message": "sweet world", "color": "orange" &#125;</code>

View File

@ -21,8 +21,8 @@ const schema = Joi.object({
}).required()
const description = `${commonDocumentation}
<p>This badge shows the number of stargazers for a gist. Gist id is accepted as input and 'gist not found' is returned if the gist is not found for the given gist id.
</p>`
This badge shows the number of stargazers for a gist. Gist id is accepted as input and 'gist not found' is returned if the gist is not found for the given gist id.`
export default class GistStars extends GithubAuthV4Service {
static category = 'social'

View File

@ -12,8 +12,9 @@ import { documentation, httpErrorsFor } from './github-helpers.js'
const schema = Joi.object({ ahead_by: nonNegativeInteger }).required()
const latestDocs =
'<p>The <code>include_prereleases</code>, <code>sort</code> and <code>filter</code> params can be used to configure how we determine the latest version.</p>'
const latestDocs = `
The <code>include_prereleases</code>, <code>sort</code> and <code>filter</code> params can be used to configure how we determine the latest version.
`
export default class GithubCommitsSince extends GithubAuthV3Service {
static category = 'activity'

View File

@ -77,13 +77,13 @@ const queryParamSchema = Joi.object({
filter: Joi.string(),
}).required()
const filterDocs = `<p>
The <code>filter</code> param can be used to apply a filter to the
project's tag or release names before selecting the latest from the list.
Two constructs are available: <code>*</code> is a wildcard matching zero
or more characters, and if the pattern starts with a <code>!</code>,
the whole pattern is negated.
</p>`
const filterDocs = `
The <code>filter</code> param can be used to apply a filter to the
project's tag or release names before selecting the latest from the list.
Two constructs are available: <code>*</code> is a wildcard matching zero
or more characters, and if the pattern starts with a <code>!</code>,
the whole pattern is negated.
`
const openApiQueryParams = queryParams(
{

View File

@ -12,9 +12,9 @@ import {
const MAX_REPO_LIMIT = 200
const description = `${commonDocumentation}
<p>
<b>Note:</b> This badge takes into account up to <code>${MAX_REPO_LIMIT}</code> of the most starred repositories of given user / org.
</p>`
<b>Note:</b> This badge takes into account up to <code>${MAX_REPO_LIMIT}</code> of the most starred repositories of given user / org.
`
const affiliationsDescription = `This param accepts three values (must be UPPER case) <code>OWNER</code>, <code>COLLABORATOR</code>, <code>ORGANIZATION_MEMBER</code>.
One can pass comma separated combinations of these values (no spaces) e.g. <code>OWNER,COLLABORATOR</code> or <code>OWNER,COLLABORATOR,ORGANIZATION_MEMBER</code>.

View File

@ -21,9 +21,7 @@ const queryParamSchema = Joi.object({
}).required()
const refText = `
<p>
ref can be filled with the name of a branch, tag or revision range of the repository.
</p>
ref can be filled with the name of a branch, tag or revision range of the repository.
`
const lastCommitDescription = description + refText

View File

@ -18,9 +18,7 @@ const queryParamSchema = Joi.object({
}).required()
const more = `
<p>
<a href="https://docs.gitlab.com/ee/user/gitlab_com/index.html#pagination-response-headers">GitLab's API </a> only reports up to 10k Merge Requests, so badges for projects that have more than 10k will not have an exact count.
</p>
<a href="https://docs.gitlab.com/ee/user/gitlab_com/index.html#pagination-response-headers">GitLab's API </a> only reports up to 10k Merge Requests, so badges for projects that have more than 10k will not have an exact count.
`
const mergeRequestsDescription = description + more

View File

@ -22,25 +22,20 @@ const queryParamSchema = Joi.object({
}).required()
const moreDocs = `
<p>
Important: If your project is publicly visible, but the badge is like this:
<img src="https://img.shields.io/badge/coverage-not&nbsp;set&nbsp;up-red" alt="coverage not set up"/>
</p>
<p>
Check if your pipelines are publicly visible as well.<br />
Navigate to your project settings on GitLab and choose General Pipelines under CI/CD.<br />
Then tick the setting Public pipelines.
</p>
<p>
Now your settings should look like this:
</p>
Important: If your project is publicly visible, but the badge is like this:
<img src="https://img.shields.io/badge/coverage-not&nbsp;set&nbsp;up-red" alt="coverage not set up"/>
Check if your pipelines are publicly visible as well.<br />
Navigate to your project settings on GitLab and choose General Pipelines under CI/CD.<br />
Then tick the setting Public pipelines.
Now your settings should look like this:
<img src="https://user-images.githubusercontent.com/12065866/67156911-e225a180-f324-11e9-93ad-10aafbb3e69e.png" alt="Setting Public pipelines set"/>
<p>
Also make sure you have set up code covrage parsing as described <a href="https://docs.gitlab.com/ee/ci/pipelines/settings.html#test-coverage-parsing">here</a>
</p>
<p>
Your badge should be working fine now.
</p>
Your badge should be working fine now.
`
export default class GitlabPipelineCoverage extends BaseSvgScrapingService {

View File

@ -22,25 +22,20 @@ const queryParamSchema = Joi.object({
}).required()
const moreDocs = `
<p>
Important: You must use the Project Path, not the Project Id. Additionally, if your project is publicly visible, but the badge is like this:
<img src="https://img.shields.io/badge/build-not&nbsp;found-red" alt="build not found"/>
</p>
<p>
Check if your pipelines are publicly visible as well.<br />
Navigate to your project settings on GitLab and choose General Pipelines under CI/CD.<br />
Then tick the setting Public pipelines.
</p>
<p>
Now your settings should look like this:
</p>
Important: You must use the Project Path, not the Project Id. Additionally, if your project is publicly visible, but the badge is like this:
<img src="https://img.shields.io/badge/build-not&nbsp;found-red" alt="build not found"/>
Check if your pipelines are publicly visible as well.<br />
Navigate to your project settings on GitLab and choose General Pipelines under CI/CD.<br />
Then tick the setting Public pipelines.
Now your settings should look like this:
<img src="https://user-images.githubusercontent.com/12065866/67156911-e225a180-f324-11e9-93ad-10aafbb3e69e.png" alt="Setting Public pipelines set"/>
<p>
Your badge should be working fine now.
</p>
<p>
NB - The badge will display 'inaccessible' if the specified repo was not found on the target Gitlab instance.
</p>
Your badge should be working fine now.
NB - The badge will display 'inaccessible' if the specified repo was not found on the target Gitlab instance.
`
class GitlabPipelineStatus extends BaseSvgScrapingService {

View File

@ -89,14 +89,13 @@ const formatMap = {
}
const description = `
<p>
We support coverage metrics from a variety of Jenkins plugins:
<ul>
<li><a href="https://plugins.jenkins.io/jacoco">JaCoCo</a></li>
<li><a href="https://plugins.jenkins.io/cobertura">Cobertura</a></li>
<li>Any plugin which integrates with version 1 or 4+ of the <a href="https://plugins.jenkins.io/code-coverage-api">Code Coverage API</a> (e.g. llvm-cov, Cobertura 1.13+, etc.)</li>
</ul>
</p>
We support coverage metrics from a variety of Jenkins plugins:
<ul>
<li><a href="https://plugins.jenkins.io/jacoco">JaCoCo</a></li>
<li><a href="https://plugins.jenkins.io/cobertura">Cobertura</a></li>
<li>Any plugin which integrates with version 1 or 4+ of the <a href="https://plugins.jenkins.io/code-coverage-api">Code Coverage API</a> (e.g. llvm-cov, Cobertura 1.13+, etc.)</li>
</ul>
`
export default class JenkinsCoverage extends JenkinsBase {

View File

@ -8,23 +8,17 @@ import {
import { coveragePercentage } from '../color-formatters.js'
const description = `
<p>
<a href="https://localizely.com/" target="_blank">Localizely</a> is a management system for translation, localization, and internationalization of your projects.
<br/>
The <b>read-only</b> API token from the Localizely account is required to fetch necessary data.
<br/>
<br/>
<b>
Note: Do not use the default API token as it grants full read-write permissions to your projects. You will expose your project and allow malicious users to modify the translations at will.
<br/>
Instead, create a new one with only read permission.
</b>
<br/>
<br/>
You can find more details regarding API tokens under <a href="https://app.localizely.com/account" target="_blank">My profile</a> page.
<br/>
</p>
`
<a href="https://localizely.com/" target="_blank">Localizely</a> is a management system for translation, localization, and internationalization of your projects.
The <b>read-only</b> API token from the Localizely account is required to fetch necessary data.
<b>
Note: Do not use the default API token as it grants full read-write permissions to your projects. You will expose your project and allow malicious users to modify the translations at will.
Instead, create a new one with only read permission.
</b>
You can find more details regarding API tokens under <a href="https://app.localizely.com/account" target="_blank">My profile</a> page.
`
const schema = Joi.object({
strings: Joi.number().required(),

View File

@ -32,28 +32,26 @@ const matrixStateSchema = Joi.array()
.required()
const description = `
<p>
In order for this badge to work, the host of your room must allow guest accounts or dummy accounts to register, and the room must be world readable (chat history visible to anyone).
<br />
The following steps will show you how to setup the badge URL using the Element Matrix client.
<br />
<ul>
<li>Select the desired room inside the Element client</li>
<li>Click on the room settings button (gear icon) located near the top right of the client</li>
<li>Scroll to the very bottom of the settings page and look under the <code>Addresses</code> section</li>
<li>You should see one or more <code>room addresses (or aliases)</code>, which can be easily identified with their starting hash (<code>#</code>) character (ex: <code>#twim:matrix.org</code>)</li>
<li>If there is no address for this room, add one under <code>Local addresses for this room</code></li>
<li>Remove the starting hash character (<code>#</code>)</li>
<li>The final badge URL should look something like this <code>/matrix/twim:matrix.org.svg</code></li>
</ul>
<br />
Some Matrix homeservers don't hold a server name matching where they live (e.g. if the homeserver <code>example.com</code> that created the room alias <code>#mysuperroom:example.com</code> lives at <code>matrix.example.com</code>).
<br />
If that is the case of the homeserver that created the room alias used for generating the badge, you will need to add the server's FQDN (fully qualified domain name) as a query parameter.
<br />
The final badge URL should then look something like this <code>/matrix/mysuperroom:example.com.svg?server_fqdn=matrix.example.com</code>.
</p>
`
In order for this badge to work, the host of your room must allow guest accounts or dummy accounts to register, and the room must be world readable (chat history visible to anyone).
The following steps will show you how to setup the badge URL using the Element Matrix client.
<ul>
<li>Select the desired room inside the Element client</li>
<li>Click on the room settings button (gear icon) located near the top right of the client</li>
<li>Scroll to the very bottom of the settings page and look under the <code>Addresses</code> section</li>
<li>You should see one or more <code>room addresses (or aliases)</code>, which can be easily identified with their starting hash (<code>#</code>) character (ex: <code>#twim:matrix.org</code>)</li>
<li>If there is no address for this room, add one under <code>Local addresses for this room</code></li>
<li>Remove the starting hash character (<code>#</code>)</li>
<li>The final badge URL should look something like this <code>/matrix/twim:matrix.org.svg</code></li>
</ul>
Some Matrix homeservers don't hold a server name matching where they live (e.g. if the homeserver <code>example.com</code> that created the room alias <code>#mysuperroom:example.com</code> lives at <code>matrix.example.com</code>).
If that is the case of the homeserver that created the room alias used for generating the badge, you will need to add the server's FQDN (fully qualified domain name) as a query parameter.
The final badge URL should then look something like this <code>/matrix/mysuperroom:example.com.svg?server_fqdn=matrix.example.com</code>.
`
export default class Matrix extends BaseJsonService {
static category = 'chat'

View File

@ -3,9 +3,7 @@
// the file contains common constants for badges uses maven-metadata
export const description = `
<p>
<code>versionPrefix</code> and <code>versionSuffix</code> allow narrowing down
the range of versions the badge will take into account,
but they are completely optional.
</p>
`

View File

@ -69,20 +69,17 @@ const openApiQueryParams = queryParams(
{
name: 'queryOpt',
example: ':c=agent-apple-osx:p=tar.gz',
description: `<p>
Note that you can use query options with any Nexus badge type (Releases, Snapshots, or Repository).
</p>
<p>
Query options should be provided as key=value pairs separated by a colon.
</p>
<p>
Possible values:
<ul>
<li><a href="https://nexus.pentaho.org/swagger-ui/#/search/search">All Nexus 3 badges</a></li>
<li><a href="https://repository.sonatype.org/nexus-restlet1x-plugin/default/docs/path__artifact_maven_resolve.html">Nexus 2 Releases and Snapshots badges</a></li>
<li><a href="https://repository.sonatype.org/nexus-indexer-lucene-plugin/default/docs/path__lucene_search.html">Nexus 2 Repository badges</a></li>
</ul>
</p>
description: `
Note that you can use query options with any Nexus badge type (Releases, Snapshots, or Repository).
Query options should be provided as key=value pairs separated by a colon.
Possible values:
<ul>
<li><a href="https://nexus.pentaho.org/swagger-ui/#/search/search">All Nexus 3 badges</a></li>
<li><a href="https://repository.sonatype.org/nexus-restlet1x-plugin/default/docs/path__artifact_maven_resolve.html">Nexus 2 Releases and Snapshots badges</a></li>
<li><a href="https://repository.sonatype.org/nexus-indexer-lucene-plugin/default/docs/path__lucene_search.html">Nexus 2 Repository badges</a></li>
</ul>
`,
},
)

View File

@ -164,19 +164,19 @@ class BasePackagistService extends BaseJsonService {
}
}
const description = `<p>
<a href="https://packagist.org/">Packagist</a> is a registry for PHP packages which can be installed with Composer.
</p>`
const description = `
<a href="https://packagist.org/">Packagist</a> is a registry for PHP packages which can be installed with Composer.
`
const customServerDocumentationFragment = `<p>
Note that only network-accessible packagist.org and other self-hosted Packagist instances are supported.
</p>`
const customServerDocumentationFragment = `
Note that only network-accessible packagist.org and other self-hosted Packagist instances are supported.
`
const cacheDocumentationFragment = `<p>
Displayed data may be slightly outdated.
Due to performance reasons, data fetched from packagist JSON API is cached for twelve hours on packagist infrastructure.
For more information please refer to <a target="_blank" href="https://packagist.org/apidoc#get-package-data">official packagist documentation</a>.
</p>`
const cacheDocumentationFragment = `
Displayed data may be slightly outdated.
Due to performance reasons, data fetched from packagist JSON API is cached for twelve hours on packagist infrastructure.
For more information please refer to <a target="_blank" href="https://packagist.org/apidoc#get-package-data">official packagist documentation</a>.
`
export {
allVersionsSchema,

View File

@ -38,10 +38,8 @@ const frameworkNameMap = {
}
const description = `
<p>
This service currently support the following Frameworks: <br/>
${Object.values(frameworkNameMap).map(obj => ` <strong>${obj.name}</strong>`)}
</p>
This service currently support the following Frameworks: <br/>
${Object.values(frameworkNameMap).map(obj => ` <strong>${obj.name}</strong>`)}
`
export default class PypiFrameworkVersion extends PypiBase {
static category = 'platform-support'

View File

@ -41,14 +41,12 @@ const repoSchema = Joi.object({
})
const description = `
<p>
To use this badge, specify the ROS <a href="http://docs.ros.org">distribution</a>
(e.g. <code>noetic</code> or <code>humble</code>) and the package repository name
(in the case of single-package repos, this may be the same as the package name).
This badge determines which versions are part of an official ROS distribution by
fetching from the <a href="https://github.com/ros/rosdistro">rosdistro</a> YAML files,
at the tag corresponding to the latest release.
</p>
To use this badge, specify the ROS <a href="http://docs.ros.org">distribution</a>
(e.g. <code>noetic</code> or <code>humble</code>) and the package repository name
(in the case of single-package repos, this may be the same as the package name).
This badge determines which versions are part of an official ROS distribution by
fetching from the <a href="https://github.com/ros/rosdistro">rosdistro</a> YAML files,
at the tag corresponding to the latest release.
`
export default class RosVersion extends GithubAuthV4Service {

View File

@ -15,10 +15,10 @@ const colorMap = {
5: 'brightgreen',
}
const description = `<p>
const description = `
Note that the Fortify Security Rating badge will only work on Sonar instances that have the <a href='https://marketplace.microfocus.com/fortify/content/fortify-sonarqube-plugin'>Fortify SonarQube Plugin</a> installed.
The badge is not available for projects analyzed on SonarCloud.io
</p>
${documentation}
`

View File

@ -52,14 +52,12 @@ const queryParamWithFormatSchema = Joi.object({
format: Joi.string().allow('short', 'long').optional(),
}).required()
const documentation = `<p>
The Sonar badges will work with both SonarCloud.io and self-hosted SonarQube instances.
Just enter the correct protocol and path for your target Sonar deployment.
</p>
<p>
If you are targeting a legacy SonarQube instance that is version 5.3 or earlier, then be sure
to include the version query parameter with the value of your SonarQube version.
</p>
const documentation = `
The Sonar badges will work with both SonarCloud.io and self-hosted SonarQube instances.
Just enter the correct protocol and path for your target Sonar deployment.
If you are targeting a legacy SonarQube instance that is version 5.3 or earlier, then be sure
to include the version query parameter with the value of your SonarQube version.
`
export {

View File

@ -1,21 +1,22 @@
import { escapeFormat } from '../../core/badge-urls/path-helpers.js'
import { BaseStaticService } from '../index.js'
const description = `<p>
The static badge accepts a single required path parameter which encodes either:
</p>
const description = `
The static badge accepts a single required path parameter which encodes either:
<ul>
<li>
Label, message and color separated by a dash <code>-</code>. For example:<br />
<img alt="any text: you like" src="https://img.shields.io/badge/any_text-you_like-blue" /> -
<a href="https://img.shields.io/badge/any_text-you_like-blue">https://img.shields.io/badge/any_text-you_like-blue</a>
https://img.shields.io/badge/any_text-you_like-blue
</li>
<li>
Message and color only, separated by a dash <code>-</code>. For example:<br />
<img alt="just the message" src="https://img.shields.io/badge/just%20the%20message-8A2BE2" /> -
<a href="https://img.shields.io/badge/just%20the%20message-8A2BE2">https://img.shields.io/badge/just%20the%20message-8A2BE2</a>
https://img.shields.io/badge/just%20the%20message-8A2BE2
</li>
</ul>
<table>
<tbody>
<tr>
@ -36,9 +37,9 @@ const description = `<p>
</tr>
</tbody>
</table>
<p>
Hex, rgb, rgba, hsl, hsla and css named colors may be used.
</p>`
Hex, rgb, rgba, hsl, hsla and css named colors may be used.
`
export default class StaticBadge extends BaseStaticService {
static category = 'static'

View File

@ -7,15 +7,11 @@ import { NotFound, pathParams } from '../index.js'
import BaseSteamAPI from './steam-base.js'
const description = `
<p>
Using a web browser, you can find the ID in the url here:
</p>
Using a web browser, you can find the ID in the url here:
<img
src="https://user-images.githubusercontent.com/6497721/46358801-1bcb3200-c668-11e8-9963-931397853945.PNG"
alt="The ID is the number found right after ?id= in the URI" />
<p>
In the steam client you can simply just Right-Click and 'Copy Page URL' and follow the above step
</p>
In the steam client you can simply just Right-Click and 'Copy Page URL' and follow the above step
<img
src="https://user-images.githubusercontent.com/7288322/46567027-27c83400-c987-11e8-9850-ab67d987202f.png"
alt="Right-Click and 'Copy Page URL'" />

View File

@ -95,25 +95,17 @@ function renderTestResultBadge({
}
const documentation = `
<p>
You may change the "passed", "failed" and "skipped" text on this badge by supplying query parameters <code>&passed_label=</code>, <code>&failed_label=</code> and <code>&skipped_label=</code> respectively.
</p>
You may change the "passed", "failed" and "skipped" text on this badge by supplying query parameters <code>&passed_label=</code>, <code>&failed_label=</code> and <code>&skipped_label=</code> respectively.
<p>
For example, if you want to use a different terminology:
<br />
<code>?passed_label=good&failed_label=bad&skipped_label=n%2Fa</code>
</p>
For example, if you want to use a different terminology:
<p>
Or symbols:
<br />
<code>?compact_message&passed_label=💃&failed_label=🤦&skipped_label=🤷</code>
</p>
\`?passed_label=good&failed_label=bad&skipped_label=n%2Fa\`
<p>
There is also a <code>&compact_message</code> query parameter, which will default to displaying , and , separated by a horizontal bar |.
</p>
Or symbols:
\`?compact_message&passed_label=💃&failed_label=🤦‍♀️&skipped_label=🤷\`
There is also a <code>&compact_message</code> query parameter, which will default to displaying , and , separated by a horizontal bar |.
`
export {

View File

@ -9,41 +9,29 @@ const packageMetricsSchema = Joi.object({
})
const description = `
<p>
The Thunderstore badges require a package's <code>namespace</code> and <code>name</code>.
</p>
<p>
Everything can be discerned from your package's URL. Thunderstore package URLs have a mostly consistent
format:
</p>
<p>
<code>https://thunderstore.io/c/[community]/p/[namespace]/[packageName]</code>
</p>
<p>
For example: <code>https://thunderstore.io/c/lethal-company/p/notnotnotswipez/MoreCompany/</code>.
<ul>
<li><code>namespace = "notnotnotswipez"</code></li>
<li><code>packageName = "MoreCompany"</code></li>
</ul>
</p>
<details>
<summary>Risk Of Rain 2</summary>
<p>
The 'default community', Risk of Rain 2, has an alternative URL:
</p>
<p>
<code>https://thunderstore.io/package/[namespace]/[packageName]</code>
</p>
</details>
<details>
<summary>Subdomain Communities</summary>
<p>
Some communities use a 'subdomain' alternative URL, for example, Valheim:
</p>
<p>
<code>https://valheim.thunderstore.io/package/[namespace]/[packageName]</code>
</p>
</details>
The Thunderstore badges require a package's <code>namespace</code> and <code>name</code>.
Everything can be discerned from your package's URL. Thunderstore package URLs have a mostly consistent format:
<code>https://thunderstore.io/c/[community]/p/[namespace]/[packageName]</code>
For example: <code>https://thunderstore.io/c/lethal-company/p/notnotnotswipez/MoreCompany/</code>.
<ul>
<li><code>namespace = "notnotnotswipez"</code></li>
<li><code>packageName = "MoreCompany"</code></li>
</ul>
:::info[Risk Of Rain 2]
The 'default community', Risk of Rain 2, has an alternative URL:
<code>https://thunderstore.io/package/[namespace]/[packageName]</code>
:::
:::info[Subdomain Communities]
Some communities use a 'subdomain' alternative URL, for example, Valheim:
<code>https://valheim.thunderstore.io/package/[namespace]/[packageName]</code>
:::
`
/**

View File

@ -3,10 +3,8 @@ import { renderDownloadsBadge } from '../downloads.js'
import VisualStudioMarketplaceBase from './visual-studio-marketplace-base.js'
const description = `
<p>
This badge can show total installs, installs for Azure DevOps Services,
or on-premises installs for Azure DevOps Server.
</p>
This badge can show total installs, installs for Azure DevOps Services,
or on-premises installs for Azure DevOps Server.
`
// This service exists separately from the other Marketplace downloads badges (in ./visual-studio-marketplace-downloads.js)

View File

@ -3,12 +3,9 @@ import { renderDownloadsBadge } from '../downloads.js'
import VisualStudioMarketplaceBase from './visual-studio-marketplace-base.js'
const description = `
<p>
This is for Visual Studio and Visual Studio Code Extensions.
</p>
<p>
For correct results on Azure DevOps Extensions, use the Azure DevOps Installs badge instead.
</p>
This is for Visual Studio and Visual Studio Code Extensions.
For correct results on Azure DevOps Extensions, use the Azure DevOps Installs badge instead.
`
export default class VisualStudioMarketplaceDownloads extends VisualStudioMarketplaceBase {

View File

@ -77,20 +77,19 @@ const getSchema = preset => {
return schema.map(url => encodeURI(url)).join(' ')
}
const description = `<p>
The W3C validation badge performs validation of the HTML, SVG, MathML, ITS, RDFa Lite, XHTML documents.
The badge uses the type property of each message found in the messages from the validation results to determine to be an error or warning.
The rules are as follows:
<ul>
<li>info: These messages are counted as warnings</li>
<li>error: These messages are counted as errors</li>
<li>non-document-error: These messages are counted as errors</li>
</ul>
</p>
<p>
This badge relies on the <a target="_blank" href="https://validator.nu/">https://validator.nu/</a> service to perform the validation.
Please refer to <a target="_blank" href="https://about.validator.nu/">https://about.validator.nu/</a> for the full documentation and Terms of service.
</p>
const description = `
The W3C validation badge performs validation of the HTML, SVG, MathML, ITS, RDFa Lite, XHTML documents.
The badge uses the type property of each message found in the messages from the validation results to determine to be an error or warning.
The rules are as follows:
<ul>
<li>info: These messages are counted as warnings</li>
<li>error: These messages are counted as errors</li>
<li>non-document-error: These messages are counted as errors</li>
</ul>
This badge relies on the https://validator.nu/ service to perform the validation.
Please refer to https://about.validator.nu/ for the full documentation and Terms of service.
`
export { description, presetRegex, getColor, getMessage, getSchema }

View File

@ -3,26 +3,24 @@ import { renderDownloadsBadge } from '../downloads.js'
import { BaseJsonService, NotFound, pathParams } from '../index.js'
const description = `
<p>
<a href="https://wikiapiary.com">WikiApiary</a> holds information about MediaWiki websites.
</p>
<p>
The name of an extension is case-sensitive excluding the first character.
</p>
<p>
For example, in the case of <code>ParserFunctions</code>, the following are
valid:
<ul>
<li><code>ParserFunctions</code></li>
<li><code>parserFunctions</code></li>
</ul>
However, the following are invalid:
<ul>
<li><code>parserfunctions</code></li>
<li><code>Parserfunctions</code></li>
<li><code>pARSERfUNCTIONS</code></li>
</ul>
</p>
<a href="https://wikiapiary.com">WikiApiary</a> holds information about MediaWiki websites.
The name of an extension is case-sensitive excluding the first character.
For example, in the case of <code>ParserFunctions</code>, the following are valid:
<ul>
<li><code>ParserFunctions</code></li>
<li><code>parserFunctions</code></li>
</ul>
However, the following are invalid:
<ul>
<li><code>parserfunctions</code></li>
<li><code>Parserfunctions</code></li>
<li><code>pARSERfUNCTIONS</code></li>
</ul>
`
const schema = Joi.object({

View File

@ -86,10 +86,8 @@ export class BaseWordpress extends BaseJsonService {
}
export const description = `
<p>
These badges rely on an API that is no longer supported by Wordpress. You are
still free to use them, simply bear in mind that Shields.io cannot guarantee
that they'll keep on working in the future. Please also double-check the
provided slug, as an incorrect value may lead to unexpected results.
</p>
These badges rely on an API that is no longer supported by Wordpress. You are
still free to use them, simply bear in mind that Shields.io cannot guarantee
that they'll keep on working in the future. Please also double-check the
provided slug, as an incorrect value may lead to unexpected results.
`