Skip to content

Commit

Permalink
Use Standard style for JS examples in README
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrobertlloyd committed Dec 10, 2023
1 parent e4353b3 commit 2df50e9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ npm install @x-govuk/marked-govspeak
## Usage

```js
import { marked } from "marked";
import govspeak from "@x-govuk/marked-govspeak";
import { marked } from 'marked'
import govspeak from '@x-govuk/marked-govspeak'

marked.use(govspeak());
marked.use(govspeak())
```

When you call `marked`, the generated HTML will include the classes to style the Govspeak Markdown extensions. For example:

```js
marked("%This is a warning callout%");
marked('%This is a warning callout%')
```

will output:
Expand Down Expand Up @@ -59,14 +59,14 @@ The class names used also differ, each prefixed with `govspeak-`. Therefore a `g
If you wish to generate class names that match those from the Govspeak Ruby gem, you can pass the `govspeakGemCompatibility` option to marked. For example:

```js
import { marked } from "marked";
import govspeak from "@x-govuk/marked-govspeak";
import { marked } from 'marked'
import govspeak from '@x-govuk/marked-govspeak'

marked.use(govspeak({
govspeakGemCompatibility: true
}));
}))

marked("%This is a warning callout%");
marked('%This is a warning callout%')
```

will output:
Expand Down

0 comments on commit 2df50e9

Please sign in to comment.