I notice that when I export an MD document that has code blocks to HTML the following element appears right next to the closing of the
I was under the assumption that this was added by the Pandoc plugin that I use to export as HTML. I had posted a question asking for help with this plugin but then while I was doing some research to solve that problem I found this: https://github.com/superDuperCyberTechno/obsidian-code-copy.
If you notice, it clearly says the following: " This functionality is now built into Obsidian itself so this repo is considered out-of-date". By “this functionality” it seems clear that what is meant is the possibility of adding a button to code blocks to copy the code within.
-H /CSS_JS/MyJS.js in the field called Extra Pandoc arguments provided in the configuration for the plugin. This is the path to the folder where I keep that .js file.
Now, since that didn’t work, I tried to use another really useful plugin called Obsidian Enhancing Export. This worked much better than the Pandoc plugin. This plugin also has an option to add extra arguments to the basic Pandoc template instruction. So I inserted
-H /CSS_JS/MyJS.js and
-H /CSS_JS/MyCSS.css in that field and everything seems to work fine. The HTML that is exported contains the custom .css and .js properly injected in the document.
The problem is, though, that this HTML document does not contain any buttons! The
<button class="copy-code-button">Copy</button> elements that I see when I generate the HTML using the Pandoc plugin do not show up when the document is generated with the Obsidian Enhancing Export plugin.
So, the question is, where does this element come from? If it is true that this functionality is now built into Obsidian itself, why is this cancelled when I use the Obsidian Enhancing Export Plugin?
I would appreciate any help you guys can provide. The simplest solution would be perhaps to figure out how to get the Pandoc plugin to work with the
Extra pandoc arguments option that is already built in. As I said, this is not working for me. Adding the path to my .js file as
-H /CSS_JS/MyJS.js doesn’t generate any error messages but it doesn’t inject anything, either.
I have also been looking for ways to insert the