Stream: website

Topic: [Emanote] Copy button to code blocks


view this post on Zulip Shivaraj B H (Dec 12 2023 at 12:46):

@Srid I was under the impression that changing embed-code.tpl file should change the way code block looks but I don't see any change at all.

Updated ember-code.tpl:

<div class="py-0.5 mb-3 text-sm" title="${ema:alt}">
  <div style="position: relative;">
    <button>Copy</button>
    <pre><code class="${ema:code:language}" ><ema:code:content /></code></pre>
  </div>
</div>

This is how the code block is rendered:
Screenshot-2023-12-12-at-6.14.14-PM.png

As you can see in the inspect element on the right there is no button in the HTML snippet.

view this post on Zulip Srid (Dec 12 2023 at 13:11):

embed-*.tpl are used only for embed wikilinks, cf. ![[..]].

For code blocks, see pandoc.tpl,
image.png

view this post on Zulip Notification Bot (Dec 12 2023 at 13:13):

This topic was moved here from #general > [Emanote] Copy button to code blocks by Srid.

view this post on Zulip Srid (Dec 12 2023 at 14:31):

It would be nice to consolidate them in one place though, if that's even possible.


Last updated: Nov 15 2024 at 12:33 UTC