summaryrefslogtreecommitdiff
path: root/docs/src/components/Examples/Functions/get-examples-headers.js
blob: 9b75d2e5da16e4f72e3953239e8ad612e2288348 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// import {templatesList as data} from './templatesList.ts'
import templateData from './get-examples-data.js'
const data = await templateData()
console.log(data)

// const examplesHeaders = data.map(section=>{
//     let arr = []
//     let obj = {
//         depth:2,
//         slug:section.title,
//         text:section.title,
//     }
//     arr.push(obj)
    
//     section.children.map(example=>{
//         let obj={
//         depth:3,
//         slug:example.text,
//         text:example.text,
//         }
//         arr.push(obj)
//     })
//     return [...arr]
// }).flat(2) 


// export default examplesHeaders