From 5706c4b21a7d905003b54df35284bace1af3a77b Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Thu, 4 Jun 2026 14:14:08 -0400 Subject: [PATCH] docs: 'Copy as markdown' button in the docs modal header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each docs page now has a header button that copies the raw markdown source to the clipboard. Useful for pasting the docs into the Book Designer chapter editor as test content. - _docsCache now stores { html, md } so the raw source survives the marked.parse() pass without a re-fetch on copy - _docsActiveMd tracks the currently displayed page's source - Button shows a brief "βœ“ Copied" confirmation and routes through toastSuccess / toastError for status Co-Authored-By: Claude Opus 4.7 --- src/index.html | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/index.html b/src/index.html index 621271d..33900b9 100644 --- a/src/index.html +++ b/src/index.html @@ -5685,6 +5685,7 @@

Artstr Studio docs

+
@@ -12126,8 +12127,9 @@ { slug: 'zaps', title: 'Zaps (NIP-57)', group: 'Publishing & payments', file: 'help/zaps.md' }, { slug: 'nwc', title: 'NWC wallet setup', group: 'Publishing & payments', file: 'help/nwc.md' }, ]; - const _docsCache = new Map(); // slug β†’ rendered HTML + const _docsCache = new Map(); // slug β†’ { html, md } let _docsActiveSlug = 'index'; + let _docsActiveMd = ''; function _renderDocsSidebar() { const aside = document.getElementById('docsSidebar'); @@ -12172,12 +12174,15 @@ try { history.replaceState(null, '', `#/help/${topic.slug}`); } catch {} } if (_docsCache.has(topic.slug)) { - content.innerHTML = _docsCache.get(topic.slug); + const cached = _docsCache.get(topic.slug); + content.innerHTML = cached.html; + _docsActiveMd = cached.md; _wireDocsInternalLinks(content); content.scrollTop = 0; return; } content.innerHTML = '

Loading…

'; + _docsActiveMd = ''; try { const md = await _fetchDocsMarkdown(topic.file); let html; @@ -12188,7 +12193,8 @@ } // Safety scrub: strip