Skip to content

Commit

Permalink
Document custom Markdown heading renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Dec 3, 2024
1 parent 43d82a4 commit 4e80297
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docs/digging-deeper/advanced-markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,38 @@ anything within the path label will be rendered as HTML. This means you can add
The filepaths are hidden on mobile devices using CSS to prevent them from overlapping with the code block.


## Heading Permalinks

Hyde automatically adds clickable permalink anchors to headings in documentation pages. When you hover over a heading, a `#` link appears that you can click to get a direct link to that section.

### Usage & Configuration

The feature is enabled by default for documentation pages. When enabled, Hyde will automatically add permalink anchors to headings between levels 2-4 (h2-h4). The permalinks are hidden by default and appear when hovering over the heading.


You can disable the feature, or enable it for other page types, in the `config/markdown.php` file.

```php
// filepath: config/markdown.php
'permalinks' => [
'enabled' => true,
'pages' => [
\Hyde\Pages\DocumentationPage::class,
],
],
```

### Advanced Customization

Under the hood, Hyde uses a custom Blade-based heading renderer when converting Markdown to HTML. This allows for more flexibility and customization compared to standard Markdown parsers. You can also publish and customize the Blade component used to render the headings:

```bash
php hyde publish:components
```

This will copy the `markdown-heading.blade.php` component to your views directory where you can modify its markup and behavior.


## Dynamic Markdown Links

HydePHP provides a powerful feature for automatically converting Markdown links to source files to the corresponding routes in the built site.
Expand Down

0 comments on commit 4e80297

Please sign in to comment.