Skip to content

Commit 9ba98f2

Browse files
committed
fix code blocks inside HTML <details> for GitHub Pages
1 parent 569746a commit 9ba98f2

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

README.md

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -14,56 +14,56 @@ run-if-changed is functional as-is, but it's still quite basic and rough as it h
1414
<details open>
1515
<summary><b>Install with npm</b></summary>
1616

17-
```shell
17+
<pre><code class="language-shell">
1818
npm install --save-dev husky @hkdobrev/run-if-changed
19-
```
19+
</code></pre>
2020

2121
##### Recommended setup:
2222

23-
```json
23+
<pre><code class="language-json">
2424
"run-if-changed": {
2525
"package-lock.json": "npm install --prefer-offline --no-audit"
2626
}
27-
```
27+
</code></pre>
2828
</details>
2929

3030
<details>
3131
<summary><b>Install with Yarn</b></summary>
3232

33-
```shell
33+
<pre><code class="language-shell">
3434
yarn add --dev husky @hkdobrev/run-if-changed
35-
```
35+
</code></pre>
3636

3737
##### Recommended setup:
3838

39-
```json
39+
<pre><code class="language-json">
4040
"run-if-changed": {
4141
"yarn.lock": "yarn install --prefer-offline --pure-lockfile --color=always"
4242
}
43-
```
43+
</code></pre>
4444
</details>
4545

4646
### Set up Git hooks
4747

4848
<details open>
49-
<summary><b>Using <a href="https://typicode.github.io/husky/">Husky</a></b></summary>
49+
<summary><b>Using <a href="https://typicode.github.io/husky/"><code>husky</code></a></b></summary>
5050

51-
```shell
51+
<pre><code class="language-shell">
5252
echo "npm run run-if-changed" > .husky/post-commit
5353
echo "npm run run-if-changed" > .husky/post-checkout
5454
echo "npm run run-if-changed" > .husky/post-merge
5555
echo "npm run run-if-changed" > .husky/post-rewrite
56-
```
56+
</code></pre>
5757

5858
<details>
59-
<summary><b>Pure Git hooks</b></summary>
59+
<summary><b>Just git hooks</b></summary>
6060

61-
```shell
61+
<pre><code class="language-shell">
6262
echo "npm run run-if-changed" >> .git/hooks/post-commit && chmod +x .git/hooks/post-commit
6363
echo "npm run run-if-changed" >> .git/hooks/post-checkout && chmod +x .git/hooks/post-checkout
6464
echo "npm run run-if-changed" >> .git/hooks/post-merge && chmod +x .git/hooks/post-merge
6565
echo "npm run run-if-changed" >> .git/hooks/post-rewrite && chmod +x .git/hooks/post-rewrite
66-
```
66+
</code></pre>
6767

6868
</details>
6969

@@ -89,13 +89,13 @@ Supported are any executables installed locally or globally via `npm` or Yarn as
8989

9090
> Using globally installed scripts is discouraged, since run-if-changed may not work for someone who doesn't have it installed.
9191
92-
`run-if-changed` is using [execa](https://github.com/sindresorhus/execa) to locate locally installed scripts and run them. So in your `.run-if-changedrc` you can just write and it would use the local version:
92+
`run-if-changed` is using [`execa`](https://github.com/sindresorhus/execa) to locate locally installed scripts and run them. So in your `.run-if-changedrc` you can just write and it would use the local version:
9393

94-
```json
94+
<pre><code class="language-json">
9595
{
9696
"src": "webpack"
9797
}
98-
```
98+
</code></pre>
9999

100100
Sequences of commands are supported. Pass an array of commands instead of a single one and they will run sequentially.
101101

@@ -110,76 +110,76 @@ Here's example configuration of `run-if-changed`:
110110
<details open>
111111
<summary><b>npm</b></summary>
112112

113-
`package.json`:
113+
<code>package.json</code>:
114114

115-
```json
115+
<pre><code class="language-json">
116116
{
117117
"run-if-changed": {
118118
"package-lock.json": "npm install --prefer-offline --no-audit"
119119
}
120120
}
121-
```
121+
</code></pre>
122122

123123
`.run-if-changedrc`:
124124

125-
```json
125+
<pre><code class="language-json">
126126
{
127127
"package-lock.json": "npm install --prefer-offline --no-audit"
128128
}
129-
```
129+
</code></pre>
130130

131131
</details>
132132

133133
<details>
134134
<summary><b>Yarn</b></summary>
135135

136-
`package.json`:
136+
<code>package.json</code>:
137137

138-
```json
138+
<pre><code class="language-json">
139139
{
140140
"run-if-changed": {
141141
"yarn.lock": "yarn install --prefer-offline --pure-lockfile --color=always"
142142
}
143143
}
144-
```
144+
</code></pre>
145145

146-
`.run-if-changedrc`:
146+
<code>.run-if-changedrc</code>:
147147

148-
```json
148+
<pre><code class="language-json">
149149
{
150150
"yarn.lock": "yarn install --prefer-offline --pure-lockfile --color=always"
151151
}
152-
```
152+
</code></pre>
153153

154154
</details>
155155

156156
<details>
157157
<summary><b>Composer</b></summary>
158158

159-
`package.json`:
159+
<code>package.json</code>:
160160

161-
```json
161+
<pre><code class="language-json">
162162
{
163163
"run-if-changed": {
164164
"composer.lock": "composer install --ignore-platform-reqs --ansi"
165165
}
166166
}
167-
```
167+
</code></pre>
168168

169169
</details>
170170

171171
<details>
172172
<summary><b>Bundler</b></summary>
173173

174-
`package.json`:
174+
<code>package.json</code>:
175175

176-
```json
176+
<pre><code class="language-json">
177177
{
178178
"run-if-changed": {
179179
"Gemfile.lock": "bundle install"
180180
}
181181
}
182-
```
182+
</code></pre>
183183

184184
</details>
185185

@@ -190,15 +190,15 @@ If you keep database migrations in your repository, you'd usually want to run th
190190
<details>
191191
<summary>Example of running Doctrine migrations when pulling or changing branches</summary>
192192

193-
`package.json`:
193+
<code>package.json</code>:
194194

195-
```json
195+
<pre><code class="language-json">
196196
{
197197
"run-if-changed": {
198198
"migrations": "./console db:migrate --allow-no-migration --no-interaction"
199199
}
200200
}
201-
```
201+
</code></pre>
202202

203203
</details>
204204

@@ -207,14 +207,14 @@ If you keep database migrations in your repository, you'd usually want to run th
207207
<details>
208208
<summary>Example for running build on changing src folder when pulling or changing branches</summary>
209209

210-
`package.json`:
210+
<code>package.json</code>:
211211

212-
```json
212+
<pre><code class="language-json">
213213
{
214214
"run-if-changed": {
215215
"src": "npm run build"
216216
}
217217
}
218-
```
218+
</code></pre>
219219

220220
</details>

0 commit comments

Comments
 (0)