Anchor - My very first yellow extension
· 1 min · ¶
I was eager to incorporate those stylish „hashtags“ that offer a permalink to each section when hovering over the headings, so I embarked on a quest to discover an elegant way to create them.
The problem
Sure, you can create with markdown like this:
## Nice headline [#](#nice-headline) {#nice-headline}
However, that felt a bit complicated for me, as I don’t have the markdown syntax memorized. So, I initially inquired in the community[1] if there was a solution for Yellow. Since patience isn’t one of my strong suits, I continued my search and stumbled upon a helpful online guide[2]. I adapted the instructions from there and successfully implemented it.
The solution
Up until that point, I was content with my solution. Considering the narrow layout of this page and thinking about mobile users, I opted for using links behind the headlines. While I only discovered anchor.js later, it turned out to be a blessing in disguise. Shortly after I shared my solution on GitHub, Mark came up with this statement:
„First make it work, then make it better :grinning:“
With that, he had me hooked, albeit subconsciously. Following that moment, it took me nearly two days before I felt ready to attempt my first extension for Yellow. And here it is: yellow-anchor
I’m somewhat proud of it, although I’m aware that there might be more elegant solutions.