Skip to content

Commit

Permalink
feat(docs): update usage examples
Browse files Browse the repository at this point in the history
  • Loading branch information
naiyerasif committed Apr 17, 2024
1 parent 284489c commit a56a3bf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ In browsers, with [esm.sh](https://esm.sh/):
Say, you have the following code fence

```
```js {1} {3, 7} {9..11, 88} {90, 101..112} textColor='--text-default' syntax_theme="nord" css=`{ *: { display: none }}`
```js {1} {3, 7} {9..11, 88} {90, 101..112} text-color='--text-default' syntax_theme="nord" css=`{ *: { display: none }}`
```

[remark](https://github.com/remarkjs/remark) will provide the `meta` and `lang` for the above code fence.

```json
{
"lang": "js",
"meta": "{1} {3, 7} {9..11, 88} {90, 101..112} textColor='--text-default' syntax_theme=\"nord\" css=`{ *: { display: none }}`"
"meta": "{1} {3, 7} {9..11, 88} {90, 101..112} text-color='--text-default' syntax_theme=\"nord\" css=`{ *: { display: none }}`"
}
```

Expand All @@ -75,14 +75,14 @@ Use the `fenceparser` to parse the `meta` as follows.
import FenceParser from "@microflash/fenceparser";

const parser = new FenceParser();
console.log(parser.parse("{1} {3, 7} {9..11, 88} {90, 101..112} textColor='--text-default' syntax_theme=\"nord\" css=`{ *: { display: none }}`"));
console.log(parser.parse("{1} {3, 7} {9..11, 88} {90, 101..112} text-color='--text-default' syntax_theme=\"nord\" css=`{ *: { display: none }}`"));
```

Running the above example yields.

```js
{
textColor: '--text-default',
'text-color': '--text-default',
syntax_theme: 'nord',
css: '{ *: { display: none }}',
highlight: [
Expand Down Expand Up @@ -195,14 +195,14 @@ Running the above example yields.
import FenceParser from "@microflash/fenceparser";

const parser = new FenceParser();
console.log(parse("dataTheme='synthwave' callback=`(code) => copyToClipboard(code)`"));
console.log(parse("data-theme='synthwave' callback=`(code) => copyToClipboard(code)`"));
```

Running the above example yields.

```js
{
dataTheme: 'synthwave',
'data-theme': 'synthwave',
callback: '(code) => copyToClipboard(code)',
}
```
Expand Down

0 comments on commit a56a3bf

Please sign in to comment.