Refactored prose and added style for ToC.astro

This commit is contained in:
2026-09-28 12:03:07 +02:00
parent d06f0293ce
commit 99d2635763
15 changed files with 559 additions and 60 deletions

View File

@@ -50,22 +50,16 @@ export function createTags(state: NodeState, resolveLink: ResolveLink): Record<s
})
state.markers.add(marker)
const n = state.sidenotes.length + 1
state.sidenotes.push({
n,
marker,
type: noteType,
children: inlineOf(text(node.attributes.note)),
})
return new Tag(
'a',
{
class: 'sidenote-ref',
id: `snref-${n}`,
href: `#sn-${n}`,
style: `anchor-name: --sn-${n}`,
},
[marker],
)
const children = inlineOf(text(node.attributes.note))
state.sidenotes.push({ n, marker, type: noteType, children })
return [
new Tag('a', { class: 'sidenote-ref', id: `snref-${n}`, href: `#sn-${n}` }, [marker]),
new Tag(
'span',
{ class: `sidenote sidenote--${noteType}`, id: `sn-${n}`, role: 'note' },
[new Tag('span', { class: 'sidenote__marker' }, [marker]), ...children],
),
]
},
},
xref: {