Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/Elastic.Markdown/Slices/Directives/Code.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,5 @@
</div>
}
<pre><code class="[email protected]">[CONTENT]</code></pre>
<button class="copybtn o-tooltip--left" data-tooltip="Copy" data-clipboard-target="#codecell0">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-copy" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="#000000" fill="none" stroke-linecap="round" stroke-linejoin="round">
<title>Copy to clipboard</title>
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<rect x="8" y="8" width="12" height="12" rx="2"></rect>
<path d="M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"></path>
</svg>
</button>
Comment on lines -12 to -19
Copy link
Member Author

@reakaleek reakaleek Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not necessary; it is injected by the javascript.

</div>
</div>
7 changes: 7 additions & 0 deletions src/Elastic.Markdown/Slices/Layout/_Scripts.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,15 @@
<script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
<script src="@Model.Static("shibuya.js")"></script>
<script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
<script src="@Model.Static("clipboard.min.js")"></script>
<script src="@Model.Static("copybutton.js")"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/go.min.js"></script>
<script>hljs.highlightAll();</script>
<script src="https://unpkg.com/[email protected]/dist/mermaid.min.js"></script>
```yaml
project:
title: MyST Markdown
github: https://github.com/jupyter-book/mystmd
```
3 changes: 3 additions & 0 deletions src/Elastic.Markdown/_static/copybutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onl

var copyTargetText = (trigger) => {
var target = document.querySelector(trigger.attributes['data-clipboard-target'].value);


console.log("HELLLO")

// get filtered text
let exclude = '.linenos';
Expand Down
Loading