adding content
This commit is contained in:
120
lisp/build.el
Executable file → Normal file
120
lisp/build.el
Executable file → Normal file
@@ -139,7 +139,6 @@
|
||||
|
||||
(defvar z-shared-head
|
||||
"
|
||||
|
||||
<link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"/assets/icons/icons8-z-key-64.png\" />
|
||||
|
||||
<link rel=\"stylesheet\" href=\"/assets/styles/style.css\" />
|
||||
@@ -155,6 +154,89 @@
|
||||
<script src=\"/assets/scripts/cookbook.js\" defer></script>
|
||||
|
||||
<script src=\"/assets/scripts/mermaid.min.js\"></script>
|
||||
|
||||
<script>
|
||||
MathJax = {
|
||||
tex: {
|
||||
inlineMath: [['\\\\(', '\\\\)']],
|
||||
displayMath: [['\\\\[', '\\\\]']],
|
||||
processEscapes: true
|
||||
},
|
||||
options: {
|
||||
skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre']
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src=\"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js\" async></script>
|
||||
|
||||
<style>
|
||||
#mv-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:9999;align-items:center;justify-content:center;}
|
||||
#mv-overlay.open{display:flex;}
|
||||
#mv-modal{background:#fff;border:1px solid #ddd;border-radius:8px;width:90vw;max-width:1100px;height:85vh;display:flex;flex-direction:column;overflow:hidden;}
|
||||
#mv-toolbar{display:flex;align-items:center;gap:8px;padding:10px 14px;border-bottom:1px solid #eee;flex-shrink:0;}
|
||||
#mv-toolbar button{border:1px solid #ccc;border-radius:5px;padding:4px 12px;font-size:13px;cursor:pointer;background:none;}
|
||||
#mv-toolbar button:hover{background:#f5f5f5;}
|
||||
#mv-canvas{flex:1;overflow:hidden;position:relative;cursor:grab;user-select:none;}
|
||||
#mv-canvas.dragging{cursor:grabbing;}
|
||||
#mv-inner{position:absolute;top:0;left:0;transform-origin:0 0;padding:20px;}
|
||||
.mermaid-view-btn{display:inline-block;margin-top:6px;padding:3px 10px;font-size:12px;cursor:pointer;border:1px solid #ccc;border-radius:4px;background:none;color:inherit;}
|
||||
</style>
|
||||
|
||||
<div id=\"mv-overlay\">
|
||||
<div id=\"mv-modal\">
|
||||
<div id=\"mv-toolbar\">
|
||||
<button onclick=\"mvZoom(-0.2)\">−</button>
|
||||
<span id=\"mv-lbl\" style=\"min-width:42px;text-align:center;font-size:13px;\">100%</span>
|
||||
<button onclick=\"mvZoom(0.2)\">+</button>
|
||||
<button onclick=\"mvReset()\">Reset</button>
|
||||
<button onclick=\"mvFit()\">Fit</button>
|
||||
<button onclick=\"mvClose()\" style=\"margin-left:auto;\">✕ Close</button>
|
||||
</div>
|
||||
<div id=\"mv-canvas\"><div id=\"mv-inner\"></div></div>
|
||||
<div style=\"font-size:12px;color:#888;padding:6px 14px;border-top:1px solid #eee;\">Scroll to zoom · Drag to pan · Esc to close</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function(){
|
||||
var sc=1,tx=0,ty=0,drag=false,lx=0,ly=0;
|
||||
function C(){return document.getElementById('mv-canvas');}
|
||||
function N(){return document.getElementById('mv-inner');}
|
||||
function L(){return document.getElementById('mv-lbl');}
|
||||
function apply(){N().style.transform='translate('+tx+'px,'+ty+'px) scale('+sc+')';L().textContent=Math.round(sc*100)+'%';}
|
||||
window.mvZoom=function(d,cx,cy){var r=C().getBoundingClientRect(),p=sc;cx=cx!=null?cx:r.width/2;cy=cy!=null?cy:r.height/2;sc=Math.max(0.1,Math.min(10,sc+d));tx+=(cx-tx)*(1-sc/p);ty+=(cy-ty)*(1-sc/p);apply();};
|
||||
window.mvReset=function(){sc=1;tx=0;ty=0;apply();};
|
||||
window.mvFit=function(){var cr=C().getBoundingClientRect(),ir=N().getBoundingClientRect();var cw=ir.width/sc,ch=ir.height/sc;sc=Math.min(cr.width/cw,cr.height/ch)*0.9;tx=(cr.width-cw*sc)/2;ty=(cr.height-ch*sc)/2;apply();};
|
||||
window.mvOpen=function(el){
|
||||
var svg = el.querySelector('svg');
|
||||
if (!svg) return;
|
||||
var clone = svg.cloneNode(true);
|
||||
var vb = clone.getAttribute('viewBox');
|
||||
if (vb) {
|
||||
var parts = vb.split(' ');
|
||||
clone.setAttribute('width', parts[2]);
|
||||
clone.setAttribute('height', parts[3]);
|
||||
}
|
||||
clone.style.maxWidth = 'none';
|
||||
clone.style.display = 'block';
|
||||
N().innerHTML = '';
|
||||
N().appendChild(clone);
|
||||
sc=1;tx=0;ty=0;apply();
|
||||
document.getElementById('mv-overlay').classList.add('open');
|
||||
setTimeout(mvFit, 100);
|
||||
};
|
||||
window.mvClose=function(){document.getElementById('mv-overlay').classList.remove('open');};
|
||||
window.addEventListener('load',function(){
|
||||
C().addEventListener('wheel',function(e){e.preventDefault();var r=C().getBoundingClientRect();mvZoom(e.deltaY<0?.15:-.15,e.clientX-r.left,e.clientY-r.top);},{passive:false});
|
||||
C().addEventListener('mousedown',function(e){drag=true;lx=e.clientX;ly=e.clientY;C().classList.add('dragging');});
|
||||
window.addEventListener('mousemove',function(e){if(!drag)return;tx+=e.clientX-lx;ty+=e.clientY-ly;lx=e.clientX;ly=e.clientY;apply();});
|
||||
window.addEventListener('mouseup',function(){drag=false;C().classList.remove('dragging');});
|
||||
document.addEventListener('keydown',function(e){if(e.key==='Escape')mvClose();});
|
||||
document.getElementById('mv-overlay').addEventListener('click',function(e){if(e.target.id==='mv-overlay')mvClose();});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
<script>
|
||||
window.addEventListener('load', function() {
|
||||
mermaid.initialize({ startOnLoad: false, theme: 'neutral' });
|
||||
@@ -164,11 +246,21 @@
|
||||
.replace(/</g, '<')
|
||||
.replace(/&/g, '&');
|
||||
});
|
||||
mermaid.run({ querySelector: '.mermaid' });
|
||||
mermaid.run({ querySelector: '.mermaid' }).then(function() {
|
||||
document.querySelectorAll('.mermaid').forEach(function(el) {
|
||||
if (el.querySelector('svg')) {
|
||||
var btn = document.createElement('button');
|
||||
btn.textContent = 'View diagram ↗';
|
||||
btn.className = 'mermaid-view-btn';
|
||||
btn.onclick = function(){ mvOpen(el); };
|
||||
el.parentNode.insertBefore(btn, el.nextSibling);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
"
|
||||
)
|
||||
)
|
||||
|
||||
(defvar z-preamble
|
||||
"
|
||||
@@ -317,6 +409,28 @@ Created with %c on <a href=\"https://www.archlinux.org/\">Arch</a> <a href=\"htt
|
||||
(insert "\n")))))
|
||||
(message "✅ all-files.org generated"))))
|
||||
|
||||
(setq org-html-mathjax-options
|
||||
'((path "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js")
|
||||
(scale 1.0)
|
||||
(align "center")
|
||||
(font "mathjax-modern")
|
||||
(overflow "overflow")
|
||||
(autonumber "AMS")
|
||||
(multlinewidth "85%")
|
||||
(tagside "right")
|
||||
(tagindent ".8em")))
|
||||
|
||||
(setq org-html-mathjax-template
|
||||
"<script>
|
||||
MathJax = {
|
||||
tex: {
|
||||
inlineMath: [['\\\\(', '\\\\)']],
|
||||
displayMath: [['\\\\[', '\\\\]']]
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src=\"%PATH\" async></script>")
|
||||
|
||||
;; -------------------------------------------------------
|
||||
;; MOV → MP4 conversion
|
||||
;; Converts all .mov files found anywhere under assets/ to
|
||||
|
||||
Reference in New Issue
Block a user