Skip to content

Commit

Permalink
docs: use titles for more code blocks (#25526)
Browse files Browse the repository at this point in the history
  • Loading branch information
HonkingGoose committed Nov 2, 2023
1 parent 36504a3 commit b583229
Show file tree
Hide file tree
Showing 18 changed files with 66 additions and 134 deletions.
19 changes: 6 additions & 13 deletions docs/usage/bazel.md
Expand Up @@ -36,16 +36,12 @@ Renovate:
In this example, there is a `.bazelrc` file which imports another file called `.registry.bazelrc`.
Both files have `--registry` values:

```
# -------------
# .bazelrc File
# -------------
```title=".bazelrc"
import .registry.bazelrc
build --registry=https://raw.githubusercontent.com/bazelbuild/bazel-central-registry/main
```

# ----------------------
# .registry.bazelrc File
# ----------------------
```title=".registry.bazelrc"
build --registry=https://example.com/custom_registry
```

Expand All @@ -58,10 +54,7 @@ The final registry list is:

In this example, a `.bazelrc` file has registry values with and without a configuration:

```
# -------------
# .bazelrc File
# -------------
```title=".bazelrc"
build:ci --registry=https://internal.server/custom_registry
build --registry=https://raw.githubusercontent.com/bazelbuild/bazel-central-registry/main
```
Expand Down Expand Up @@ -164,8 +157,8 @@ Renovate extracts dependencies from the following repository rules:
- `http_archive`
- `http_file`

It also recognizes when these repository rule names are prefixed with an
underscore. For example, `_http_archive` is treated the same as `http_archive`.
It also recognizes when these repository rule names are prefixed with an underscore.
For example, `_http_archive` is treated the same as `http_archive`.

### `git_repository`

Expand Down
56 changes: 17 additions & 39 deletions docs/usage/configuration-options.md
Expand Up @@ -727,9 +727,8 @@ Each provided `matchString` will be matched individually to the content of the `
If a `matchString` has multiple matches in a file each will be interpreted as an independent dependency.

As example the following configuration will update all three lines in the Dockerfile.
renovate.json:

```json
```json title="renovate.json"
{
"customManagers": [
{
Expand All @@ -746,9 +745,7 @@ renovate.json:
}
```

A Dockerfile:

```dockerfile
```dockerfile title="Dockerfile"
FROM amd64/ubuntu:18.04
ENV GRADLE_VERSION=6.2 # gradle-version/gradle&versioning=maven
ENV NODE_VERSION=10.19.0 # github-tags/nodejs/node&versioning=node
Expand All @@ -769,9 +766,7 @@ This is an example how this can work.
The first custom manager will only upgrade `grafana/loki` as looks for the `backup` key then looks for the `test` key and then uses this result for extraction of necessary attributes.
But the second custom manager will upgrade both definitions as its first `matchStrings` matches both `test` keys.

renovate.json:

```json
```json title="renovate.json"
{
"customManagers": [
{
Expand All @@ -798,9 +793,7 @@ renovate.json:
}
```

example.json:

```json
```json title="example.json"
{
"backup": {
"test": {
Expand Down Expand Up @@ -829,9 +822,7 @@ To update multiple dependencies with `combination` you must define multiple cust

Matched group values will be merged to form a single dependency.

renovate.json:

```json
```json title="renovate.json"
{
"customManagers": [
{
Expand All @@ -857,9 +848,7 @@ renovate.json:
}
```

Ansible variable file (YAML):

```yaml
```yaml title="Ansible variable file (YAML)"
prometheus_image: "prom/prometheus" // a comment
prometheus_version: "v2.21.0" // a comment
------
Expand Down Expand Up @@ -916,16 +905,12 @@ Allows overwriting how the matched string is replaced.
This allows for some migration strategies.
E.g. moving from one Docker image repository to another one.

`helm-values.yaml`:

```yaml
```yaml title="helm-values.yaml"
# The image of the service <registry>/<repo>/<image>:<tag>
image: my.old.registry/aRepository/andImage:1.18-alpine
```

The regex definition:

```json
```json title="The regex definition"
{
"customManagers": [
{
Expand Down Expand Up @@ -1630,7 +1615,7 @@ For example to also skip 404 responses then configure the following:
Use this field to configure Renovate to abort runs for custom hosts.
By default, Renovate will only abort for known public hosts, which has the downside that transient errors for other hosts can cause autoclosing of PRs.

To abort Renovate runs for http failures from _any_ host:
To abort Renovate runs for HTTP failures from _any_ host:

```json
{
Expand Down Expand Up @@ -1769,7 +1754,7 @@ You usually don't need to configure it in a host rule if you have already config

### insecureRegistry

Enable this option to allow Renovate to connect to an [insecure Docker registry](https://docs.docker.com/registry/insecure/) that is http only.
Enable this option to allow Renovate to connect to an [insecure Docker registry](https://docs.docker.com/registry/insecure/) that is HTTP only.
This is insecure and is not recommended.

Example:
Expand Down Expand Up @@ -2764,9 +2749,7 @@ For example to apply a special label to `major` updates:
This configuration option needs a Mend API key, and is in private beta testing only.
API keys are not available for free or via the `renovatebot/renovate` repository.

For example to group high merge confidence updates:

```json
```json title="Grouping high merge confidence updates"
{
"packageRules": [
{
Expand Down Expand Up @@ -2797,9 +2780,7 @@ Source URLs are necessary in order to look up release notes.

Using this field we can specify the exact URL to fetch release notes from.

Example setting source URL for package "dummy":

```json
```json title="Setting the source URL for the dummy package"
{
"packageRules": [
{
Expand Down Expand Up @@ -3447,9 +3428,7 @@ i.e. Renovate will run on the repository around the clock.
The easiest way to define a schedule is to use a preset if one of them fits your requirements.
See [Schedule presets](https://docs.renovatebot.com/presets-schedule/) for details and feel free to request a new one in the source repository if you think it would help others.

Otherwise, here are some text schedules that are known to work:

```
```title="Some text schedules that are known to work"
every weekend
before 5:00am
after 10pm and before 5:00am
Expand Down Expand Up @@ -3576,7 +3555,7 @@ You can set your own label name with the `"stopUpdatingLabel"` field:
## suppressNotifications

Use this field to suppress various types of warnings and other notifications from Renovate.
Example:
For example:

```json
{
Expand Down Expand Up @@ -3642,7 +3621,7 @@ You can edit these user-facing strings:
- `ignoreOther`: Text of the PR comment for other (neither digest nor major) upgrades.
- `ignoreTopic`: Topic of the PR comment.

Example:
For example:

```json
{
Expand Down Expand Up @@ -3723,9 +3702,8 @@ Follow these steps:
Once the above conditions are met, and you got one or more vulnerability alerts from GitHub for this repository, then Renovate tries to raise fix PRs.

You may use the `vulnerabilityAlerts` configuration object to customize vulnerability-fix PRs.
For example, to set a custom label and assignee:

```json
```json title="Setting a custom label and assignee"
{
"vulnerabilityAlerts": {
"labels": ["security"],
Expand All @@ -3748,7 +3726,7 @@ For example, to set a custom label and assignee:

To disable the vulnerability alerts feature, set `enabled=false` in a `vulnerabilityAlerts` config object, like this:

```json
```json title="Disabling vulnerability alerts"
{
"vulnerabilityAlerts": {
"enabled": false
Expand Down
5 changes: 2 additions & 3 deletions docs/usage/docker.md
Expand Up @@ -51,9 +51,8 @@ You could then use this `packageRules` array, to tell Renovate to use `semver` v
```

Another example is the official `python` image, which follows `pep440` versioning.
You can tell Renovate to use the `pep440` versioning scheme with this set of `packageRules`:

```json
```json title="Telling Renovate to use the pep440 versioning scheme"
{
"packageRules": [
{
Expand Down Expand Up @@ -202,7 +201,7 @@ We will explain how to authenticate for the most common registries.
Here is an example of configuring a default Docker username/password in `config.js`.
The Docker Hub password is stored in a process environment variable.

```js
```js title="config.js"
module.exports = {
hostRules: [
{
Expand Down
20 changes: 8 additions & 12 deletions docs/usage/examples/self-hosting.md
Expand Up @@ -21,9 +21,8 @@ The same goes for any other third-party binary tool like `gradle` or `poetry` -

Renovate is available for Docker via an automated build at [`renovate/renovate` on Docker Hub](https://hub.docker.com/r/renovate/renovate/).
It builds `latest` based on the `main` branch and all SemVer tags are published too.
For example, all the following are valid tags:

```sh
```sh title="Example of valid tags"
docker run --rm renovate/renovate
docker run --rm renovate/renovate:35
docker run --rm renovate/renovate:35.14
Expand All @@ -46,9 +45,8 @@ docker run --rm -v "/path/to/your/config.js:/usr/src/app/config.js" renovate/ren

Renovate's official Docker image is compatible with Kubernetes.
The following is an example manifest of running Renovate against a GitHub Enterprise server.
First the Kubernetes manifest:

```yaml
```yaml title="Kubernetes manifest"
apiVersion: batch/v1
kind: CronJob
metadata:
Expand Down Expand Up @@ -79,7 +77,7 @@ spec:

And the `secret.yaml` that goes with it:

```yaml
```yaml title="secret.yaml"
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -97,7 +95,7 @@ stringData:

A `config.json` file can be added to the manifest using a `ConfigMap` as shown in the following example (using a "dry run" in github.com):

```yaml
```yaml title="Adding a config.json file to the manifest with configMap"
---
apiVersion: v1
kind: ConfigMap
Expand Down Expand Up @@ -261,10 +259,9 @@ If you're running against GitHub Enterprise Server, then change the `gitlab` val

You can save this file as anything you want and then use the `RENOVATE_CONFIG_FILE` environment variable to tell Renovate where to find it.

Most people use cron to schedule when Renovate runs, usually on an hourly schedule.
Here's an example Bash script that you can point `cron` to:
Most people use `cron` to schedule when Renovate runs, usually on an hourly schedule.

```sh
```sh title="Example bash script that you can point cron to"
#!/bin/bash

export PATH="/home/user/.yarn/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH"
Expand All @@ -277,7 +274,7 @@ renovate
```

Save the script file, and run the script manually.
Only add the script to cron after you checked it works.
Only add the script to `cron` after you checked it works.

<!-- prettier-ignore -->
!!! note
Expand Down Expand Up @@ -428,9 +425,8 @@ On Ubuntu/Debian and many Linux-based systems, this can be done by copying the s
### Renovate Docker image

If you're using the official [Renovate Docker image](#docker) then we recommend you add the self-signed certificate and build your own modified Docker image.
For example, the following `Dockerfile` is set up to use a self-signed certificate:

```dockerfile
```dockerfile title="Example of a Dockerfile that uses a self-signed certificate"
FROM renovate/renovate

# Changes to the certificate authority require root permissions
Expand Down
8 changes: 2 additions & 6 deletions docs/usage/faq.md
Expand Up @@ -81,9 +81,7 @@ Use the "Dependency Dashboard approval" workflow to get updates for certain pack

The basic idea is that you create a new `packageRules` entry and describe what kind of package, or type of updates you want to approve beforehand.

Say you want to manually approve all major `npm` package manager updates:

```json
```json title="Manually approve all major npm package manager updates"
{
"packageRules": [
{
Expand All @@ -95,9 +93,7 @@ Say you want to manually approve all major `npm` package manager updates:
}
```

Or say you want to manually approve all major Jest updates:

```json
```json title="Manually approve all major Jest updates"
{
"packageRules": [
{
Expand Down
6 changes: 2 additions & 4 deletions docs/usage/getting-started/private-packages.md
Expand Up @@ -67,9 +67,7 @@ In addition to the above options to match against a host, you need to add the cr
Typically they are either `token`, or `username` + `password`.
Other credential terms are not supported yet.

Here is an example of some host rules:

```json
```json title="Example host rules"
{
"hostRules": [
{
Expand Down Expand Up @@ -210,7 +208,7 @@ The environment variables used are: `GIT_CONFIG_KEY_0=url.https://${token}@githu
Maybe you're running your own ChartMuseum server to host your private Helm Charts.
This is how you connect to a private Helm repository:

```js
```js title="Connecting to a private Helm repository"
module.exports = {
hostRules: [
{
Expand Down
3 changes: 1 addition & 2 deletions docs/usage/golang.md
Expand Up @@ -66,9 +66,8 @@ Renovate will commit all files changed within the `vendor/` folder.
By default, Renovate will keep up with the latest version of the `go` binary.

You can force Renovate to use a specific version of Go by setting a constraint.
As an example, say you want Renovate to use the latest patch version of the `1.16` Go binary, you'd put this in your Renovate config:

```json
```json title="Getting Renovate to use the latest patch version of the 1.16 Go binary"
{
"constraints": {
"go": "1.16"
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/java.md
Expand Up @@ -106,7 +106,7 @@ Renovate can be configured to access more repositories and access repositories a
This example shows how you can use a `config.js` file to configure Renovate for use with Artifactory.
We're using environment variables to pass the Artifactory username and password to Renovate bot.

```js
```js title="config.js"
module.exports = {
hostRules: [
{
Expand Down

0 comments on commit b583229

Please sign in to comment.