- Establish dual licensing: GNU Free Documentation License v1.3 or later (no invariants) for slides, documentation, and diagrams - License automation scripts, Makefiles, CSS/JS templates, and Lua filters under the MIT License - Implement REUSE compliance with LICENSES/ directory and machine-readable SPDX headers across all project files - Document licensing terms and DCO contribution requirements in README.rst and CONTRIBUTING.rst - Update Schema.org JSON-LD metadata and closing slide with canonical GNU FDL references Co-developed-by: Antigravity <antigravity@google.com> Signed-off-by: Rénich Bon Ćirić <renich@woralelandia.com>
118 lines
5.1 KiB
Lua
118 lines
5.1 KiB
Lua
-- templates/revealjs/lua/notes.lua
|
|
-- SPDX-License-Identifier: MIT
|
|
-- SPDX-FileCopyrightText: 2026 Fundación MxOS <contacto@mx-os.mx>
|
|
-- Pandoc Lua Filter:
|
|
-- 1. Transforma directivas `.. note::` en RST a `<aside class="notes">` nativo para Reveal.js.
|
|
-- 2. Asigna transiciones dinámicas (zoom, convex, concave, fade, slide) y fondos temáticos
|
|
-- por acto para hacer la presentación visualmente dinámica y atractiva.
|
|
|
|
local slide_counter = 0
|
|
|
|
-- Mapeo temático para los Actos (Nivel 1)
|
|
local function get_act_config(title)
|
|
if title:match("^Acto III") then
|
|
return { transition = "zoom", bg = "#031f13", speed = "fast" }
|
|
elseif title:match("^Acto II") then
|
|
return { transition = "convex", bg = "#091626" }
|
|
elseif title:match("^Acto IV") then
|
|
return { transition = "convex", bg = "#1a0927" }
|
|
elseif title:match("^Acto V") then
|
|
return { transition = "zoom", bg = "#081d30" }
|
|
elseif title:match("^Acto I") then
|
|
return { transition = "zoom", bg = "#1e0a0d" }
|
|
elseif title:match("^Cierre") then
|
|
return { transition = "concave", bg = "#151518" }
|
|
else
|
|
return nil
|
|
end
|
|
end
|
|
|
|
-- Asignación inteligente de transiciones para slides individuales
|
|
local function get_slide_transition(title)
|
|
local t = title:lower()
|
|
|
|
-- 1. Demostraciones en vivo y Terminal: zoom dinámico acelerado
|
|
if t:match("demo") or t:match("vivo") or t:match("terminal") or t:match("cockpit") then
|
|
return "zoom", "fast"
|
|
end
|
|
|
|
-- 2. Diagramas de arquitectura, referencias y preguntas: fade suave para enfoque
|
|
if t:match("referencias") or t:match("preguntas") or t:match("vs") or t:match("diagrama") or t:match("tríada") or t:match("stack") or t:match("pirámide") or t:match("arquitectura") then
|
|
return "fade", "default"
|
|
end
|
|
|
|
-- 3. Choque de realidades, problemas, crisis, causas y retos: efecto 3D convex
|
|
if t:match("crisis") or t:match("causas") or t:match("obsolescencia") or t:match("impacto") or t:match("putrefacción") or t:match("decaimiento") or t:match("retos") or t:match("teatro") or t:match("abismo") or t:match("veneno") or t:match("jaque") or t:match("trampa") or t:match("provocacion") or t:match("riesgos") or t:match("problema") then
|
|
return "convex", "default"
|
|
end
|
|
|
|
-- 4. Manifiestos, remates épicos, futuro y conclusiones: efecto zoom expansivo
|
|
if t:match("futuro") or t:match("conclusiones") or t:match("rebelión") or t:match("manifiesto") or t:match("regla de oro") or t:match("no asumas") or t:match("resurrección") or t:match("¡larga vida") or t:match("to build") or t:match("soberanía") then
|
|
return "zoom", "default"
|
|
end
|
|
|
|
-- 5. Soluciones, procesos técnicos, memoria, buenas prácticas y captura: efecto 3D concave
|
|
if t:match("soluciones") or t:match("prácticas") or t:match("captura") or t:match("gestión") or t:match("documentación") or t:match("receta") or t:match("memoria") or t:match("gobernanza") or t:match("modelo") or t:match("confianza") or t:match("descentralización") or t:match("fundación") then
|
|
return "concave", "default"
|
|
end
|
|
|
|
-- 6. Rotación dinámica para conceptos restantes: asegura variedad continua
|
|
local variety = { "convex", "concave", "fade", "zoom", "slide" }
|
|
slide_counter = slide_counter + 1
|
|
return variety[(slide_counter % #variety) + 1], "default"
|
|
end
|
|
|
|
function Header(el)
|
|
local title = pandoc.utils.stringify(el.content)
|
|
|
|
if el.level == 1 then
|
|
local cfg = get_act_config(title)
|
|
if cfg then
|
|
if not el.attributes['data-transition'] then
|
|
el.attributes['data-transition'] = cfg.transition
|
|
end
|
|
if not el.attributes['data-background-color'] then
|
|
el.attributes['data-background-color'] = cfg.bg
|
|
end
|
|
if not el.attributes['data-background-transition'] then
|
|
el.attributes['data-background-transition'] = cfg.transition
|
|
end
|
|
if cfg.speed and not el.attributes['data-transition-speed'] then
|
|
el.attributes['data-transition-speed'] = cfg.speed
|
|
end
|
|
else
|
|
-- Diapositivas regulares de Nivel 1 (para mazos con slide-level=1)
|
|
if not el.attributes['data-transition'] then
|
|
local trans, speed = get_slide_transition(title)
|
|
el.attributes['data-transition'] = trans
|
|
if speed ~= "default" and not el.attributes['data-transition-speed'] then
|
|
el.attributes['data-transition-speed'] = speed
|
|
end
|
|
end
|
|
end
|
|
elseif el.level == 2 then
|
|
if not el.attributes['data-transition'] then
|
|
local trans, speed = get_slide_transition(title)
|
|
el.attributes['data-transition'] = trans
|
|
if speed ~= "default" and not el.attributes['data-transition-speed'] then
|
|
el.attributes['data-transition-speed'] = speed
|
|
end
|
|
end
|
|
end
|
|
|
|
return el
|
|
end
|
|
|
|
function Div(el)
|
|
if el.classes:includes('note') then
|
|
local content = {}
|
|
for _, block in ipairs(el.content) do
|
|
-- Filtrar el párrafo de título por defecto que inserta docutils/pandoc ("Note")
|
|
if not (block.classes and block.classes:includes('title')) then
|
|
table.insert(content, block)
|
|
end
|
|
end
|
|
-- En el template de revealjs de Pandoc, un Div con clase "notes" se convierte en <aside class="notes">
|
|
return pandoc.Div(content, pandoc.Attr("", {"notes"}))
|
|
end
|
|
end
|