Skip to content

Commit 3e4682e

Browse files
authored
Merge branch 'nushell:main' into main
2 parents 8d5be05 + b97d470 commit 3e4682e

File tree

1,375 files changed

+75731
-16110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,375 files changed

+75731
-16110
lines changed
Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
name: Comment on manual command changes
22
on:
3-
pull_request:
3+
pull_request_target:
44
paths:
55
- 'commands/docs/**'
6+
- 'commands/categories/**'
67

78
jobs:
89
comment:
910
runs-on: ubuntu-latest
11+
# Maintainers/Contributors can add themselves exempt from this bot if they regularly run the command doc generation.
12+
# If you are on this list, be careful about accidental changes!
13+
if: ${{!contains(fromJSON('["hustcer", "sholderbach"]'), github.event.pull_request.user.login)}}
1014
steps:
1115
- uses: actions/[email protected]
1216
with:
@@ -16,8 +20,13 @@ jobs:
1620
owner: context.repo.owner,
1721
repo: context.repo.repo,
1822
body: 'Awesome that you are trying to improve the documentation of a nushell command!\n\n' +
19-
'As we autogenerate these command pages from the help information defined with the command after each release:\n'+
20-
'- If you already updated the command help, you are already done!\n'+
21-
'- Else, please look for the command in the [source tree](https://github.com/nushell/nushell/tree/main/crates) and make your changes directly there.\n\n'+
23+
'**You should not modify the files in `commands/docs` or `commands/categories`!**\n' +
24+
'We autogenerate these command pages from the `help` information defined by the command implementation, after each release. Thus:\n'+
25+
'- If you already updated the command help, you are already done and can close this PR!\n'+
26+
'- Else, please look for the command in the [source tree](https://github.com/nushell/nushell/tree/main/crates) and make your changes directly there in the `impl Command` and `Signature`.\n'+
27+
'- If you accidentally made a change in `commands/` while working on general documentation, please revert changes to `commands/`\n\n'+
2228
'Thanks for helping out!'
2329
})
30+
- run: |
31+
echo "This PR touched autogenerated command docs. If you are not a maintainer of the autogenerated docs, please revert changes to `commands/docs/**` and make the change on the nushell side"
32+
exit 1

.vuepress/components/BlogPosts.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export default {
2929
let path = p.path.replace('/blog/', '');
3030
return { ...p, path: path, date: path.substring(0, 10) };
3131
})
32-
.sort((a, b) => new Date(b.date) - new Date(a.date));
32+
.sort(
33+
(a, b) =>
34+
new Date(b.date) - new Date(a.date) || b.path.localeCompare(a.path),
35+
);
3336
},
3437
},
3538
};

.vuepress/config.js

Lines changed: 79 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
navbarPtBR,
2121
navbarRU,
2222
navbarZhCN,
23+
navbarKo,
2324
sidebarDe,
2425
sidebarEn,
2526
sidebarFr,
@@ -28,6 +29,7 @@ import {
2829
sidebarPtBR,
2930
sidebarRU,
3031
sidebarZhCN,
32+
sidebarKo,
3133
} from './configs/index.js';
3234

