Skip to content

Commit 3173a07

Browse files
committed
Lay the quick start out as sections instead of tabs
Gradle, the command line and GitHub Actions are not alternatives: a project usually wants all three, and tabs hid two of them. They now follow each other under their own headings. Groovy and Kotlin stay as tabs, because there a reader really picks one.
1 parent 967e28d commit 3173a07

1 file changed

Lines changed: 33 additions & 33 deletions

File tree

‎docs/index.md‎

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -92,52 +92,52 @@ chain breaks into one call per line.
9292

9393
## Quick start
9494

95-
=== "Gradle"
95+
### In a Gradle build
9696

97-
=== "Groovy"
97+
=== "Groovy"
9898

99-
``` groovy title="build.gradle"
100-
plugins {
101-
id 'dev.openjavaformat.java-format' version '2.98.0.1'
102-
}
103-
```
99+
``` groovy title="build.gradle"
100+
plugins {
101+
id 'dev.openjavaformat.java-format' version '2.98.0.1'
102+
}
103+
```
104104

105-
=== "Kotlin"
105+
=== "Kotlin"
106106

107-
``` kotlin title="build.gradle.kts"
108-
plugins {
109-
id("dev.openjavaformat.java-format") version "2.98.0.1"
110-
}
111-
```
107+
``` kotlin title="build.gradle.kts"
108+
plugins {
109+
id("dev.openjavaformat.java-format") version "2.98.0.1"
110+
}
111+
```
112112

113-
The plugin configures IntelliJ IDEA to use the formatter and adds the `formatDiff` task, which
114-
formats only the lines you changed in git.
113+
The plugin configures IntelliJ IDEA to use the formatter and adds the `formatDiff` task, which
114+
formats only the lines you changed in git.
115115

116-
=== "Command line"
116+
### On the command line
117117

118-
Every [release](https://github.com/openjavaformat/open-java-format/releases/latest) carries
119-
native binaries for Linux and macOS, and a runnable jar for Java 21 or later.
118+
Every [release](https://github.com/openjavaformat/open-java-format/releases/latest) carries native
119+
binaries for Linux and macOS, and a runnable jar for Java 21 or later.
120120

121-
``` sh title="Format files in place"
122-
open-java-format --ojf --replace src/main/java/com/example/Hello.java
123-
```
121+
``` sh title="Format files in place"
122+
open-java-format --ojf --replace src/main/java/com/example/Hello.java
123+
```
124124

125-
``` sh title="Fail when anything is not formatted"
126-
open-java-format --ojf --dry-run --set-exit-if-changed $(git ls-files '*.java')
127-
```
125+
``` sh title="Fail when anything is not formatted"
126+
open-java-format --ojf --dry-run --set-exit-if-changed $(git ls-files '*.java')
127+
```
128128

129-
=== "GitHub Actions"
129+
### In CI with GitHub Actions
130130

131-
``` yaml title=".github/workflows/format.yml"
132-
- uses: actions/checkout@v7
131+
``` yaml title=".github/workflows/format.yml"
132+
- uses: actions/checkout@v7
133133

134-
- uses: openjavaformat/open-java-format-action@v1
135-
with:
136-
version: '2.98.0.1'
137-
```
134+
- uses: openjavaformat/open-java-format-action@v1
135+
with:
136+
version: '2.98.0.1'
137+
```
138138
139-
The [action](https://github.com/openjavaformat/open-java-format-action) downloads the native
140-
binary and fails the job when a changed file is not formatted. It needs no Java on the runner.
139+
The [action](https://github.com/openjavaformat/open-java-format-action) downloads the native binary
140+
and fails the job when a changed file is not formatted. It needs no Java on the runner.
141141
142142
## A drop-in for palantir-java-format
143143

0 commit comments

Comments
 (0)