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');
|
||||
|
||||
// Конфигурация приложения
|
||||
|
||||
@ -34,6 +34,12 @@ const { title, authors, description } = Astro.props;
|
||||
|
||||
let deck = new Reveal({
|
||||
plugins: [Highlight, Zoom, Notes],
|
||||
highlight: {
|
||||
beforeHighlight: (hljs) => {
|
||||
// Важная настройка для динамического контента
|
||||
hljs.configure({ ignoreUnescapedHTML: true });
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
deck.initialize().then(() => {
|
||||
@ -48,10 +54,14 @@ const { title, authors, description } = Astro.props;
|
||||
try {
|
||||
const response = await fetch(block.dataset.external);
|
||||
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) {
|
||||
block.textContent = "⚠️ Error: " + error.message;
|
||||
}
|
||||
|
||||
@ -241,11 +241,37 @@ export const description =
|
||||
|
||||
<section>
|
||||
<section>
|
||||
<h2>Демонстрация тестового кода с перехватом основных сигналов</h2>
|
||||
<h2>Демонстрация тестового кода с перехватом основных сигналов</h2>
|
||||
</section>
|
||||
<section>
|
||||
<pre><code class="javascript" data-external="https://gitea.meettya.ru/Meettya/signal-slides/raw/branch/main/example/server.cjs"></code></pre>
|
||||
<section class="fullscreen-code">
|
||||
<pre><code class="javascript" data-trim data-external="https://gitea.meettya.ru/Meettya/signal-slides/raw/branch/main/example/server.cjs" /></pre>
|
||||
</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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user