1

I am using the laravel markdown extension https://github.com/GrahamCampbell/Laravel-Markdown

It is a wrapper for https://github.com/thephpleague/commonmark

Does anyone know what this would be called, or how do I enable the ability to add ids manually in markdown?

I came across this article, but the curly brackets don't work. https://uhded.com/add-id-header-markdown

# Header Exmaple {#header-example}

I want to add the anchor IDs to navigation to link to various sections of the documentation.

Any help or guidance on how I can go about making this would be much appreciated.

Jakub
  • 1,260
  • 1
  • 13
  • 40
  • 1
    it seems its already implemented. https://github.com/thephpleague/commonmark/pull/420/commits/f7308a32d1ea6e90917f0a6c7db194d2f08c0427 - no need for your curly bois – Michael Mano Mar 15 '22 at 23:45
  • Ooh thanks for that, will need to mess around some more try to figure out why it doesn't work with the package i installed. – Jakub Mar 16 '22 at 00:38

1 Answers1

2

I just learned that this was something you need to enable in commonmark

https://commonmark.thephpleague.com/2.2/extensions/attributes/

You need to go to markdown.php file and add the attributes class

    'extensions' => [
        League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension::class,
        League\CommonMark\Extension\Table\TableExtension::class,
        League\CommonMark\Extension\Autolink\AutolinkExtension::class,
        Torchlight\Commonmark\V2\TorchlightExtension::class,
        League\CommonMark\Extension\ExternalLink\ExternalLinkExtension::class,
        League\CommonMark\Extension\TaskList\TaskListExtension::class,
        // attributes extension 
        League\CommonMark\Extension\Attributes\AttributesExtension::class,
    ],
Jakub
  • 1,260
  • 1
  • 13
  • 40