Skip to content

Commit

Permalink
Merge pull request #2862 from Franz-Kafka/main
Browse files Browse the repository at this point in the history
add $ before bash code blocks
  • Loading branch information
szarnyasg authored May 14, 2024
2 parents bd403a1 + 6708189 commit 1dab9ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions css/syntax_highlighting.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
color: #c5a332;
}

.language-bash code:before {
content: '$ ';
}

// keywords in table headers
th .k {
color: #fff;
Expand Down
14 changes: 8 additions & 6 deletions js/copy_button.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ $(document).ready(function() {
var codeBlocks = [].concat(...document.querySelectorAll('pre.highlight'), ...document.querySelectorAll('figure.highlight'));

codeBlocks.forEach(function (codeBlock) {
var copyButton = document.createElement('button');
copyButton.className = 'copy';
copyButton.type = 'button';
copyButton.ariaLabel = 'Copy code to clipboard';
copyButton.innerHTML = '<span class="copy"></span>';
codeBlock.append(copyButton);
if (!$(codeBlock).parents().hasClass('language-console')) {
var copyButton = document.createElement('button');
copyButton.className = 'copy';
copyButton.type = 'button';
copyButton.ariaLabel = 'Copy code to clipboard';
copyButton.innerHTML = '<span class="copy"></span>';
codeBlock.append(copyButton);
}
});

$('main').on('click', 'button.copy', function() {
Expand Down

0 comments on commit 1dab9ae

Please sign in to comment.