-
@@ -180,25 +177,26 @@ import { Dialog, DialogOverlay, TransitionChild, TransitionRoot } from '@headles
import { documentation } from '../utils/Navigation'
import { CalendarIcon, ChartBarIcon, FolderIcon, HomeIcon, InboxIcon, MenuIcon, UsersIcon, XIcon, MenuAlt2Icon } from '@heroicons/vue/outline'
-defineProps<{ title: string }>()
-
const sidebarOpen = ref(false)
-let toc = ref(null)
+let toc = ref([])
onMounted(() => {
- const elements = document.querySelectorAll('h2, h3, h4, h5, h6')
- elements.forEach((element: HTMLElement) => element.id = `anchor-${element.innerText}`)
- toc.value = Array.from(elements).map((element: HTMLElement) => ({
- label: element.innerText,
- id: `anchor-${element.innerText}`
- }))
+ setTimeout(() => {
+ const elements = document.querySelectorAll('h2, h3')
+ toc.value = Array.from(elements).map((element: HTMLElement) => ({
+ label: element.innerText,
+ id: element.innerText
+ .toLowerCase()
+ .replace(/ /g, '-')
+ }))
+ }, 200)
})
-function scrollMeTo (refName) {
+function scrollMeTo (refName: string) {
const element = document.getElementById(refName)
const top = element.offsetTop;
- window.scroll(0, top - 64);
+ window.scroll(0, top + 20);
}
@@ -212,7 +210,7 @@ h2 {
color: #204977;
}
h3 {
- @apply text-2xl leading-10 pt-10;
+ @apply text-2xl leading-0 pt-16;
color: #204977;
}
h4 {
@@ -223,10 +221,6 @@ h5 {
@apply text-xl leading-10 pt-10;
color: #204977;
}
-h6 {
- @apply text-lg leading-10 pt-2;
- color: #204977;
-}
ul {
li {
@apply leading-8
-