chore(*): add code formatting
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
221cbfeafe
commit
aead0cd87b
@ -1,5 +1,3 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
const http = require('http');
|
const http = require('http');
|
||||||
|
|
||||||
// Конфигурация приложения
|
// Конфигурация приложения
|
||||||
|
|||||||
@ -34,6 +34,12 @@ const { title, authors, description } = Astro.props;
|
|||||||
|
|
||||||
let deck = new Reveal({
|
let deck = new Reveal({
|
||||||
plugins: [Highlight, Zoom, Notes],
|
plugins: [Highlight, Zoom, Notes],
|
||||||
|
highlight: {
|
||||||
|
beforeHighlight: (hljs) => {
|
||||||
|
// Важная настройка для динамического контента
|
||||||
|
hljs.configure({ ignoreUnescapedHTML: true });
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
deck.initialize().then(() => {
|
deck.initialize().then(() => {
|
||||||
@ -48,10 +54,14 @@ const { title, authors, description } = Astro.props;
|
|||||||
try {
|
try {
|
||||||
const response = await fetch(block.dataset.external);
|
const response = await fetch(block.dataset.external);
|
||||||
const code = await response.text();
|
const code = await response.text();
|
||||||
block.textContent = code;
|
block.innerHTML = code;
|
||||||
|
|
||||||
// Правильный способ обновить подсветку
|
// Сбрасываем состояние подсветки
|
||||||
deck.getPlugin("highlight").hljs.highlightBlock(block);
|
delete block.dataset.highlighted;
|
||||||
|
block.classList.remove("hljs");
|
||||||
|
|
||||||
|
// Новая подсветка через API reveal.js
|
||||||
|
deck.getPlugin("highlight").hljs.highlightElement(block);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
block.textContent = "⚠️ Error: " + error.message;
|
block.textContent = "⚠️ Error: " + error.message;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -243,9 +243,35 @@ export const description =
|
|||||||
<section>
|
<section>
|
||||||
<h2>Демонстрация тестового кода с перехватом основных сигналов</h2>
|
<h2>Демонстрация тестового кода с перехватом основных сигналов</h2>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section class="fullscreen-code">
|
||||||
<pre><code class="javascript" data-external="https://gitea.meettya.ru/Meettya/signal-slides/raw/branch/main/example/server.cjs"></code></pre>
|
<pre><code class="javascript" data-trim data-external="https://gitea.meettya.ru/Meettya/signal-slides/raw/branch/main/example/server.cjs" /></pre>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
/* Основные стили для полноэкранного блока */
|
||||||
|
.fullscreen-code {
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
margin: -45px 0 0 -45px !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Переопределение дефолтных стилей reveal.js */
|
||||||
|
.fullscreen-code code {
|
||||||
|
max-height: none !important;
|
||||||
|
padding: 20px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Убираем границы и скролл */
|
||||||
|
.fullscreen-code pre {
|
||||||
|
width: 80%;
|
||||||
|
height: 68%;
|
||||||
|
box-shadow: none;
|
||||||
|
overflow-y: visible;
|
||||||
|
overflow-x: hidden;
|
||||||
|
background: #2d2d2d;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user