Skip to content

Commit e986a36

Browse files
authored
feat: Move el2org to docs subcommand (#388)
* feat: Move el2org to docs subcommand * changelog * docs: update interface * test: Add docs tests * feat: Require 28.1 for el2org * test: Restore vc status after test * fix: pr no
1 parent 59a7565 commit e986a36

10 files changed

Lines changed: 107 additions & 31 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
1313
* fix(lisp/emacs): Respect Eask file settings when possible ([`1b5aaa1`](../../commit/1b5aaa121b5d6a39e3a0664006fc10a4b22c2e84))
1414
* fix(lisp): Let buttercup tests handle exit code themselves ([#385](../../pull/385))
1515
* fix(lisp): Set up paths regardless of the working environment ([#386](../../pull/386))
16+
* feat(cmds): Move `el2org` to docs subcommand ([#388](../../pull/388))
1617

1718
## 0.12.x
1819
> Released Dec 02, 2025

cmds/core/docs.js

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,22 @@
1717

1818
"use strict";
1919

20-
exports.command = ['docs [names..]', 'doc [names..]'];
20+
exports.command = ['docs <generator>', 'doc <generator>'];
2121
exports.desc = 'Build documentation';
22-
exports.builder = yargs => yargs
23-
.positional(
24-
'[names..]', {
25-
description: 'specify source files to scan',
26-
type: 'array',
27-
})
28-
.options({
29-
'destination': {
30-
description: 'optional output destination',
31-
requiresArg: true,
32-
alias: 'dest',
33-
type: 'string',
34-
group: TITLE_CMD_OPTION,
35-
},
36-
});
22+
exports.builder = function (yargs) {
23+
yargs.usage(`${exports.desc}
3724
38-
exports.handler = async (argv) => {
39-
await UTIL.e_call(argv, 'core/docs'
40-
, argv.names
41-
, UTIL.def_flag(argv.dest, '--dest', argv.dest));
42-
};
25+
Usage: eask docs <generator> [options..]`)
26+
.commandDir('../docs/')
27+
.demandCommand();
28+
29+
/* XXX: Configure only in the menu. */
30+
if (UTIL.cmd_count() == 1) {
31+
yargs.positional(
32+
'<generator>', {
33+
description: 'type of the generator',
34+
});
35+
}
36+
}
37+
38+
exports.handler = async (argv) => { };

cmds/docs/el2org.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/**
2+
* Copyright (C) 2024-2026 the Eask authors.
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 3, or (at your option)
7+
* any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
18+
"use strict";
19+
20+
exports.command = ['el2org [names..]', ];
21+
exports.desc = 'Build documentation with el2org';
22+
exports.builder = yargs => yargs
23+
.positional(
24+
'[names..]', {
25+
description: 'specify source files to scan',
26+
type: 'array',
27+
})
28+
.options({
29+
'destination': {
30+
description: 'optional output destination',
31+
requiresArg: true,
32+
alias: 'dest',
33+
type: 'string',
34+
group: TITLE_CMD_OPTION,
35+
},
36+
});
37+
38+
exports.handler = async (argv) => {
39+
await UTIL.e_call(argv, 'docs/el2org'
40+
, argv.names
41+
, UTIL.def_flag(argv.dest, '--dest', argv.dest));
42+
};

docs/content/Getting-Started/Basic-Usage/_index.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Commands:
3838
compile [names..] Byte-compile `.el' files
3939
create <type> Create a new elisp project
4040
docker <version> [args..] Launch specified Emacs version in a Docker container
41-
docs [names..] Build documentation [aliases: doc]
41+
docs <generator> Build documentation [aliases: doc]
4242
emacs [args..] Execute emacs with the appropriate environment
4343
eval [form] Evaluate lisp form with a proper PATH
4444
path [patterns..] Print the PATH (exec-path) from workspace [aliases: exec-path]

docs/content/Getting-Started/Basic-Usage/_index.zh-tw.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Commands:
3535
compile [names..] Byte-compile `.el' files
3636
create <type> Create a new elisp project
3737
docker <version> [args..] Launch specified Emacs version in a Docker container
38-
docs [names..] Build documentation [aliases: doc]
38+
docs <generator> Build documentation [aliases: doc]
3939
emacs [args..] Execute emacs with the appropriate environment
4040
eval [form] Evaluate lisp form with a proper PATH
4141
path [patterns..] Print the PATH (exec-path) from workspace [aliases: exec-path]

docs/content/Getting-Started/Commands-and-options/_index.en.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,12 @@ eask [GLOBAL-OPTIONS] loc [FILES..]
349349

350350
Commands used to build documentation site.
351351

352-
## 🔍 eask docs
352+
## 🔍 eask docs el2org
353353

354-
Build documentation.
354+
Build documentation with [el2org][].
355355

356356
```sh
357-
eask [GLOBAL-OPTIONS] docs [NAMES..]
357+
eask [GLOBAL-OPTIONS] docs el2org [NAMES..]
358358
```
359359

360360
# 🚩 Execution
@@ -1178,6 +1178,8 @@ Do not use a proxy for any URL matching pattern.
11781178
[GitLab Runner]: https://docs.gitlab.com/runner/
11791179
[Travis CI]: https://www.travis-ci.com/
11801180

1181+
[el2org]: https://github.com/tumashu/el2org
1182+
11811183
[ert]: https://www.gnu.org/software/emacs/manual/html_node/ert/
11821184
[ert-runner]: https://github.com/rejeep/ert-runner.el
11831185
[buttercup]: https://github.com/jorgenschaefer/emacs-buttercup

docs/content/Getting-Started/Commands-and-options/_index.zh-tw.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,12 +344,12 @@ eask [GLOBAL-OPTIONS] loc [FILES..]
344344

345345
用於建立文檔站點的命令。
346346

347-
## 🔍 eask docs
347+
## 🔍 eask docs el2org
348348

349-
建置文檔。
349+
使用 [el2org][] 建置文檔。
350350

351351
```sh
352-
eask [GLOBAL-OPTIONS] docs [NAMES..]
352+
eask [GLOBAL-OPTIONS] docs el2org [NAMES..]
353353
```
354354

355355
# 🚩 執行
@@ -1163,6 +1163,8 @@ eask --proxy "localhost:8888" [COMMAND]
11631163
[GitLab Runner]: https://docs.gitlab.com/runner/
11641164
[Travis CI]: https://www.travis-ci.com/
11651165

1166+
[el2org]: https://github.com/tumashu/el2org
1167+
11661168
[ert]: https://www.gnu.org/software/emacs/manual/html_node/ert/
11671169
[ert-runner]: https://github.com/rejeep/ert-runner.el
11681170
[buttercup]: https://github.com/jorgenschaefer/emacs-buttercup
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; core/docs.el --- Build documentation -*- lexical-binding: t; -*-
1+
;;; docs/el2org.el --- Build documentation with el2org -*- lexical-binding: t; -*-
22

33
;;; Commentary:
44
;;
@@ -23,6 +23,11 @@
2323
(locate-dominating-file dir "_prepare.el"))
2424
nil t))
2525

26+
;;
27+
;;; Flags
28+
29+
(eask-command-check "28.1")
30+
2631
;;
2732
;;; Externals
2833

@@ -72,4 +77,4 @@
7277
(eask-info "(No elisp source can be read)")
7378
(eask-help "core/docs")))))
7479

75-
;;; core/docs.el ends here
80+
;;; docs/el2org.el ends here

test/jest/local.test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ describe("local", () => {
7979
});
8080
});
8181

82+
describe("Documentation", () => {
83+
it("docs el2org", async () => {
84+
if (cmp(await emacsVersion(), "28.1") == 1) {
85+
await ctx.runEask("docs el2org");
86+
}
87+
});
88+
});
89+
8290
describe("Development", () => {
8391
beforeAll(async () => {
8492
await ctx.runEask("install-deps", { timeout: 40000 });
@@ -139,6 +147,9 @@ describe("local", () => {
139147
"recipes", // from generate recipes
140148
".gitignore", // from generate ignore elisp
141149
);
150+
151+
// restore original .gitignore
152+
await ctx.run("git restore .");
142153
});
143154

144155
it.each([

test/jest/local/.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# ignore these directories
2+
/.git
3+
/recipes
4+
5+
# ignore generated files
6+
*.elc
7+
8+
# eask packages
9+
.eask/
10+
dist/
11+
12+
# packaging
13+
*-autoloads.el
14+
*-pkg.el
15+
16+
# Documentation generation tests
17+
docs/

0 commit comments

Comments
 (0)