Skip to content

Commit ff79fc3

Browse files
authored
Merge pull request #355 from Peefy/docs-file-module-more-func
feat: add more docs for the file module
2 parents f1215e1 + a936f7a commit ff79fc3

File tree

5 files changed

+98
-2
lines changed

5 files changed

+98
-2
lines changed

docs/reference/model/file.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,27 @@ Whether this file path exists. Returns true if the path points at an existing en
4141
`abs(filepath: str) -> str`
4242

4343
Returns the canonical, absolute form of the path with all intermediate components normalized and symbolic links resolved.
44+
45+
## mkdir
46+
47+
`mkdir(directory: str, exists: bool=False)`
48+
49+
Create a new directory at the specified path if it doesn't already exist.
50+
51+
## delete
52+
53+
`delete(directory: str, exists)`
54+
55+
Delete a file or an empty directory at the specified path.
56+
57+
## cp
58+
59+
`cp(src: str, dest: str)`
60+
61+
Copy a file or directory from the source path to the destination path.
62+
63+
## mv
64+
65+
`mv(src: str, dest: str)`
66+
67+
Move a file or directory from the source path to the destination path.

docusaurus.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ const katex = require('rehype-katex');
99
/** @type {import('@docusaurus/types').Config} */
1010
const config = {
1111
title: 'KCL programming language.',
12-
tagline: 'Mutation Validation Abstraction Production-Ready',
12+
tagline: 'Mutation Validation Abstraction Automation Production-Ready',
1313

14-
url: 'https://kcl-lang.github.io',
14+
url: 'https://www.kcl-lang.io',
1515
organizationName: 'kcl-lang', // Usually your GitHub org/user name.
1616
projectName: 'kcl', // Usually your repo name.
1717

i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/model/file.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,27 @@ weight: 100
4141
`abs(filepath: str) -> str`
4242

4343
返回路径的规范化绝对形式,其中所有中间路径均已规范化并解析为符号链接。
44+
45+
## mkdir
46+
47+
`mkdir(directory: str, exists: bool=False)`
48+
49+
如果指定路径上不存在目录,则创建一个新目录。
50+
51+
## delete
52+
53+
`delete(directory: str, exists)`
54+
55+
在指定路径上删除一个文件或空目录。
56+
57+
## cp
58+
59+
`cp(src: str, dest: str)`
60+
61+
将文件或目录从源路径复制到目标路径。
62+
63+
## mv
64+
65+
`mv(src: str, dest: str)`
66+
67+
将文件或目录从源路径移动到目标路径。

i18n/zh-CN/docusaurus-plugin-content-docs/version-0.8/reference/model/file.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,27 @@ weight: 100
4141
`abs(filepath: str) -> str`
4242

4343
返回路径的规范化绝对形式,其中所有中间路径均已规范化并解析为符号链接。
44+
45+
## mkdir
46+
47+
`mkdir(directory: str, exists: bool=False)`
48+
49+
如果指定路径上不存在目录,则创建一个新目录。
50+
51+
## delete
52+
53+
`delete(directory: str, exists)`
54+
55+
在指定路径上删除一个文件或空目录。
56+
57+
## cp
58+
59+
`cp(src: str, dest: str)`
60+
61+
将文件或目录从源路径复制到目标路径。
62+
63+
## mv
64+
65+
`mv(src: str, dest: str)`
66+
67+
将文件或目录从源路径移动到目标路径。

versioned_docs/version-0.8/reference/model/file.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,27 @@ Whether this file path exists. Returns true if the path points at an existing en
4141
`abs(filepath: str) -> str`
4242

4343
Returns the canonical, absolute form of the path with all intermediate components normalized and symbolic links resolved.
44+
45+
## mkdir
46+
47+
`mkdir(directory: str, exists: bool=False)`
48+
49+
Create a new directory at the specified path if it doesn't already exist.
50+
51+
## delete
52+
53+
`delete(directory: str, exists)`
54+
55+
Delete a file or an empty directory at the specified path.
56+
57+
## cp
58+
59+
`cp(src: str, dest: str)`
60+
61+
Copy a file or directory from the source path to the destination path.
62+
63+
## mv
64+
65+
`mv(src: str, dest: str)`
66+
67+
Move a file or directory from the source path to the destination path.

0 commit comments

Comments
 (0)