3335
const compareDate = (dateA, dateB) => {
@@ -88,8 +90,23 @@ export default defineUserConfig({
8890
title: 'Nushell',
8991
description: 'Новый тип оболочки.',
9092
},
93+
'/ko/': {
94+
lang: 'ko-KR',
95+
title: 'Nushell',
96+
description: '새로운 유형의 셸',
97+
},
9198
},
9299
head: [
100+
[
101+
'link',
102+
{
103+
rel: 'preload',
104+
href: '/fonts/FiraCode-Regular.woff2',
105+
as: 'font',
106+
type: 'font/woff2',
107+
crossorigin: 'anonymous',
108+
},
109+
],
93110
['meta', { name: 'theme-color', content: '#3eaf7c' }],
94111
['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
95112
[
@@ -103,11 +120,15 @@ export default defineUserConfig({
103120
handleImportPath: (str) =>
104121
str.replace(/^@snippets/, path.resolve(__dirname, '../snippets')),
105122
},
123+
highlighter: 'shiki',
106124
},
107125
// without this, we attempt to prefetch the whole site 😬
108126
shouldPrefetch: false,
109127
colorMode: 'auto',
110128
theme: defaultTheme({
129+
markdown: {
130+
highlighter: 'shiki',
131+
},
111132
repo: 'nushell/nushell',
112133
repoLabel: 'GitHub',
113134
editLinks: true,
@@ -171,6 +192,16 @@ export default defineUserConfig({
171192
navbar: navbarZhCN,
172193
sidebar: sidebarZhCN,
173194
},
195+
'/ko/': {
196+
selectText: '언어',
197+
selectLanguageName: '한국어',
198+
editLinkText: 'GitHub에서 수정하기',
199+
navbar: navbarKo,
200+
sidebar: sidebarKo,
201+
},
202+
},
203+
themePlugins: {
204+
prismjs: false,
174205
},
175206
}),
176207
plugins: [
@@ -185,14 +216,40 @@ export default defineUserConfig({
185216
},
186217
}),
187218
shikiPlugin({
188-
theme: 'dark-plus',
189-
lineNumbers: true,
219+
themes: {
220+
light: 'dark-plus',
221+
dark: 'dark-plus',
222+
onedarkpro: 'one-dark-pro', // pre-load one-dark-pro for ansi code blocks
223+
},
224+
lineNumbers: 10,
225+
collapsedLines: false,
226+
transformers: [
227+
// use one-dark-pro theme for ansi code blocks
228+
{
229+
preprocess(code, options) {
230+
if (options.lang == 'ansi') {
231+
this.options.defaultColor = 'onedarkpro';
232+
// this doesn't work at the top-level for some reason
233+
this.options.colorReplacements = {
234+
// make one-dark-pro background color the same as dark-plus
235+
'#282c34': '#1e1e1e',
236+
// HACK: change color of comments, since nu-highlight can't highlight them
237+
'#abb2bf': '#80858f',
238+
};
239+
}
240+
return code;
241+
},
242+
},
243+
],
190244
langs: [
245+
'csv',
191246
'nushell',
192247
'rust',
193248
'bash',
194249
'shell',
195250
'sh',
251+
'csv',
252+
'ansi',
196253
'toml',
197254
'json',
198255
'javascript',
@@ -218,14 +275,27 @@ export default defineUserConfig({
218275
);
219276
},
220277
sorter: (a, b) => {
221-
return compareDate(
222-
a.data.git?.createdTime
223-
? new Date(a.data.git?.createdTime)
224-
: a.frontmatter.date,
225-
b.data.git?.createdTime
226-
? new Date(b.data.git?.createdTime)
227-
: b.frontmatter.date,
278+
const pathDateA = new Date(
279+
a.path.replace('/blog/', '').substring(0, 10),
280+
);
281+
const pathDateB = new Date(
282+
b.path.replace('/blog/', '').substring(0, 10),
228283
);
284+
const effectiveDateA =
285+
pathDateA != 'Invalid Date'
286+
? pathDateA
287+
: a.frontmatter.date
288+
? new Date(a.frontmatter.date)
289+
: new Date(a.data.git?.createdTime);
290+
291+
// Determine the effective date for item B
292+
const effectiveDateB =
293+
pathDateB != 'Invalid Date'
294+
? pathDateB
295+
: b.frontmatter.date
296+
? new Date(b.frontmatter.date)
297+
: new Date(b.data.git?.createdTime);
298+
return compareDate(effectiveDateA, effectiveDateB);
229299
},
230300
}),
231301
sitemapPlugin({

.vuepress/configs/navbar/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ export * from './ja.js';
66
export * from './pt-BR.js';
77
export * from './ru.js';
88
export * from './zh-CN.js';
9+
export * from './ko.js';

.vuepress/configs/navbar/ko.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type { NavbarConfig } from '@vuepress/theme-default';
2+
3+
export const navbarKo: NavbarConfig = [
4+
{ text: '문서', link: '/ko/book/' },
5+
// { text: "Contributor Book", link: "/contributor-book/" },
6+
{ text: '쿡북', link: '/cookbook/' },
7+
{ text: '블로그', link: '/blog/' },
8+
];

.vuepress/configs/navbar/zh-CN.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
import type { NavbarConfig } from '@vuepress/theme-default';
22

33
export const navbarZhCN: NavbarConfig = [
4-
{ text: '书', link: '/zh-CN/book/' },
5-
// { text: "Contributor Book", link: "/contributor-book/" },
6-
{ text: 'Cookbook', link: '/cookbook/' },
4+
{ text: '安装 Nu !', link: '/zh-CN/book/installation' },
5+
{ text: '快速开始', link: '/zh-CN/book/getting_started' },
6+
{
7+
text: '文档',
8+
children: [
9+
{ text: 'Nushell 之书', link: '/zh-CN/book/' },
10+
{ text: '命令参考列表', link: '/commands/' },
11+
{ text: '实战指南', link: '/zh-CN/cookbook/' },
12+
{ text: '语言参考指南', link: '/lang-guide/' },
13+
{ text: '贡献指南', link: '/zh-CN/contributor-book/' },
14+
],
15+
},
716
{ text: '博客', link: '/blog/' },
817
];

.vuepress/configs/sidebar/command_categories.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const commandCategories = [
1111
'/commands/categories/debug.md',
1212
'/commands/categories/default.md',
1313
'/commands/categories/env.md',
14+
'/commands/categories/experimental.md',
1415
'/commands/categories/expression.md',
1516
'/commands/categories/filesystem.md',
1617
'/commands/categories/filters.md',

.vuepress/configs/sidebar/de.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const sidebarDe: SidebarConfig = {
5757
'/de/book/custom_completions',
5858
'/de/book/coloring_and_theming',
5959
'/de/book/hooks',
60-
'/de/book/background_task.md',
60+
'/de/book/background_jobs.md',
6161
],
6262
},
6363
{

.vuepress/configs/sidebar/en.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export const sidebarEn: SidebarConfig = {
3838
'/book/working_with_records.md',
3939
'/book/working_with_tables.md',
4040
'/book/navigating_structured_data.md',
41+
'/book/special_variables.md',
4142
],
4243
},
4344
{
@@ -61,6 +62,7 @@ export const sidebarEn: SidebarConfig = {
6162
],
6263
},
6364
'/book/overlays.md',
65+
'/book/sorting.md',
6466
'/book/testing.md',
6567
'/book/style_guide.md',
6668
],
@@ -73,15 +75,15 @@ export const sidebarEn: SidebarConfig = {
7375
'/book/configuration.md',
7476
'/book/environment.md',
7577
'/book/stdout_stderr_exit_codes.md',
76-
'/book/escaping.md',
78+
'/book/running_externals.md',
7779
'/book/3rdpartyprompts.md',
78-
'/book/shells_in_shells.md',
80+
'/book/directory_stack.md',
7981
'/book/line_editor.md',
8082
'/book/custom_completions.md',
8183
'/book/externs.md',
8284
'/book/coloring_and_theming.md',
8385
'/book/hooks.md',
84-
'/book/background_task.md',
86+
'/book/background_jobs.md',
8587
],
8688
},
8789
{
@@ -152,6 +154,7 @@ export const sidebarEn: SidebarConfig = {
152154
'/cookbook/parsing',
153155
'/cookbook/foreign_shell_scripts',
154156
'/cookbook/pattern_matching',
157+
'/cookbook/custom_completers',
155158
'/cookbook/external_completers',
156159
'/cookbook/modules',
157160
'/cookbook/files',

.vuepress/configs/sidebar/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ export * from './ja.js';
66
export * from './pt-BR.js';
77
export * from './ru.js';
88
export * from './zh-CN.js';
9+
export * from './ko.js';

0 commit comments

Comments
 (0)