docs: add framework page (#12162)

* initial draft

* finalize page

* fix vale error

* changes to intro

* small fix

* added features list
This commit is contained in:
Shahed Nasser
2025-04-16 17:58:27 +03:00
committed by GitHub
parent 6c59d3fe6f
commit 757ba6cd7f
9 changed files with 14976 additions and 12997 deletions

View File

@@ -20,6 +20,7 @@ import {
parsePackageInstall,
parsePrerequisites,
parseSourceCodeLink,
parseSplitList,
parseTable,
parseTabs,
parseTypeList,
@@ -46,6 +47,7 @@ const parsers: Record<string, ComponentParser> = {
IconSearch: parseIconSearch,
HookValues: parseHookValues,
Colors: parseColors,
SplitList: parseSplitList,
}
const isComponentAllowed = (nodeName: string): boolean => {

View File

@@ -886,6 +886,71 @@ export const parseColors: ComponentParser<{
})
}
export const parseSplitList: ComponentParser = (
node: UnistNodeWithData,
index: number,
parent: UnistTree
): VisitorResult => {
const items = node.attributes?.find((attr) => attr.name === "items")
if (!items || typeof items.value === "string" || !items.value.data?.estree) {
return
}
const itemsJsVar = estreeToJs(items.value.data.estree)
if (!itemsJsVar || !Array.isArray(itemsJsVar)) {
return
}
const listItems = itemsJsVar
.map((item) => {
if (
!isExpressionJsVarObj(item) ||
!("title" in item) ||
!("link" in item) ||
!isExpressionJsVarLiteral(item.title) ||
!isExpressionJsVarLiteral(item.link)
) {
return null
}
const description = isExpressionJsVarLiteral(item.description)
? (item.description.data as string)
: ""
return {
type: "listItem",
children: [
{
type: "paragraph",
children: [
{
type: "link",
url: `${item.link.data}`,
children: [
{
type: "text",
value: `${item.title.data}${description ? `: ${description}` : ""}`,
},
],
},
],
},
],
}
})
.filter(Boolean) as UnistNode[]
if (!listItems.length) {
return
}
parent?.children.splice(index, 1, {
type: "list",
ordered: false,
spread: false,
children: listItems,
})
return [SKIP, index]
}
/**
* Helpers
*/