Skip to content

Commit 130345b

Browse files
committed
docs(DevAPI): Add environment sections
1 parent 9d2622b commit 130345b

File tree

3 files changed

+139
-15
lines changed

3 files changed

+139
-15
lines changed

docs/content/en/Development-API/_index.md

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,70 @@ Command entry point. Each command file should contain this macro somewhere in th
3333
)
3434
```
3535

36+
# 🚩 Environment
37+
38+
## 🔍 Variable: eask-has-colors
39+
40+
Return non-nil if the terminal supports colors.
41+
42+
```elisp
43+
(when eask-has-colors ...
44+
```
45+
46+
## 🔍 Variable: eask-homedir
47+
48+
Eask's home directory path.
49+
50+
```elisp
51+
(message "%s" eask-homedir)
52+
```
53+
54+
## 🔍 Variable: eask-invocation
55+
56+
Eask's invocation program path.
57+
58+
```elisp
59+
(message "%s" eask-invocation)
60+
```
61+
62+
It could be the `node` executable or the `eask` executable itself.
63+
64+
## 🔍 Variable: eask-is-pkg
65+
66+
Return non-nil if Eask is packaged.
67+
68+
```elisp
69+
(when eask-is-pkg ...
70+
```
71+
72+
## 🔍 Variable: eask-rest
73+
74+
Eask's arguments after command separator `--'; return a list.
75+
76+
```sh
77+
$ eask <command> -- args0 args1
78+
```
79+
80+
Output:
81+
82+
```elisp
83+
(message "%s" eask-rest) ; '(args0 args1)
84+
```
85+
86+
## 🔍 Function: eask-rest ()
87+
88+
Eask's arguments after command separator `--'; return a string.
89+
90+
```sh
91+
$ eask <command> -- args0 args1
92+
```
93+
94+
Output:
95+
96+
```elisp
97+
(message "%s" (eask-rest)) ; "args0 args1"
98+
```
99+
36100
# 🚩 Core
37101

38102
## 🔍 Variable: eask-lisp-root
@@ -45,9 +109,7 @@ Points to `lisp` directory from the project root.
45109

46110
## 🔍 Function: eask-command ()
47111

48-
Return the current command in string.
49-
50-
Suppose the command is:
112+
Return the current command in string. Suppose the command is:
51113

52114
```sh
53115
$ eask init

docs/content/zh-TW/Development-API/_index.md

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,70 @@ weight: 700
3232
)
3333
```
3434

35+
# 🚩 環境
36+
37+
## 🔍 變數: eask-has-colors
38+
39+
如果終端支援顏色,則傳回非零。
40+
41+
```elisp
42+
(when eask-has-colors ...
43+
```
44+
45+
## 🔍 變數: eask-homedir
46+
47+
Eask 的主目錄路徑。
48+
49+
```elisp
50+
(message "%s" eask-homedir)
51+
```
52+
53+
## 🔍 變數: eask-invocation
54+
55+
Eask的呼叫程式路徑。
56+
57+
```elisp
58+
(message "%s" eask-invocation)
59+
```
60+
61+
它可以是 `node` 可執行檔或 `eask` 執行檔本身。
62+
63+
## 🔍 變數: eask-is-pkg
64+
65+
如果 Eask 已打包,則傳回非零。
66+
67+
```elisp
68+
(when eask-is-pkg ...
69+
```
70+
71+
## 🔍 變數: eask-rest
72+
73+
命令分隔符號 `--` 之後的 Eask 參數;傳回一個列表。
74+
75+
```sh
76+
$ eask <command> -- args0 args1
77+
```
78+
79+
輸出:
80+
81+
```elisp
82+
(message "%s" eask-rest) ; '(args0 args1)
83+
```
84+
85+
## 🔍 函式: eask-rest ()
86+
87+
命令分隔符號 `--` 之後的 Eask 參數;傳回一個字串。
88+
89+
```sh
90+
$ eask <command> -- args0 args1
91+
```
92+
93+
輸出:
94+
95+
```elisp
96+
(message "%s" (eask-rest)) ; "args0 args1"
97+
```
98+
3599
# 🚩 核心
36100

37101
## 🔍 變數: eask-lisp-root
@@ -44,9 +108,7 @@ weight: 700
44108

45109
## 🔍 函式: eask-command ()
46110

47-
返回字符串中的當前命令。
48-
49-
假設命令是:
111+
返回字符串中的當前命令。假設命令是:
50112

51113
```sh
52114
$ eask init

lisp/_prepare.el

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
(declare-function ansi-white "ext:ansi.el")
4343

4444
;;
45-
;;; Environments
45+
;;; Environment
4646

4747
;; Determine the underlying operating system
4848
(defconst eask-is-windows (memq system-type '(cygwin windows-nt ms-dos))
@@ -79,29 +79,29 @@ Arguments FNC and ARGS are used for advice `:around'."
7979
(advice-add 'load :around #'eask--load--adv)
8080

8181
(defconst eask-has-colors (getenv "EASK_HASCOLORS")
82-
"Return non-nil if terminal support colors.")
82+
"Return non-nil if terminal supports colors.")
8383

8484
(defconst eask-homedir (getenv "EASK_HOMEDIR")
85-
"Eask temporary storage.")
85+
"Eask's home directory path.")
8686

8787
(defconst eask-invocation (getenv "EASK_INVOCATION")
88-
"Eask invocation program.")
88+
"Eask's invocation program path.")
8989

9090
(defconst eask-is-pkg (getenv "EASK_IS_PKG")
91-
"Eask is pkg.")
91+
"Return non-nil if Eask is packaged.")
9292

9393
(defconst eask-rest
9494
(let ((args (getenv "EASK_REST_ARGS")))
9595
(setq args (ignore-errors (split-string args ",")))
9696
args)
97-
"Eask arguments in list after command separator `--'.
97+
"Eask's arguments after command separator `--'; return a list.
9898
99-
If the argument is `-- hello world'; it will return `(hello world)'.")
99+
If the argument is `-- arg0 arg1'; it will return `(arg0 arg1)'.")
100100

101101
(defun eask-rest ()
102-
"Eask arguments in string after command separator `--'.
102+
"Eask's arguments after command separator `--'; return a string.
103103
104-
If the argument is `-- hello world'; it will return `hello world'."
104+
If the argument is `-- arg0 arg1'; it will return `arg0 arg1'."
105105
(mapconcat #'identity eask-rest " "))
106106

107107
(defcustom eask-import-timeout 10

0 commit comments

Comments
 (0)