Closed uncenter closed 1 year ago
Sorry for my late response, I took a break from coding.
Good idea to add a copy button. The button can be added when processing the markdown content (via markdown-it) to reduce client-side JS and the copy action can be handled using Alpine.
Sorry for my late response, I took a break from coding.
Good idea to add a copy button. The button can be added when processing the markdown content (via markdown-it) to reduce client-side JS and the copy action can be handled using Alpine.
Sounds good!
I was a little worried I would have trouble updating because of my customizations but it worked perfectly! Well thought out solution, looks great. Thank you!
Thanks, glad you like it 👍
I added this as just a script to my own Eleventy Notes instance a while back, see: https://github.com/uncenter/learn-eleventy/commit/6ab3da21c882922731f0d41521c9c935e98ba132
Probably not the best approach, I'm curious as to what you come up with. Since the script is in a template, we could use the existing shortcode for adding SVGs instead of manually having those SVG strings. The buttons are designed after GitHub's buttons in Markdown files, and I think it works quite well (though it can be hard to see in light mode?).