Skip to content

Commit

Permalink
chore: update docs & fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Oct 13, 2022
1 parent 6b1a778 commit 5d4bae0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 26 deletions.
45 changes: 20 additions & 25 deletions docs/content/4.api/3.configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,7 @@ Whether MDC syntax should be supported or not.
### `toc`

- Type: `Object`{lang=ts}
- Default
```ts
{
depth: 2,
searchDepth: 2
}
```
- Default: `{ depth: 2, searchDepth: 2 }`{lang="ts"}

Control behavior of Table of Contents generation.

Expand All @@ -194,6 +188,25 @@ export default defineNuxtConfig({
})
```

### `anchorLinks`

- Type: `Boolean | Object`{lang=ts}
- Default: `{depth: 4, exclude: [1]}`{lang=ts}

By default Content module generates anchor links for `h2`, `h3` and `h4` heading. Using this option you can control link generation.

`false`{lang=ts} will disable link generation.

`true`{lang=ts} will enable link generation for all headings.

**options**

| Option | Type | Description |
| ------- | :--------: | :------------------------------------------------------- |
| depth | `number` | Sets the maximal depth for anchor link generation. |
| exclude | `number[]` | A list of which headings to exclude from link generation |


## `highlight`

- Type: `false | Object`{lang=ts}
Expand Down Expand Up @@ -334,21 +347,3 @@ Toggles the document-driven mode.
| `globals` | `Object \| Boolean` | A list of globals to be made available globally. |
| `layoutFallbacks` | `string[]` | A list of `globals` key to use to find a layout fallback. |
| `injectPage` | `boolean` | Inject `[...slug].vue` pre-configured page |

## `anchorLinks`

- Type: `Boolean | Object`{lang=ts}
- Default: `{depth: 4, exclude: [1]}`{lang=ts}

Sets if anchor links are generated with the headings.

`false`{lang=ts} will disable link generation.

`true`{lang=ts} will enable link generation for all headings.

### `anchorLinks` options

| Option | Type | Description |
| ------- | :--------: | :------------------------------------------------------- |
| depth | `number` | Sets the maximal depth for anchor link generation. |
| exclude | `number[]` | A list of which headings to exclude from link generation |
2 changes: 1 addition & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ export default defineNuxtModule<ModuleOptions>({
// Document-driven configuration
documentDriven: options.documentDriven as ModuleOptions['documentDriven'],
// Anchor link generation config
anchorLinks: options.markdown.anchorLinks as ModuleOptions['markdown.anchorLinks']
anchorLinks: options.markdown.anchorLinks
})

// Context will use in server
Expand Down

0 comments on commit 5d4bae0

Please sign in to comment.