Seite als Markdown kopieren
Sammelt Überschriften, Absätze und Listen und kopiert sie als Markdown.
Code zum Kopieren
(function () {
try {
var content = document.querySelector('.notion-page-content');
if (!content) { alert('No page content found.'); return; }
var lines = [];
content.querySelectorAll('.notion-text-block, .notion-header-block, .notion-sub_header-block, .notion-sub_sub_header-block, .notion-bulleted_list-block, .notion-numbered_list-block').forEach(function (b) {
var t = (b.innerText || '').trim();
if (!t) return;
if (b.classList.contains('notion-header-block')) lines.push('# ' + t);
else if (b.classList.contains('notion-sub_header-block')) lines.push('## ' + t);
else if (b.classList.contains('notion-sub_sub_header-block')) lines.push('### ' + t);
else if (b.classList.contains('notion-bulleted_list-block')) lines.push('- ' + t);
else if (b.classList.contains('notion-numbered_list-block')) lines.push('1. ' + t);
else lines.push(t);
});
var md = lines.join('\n\n');
if (!md) { alert('No content to copy.'); return; }
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(md).then(function () { alert('Copied page as Markdown.'); });
} else {
var ta = document.createElement('textarea');
ta.value = md; document.body.appendChild(ta); ta.select();
document.execCommand('copy'); ta.remove();
alert('Copied page as Markdown.');
}
} catch (e) { alert('Could not copy as Markdown: ' + e.message); }
})();
So verwendest du dieses Beispiel
- Kopiere den Code mit der Schaltfläche oben.
- Installiere JustZix (2 Minuten) und öffne die Erweiterung auf der Zielseite.
- Füge eine neue Regel hinzu, die zu dieser Seite passt.
- Aktiviere das Aktionspanel, füge im Tab Aktionen einen Button hinzu und füge den Code ein — starte ihn mit einem Klick.
Bewerte dieses Beispiel
Noch keine Bewertungen — sei der Erste.