Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gatsby-remark-embed-snippet): readme - add example sources #24874

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions packages/gatsby-remark-embed-snippet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,23 @@ You can specify specific lines for Prism to highlight using

**JavaScript example**:

````no-highlight
```jsx
import React from "react"
import ReactDOM from "react-dom"

const name = "Brian" // highlight-line

ReactDOM.render(
<div>
{/* highlight-range{1-3} */}
<h1>Hello, ${name}!</h1>
</div>,
document.getElementById("root")
)
```
````

```jsx
import React from "react"
import ReactDOM from "react-dom"
Expand All @@ -207,6 +224,20 @@ ReactDOM.render(

**CSS example**:

````no-highlight
```css
html {
/* highlight-range{1-2} */
height: 100%;
width: 100%;
}

* {
box-sizing: border-box; /* highlight-line */
}
```
````

```css
html {
/* highlight-range{1-2} */
Expand All @@ -222,6 +253,20 @@ html {
**HTML example**:

<!-- prettier-ignore-start -->
````no-highlight
```html
<html>
<body>
<h1>highlight me</h1> <!-- highlight-line -->
<p>
<!-- highlight-next-line -->
And me
</p>
</body>
</html>
```
````

```html
<html>
<body>
Expand All @@ -237,6 +282,16 @@ html {

**YAML example**:

````no-highlight
```yaml
foo: "highlighted" # highlight-line
bar: "not highlighted"
# highlight-range{1-2}
baz: "highlighted"
quz: "highlighted"
```
````

```yaml
foo: "highlighted" # highlight-line
bar: "not highlighted"
Expand Down