feat: add support for running ruby

This commit is contained in:
Hatem Hosny committed 2025-01-05 17:17:56 +02:00
1 parent 870fe5177b
commit da53b553ba
2 files changed
+3 -2

No files matched your search

+1
View File
@@ -11,6 +11,7 @@ intro: |
The [Ruby](https://www.ruby-lang.org/) cheat sheet is a one-page reference sheet for the Ruby programming language.
plugins:
- copyCode
- runCode
---
## Getting Started
+2 -2
View File
@@ -85,7 +85,7 @@
let content = codeBlock.textContent || '';
let language = [...codeBlock.classList].filter(c => c.startsWith("language-"))[0].replace("language-", "");
if (language === 'shell') return;
if (['shell', 'bash'].includes(language)) return;
// Create a run button element
const runButton = document.createElement('button');
@@ -103,7 +103,7 @@
language = 'typescript';
}
const editorId = ['js', 'javascript', 'typescript', 'python', 'php'].includes(language)
const editorId = ['js', 'javascript', 'typescript', 'python', 'php', 'ruby'].includes(language)
? 'script'
: ['css', 'scss'].includes(language)
? 'style'