浏览代码

docs: update semantization (#121)

Co-authored-by: yinjindong <[email protected]>
YinDong 4 年之前
父节点
当前提交
d59d36cb7c

+ 4 - 4
search/generator.js

@@ -109,7 +109,7 @@ class SingleMdxProcessor {
     }
 
 
-    processChildNode(childNode, meanfulType) {
+    processChildNode(childNode, meaningfulType) {
         const belong=this.belong;
         const mdxID = this.mdxID;
         const mdxInfo = this.mdxInfo;
@@ -126,7 +126,7 @@ class SingleMdxProcessor {
                 parent:null,
                 anchor,
                 mdxInfo,
-                meanfulType: "heading",
+                meaningfulType: "heading",
             };
             this.nodeMap[uniqueID] = node;
             this.closestAnchorAncestorUniqueID=node.uniqueID;
@@ -143,7 +143,7 @@ class SingleMdxProcessor {
                 value,
                 parent:this.closestAnchorAncestorUniqueID,
                 mdxInfo,
-                meanfulType,
+                meaningfulType,
             };
             this.nodeMap[uniqueID] = node;
             this.mdxInfo.nodeUniqueIDList.push(uniqueID);
@@ -159,7 +159,7 @@ class SingleMdxProcessor {
                 value,
                 parent:this.closestAnchorAncestorUniqueID,
                 mdxInfo,
-                meanfulType: type,
+                meaningfulType: type,
             };
             this.nodeMap[uniqueID] = node;
             this.mdxInfo.nodeUniqueIDList.push(uniqueID);

+ 1 - 1
search/searchDemo.js

@@ -25,7 +25,7 @@ function search(str) {
     resultNodeList.map((node) => {
         const result = {
             text: node.value,
-            type: node.meanfulType,
+            type: node.meaningfulType,
             context: getContext(node).join(" => "),
             url: "https://semi.design/design/" + node.mdxInfo.slug + (node.anchor ? node.anchor : nodeMap[node.parent].anchor),
         };

+ 1 - 1
src/components/SearchAllInOne/SearchModal/index.interface.ts

@@ -27,7 +27,7 @@ export interface nodeInterface {
     "parent": string | null,
     "anchor": string,
     "mdxInfo": mdxInfoInterface,
-    "meanfulType": 'heading' | 'code' | 'jsx' | 'list' | 'listItem' | 'root' | 'strong' | 'paragraph' | 'table'
+    "meaningfulType": 'heading' | 'code' | 'jsx' | 'list' | 'listItem' | 'root' | 'strong' | 'paragraph' | 'table'
 }
 export interface searchDataInterface {
     'zh-CN'?: {

+ 2 - 2
src/components/SearchAllInOne/search.ts

@@ -39,7 +39,7 @@ export default function search(str,data,locale) {
     resultNodeList.map((node) => {
         const result:searchFuncResultItemInterface = {
             text: node.value,
-            type: node.meanfulType,
+            type: node.meaningfulType,
             belong:node.belong,
             context: getContext(node),
             url: withPrefix(node.mdxInfo.slug + (node.anchor ?calcHashViaAnchor(node.anchor) : (node.parent?calcHashViaAnchor(nodeMap[node.parent].anchor):''))),
@@ -67,4 +67,4 @@ export default function search(str,data,locale) {
   
     
     return resultList;
-}
+}