@qui-cli/markdown 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/Markdown.d.ts +1 -0
- package/dist/Markdown.js +16 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [1.1.0](https://github.com/battis/qui-cli/compare/markdown/1.0.1...markdown/1.1.0) (2025-11-12)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* adjust heading level for Markdown prettiness ([88a651e](https://github.com/battis/qui-cli/commit/88a651e91a47b1b1b4814676c436c4845910c21a))
|
|
11
|
+
|
|
5
12
|
## [1.0.1](https://github.com/battis/qui-cli/compare/markdown/1.0.0...markdown/1.0.1) (2025-11-07)
|
|
6
13
|
|
|
7
14
|
### Bug Fixes
|
package/dist/Markdown.d.ts
CHANGED
package/dist/Markdown.js
CHANGED
|
@@ -9,12 +9,14 @@ export const name = 'markdown';
|
|
|
9
9
|
let outputPath = '.';
|
|
10
10
|
let fileName = 'usage.md';
|
|
11
11
|
let pre = '';
|
|
12
|
+
let headingLevelAdjustment = 0;
|
|
12
13
|
let post = '';
|
|
13
14
|
let overwrite = false;
|
|
14
15
|
export function configure(config = {}) {
|
|
15
16
|
outputPath = Plugin.hydrate(config.outputPath, outputPath);
|
|
16
17
|
fileName = Plugin.hydrate(config.fileName, fileName);
|
|
17
18
|
pre = Plugin.hydrate(config.pre, pre);
|
|
19
|
+
headingLevelAdjustment = Plugin.hydrate(config.headingLevelAdjustment, headingLevelAdjustment);
|
|
18
20
|
post = Plugin.hydrate(config.post, post);
|
|
19
21
|
overwrite = Plugin.hydrate(config.overwrite, overwrite);
|
|
20
22
|
}
|
|
@@ -36,7 +38,19 @@ export async function run() {
|
|
|
36
38
|
}
|
|
37
39
|
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
|
38
40
|
}
|
|
39
|
-
fs.writeFileSync(outputPath, `${pre.length ? `${pre}\n` : ''}${stripAnsi(Core.usageMarkdown())
|
|
41
|
+
fs.writeFileSync(outputPath, `${pre.length ? `${pre}\n` : ''}${adjustHeadingLevel(stripAnsi(Core.usageMarkdown()))
|
|
40
42
|
.replace('Usage:\n\n```', '## Usage:\n\n```bash')
|
|
41
|
-
.replace('
|
|
43
|
+
.replace('#### `-h --help', '## Arguments\n\n#### `-h --help')}${post.length ? `\n${post}` : ''}`);
|
|
44
|
+
}
|
|
45
|
+
function adjustHeadingLevel(usage) {
|
|
46
|
+
return usage
|
|
47
|
+
.split('\n')
|
|
48
|
+
.map((line) => {
|
|
49
|
+
const [, heading] = line.match(/^(#+) /) || [];
|
|
50
|
+
if (heading) {
|
|
51
|
+
return line.replace(/^(#+)/, '#'.repeat(heading.length + headingLevelAdjustment));
|
|
52
|
+
}
|
|
53
|
+
return line;
|
|
54
|
+
})
|
|
55
|
+
.join('\n');
|
|
42
56
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qui-cli/markdown",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "@qui-cli Plugin: Export usage as markdown",
|
|
5
5
|
"homepage": "https://github.com/battis/qui-cli/tree/main/packages/markdown#readme",
|
|
6
6
|
"repository": {
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"del-cli": "^6.0.0",
|
|
28
28
|
"npm-run-all": "^4.1.5",
|
|
29
29
|
"typescript": "^5.9.3",
|
|
30
|
-
"@qui-cli/core": "5.0.0",
|
|
31
30
|
"@qui-cli/plugin": "4.0.0",
|
|
32
|
-
"@qui-cli/root": "3.0.
|
|
31
|
+
"@qui-cli/root": "3.0.4",
|
|
32
|
+
"@qui-cli/core": "5.0.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@qui-cli/core": "5.x",
|