Skip to content

Commit 592801b

Browse files
mueschaAisha Blake
andauthored
fix(gatsby-remark-embed-snippet): readme - add example sources (#24874)
* add example sources * Wrap full code blocks in no-highlight blocks Co-authored-by: Aisha Blake <aisha@gatsbyjs.com>
1 parent bed5dc4 commit 592801b

File tree

1 file changed

+55
-0
lines changed
  • packages/gatsby-remark-embed-snippet

1 file changed

+55
-0
lines changed

packages/gatsby-remark-embed-snippet/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,23 @@ You can specify specific lines for Prism to highlight using
190190

191191
**JavaScript example**:
192192

193+
````no-highlight
194+
```jsx
195+
import React from "react"
196+
import ReactDOM from "react-dom"
197+
198+
const name = "Brian" // highlight-line
199+
200+
ReactDOM.render(
201+
<div>
202+
{/* highlight-range{1-3} */}
203+
<h1>Hello, ${name}!</h1>
204+
</div>,
205+
document.getElementById("root")
206+
)
207+
```
208+
````
209+
193210
```jsx
194211
import React from "react"
195212
import ReactDOM from "react-dom"
@@ -207,6 +224,20 @@ ReactDOM.render(
207224

208225
**CSS example**:
209226

227+
````no-highlight
228+
```css
229+
html {
230+
/* highlight-range{1-2} */
231+
height: 100%;
232+
width: 100%;
233+
}
234+
235+
* {
236+
box-sizing: border-box; /* highlight-line */
237+
}
238+
```
239+
````
240+
210241
```css
211242
html {
212243
/* highlight-range{1-2} */
@@ -222,6 +253,20 @@ html {
222253
**HTML example**:
223254

224255
<!-- prettier-ignore-start -->
256+
````no-highlight
257+
```html
258+
<html>
259+
<body>
260+
<h1>highlight me</h1> <!-- highlight-line -->
261+
<p>
262+
<!-- highlight-next-line -->
263+
And me
264+
</p>
265+
</body>
266+
</html>
267+
```
268+
````
269+
225270
```html
226271
<html>
227272
<body>
@@ -237,6 +282,16 @@ html {
237282

238283
**YAML example**:
239284

285+
````no-highlight
286+
```yaml
287+
foo: "highlighted" # highlight-line
288+
bar: "not highlighted"
289+
# highlight-range{1-2}
290+
baz: "highlighted"
291+
quz: "highlighted"
292+
```
293+
````
294+
240295
```yaml
241296
foo: "highlighted" # highlight-line
242297
bar: "not highlighted"

0 commit comments

Comments
 (0)