Skip to content

Commit

Permalink
deps, docs;
Browse files Browse the repository at this point in the history
  • Loading branch information
ShenHongFei committed Aug 21, 2023
1 parent bd929cd commit bbebc9f
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 187 deletions.
44 changes: 41 additions & 3 deletions DdbCodeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -675,18 +675,56 @@ const token_ends = new Set(
Object.values(token_map)
)


interface RstDocument {
title: string
type: DocumentType
children: Paragraph[]
}

interface Paragraph {
type: ParagraphType
title: string
children: ContextBlock[]
}

interface ContextBlock {
type: 'text' | 'code'
language?: string
value: string[]
}

type DocumentType = 'command' | 'function' | 'template'

type ParagraphType = 'grammer' | 'parameters' | 'detail' | 'example'


const func_fps = {
command: 'FunctionsandCommands/CommandsReferences/',
function: 'FunctionsandCommands/FunctionReferences/',
template: 'Functionalprogramming/TemplateFunctions/'
} as const


function get_func_md (keyword: string) {
const func_doc = docs[keyword] || docs[keyword + '!']
const func_doc: RstDocument = docs[keyword] || docs[keyword + '!']

if (!func_doc)
return

const { title, type } = func_doc

let str =
// 标题
`#### ${func_doc.title}\n` +
`#### ${title}\n` +

// 链接
`https://www.dolphindb.cn/cn/help/FunctionsandCommands/${ func_doc.type === 'command' ? 'CommandsReferences' : 'FunctionReferences' }/${func_doc.title[0]}/${func_doc.title}.html\n`
'https://' +
(language === 'zh' ? 'docs.dolphindb.cn/zh/' : 'dolphindb.com/') +
'help/' +
func_fps[type] +
(type !== 'template' ? `${title[0]}/` : '') +
title + '.html\n'


for (const para of func_doc.children) {
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@grafana/schema": "^10.0.3",
"@grafana/ui": "^10.0.3",
"@svgr/webpack": "^8.1.0",
"@types/node": "^20.5.0",
"@types/node": "^20.5.1",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"@types/sass-loader": "^8.0.5",
Expand All @@ -35,11 +35,11 @@
"css-loader": "^6.8.1",
"eslint": "^8.47.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-xlint": "^1.0.6",
"eslint-plugin-xlint": "^1.0.7",
"license-webpack-plugin": "^4.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sass": "^1.65.1",
"sass": "^1.66.1",
"sass-loader": "^13.3.2",
"source-map": "^0.7.4",
"source-map-loader": "^4.0.1",
Expand All @@ -51,13 +51,13 @@
},
"dependencies": {
"dayjs": "^1.11.9",
"dolphindb": "^2.0.1014",
"dolphindb": "^2.0.1015",
"monaco-editor": "^0.41.0",
"re-resizable": "^6.9.11",
"rxjs": "7.8.0",
"tslib": "^2.6.1",
"tslib": "^2.6.2",
"vscode-oniguruma": "^1.7.0",
"vscode-textmate": "^9.0.0",
"xshell": "^1.0.49"
"xshell": "^1.0.50"
}
}
Loading

0 comments on commit bbebc9f

Please sign in to comment.