diff --git a/.gitignore b/.gitignore index 84bf662d1a2..6240da8b10b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,21 @@ -.temp/ -.cache/ -.DS_Store -node_modules -npm-debug.log -.vuepress/dist/ +# build output +dist/ +# generated types +.astro/ + +# dependencies +node_modules/ + +# logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* -# ignore the git mailmap file -.mailmap + +# environment variables +.env +.env.production + +# macOS-specific files +.DS_Store diff --git a/.prettierignore b/.prettierignore index f0002ae865d..7c2f7ecb68a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,12 +1,33 @@ +# build output +dist +# generated types +.astro + +# dependencies node_modules -package-lock.json - -operators.md -dataframes.md -nushell_map.md -*_bash*.md -commands/docs/*.md -.vuepress/.temp -.vuepress/.cache -.vuepress/dist/ + +# logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# environment variables +.env +.env.production + +# macOS-specific files +.DS_Store + +# files +**/*.js +**/*.ts +**/*.cjs +**/*.mjs +**/*.json +**/*.yaml +**/*.yml +!package.json +!tsconfig.json +!src/content/docs/book/coming-to-nu/coming_from_bash.md diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 544138be456..00000000000 --- a/.prettierrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "singleQuote": true -} diff --git a/.prettierrc.mjs b/.prettierrc.mjs new file mode 100644 index 00000000000..7e619305dc7 --- /dev/null +++ b/.prettierrc.mjs @@ -0,0 +1,12 @@ +/** @type {import("prettier").Config} */ +export default { + plugins: ["prettier-plugin-astro"], + overrides: [ + { + files: "*.astro", + options: { + parser: "astro", + }, + }, + ], +}; diff --git a/.typos.toml b/.typos.toml index c281b7ef1bc..b6653900376 100644 --- a/.typos.toml +++ b/.typos.toml @@ -1,8 +1,13 @@ [files] -extend-exclude = ["pt-BR", "de", "ja", "es", "book/commands"] +extend-exclude = ["pt-BR", "de", "ja", "es", "blog/202[0-3]*"] [default.extend-words] # Avoid the false positive in book/commands/str_replace.md ons = "ons" +# Avoid false positive for json placeholder in cookbook/http.md +optio = "optio" +ratatui = "ratatui" +doas = "doas" +iterm = "iterm" nushell = "nushell" diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000000..22a15055d63 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,4 @@ +{ + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000000..d6422097621 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] +} diff --git a/.vuepress/client.js b/.vuepress/client.js deleted file mode 100755 index 8626e478dcf..00000000000 --- a/.vuepress/client.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Client app enhancement file. - * - * https://v2.vuepress.vuejs.org/advanced/cookbook/usage-of-client-config.html - */ - -import { defineClientConfig } from '@vuepress/client'; -import BlogPosts from './components/BlogPosts.vue'; - -export default defineClientConfig({ - enhance({ app }) { - app.component('BlogPosts', BlogPosts); - }, -}); diff --git a/.vuepress/components/BlogPosts.vue b/.vuepress/components/BlogPosts.vue deleted file mode 100644 index d64a6915842..00000000000 --- a/.vuepress/components/BlogPosts.vue +++ /dev/null @@ -1,76 +0,0 @@ -<template> - <div> - <div v-for="post in posts"> - <section class="blog-post"> - <time class="published">{{ post.date }}</time> - <h2 class="title"> - <a v-bind:href="post.path" class="link">{{ post.title }}</a> - </h2> - <p v-if="post.frontmatter.excerpt" class="excerpt"> - {{ post.frontmatter.excerpt }} - </p> - <a class="read-more" v-bind:href="post.path"> Read More →</a> - </section> - </div> - </div> -</template> - -<script> -import pages from '@temp/pages'; -export default { - name: 'BlogPosts', - computed: { - posts() { - return pages - .filter((p) => { - return p.path.indexOf('/blog/') >= 0 && p.path != '/blog/'; - }) - .map((p) => { - let path = p.path.replace('/blog/', ''); - return { ...p, path: path, date: path.substring(0, 10) }; - }) - .sort((a, b) => new Date(b.date) - new Date(a.date)); - }, - }, -}; -</script> - -<style scoped> -.blog-post { - margin-bottom: 2.5rem; -} -.excerpt { - margin-top: 0; - margin-bottom: 12px; - font-size: 1.2rem; -} -.link { - font-weight: 700; - color: #2c3e50; - &:hover { - text-decoration: underline; - } -} -.published { - font-weight: 400; -} -.title { - margin-top: 0.5rem; - margin-bottom: 0.75rem; - font-size: 24px; - padding-top: 0; -} -.dark .title a { - color: #adb6be; -} -.read-more { - font-weight: 500; - border: 1px solid #3eaf7c; - border-radius: 4px; - color: #3eaf7c; - font-size: 0.9rem; - padding: 0.3rem 0.6rem; - box-shadow: 0 0; - display: inline-block; -} -</style> diff --git a/.vuepress/config.js b/.vuepress/config.js deleted file mode 100755 index e9b225646c8..00000000000 --- a/.vuepress/config.js +++ /dev/null @@ -1,209 +0,0 @@ -import path from 'path'; -import { defineUserConfig } from '@vuepress/cli'; -import { gitPlugin } from '@vuepress/plugin-git'; -import { feedPlugin } from 'vuepress-plugin-feed2'; -import { shikiPlugin } from '@vuepress/plugin-shiki'; -import { defaultTheme } from '@vuepress/theme-default'; -import { sitemapPlugin } from 'vuepress-plugin-sitemap2'; -import { docsearchPlugin } from '@vuepress/plugin-docsearch'; -import { backToTopPlugin } from '@vuepress/plugin-back-to-top'; -import { mediumZoomPlugin } from '@vuepress/plugin-medium-zoom'; - -import { - navbarDe, - navbarEn, - navbarEs, - navbarJa, - navbarPtBR, - navbarRU, - navbarZhCN, - sidebarDe, - sidebarEn, - sidebarEs, - sidebarJa, - sidebarPtBR, - sidebarRU, - sidebarZhCN, -} from './configs/index.js'; - -const compareDate = (dateA, dateB) => { - if (!dateA || !(dateA instanceof Date)) return 1; - if (!dateB || !(dateB instanceof Date)) return -1; - - return dateB.getTime() - dateA.getTime(); -}; - -export default defineUserConfig({ - locales: { - '/': { - lang: 'English', - title: 'Nushell', - description: 'A new type of shell.', - }, - '/zh-CN/': { - lang: 'zh-CN', - title: 'Nushell', - description: '一种新型的Shell', - }, - '/de/': { - lang: 'Deutsch', - title: 'Nushell', - description: 'Eine neue Art von Shell.', - }, - '/es/': { - lang: 'es', - title: 'Nushell', - description: 'Un nuevo tipo de shell.', - }, - '/ja/': { - lang: 'ja', - title: 'Nushell', - description: '新しいタイプのシェル', - }, - '/pt-BR/': { - lang: 'pt-BR', - title: 'Nushell', - description: 'Um novo tipo de shell.', - }, - '/ru': { - lang: 'ru', - title: 'Nushell', - description: 'Новый тип оболочки.', - }, - }, - head: [ - ['meta', { name: 'theme-color', content: '#3eaf7c' }], - ['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }], - [ - 'meta', - { name: 'apple-mobile-web-app-status-bar-style', content: 'black' }, - ], - ['link', { rel: 'icon', href: '/icon.png' }], - ], - markdown: { - code: { - lineNumbers: false, - }, - importCode: { - handleImportPath: (str) => - str.replace(/^@snippets/, path.resolve(__dirname, '../snippets')), - }, - }, - // without this, we attempt to prefetch the whole site 😬 - shouldPrefetch: false, - theme: defaultTheme({ - repo: 'nushell/nushell', - repoLabel: 'GitHub', - editLinks: true, - docsRepo: 'nushell/nushell.github.io', - docsBranch: 'main', - lastUpdated: false, - locales: { - '/': { - selectText: 'Languages', - selectLanguageName: 'English', - editLinkText: 'Edit this page on GitHub', - navbar: navbarEn, - sidebar: sidebarEn, - }, - '/de/': { - selectText: 'Sprachen', - selectLanguageName: 'Deutsch', - editLinkText: 'Diese Seite auf GitHub bearbeiten', - navbar: navbarDe, - sidebar: sidebarDe, - }, - '/es/': { - selectText: 'Idiomas', - selectLanguageName: 'Español', - editLinkText: 'Edita esta página en GitHub', - navbar: navbarEs, - sidebar: sidebarEs, - }, - '/ja/': { - selectText: '言語', - selectLanguageName: '日本語', - editLinkText: 'GitHubでこのページを編集する', - navbar: navbarJa, - sidebar: sidebarJa, - }, - '/pt-BR/': { - selectText: 'Línguas', - selectLanguageName: 'Português do Brasil', - editLinkText: 'Edite esta página no GitHub', - navbar: navbarPtBR, - sidebar: sidebarPtBR, - }, - '/ru': { - selectText: 'Языки', - selectLanguageName: 'Русский язык', - editLinkText: 'Отредактируйте эту страницу на GitHub', - navbar: navbarRU, - sidebar: sidebarRU, - }, - '/zh-CN/': { - selectText: '语言', - selectLanguageName: '中文', - editLinkText: '在GitHub上编辑此页面', - navbar: navbarZhCN, - sidebar: sidebarZhCN, - }, - }, - }), - plugins: [ - gitPlugin(), - backToTopPlugin(), - mediumZoomPlugin(), - shikiPlugin({ - theme: 'dark-plus', - langs: [ - 'nushell', - 'rust', - 'bash', - 'shell', - 'sh', - 'toml', - 'json', - 'python', - 'cpp', - 'powershell', - ], - }), - docsearchPlugin({ - appId: 'GHCTOYCW6T', - indexName: 'nushell', - apiKey: 'dd6a8f770a42efaed5befa429d167232', - }), - feedPlugin({ - rss: true, - json: true, - atom: true, - count: 30, - hostname: 'https://www.nushell.sh', - filter: ({ frontmatter, filePathRelative }) => { - return ( - frontmatter.feed === true || filePathRelative?.indexOf('blog/') >= 0 - ); - }, - sorter: (a, b) => { - return compareDate( - a.data.git?.createdTime - ? new Date(a.data.git?.createdTime) - : a.frontmatter.date, - b.data.git?.createdTime - ? new Date(b.data.git?.createdTime) - : b.frontmatter.date, - ); - }, - }), - sitemapPlugin({ - hostname: 'https://www.nushell.sh/', - }), - ], - onPrepared: async (app) => { - await app.writeTemp( - 'pages.js', - `export default ${JSON.stringify(app.pages.map(({ data }) => data))}`, - ); - }, -}); diff --git a/.vuepress/configs/index.ts b/.vuepress/configs/index.ts deleted file mode 100644 index e9323f1da3c..00000000000 --- a/.vuepress/configs/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './navbar/index.js'; -export * from './sidebar/index.js'; diff --git a/.vuepress/configs/navbar/de.ts b/.vuepress/configs/navbar/de.ts deleted file mode 100644 index ce03892a4b3..00000000000 --- a/.vuepress/configs/navbar/de.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { NavbarConfig } from '@vuepress/theme-default'; - -export const navbarDe: NavbarConfig = [ - { text: 'Buch', link: '/de/book/' }, - // { text: "Contributor Book", link: "/contributor-book/" }, - { text: 'Cookbook', link: '/cookbook/' }, - { text: 'Blog', link: '/blog/' }, -]; diff --git a/.vuepress/configs/navbar/en.ts b/.vuepress/configs/navbar/en.ts deleted file mode 100644 index 1db569c200d..00000000000 --- a/.vuepress/configs/navbar/en.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { NavbarConfig } from '@vuepress/theme-default'; - -export const navbarEn: NavbarConfig = [ - { text: 'Book', link: '/book/' }, - // { text: "Contributor Book", link: "/contributor-book/" }, - { text: 'Commands', link: '/commands/' }, - { text: 'Cookbook', link: '/cookbook/' }, - { text: 'Blog', link: '/blog/' }, - { text: 'Ref', link: '/lang-guide/' }, -]; diff --git a/.vuepress/configs/navbar/es.ts b/.vuepress/configs/navbar/es.ts deleted file mode 100644 index c80a28b016a..00000000000 --- a/.vuepress/configs/navbar/es.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { NavbarConfig } from '@vuepress/theme-default'; - -export const navbarEs: NavbarConfig = [ - { text: 'Libro', link: '/es/book/' }, - { text: 'Cookbook', link: '/cookbook/' }, - { text: 'Blog', link: '/blog/' }, -]; diff --git a/.vuepress/configs/navbar/index.ts b/.vuepress/configs/navbar/index.ts deleted file mode 100644 index 5703043d438..00000000000 --- a/.vuepress/configs/navbar/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './de.js'; -export * from './en.js'; -export * from './es.js'; -export * from './ja.js'; -export * from './pt-BR.js'; -export * from './ru.js'; -export * from './zh-CN.js'; diff --git a/.vuepress/configs/navbar/ja.ts b/.vuepress/configs/navbar/ja.ts deleted file mode 100644 index 8821e24ef56..00000000000 --- a/.vuepress/configs/navbar/ja.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { NavbarConfig } from '@vuepress/theme-default'; - -export const navbarJa: NavbarConfig = [ - { text: 'Book', link: '/ja/book/' }, - // { text: "Contributor Book", link: "/contributor-book/" }, - { text: 'Cookbook', link: '/cookbook/' }, - { text: 'Blog', link: '/blog/' }, -]; diff --git a/.vuepress/configs/navbar/pt-BR.ts b/.vuepress/configs/navbar/pt-BR.ts deleted file mode 100644 index 388373a5a05..00000000000 --- a/.vuepress/configs/navbar/pt-BR.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { NavbarConfig } from '@vuepress/theme-default'; - -export const navbarPtBR: NavbarConfig = [ - { text: 'Livro', link: '/pt-BR/book/' }, - { text: 'Cookbook', link: '/cookbook/' }, - { text: 'Blog', link: '/blog/' }, -]; diff --git a/.vuepress/configs/navbar/ru.ts b/.vuepress/configs/navbar/ru.ts deleted file mode 100644 index 46305040115..00000000000 --- a/.vuepress/configs/navbar/ru.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { NavbarConfig } from '@vuepress/theme-default'; - -export const navbarRU: NavbarConfig = [ - { text: 'Книга', link: '/ru/book/' }, - // { text: "Contributor Book", link: "/contributor-book/" }, - { text: 'Команды', link: '/commands/' }, - { text: 'Cookbook', link: '/cookbook/' }, - { text: 'Блог', link: '/blog/' }, -]; diff --git a/.vuepress/configs/navbar/zh-CN.ts b/.vuepress/configs/navbar/zh-CN.ts deleted file mode 100644 index a46745f3e13..00000000000 --- a/.vuepress/configs/navbar/zh-CN.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { NavbarConfig } from '@vuepress/theme-default'; - -export const navbarZhCN: NavbarConfig = [ - { text: '书', link: '/zh-CN/book/' }, - // { text: "Contributor Book", link: "/contributor-book/" }, - { text: 'Cookbook', link: '/cookbook/' }, - { text: '博客', link: '/blog/' }, -]; diff --git a/.vuepress/configs/sidebar/command_categories.ts b/.vuepress/configs/sidebar/command_categories.ts deleted file mode 100644 index dad4c818bfa..00000000000 --- a/.vuepress/configs/sidebar/command_categories.ts +++ /dev/null @@ -1,34 +0,0 @@ -export const commandCategories = [ - '/commands/categories/bits.md', - '/commands/categories/bytes.md', - '/commands/categories/chart.md', - '/commands/categories/conversions.md', - '/commands/categories/core.md', - '/commands/categories/database.md', - '/commands/categories/dataframe.md', - '/commands/categories/dataframe_or_lazyframe.md', - '/commands/categories/date.md', - '/commands/categories/debug.md', - '/commands/categories/default.md', - '/commands/categories/env.md', - '/commands/categories/expression.md', - '/commands/categories/filesystem.md', - '/commands/categories/filters.md', - '/commands/categories/formats.md', - '/commands/categories/generators.md', - '/commands/categories/hash.md', - '/commands/categories/history.md', - '/commands/categories/lazyframe.md', - '/commands/categories/math.md', - '/commands/categories/misc.md', - '/commands/categories/network.md', - '/commands/categories/path.md', - '/commands/categories/platform.md', - '/commands/categories/prompt.md', - '/commands/categories/random.md', - '/commands/categories/removed.md', - '/commands/categories/shells.md', - '/commands/categories/strings.md', - '/commands/categories/system.md', - '/commands/categories/viewers.md', -]; diff --git a/.vuepress/configs/sidebar/de.ts b/.vuepress/configs/sidebar/de.ts deleted file mode 100644 index 3667f4f9870..00000000000 --- a/.vuepress/configs/sidebar/de.ts +++ /dev/null @@ -1,76 +0,0 @@ -import type { SidebarConfig } from '@vuepress/theme-default'; -import type { commandCategories } from './command_categories'; - -export const sidebarDe: SidebarConfig = { - '/de/book/': [ - { - text: 'Einleitung', - link: '/de/book/README.md', - collapsible: false, - }, - { - text: 'Erste Schritte', - link: '/de/book/getting_started.md', - collapsible: false, - children: [ - '/de/book/installation', - '/de/book/moving_around', - '/de/book/thinking_in_nushell', - ], - }, - { - text: 'Nu Grundlagen', - link: '/de/book/nu_fundamentals.md', - collapsible: false, - children: [ - '/de/book/types_of_data', - '/de/book/loading_data', - '/de/book/pipeline.md', - '/de/book/working_with_strings', - '/de/book/working_with_lists', - '/de/book/working_with_tables', - ], - }, - { - text: 'Programmieren in Nu', - link: '/de/book/programming_in_nu.md', - collapsible: false, - children: [ - '/de/book/custom_commands', - '/de/book/aliases', - '/de/book/operators', - '/de/book/variables_and_subexpressions.md', - '/de/book/scripts', - '/de/book/overlays', - '/de/book/command_signature', - ], - }, - { - text: 'Nu als Shell', - link: '/de/book/nu_as_a_shell.md', - collapsible: false, - children: [ - '/de/book/configuration', - '/de/book/environment', - '/de/book/escaping', - '/de/book/3rdpartyprompts', - '/de/book/custom_completions', - '/de/book/coloring_and_theming', - '/de/book/hooks', - '/de/book/background_task.md', - ], - }, - { - text: 'Wechsel zu Nu', - link: '/de/book/coming_to_nu.md', - collapsible: false, - children: ['/de/book/coming_from_bash', '/de/book/command_reference'], - }, - { - text: '(Nicht nur für) Fortgeschrittene', - link: '/de/book/advanced.md', - collapsible: false, - children: ['/de/book/plugins', '/de/book/metadata.md'], - }, - ], -}; diff --git a/.vuepress/configs/sidebar/en.ts b/.vuepress/configs/sidebar/en.ts deleted file mode 100644 index d364eda9187..00000000000 --- a/.vuepress/configs/sidebar/en.ts +++ /dev/null @@ -1,161 +0,0 @@ -import type { SidebarConfig } from '@vuepress/theme-default'; -import { commandCategories } from './command_categories'; - -export const sidebarEn: SidebarConfig = { - '/book/': [ - { - text: 'Introduction', - link: '/book/README.md', - collapsible: false, - }, - { - text: 'Getting Started', - link: '/book/getting_started.md', - collapsible: false, - children: [ - '/book/installation.md', - '/book/default_shell.md', - '/book/quick_tour.md', - '/book/moving_around.md', - '/book/thinking_in_nu.md', - '/book/cheat_sheet.md', - ], - }, - { - text: 'Nu Fundamentals', - link: '/book/nu_fundamentals.md', - collapsible: false, - children: [ - '/book/types_of_data.md', - '/book/loading_data.md', - '/book/pipelines.md', - '/book/working_with_strings.md', - '/book/working_with_lists.md', - '/book/working_with_tables.md', - ], - }, - { - text: 'Programming in Nu', - link: '/book/programming_in_nu.md', - collapsible: false, - children: [ - '/book/custom_commands.md', - '/book/aliases.md', - '/book/operators.md', - '/book/variables_and_subexpressions.md', - '/book/control_flow.md', - '/book/scripts.md', - '/book/modules.md', - '/book/overlays.md', - '/book/command_signature.md', - '/book/testing.md', - '/book/style_guide.md', - ], - }, - { - text: 'Nu as a Shell', - link: '/book/nu_as_a_shell.md', - collapsible: false, - children: [ - '/book/configuration.md', - '/book/environment.md', - '/book/stdout_stderr_exit_codes.md', - '/book/escaping.md', - '/book/3rdpartyprompts.md', - '/book/shells_in_shells.md', - '/book/line_editor.md', - '/book/externs.md', - '/book/custom_completions.md', - '/book/coloring_and_theming.md', - '/book/hooks.md', - '/book/background_task.md', - ], - }, - { - text: 'Coming to Nu', - link: '/book/coming_to_nu.md', - collapsible: false, - children: [ - '/book/coming_from_bash.md', - '/book/coming_from_cmd.md', - '/book/nushell_map.md', - '/book/nushell_map_imperative.md', - '/book/nushell_map_functional.md', - '/book/nushell_operator_map.md', - ], - }, - { - text: 'Design Notes', - link: '/book/design_notes.md', - collapsible: false, - children: ['/book/how_nushell_code_gets_run.md'], - }, - { - text: '(Not So) Advanced', - link: '/book/advanced.md', - collapsible: false, - children: [ - '/book/standard_library.md', - '/book/dataframes.md', - '/book/metadata.md', - '/book/creating_errors.md', - '/book/parallelism.md', - '/book/plugins.md', - '/book/explore.md', - ], - }, - ], - '/commands/': [ - { - text: 'Categories', - collapsible: false, - children: commandCategories, - }, - ], - '/contributor-book/': [ - { - text: 'Contributor Book', - link: '/contributor-book/README.md', - collapsible: false, - children: [ - 'README.md', - 'philosophy', - 'philosophy_0_80', - 'commands', - 'plugins', - ], - }, - ], - '/cookbook/': [ - { - text: 'Cookbook', - collapsible: false, - children: [ - 'README.md', - 'setup', - 'help', - 'system', - 'parsing', - 'pattern_matching', - 'external_completers', - 'files', - 'git', - 'parsing_git_log', - 'http', - 'direnv', - 'ssh_agent', - 'tables', - 'polars_v_pandas_v_nushell', - 'jq_v_nushell', - ], - }, - ], - '/lang-guide/': [ - { - text: 'Language Reference Guide', - link: '/lang-guide/README.md', - collapsible: false, - children: ['README.md', 'lang-guide.md'], - }, - ], -}; diff --git a/.vuepress/configs/sidebar/es.ts b/.vuepress/configs/sidebar/es.ts deleted file mode 100644 index e602f5ecf24..00000000000 --- a/.vuepress/configs/sidebar/es.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { SidebarConfig } from '@vuepress/theme-default'; - -export const sidebarEs: SidebarConfig = { - '/es/book/': [ - { - text: 'Nu Libro', - collapsible: false, - children: [ - 'README.md', - 'instalacion', - 'explorando', - 'tipos_de_datos', - 'cargando_datos', // "trabajando_con_listas" - 'trabajando_con_tablas', - 'pipeline', - 'configuracion', // "custom_commands" - 'aliases', // "operadores" - 'matematicas', // "variables_y_subexpresiones" - 'entorno', // "scripts" - 'metadatos', - 'shells_en_shells', - 'escapando', - 'plugins', // "dataframes" - 'llegando_de_bash', - 'mapa_nushell', - 'mapa_imperativo_nushell', - 'mapa_funcional_nushell', - 'mapa_operador_nushell', - '/book/command_reference.md', - ], - }, - ], -}; diff --git a/.vuepress/configs/sidebar/index.ts b/.vuepress/configs/sidebar/index.ts deleted file mode 100644 index 5703043d438..00000000000 --- a/.vuepress/configs/sidebar/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './de.js'; -export * from './en.js'; -export * from './es.js'; -export * from './ja.js'; -export * from './pt-BR.js'; -export * from './ru.js'; -export * from './zh-CN.js'; diff --git a/.vuepress/configs/sidebar/ja.ts b/.vuepress/configs/sidebar/ja.ts deleted file mode 100644 index 3053cd02d59..00000000000 --- a/.vuepress/configs/sidebar/ja.ts +++ /dev/null @@ -1,107 +0,0 @@ -import type { SidebarConfig } from '@vuepress/theme-default'; -// import { commandCategories } from './command_categories'; - -export const sidebarJa: SidebarConfig = { - '/ja/book/': [ - { - text: 'はじめに', - link: '/ja/book/README.md', - collapsible: false, - }, - { - text: 'Getting Started', - link: '/ja/book/getting_started.md', - collapsible: false, - children: [ - '/ja/book/installation.md', - '/book/default_shell.md', - '/ja/book/quick_tour.md', - '/ja/book/moving_around.md', - '/book/thinking_in_nu.md', - '/book/cheat_sheet.md', - ], - }, - { - text: 'Nu 基礎編', - link: '/ja/book/nu_fundamentals.md', - collapsible: false, - children: [ - '/ja/book/types_of_data.md', - '/ja/book/loading_data.md', - '/ja/book/pipeline.md', - '/book/working_with_strings.md', - '/book/working_with_lists.md', - '/ja/book/working_with_tables.md', - ], - }, - { - text: 'Programming in Nu', - link: '/ja/book/programming_in_nu.md', - collapsible: false, - children: [ - '/book/custom_commands.md', - '/ja/book/aliases.md', - '/book/operators.md', - '/book/variables_and_subexpressions.md', - '/book/scripts.md', - '/book/modules.md', - '/book/overlays.md', - '/book/command_signature.md', - '/book/testing.md', - '/book/style_guide.md', - ], - }, - { - text: 'シェルとしての Nu', - link: '/ja/book/nu_as_a_shell.md', - collapsible: false, - children: [ - '/ja/book/configuration.md', - '/ja/book/environment.md', - '/book/stdout_stderr_exit_codes.md', - '/ja/book/escaping.md', - '/book/3rdpartyprompts.md', - '/ja/book/shells_in_shells.md', - '/book/line_editor.md', - '/book/externs.md', - '/book/custom_completions.md', - '/book/coloring_and_theming.md', - '/book/hooks.md', - '/book/background_task.md', - ], - }, - { - text: 'Nu への移行', - link: '/ja/book/coming_to_nu.md', - collapsible: false, - children: [ - '/ja/book/coming_from_bash.md', - '/book/coming_from_cmd.md', - '/ja/book/nushell_map.md', - '/ja/book/nushell_map_imperative.md', - '/ja/book/nushell_map_functional.md', - '/ja/book/nushell_operator_map.md', - ], - }, - { - text: 'Design Notes', - link: '/ja/book/design_notes.md', - collapsible: false, - children: ['/book/how_nushell_code_gets_run.md'], - }, - { - text: '(Not So) Advanced', - link: '/ja/book/advanced.md', - collapsible: false, - children: [ - '/book/standard_library.md', - '/book/dataframes.md', - '/ja/book/metadata.md', - '/book/creating_errors.md', - '/book/parallelism.md', - '/ja/book/plugins.md', - '/book/explore.md', - ], - }, - ], -}; diff --git a/.vuepress/configs/sidebar/pt-BR.ts b/.vuepress/configs/sidebar/pt-BR.ts deleted file mode 100644 index 3a4dba3250a..00000000000 --- a/.vuepress/configs/sidebar/pt-BR.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { SidebarConfig } from '@vuepress/theme-default'; - -export const sidebarPtBR: SidebarConfig = { - '/pt-BR/book/': [ - { - text: 'Nu Livro', - collapsible: false, - children: [ - 'instalacao', - 'introducao', - 'explorando', - 'tipos_de_dados', - 'carregando_dados', - 'trabalhando_com_tabelas', - 'pipeline', - 'line_editor', - 'metadados', - 'shells_em_shells', - 'escapando', - 'plugins', - ], - }, - ], -}; diff --git a/.vuepress/configs/sidebar/ru.ts b/.vuepress/configs/sidebar/ru.ts deleted file mode 100644 index 7720a5a3bae..00000000000 --- a/.vuepress/configs/sidebar/ru.ts +++ /dev/null @@ -1,110 +0,0 @@ -import type { SidebarConfig } from '@vuepress/theme-default'; -import { commandCategories } from './command_categories'; - -export const sidebarRU: SidebarConfig = { - '/ru/book/': [ - { - text: 'Введение', - link: '/ru/book/README.md', - collapsible: false, - }, - // { - // text: 'Начало работы', - // link: '/ru/book/getting_started.md', - // collapsible: false, - // children: [ - // '/ru/book/installation.md', - // '/ru/book/default_shell.md', - // '/ru/book/quick_tour.md', - // '/ru/book/moving_around.md', - // '/ru/book/thinking_in_nu.md', - // '/ru/book/cheat_sheet.md', - // ], - // }, - // { - // text: 'Основы Nu', - // link: '/nu_fundamentals.md', - // collapsible: false, - // children: [ - // '/ru/book/types_of_data.md', - // '/ru/book/loading_data.md', - // '/ru/book/pipelines.md', - // '/ru/book/working_with_strings.md', - // '/ru/book/working_with_lists.md', - // '/ru/book/working_with_tables.md', - // ], - // }, - // { - // text: 'Программирование в Nu', - // link: '/programming_in_nu.md', - // collapsible: false, - // children: [ - // '/ru/book/custom_commands.md', - // '/ru/book/aliases.md', - // '/ru/book/operators.md', - // '/ru/book/variables_and_subexpressions.md', - // '/ru/book/control_flow.md', - // '/ru/book/scripts.md', - // '/ru/book/modules.md', - // '/ru/book/overlays.md', - // '/ru/book/command_signature.md', - // '/ru/book/testing.md', - // '/ru/book/style_guide.md', - // ], - // }, - // { - // text: 'Nu как оболочка', - // link: '/nu_as_a_shell.md', - // collapsible: false, - // children: [ - // '/ru/book/configuration.md', - // '/ru/book/environment.md', - // '/ru/book/stdout_stderr_exit_codes.md', - // '/ru/book/escaping.md', - // '/ru/book/3rdpartyprompts.md', - // '/ru/book/shells_in_shells.md', - // '/ru/book/line_editor.md', - // '/ru/book/externs.md', - // '/ru/book/custom_completions.md', - // '/ru/book/coloring_and_theming.md', - // '/ru/book/hooks.md', - // '/ru/book/background_task.md', - // ], - // }, - // { - // text: 'Переход в Nu', - // link: '/coming_to_nu.md', - // collapsible: false, - // children: [ - // '/ru/book/coming_from_bash.md', - // '/ru/book/coming_from_cmd.md', - // '/ru/book/nushell_map.md', - // '/ru/book/nushell_map_imperative.md', - // '/ru/book/nushell_map_functional.md', - // '/ru/book/nushell_operator_map.md', - // ], - // }, - // { - // text: 'Примечания к дизайну', - // link: '/design_notes.md', - // collapsible: false, - // children: [ - // '/ru/book/how_nushell_code_gets_run.md' - // ], - // }, - // { - // text: '(Не очень) Продвинутый', - // link: '/advanced.md', - // collapsible: false, - // children: [ - // '/ru/book/standard_library.md', - // '/ru/book/dataframes.md', - // '/ru/book/metadata.md', - // '/ru/book/creating_errors.md', - // '/ru/book/parallelism.md', - // '/ru/book/plugins.md', - // '/ru/book/explore.md', - // ], - // }, - ], -}; diff --git a/.vuepress/configs/sidebar/zh-CN.ts b/.vuepress/configs/sidebar/zh-CN.ts deleted file mode 100644 index 960bc73e59e..00000000000 --- a/.vuepress/configs/sidebar/zh-CN.ts +++ /dev/null @@ -1,81 +0,0 @@ -import type { SidebarConfig } from '@vuepress/theme-default'; - -export const sidebarZhCN: SidebarConfig = { - '/zh-CN/book/': [ - { - text: '入门篇', - collapsible: false, - children: [ - 'README.md', - 'installation', - 'thinking_in_nu', - 'moving_around', - ], - }, - { - text: 'Nu 基础篇', - collapsible: false, - children: [ - 'types_of_data', - 'loading_data', - 'working_with_strings', - 'working_with_lists', - 'working_with_tables', - 'pipelines', - 'command_reference', - ], - }, - { - text: 'Nushell 编程', - collapsible: false, - children: [ - 'custom_commands', - 'aliases', - 'operators', - 'variables_and_subexpressions', - 'scripts', - 'modules', - 'overlays', - ], - }, - { - text: 'Nu 作为 Shell 使用', - collapsible: false, - children: [ - 'configuration', - 'environment', - 'stdout_stderr_exit_codes', - 'escaping', - '3rdpartyprompts', - 'shells_in_shells', - 'line_editor', - 'externs', - 'custom_completions', - 'coloring_and_theming', - 'hooks.md', - ], - }, - { - text: '迁移到 Nu', - collapsible: false, - children: [ - 'coming_from_bash', - 'nushell_map', - 'nushell_map_imperative', - 'nushell_map_functional', - 'nushell_operator_map', - ], - }, - { - text: '高级篇', - collapsible: false, - children: [ - 'dataframes', - 'metadata', - 'creating_errors', - 'parallelism', - 'plugins', - ], - }, - ], -}; diff --git a/.vuepress/public/icon.png b/.vuepress/public/icon.png deleted file mode 100644 index d5cf15428e5..00000000000 Binary files a/.vuepress/public/icon.png and /dev/null differ diff --git a/.vuepress/styles/index.scss b/.vuepress/styles/index.scss deleted file mode 100755 index bc09eb16627..00000000000 --- a/.vuepress/styles/index.scss +++ /dev/null @@ -1,46 +0,0 @@ -.navbar .navbar-items-wrapper { - flex-direction: row-reverse; -} - -.command-title { - margin-top: 15px; - white-space: pre-wrap; -} - -/* Reduce line height in code blocks - * to avoid gaps in tables rendered with box-drawing characters - */ -.theme-default-content pre, -.theme-default-content pre[class*=language-] { - line-height: 1; -} - -/* Add DejaVu Sans Mono to the list of monospaced fonts. - * This allows tables to be rendered seamlessly with box-drawing characters. - */ -:root { - --font-family-code: Consolas, Monaco, 'Andale Mono', 'DejaVu Sans Mono', 'Ubuntu Mono', monospace; -} - -@media screen and (min-width: 720px) and (max-width: 815px) { - #docsearch-container { - width: 150px; - } - button.toggle-color-mode-button { - margin-right: 20px; - margin-left: 20px; - } -} - -@media screen and (min-width: 816px) { - #docsearch-container { - width: 239px; - .DocSearch-Button-Container { - width: 150px; - } - } - - button.toggle-color-mode-button { - margin-right: 30px; - } -} diff --git a/.vuepress/styles/palette.scss b/.vuepress/styles/palette.scss deleted file mode 100755 index d9d86da65d9..00000000000 --- a/.vuepress/styles/palette.scss +++ /dev/null @@ -1,4 +0,0 @@ -$accentColor: #3eaf7c; -$textColor: #2c3e50; -$borderColor: #eaecef; -$codeBgColor: #282c34; diff --git a/README.md b/README.md index 19b9e1e467d..4af41779ca9 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ features: ### Nu works with existing data -Nu speaks [JSON, YAML, SQLite, Excel, and more](/book/loading_data.html) out of the box. It's easy to bring data into a Nu pipeline whether it's in a file, a database, or a web API: +Nu speaks [JSON, YAML, SQLite, Excel, and more](/book/loading_data) out of the box. It's easy to bring data into a Nu pipeline whether it's in a file, a database, or a web API: <img src="https://www.nushell.sh/frontpage/fetch-example.png" alt="Screenshot showing fetch with a web API" class="hero"/> @@ -30,7 +30,7 @@ Nu operates on typed data, so it catches bugs that other shells don't. And when ## Get Nu -Nushell is available as [downloadable binaries](https://github.com/nushell/nushell/releases), [via your favourite package manager](https://repology.org/project/nushell/versions), in [a GitHub Action](https://github.com/marketplace/actions/setup-nu), and as [source code](https://github.com/nushell/nushell). Read [the detailed installation instructions](/book/installation.html) or dive right in: +Nushell is available as [downloadable binaries](https://github.com/nushell/nushell/releases), [via your favourite package manager](https://repology.org/project/nushell/versions), in [a GitHub Action](https://github.com/marketplace/actions/setup-nu), and as [source code](https://github.com/nushell/nushell). Read [the detailed installation instructions](/book/installation) or dive right in: #### macOS / Linux: diff --git a/astro.config.mjs b/astro.config.mjs new file mode 100644 index 00000000000..a3b4a52a4ca --- /dev/null +++ b/astro.config.mjs @@ -0,0 +1,113 @@ +import fs from "node:fs"; +import starlight from "@astrojs/starlight"; +import { ExpressiveCodeTheme } from "@astrojs/starlight/expressive-code"; +import { defineConfig } from "astro/config"; + +const jsoncString = fs.readFileSync( + new URL("./public/nushell_minimal_dark_theme.json", import.meta.url), + "utf-8", +); +const nushellTheme = ExpressiveCodeTheme.fromJSONString(jsoncString); + +// https://astro.build/config +export default defineConfig({ + site: "https://www.nushell.sh/", + integrations: [ + starlight({ + title: "Nushell Docs", + defaultLocale: "root", + locales: { + root: { + label: "English", + lang: "en", + }, + "zh-cn": { + label: "简体中文", + lang: "zh-CN", + }, + es: { + label: "Español", + }, + ja: { + label: "日本語", + }, + pt: { + label: "Português", + }, + ru: { + label: "Русский", + }, + de: { + label: "Deutsch", + }, + }, + expressiveCode: { + themes: [nushellTheme], + }, + editLink: { + baseUrl: "https://github.com/nushell/nushell.github.io/edit/master/", + }, + customCss: ["./src/styles/index.css"], + logo: { + src: "./src/assets/images/nu_icon.png", + }, + social: { + github: "https://github.com/nushell/nushell", + discord: "https://discord.gg/NtAbbGn", + }, + sidebar: [ + { + label: "Book", + collapsed: true, + items: [ + { + label: "Getting Started", + translations: { pt: "Comece Aqui" }, + collapsed: true, + autogenerate: { directory: "/book/getting-started" }, + }, + { + label: "Nu Fundamentals", + collapsed: true, + autogenerate: { directory: "/book/nu-fundamentals" }, + }, + { + label: "Programming in Nu", + collapsed: true, + autogenerate: { directory: "/book/programming-in-nu" }, + }, + { + label: "Nu as a Shell", + collapsed: true, + autogenerate: { directory: "/book/nu-as-a-shell" }, + }, + { + label: "Coming to Nu", + collapsed: true, + autogenerate: { directory: "/book/coming-to-nu" }, + }, + { + label: "(Not so) Advanced", + collapsed: true, + autogenerate: { directory: "/book/advanced" }, + }, + ], + }, + { + label: "Command Reference", + collapsed: true, + link: "/commands/", + }, + { + label: "Cookbook", + collapsed: true, + autogenerate: { directory: "/cookbook/" }, + }, + { + label: "Blog", + link: "/blog/", + }, + ], + }), + ], +}); diff --git a/biome.json b/biome.json new file mode 100644 index 00000000000..a61694f408a --- /dev/null +++ b/biome.json @@ -0,0 +1,26 @@ +{ + "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", + "organizeImports": { + "enabled": true + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true + } + }, + "formatter": { + "enabled": true, + "indentStyle": "space" + }, + "files": { + "ignoreUnknown": true, + "ignore": [ + "dist/", + ".vercel/", + ".astro/", + "./public/*json", + "./src/content/docs/book/coming_from_bash.md" + ] + } +} diff --git a/blog/2023-07-25-nushell_0_83.md b/blog/2023-07-25-nushell_0_83.md deleted file mode 100644 index 497b1bbd17f..00000000000 --- a/blog/2023-07-25-nushell_0_83.md +++ /dev/null @@ -1,451 +0,0 @@ ---- -title: Nushell 0.83 -author: The Nu Authors -author_site: https://twitter.com/nu_shell -author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.83 of Nu. This release adds match guards, stronger type checking features, unit testing improvements, flexible variable initializations, and more. ---- - -# Nushell 0.83 - -Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. - -Today, we're releasing version 0.83 of Nu. This release adds match guards, stronger type checking features, unit testing improvements, flexible variable initializations, and more. - -<!-- more --> - -# Where to get it - -Nu 0.83 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.83.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. - -NOTE: The optional dataframe functionality is available by `cargo install nu --features=dataframe`. - -As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. - -# Themes of this release / New features - -## Fixes, stabilization and shoutouts - -| Name | Link | Description | -| ------------------------------------------------------ | ---------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| [@WindSoilder](https://github.com/WindSoilder) | [9747](https://github.com/nushell/nushell/pull/9747) | Redirection: make `o>`, `e>`, `o+e>`'s target support variables and string interpolation | -| [@kubouch](https://github.com/kubouch) | [9679](https://github.com/nushell/nushell/pull/9679) | Fix broken constants in scopes | -| [@rusty-jules](https://github.com/rusty-jules) | [9594](https://github.com/nushell/nushell/pull/9594) | Fix: return all headers with the same name from `http <method>` | -| [@baehyunsol](https://github.com/baehyunsol) | [9582](https://github.com/nushell/nushell/pull/9582) | make the behaviours of `last` and `first` more consistent | -| [@hanjunghyuk](https://github.com/hanjunghyuk) | [9623](https://github.com/nushell/nushell/pull/9623) | Fix `explore` crashes on {} | -| [@YassineHaouzane](https://github.com/YassineHaouzane) | [9616](https://github.com/nushell/nushell/pull/9616) | Fix: update engine_state when history.isolation is true (#9268) | -| [@IanManske](https://github.com/IanManske) | [9603](https://github.com/nushell/nushell/pull/9603) | Fix `headers` command handling of missing values | -| [@AyushSingh13](https://github.com/AyushSingh13) | [9580](https://github.com/nushell/nushell/pull/9580) | fixes `which` showing aliases as built-in nushell commands | -| [@mengsuenyan](https://github.com/mengsuenyan) | [9662](https://github.com/nushell/nushell/pull/9662) | fix the command `cp -u src dst`/`mv -u src dst` doesn't work when the… | - -## Changes to commands -Since last release, some commands have changed and some have been created, here is a list of some changes and what they mean: -- [@amtoine](https://github.com/amtoine) in [#9646]: `which` returns the type of the command instead of only whether it is builtin or not and uses more explicit column names -- [@atahabaki](https://github.com/atahabaki) in [#9750]: `str expand` now allows empty member in *brace expansion*, e.g. `A{,B,C}` would expand to `[A, AB, AC]` -- [@fdncred](https://github.com/fdncred) in [#9669]: `keybinding listen` gives more information about keys like `home` and `end`, namely their `kind` and `state` -- [@NotLebedev](https://github.com/NotLebedev) in [#9453]: `input listen` allows to query for a single key press, e.g. the following will take a 4-char input `1..4 | each { input listen } | where key_type == char | get code | str join` -- [@kubouch](https://github.com/kubouch) in [#9687]: `path` commands lose the `-c` flag; instead, use `update` to update table columns - -[#9646]: https://github.com/nushell/nushell/pull/9646 -[#9750]: https://github.com/nushell/nushell/pull/9750 -[#9669]: https://github.com/nushell/nushell/pull/9669 -[#9453]: https://github.com/nushell/nushell/pull/9453 -[#9687]: https://github.com/nushell/nushell/pull/9687 - -## Command set refinement efforts -Again with this new release, we are continuing refining our set of core commands. As part of this, another set of commands have moved to `extra`. Thanks to folks who are helping our efforts on the road to 1.0! - -> **Note** -> No command has been removed completely, they have just been moved in the *extra* feature of Nushell. -> simply use `cargo ... --features extra` to reenable them. - -Math commands have been moved by [@stormasm] in [#9674], [#9657] and [#9647] and the following -commands have been moved in [#9404]: `fmt`, `each while`, `roll`, `roll down`, `roll left`, `roll right`, -`roll up`, `rotate`, `update cells`, `decode hex`, `encode hex`, `from url`, `to html`, `ansi gradient`, -`ansi link`and `format` - -[@stormasm]: https://github.com/stormasm -[#9674]: https://github.com/nushell/nushell/pull/9674 -[#9657]: https://github.com/nushell/nushell/pull/9657 -[#9647]: https://github.com/nushell/nushell/pull/9647 -[#9404]: https://github.com/nushell/nushell/pull/9404 - -## Language improvements -Since last release, a few changes have happened to the Nu language itself. - -### Declaration and assignment of variables -Until now, declaration keywords such as `let` and `mut` have required the use of parentheses around pipelines to assign the output of a chain of command to a variable. -Thanks to [@jntrnr] in [#9658] and [#9589], this syntax has been relaxed for `let` and `mut`. Let's give some examples! -```nushell -let filenames = ls | where type == file | get name -``` -and -```nushell -mut my_var = "hello world" | str length -``` -are now completely valid Nushell code. - -> **Note** -> this new syntax does not work on `const` and it does not apply to assignment of values to variables, e.g. -> ```nushell -> $env.FILENAMES = ls | where type == file | get name -> ``` -> is not parsed as valid Nushell. - -Another parser improvement has to do with the use of `if` and `match` in variable assignment. -In [#9650], [@Windsoilder] made the following Nushell snippets possible: -```nushell -mut a = 3 -$a = if 4 == 3 { 10 } else {20} -``` -and -```nushell -$env.BUILD_EXT = match 3 { 1 => { 'yes!' }, _ => { 'no!' } } -``` - -[@jntrnr]: https://github.com/jntrnr -[#9658]: https://github.com/nushell/nushell/pull/9658 -[#9589]: https://github.com/nushell/nushell/pull/9589 -[@Windsoilder]: https://github.com/Windsoilder -[#9650]: https://github.com/nushell/nushell/pull/9650 - -### Input / output type checking and annotations ([@jntrnr]) -Nushell as a language is more strictly typed than other shell languages. -However, not everything was type-checked nor possible to annotate and this new release tries to fill this gap a bit more. - -> **Note** -> in the following of this section, the term *input / output signature* is used. This describes the input of a command -> and the associated output type of the command for the given input type, e.g. in `ls | get 0.name` the input type of -> `get` is a `table` and its output type is a `string`, so we can say that the *input / output signature* of `get` here -> is `table -> string`. -> -> Please note that *input / output signatures* always come in pair. - -First, [#9686] makes the input / output type signatures clearer in the help pages of commands. -Then, [#9690] and [#9680] enable input / output type annotations on custom commands and enforce a strong type checking -on the input and output of commands. -This means a few things -- the input / output of custom commands can be annotated -```nushell -def sum []: list<int> -> int { - math sum -} -``` -- some type-invalid calls to commands are now parsed as an error, e.g. `123 | get foo` gives the following error -```nushell -Error: nu::parser::input_type_mismatch - - × Command does not support int input. - ╭─[entry #2:1:1] - 1 │ 123 | get foo - · ─┬─ - · ╰── command doesn't support int input - ╰──── -``` - -This is still a work in progress, so some commands might have incorrect or missing input / output type annotations :open_mouth: -This is expected and we worked and are working on this to fix all incorrect signatures ([#9755], [#9749], [#9707], [#9706], [#9695], -[#9683], [#9775], [#9741], [#9742], [#9739] and [#9778])! - -[@jntrnr]: https://github.com/jntrnr -[#9686]: https://github.com/nushell/nushell/pull/9686 -[#9690]: https://github.com/nushell/nushell/pull/9690 -[#9680]: https://github.com/nushell/nushell/pull/9680 -[#9755]: https://github.com/nushell/nushell/pull/9755 -[#9749]: https://github.com/nushell/nushell/pull/9749 -[#9707]: https://github.com/nushell/nushell/pull/9707 -[#9706]: https://github.com/nushell/nushell/pull/9706 -[#9695]: https://github.com/nushell/nushell/pull/9695 -[#9683]: https://github.com/nushell/nushell/pull/9683 -[#9775]: https://github.com/nushell/nushell/pull/9775 -[#9741]: https://github.com/nushell/nushell/pull/9741 -[#9742]: https://github.com/nushell/nushell/pull/9742 -[#9739]: https://github.com/nushell/nushell/pull/9739 -[#9778]: https://github.com/nushell/nushell/pull/9778 - -### Shoutouts -In between the two releases, [@1Kinoti](https://github.com/1Kinoti) has worked on some nice improvements to the language -- match guards have been added to the `match` command in [#9621](https://github.com/nushell/nushell/pull/9621) -- `table` types can now have parameters, just as `record`s and `list`s can, thansk to [#9613](https://github.com/nushell/nushell/pull/9613) -- structural subtyping has been improved in [#9614](https://github.com/nushell/nushell/pull/9614) and allow to match structured types regardless of the orders of the fields - -## Configuration tweaks -Contributions have been made to give a more consistent and sensible default experience in Nushell, both when using -the `default_config.nu` config file or when not having a config, e.g. with `nu -n`. -A better right prompt has been written in [#9585] and [#9581] and the default configuration has been polished in [#9676]. - -[#9585]: https://github.com/nushell/nushell/pull/9585 -[#9581]: https://github.com/nushell/nushell/pull/9581 -[#9676]: https://github.com/nushell/nushell/pull/9676 - -## The standard library -The biggest topic in this 0.83 release for the standard library has been the test runner! - -Thanks to [@Yethal], the test runner of the standard library can now use annotations to decide whether or not to run -a command as part of the test suite of a project: [#9628], [#9622], [#9611] and [#9406]. - -For instance, we can now write a module as follows -```nushell -def add [a: int, b: int] { - $a + $b -} - -#[test] -def addition [] { - use std assert - assert equal (add 1 2) 3 -} -``` -and `std testing run-tests` would successfully run the `addition` test, no need to define tests with `test_` in their names! - -Thanks to [@Hofer-Julian] ([#9607]), the standard library now also comes with a `pwd` command that tells you were you are in -the filesystem. - -[@Yethal]: https://github.com/Yethal -[@Hofer-Julian]: https://github.com/Hofer-Julian -[#9628]: https://github.com/nushell/nushell/pull/9628 -[#9622]: https://github.com/nushell/nushell/pull/9622 -[#9611]: https://github.com/nushell/nushell/pull/9611 -[#9406]: https://github.com/nushell/nushell/pull/9406 -[#9607]: https://github.com/nushell/nushell/pull/9607 - -# Breaking changes - -**PLEASE NOTE:** there are some big breaking changes in this release. These include: - -* Removal of `let-env` (now use the `$env.FOO = "BAR"` form instead) -* Stricter checking of input/output types -* Transitioning of a set of commands to now be avialable via `extra` feature rather than default - -Full list of breaking changes: -- [#9574](https://github.com/nushell/nushell/pull/9574) remove let-env, focus on mutating $env -- [#9587](https://github.com/nushell/nushell/pull/9587) disallow blocks as first-class values -- [#9589](https://github.com/nushell/nushell/pull/9589) `let` no longer allows bareword assignment (Eg, `let foo = bar` where `bar` is assumed to be a string) -- [#9582](https://github.com/nushell/nushell/pull/9582) make the behaviours of `last` and `first` more consistent -- [#9594](https://github.com/nushell/nushell/pull/9594) Fix: return all headers with the same name from `http <method>` -- [#9646](https://github.com/nushell/nushell/pull/9646) change the output of `which` to be more explicit -- [#9404](https://github.com/nushell/nushell/pull/9404) [#9647](https://github.com/nushell/nushell/pull/9647) [#9657](https://github.com/nushell/nushell/pull/9657) - a number of commands have been moved to `extra` -- [#9680](https://github.com/nushell/nushell/pull/9680) Input output checking -- [#9613](https://github.com/nushell/nushell/pull/9613) allow table types to have parameters -- [#9687](https://github.com/nushell/nushell/pull/9687) Refactor path commands -- [#9690](https://github.com/nushell/nushell/pull/9690) The `extern` command has split into `extern` and `extern-wrapped`, the latter allowing a block to be called when calling an extern - -# Full changelog -## Nushell -- [sholderbach](https://github.com/sholderbach) created - - [Adjust signatures for cellpath access of tables](https://github.com/nushell/nushell/pull/9778) - - [Update `nu-ansi-term`, `lscolors`, and `reedline`](https://github.com/nushell/nushell/pull/9787) - - [Abort type determination for List early](https://github.com/nushell/nushell/pull/9779) - - [Fix output signature of `split chars`/`words`](https://github.com/nushell/nushell/pull/9739) - - [Use explicit in/out list types for vectorized commands](https://github.com/nushell/nushell/pull/9742) - - [Add explicit input types for vectorized `into int` form](https://github.com/nushell/nushell/pull/9741) - - [Remove underused devdep `getset`](https://github.com/nushell/nushell/pull/9727) - - [Clean up tests containing unnecessary `cwd:` tokens](https://github.com/nushell/nushell/pull/9692) - - [Use `is-terminal` crate for now](https://github.com/nushell/nushell/pull/9670) - - [Bump deps to transitively use hashbrown 0.14](https://github.com/nushell/nushell/pull/9668) - - [Apply nightly clippy lints](https://github.com/nushell/nushell/pull/9654) - - [Update reedline dev version lock](https://github.com/nushell/nushell/pull/9644) - - [Bump `indexmap` to 2.0](https://github.com/nushell/nushell/pull/9643) - - [Remove duplicated dependency on `ansi-str 0.7`](https://github.com/nushell/nushell/pull/9641) - - [Update `proc-macro2` lock, fix nightly build](https://github.com/nushell/nushell/pull/9618) - - [Exclude deprecated commands from completions](https://github.com/nushell/nushell/pull/9612) - - [Document `fn pipeline()` used with `nu!` tests](https://github.com/nushell/nushell/pull/9609) - - [Remove unnecessary parentheses](https://github.com/nushell/nushell/pull/9605) -- [app/dependabot](https://github.com/app/dependabot) created - - [Bump pretty_assertions from 1.3.0 to 1.4.0](https://github.com/nushell/nushell/pull/9781) - - [Bump tempfile from 3.6.0 to 3.7.0](https://github.com/nushell/nushell/pull/9780) - - [Bump miette from 5.9.0 to 5.10.0](https://github.com/nushell/nushell/pull/9713) - - [Bump strum_macros from 0.24.3 to 0.25.1](https://github.com/nushell/nushell/pull/9714) - - [Bump strum from 0.24.1 to 0.25.0](https://github.com/nushell/nushell/pull/9639) - - [Bump scraper from 0.16.0 to 0.17.1](https://github.com/nushell/nushell/pull/9638) - - [Bump libproc from 0.13.0 to 0.14.0](https://github.com/nushell/nushell/pull/9640) - - [Bump tempfile from 3.5.0 to 3.6.0](https://github.com/nushell/nushell/pull/9591) - - [Bump calamine from 0.19.1 to 0.21.2](https://github.com/nushell/nushell/pull/9592) - - [Bump ureq from 2.6.2 to 2.7.1](https://github.com/nushell/nushell/pull/9590) - - [Bump open from 4.1.0 to 5.0.0](https://github.com/nushell/nushell/pull/9526) -- [amtoine](https://github.com/amtoine) created - - [add `table -> table` to `into datetime`](https://github.com/nushell/nushell/pull/9775) - - [change the output of `which` to be more explicit](https://github.com/nushell/nushell/pull/9646) - - [add `any -> record` to `metadata`](https://github.com/nushell/nushell/pull/9755) - - [sync default config / env with default behaviour without any configuration](https://github.com/nushell/nushell/pull/9676) - - [allow `into filesize` to take tables as input / output](https://github.com/nushell/nushell/pull/9706) - - [simplify the test for `let` core command](https://github.com/nushell/nushell/pull/9671) - - [fix the `std` test commands calls in dev documents](https://github.com/nushell/nushell/pull/9535) - - [refactor the CI](https://github.com/nushell/nushell/pull/9626) - - [REFACTOR: move the 0% commands to `nu-cmd-extra`](https://github.com/nushell/nushell/pull/9404) - - [simplify the `nu!` tests for `last` and `first` commands](https://github.com/nushell/nushell/pull/9608) -- [hexavik](https://github.com/hexavik) created - - [Fix: remove unnecessary `r#"..."#` (#8670)](https://github.com/nushell/nushell/pull/9764) -- [mengsuenyan](https://github.com/mengsuenyan) created - - [fix #9653 the cmd `detect columns` with the flag `-c`](https://github.com/nushell/nushell/pull/9667) - - [fix the command `cp -u src dst`/`mv -u src dst` doesn't work when the…](https://github.com/nushell/nushell/pull/9662) -- [IanManske](https://github.com/IanManske) created - - [Add functions for each `Value` case](https://github.com/nushell/nushell/pull/9736) - - [nushell should be non-interactive if `--testbin` is supplied](https://github.com/nushell/nushell/pull/9730) - - [Do not attempt to take control of terminal in non-interactive mode](https://github.com/nushell/nushell/pull/9693) - - [Fix SIGTTIN handling](https://github.com/nushell/nushell/pull/9681) - - [Fix `headers` command handling of missing values](https://github.com/nushell/nushell/pull/9603) -- [fdncred](https://github.com/fdncred) created - - [update history_isolation to false](https://github.com/nushell/nushell/pull/9763) - - [change the default of history.isolation](https://github.com/nushell/nushell/pull/9762) - - [handle sqlite tables better by surrounding with brackets](https://github.com/nushell/nushell/pull/9752) - - [add range input to par-each](https://github.com/nushell/nushell/pull/9749) - - [normalize default_config/env formatting](https://github.com/nushell/nushell/pull/9731) - - [allow range as a input_output_type on filter](https://github.com/nushell/nushell/pull/9707) - - [update rust toolchain to 1.69.0](https://github.com/nushell/nushell/pull/9691) - - [add more input_output_types found from breaking scripts](https://github.com/nushell/nushell/pull/9683) - - [add kind and state to other key presses](https://github.com/nushell/nushell/pull/9669) - - [fix right prompt in the default_env.nu](https://github.com/nushell/nushell/pull/9581) - - [fix typo in deprecated message: `$nu` should be `$env`](https://github.com/nushell/nushell/pull/9579) - - [update ide-check help text](https://github.com/nushell/nushell/pull/9559) - - [add input_output type to `input list` to return string](https://github.com/nushell/nushell/pull/9557) - - [convert a string to a raw binary string of 0s and 1s](https://github.com/nushell/nushell/pull/9534) - - [update sqlparser dep to 0.34](https://github.com/nushell/nushell/pull/9549) -- [atahabaki](https://github.com/atahabaki) created - - [str-expand: new capability, empty collection item](https://github.com/nushell/nushell/pull/9750) - - [A new subcommand to str, str-expand.](https://github.com/nushell/nushell/pull/9290) -- [jntrnr](https://github.com/jntrnr) created - - [Fix capture logic for inner closures](https://github.com/nushell/nushell/pull/9754) - - [fix input signature of let/mut](https://github.com/nushell/nushell/pull/9695) - - [Revert "Fix SIGTTIN handling"](https://github.com/nushell/nushell/pull/9694) - - [Custom command input/output types](https://github.com/nushell/nushell/pull/9690) - - [Change input/output types in help to a table](https://github.com/nushell/nushell/pull/9686) - - [Input output checking](https://github.com/nushell/nushell/pull/9680) - - [Remove broken compile-time overload system](https://github.com/nushell/nushell/pull/9677) - - [allow mut to take pipelines](https://github.com/nushell/nushell/pull/9658) - - [Move to using a safer shell integration default setting](https://github.com/nushell/nushell/pull/9600) - - [Let with pipeline](https://github.com/nushell/nushell/pull/9589) - - [disallow blocks as first-class values](https://github.com/nushell/nushell/pull/9587) - - [use an easier-to-read date format in prompt](https://github.com/nushell/nushell/pull/9585) - - [fix a few clippy issues](https://github.com/nushell/nushell/pull/9578) - - [remove let-env, focus on mutating $env](https://github.com/nushell/nushell/pull/9574) - - [Improve type hovers](https://github.com/nushell/nushell/pull/9515) -- [cramt](https://github.com/cramt) created - - [fix removing symlinks on windows](https://github.com/nushell/nushell/pull/9704) -- [WindSoilder](https://github.com/WindSoilder) created - - [Redirection: make `o>`, `e>`, `o+e>`'s target support variables and string interpolation](https://github.com/nushell/nushell/pull/9747) - - [support env assignment and mutable variable assignment with `if` block and `match` guard](https://github.com/nushell/nushell/pull/9650) - - [dependency: use notify-debouncer-full(based on notify v6) instead of notify v4](https://github.com/nushell/nushell/pull/9606) - - [Bracketed paste refactor](https://github.com/nushell/nushell/pull/9547) - - [fix cd permissions when user belongs to folder group](https://github.com/nushell/nushell/pull/9531) - - [`rename`: add -b flag to support closure input](https://github.com/nushell/nushell/pull/8948) -- [stormasm](https://github.com/stormasm) created - - [add in a Readme for the crate nu-cmd-extra](https://github.com/nushell/nushell/pull/9745) - - [remove warning: unused import pipeline](https://github.com/nushell/nushell/pull/9675) - - [cratification: part III of the math commands to nu-cmd-extra](https://github.com/nushell/nushell/pull/9674) - - [cratification: part II of the math commands to nu-cmd-extra](https://github.com/nushell/nushell/pull/9657) - - [cratification: start moving over the math commands to nu-cmd-extra](https://github.com/nushell/nushell/pull/9647) -- [dmatos2012](https://github.com/dmatos2012) created - - [Disallow empty record with empty key,value pairs on ini format](https://github.com/nushell/nushell/pull/9722) -- [nibon7](https://github.com/nibon7) created - - [Remove `is-root` crate](https://github.com/nushell/nushell/pull/9615) - - [Replace `users` with `nix` crate](https://github.com/nushell/nushell/pull/9610) - - [Fix cargo-build-nu](https://github.com/nushell/nushell/pull/9571) - - [Refactor cargo-build-nu](https://github.com/nushell/nushell/pull/9554) - - [Fix release workflows](https://github.com/nushell/nushell/pull/9542) -- [1Kinoti](https://github.com/1Kinoti) created - - [add match guards](https://github.com/nushell/nushell/pull/9621) - - [allow tables to have annotations](https://github.com/nushell/nushell/pull/9613) - - [improve subtyping](https://github.com/nushell/nushell/pull/9614) -- [kubouch](https://github.com/kubouch) created - - [Refactor path commands](https://github.com/nushell/nushell/pull/9687) - - [Fix broken constants in scopes](https://github.com/nushell/nushell/pull/9679) -- [zhiburt](https://github.com/zhiburt) created - - [nu-explore/ Add handlers for HOME/END keys](https://github.com/nushell/nushell/pull/9666) - - [Fix #9548](https://github.com/nushell/nushell/pull/9552) -- [hanjunghyuk](https://github.com/hanjunghyuk) created - - [Remove unnecessary `cwd`, `pipeline()`, `r#` from various tests](https://github.com/nushell/nushell/pull/9645) - - [Fix `explore` crashes on {}](https://github.com/nushell/nushell/pull/9623) -- [Yethal](https://github.com/Yethal) created - - [test-runner: add configurable threading](https://github.com/nushell/nushell/pull/9628) - - [test-runner: Performance improvements + regex match for test include/exclude](https://github.com/nushell/nushell/pull/9622) - - [test-runner: Add option to exclude single test and module](https://github.com/nushell/nushell/pull/9611) - - [Implement annotations support in test runner](https://github.com/nushell/nushell/pull/9406) - - [Pre-register plugins inside docker container](https://github.com/nushell/nushell/pull/9533) -- [AyushSingh13](https://github.com/AyushSingh13) created - - [fixes `which` showing aliases as built-in nushell commands](https://github.com/nushell/nushell/pull/9580) -- [YassineHaouzane](https://github.com/YassineHaouzane) created - - [Fix: update engine_state when history.isolation is true (#9268)](https://github.com/nushell/nushell/pull/9616) -- [Hofer-Julian](https://github.com/Hofer-Julian) created - - [Add `pwd` command to stdlib](https://github.com/nushell/nushell/pull/9607) -- [NotLebedev](https://github.com/NotLebedev) created - - [Command to get individual keys](https://github.com/nushell/nushell/pull/9453) -- [rusty-jules](https://github.com/rusty-jules) created - - [Fix: return all headers with the same name from `http <method>`](https://github.com/nushell/nushell/pull/9594) -- [baehyunsol](https://github.com/baehyunsol) created - - [make the behaviours of `last` and `first` more consistent](https://github.com/nushell/nushell/pull/9582) -- [bgmort](https://github.com/bgmort) created - - [Add useful example to `http options` documentation](https://github.com/nushell/nushell/pull/9576) - -## Extension -- [fdncred](https://github.com/fdncred) created - - [forgot to merge changes for 1.60](https://github.com/nushell/vscode-nushell-lang/pull/145) - -## Documentation -- [amtoine](https://github.com/amtoine) created - - [refactor `ssh-agent` cookbook example](https://github.com/nushell/nushell.github.io/pull/982) - - [remove all `| table` from the book](https://github.com/nushell/nushell.github.io/pull/976) - - [add a more complete example to persist aliases in `config.nu`](https://github.com/nushell/nushell.github.io/pull/973) -- [Heidar-An](https://github.com/Heidar-An) created - - [Update nushell_map_imperative.md](https://github.com/nushell/nushell.github.io/pull/986) -- [JoaquinTrinanes](https://github.com/JoaquinTrinanes) created - - [Add external completers cookbook entry to sidebar](https://github.com/nushell/nushell.github.io/pull/985) - - [Expand external completer docs](https://github.com/nushell/nushell.github.io/pull/984) -- [fachammer](https://github.com/fachammer) created - - [Fix link](https://github.com/nushell/nushell.github.io/pull/981) - - [Fix typo](https://github.com/nushell/nushell.github.io/pull/980) - - [Fix typo](https://github.com/nushell/nushell.github.io/pull/979) -- [hustcer](https://github.com/hustcer) created - - [Use lefthook instead of husky and lint-staged for git hooks](https://github.com/nushell/nushell.github.io/pull/978) - - [Refresh commands docs for Nu v0.82](https://github.com/nushell/nushell.github.io/pull/965) -- [Equationzhao](https://github.com/Equationzhao) created - - [fix a broken link in plugins page in zh-CN](https://github.com/nushell/nushell.github.io/pull/975) -- [Hofer-Julian](https://github.com/Hofer-Julian) created - - [Remove `&&` and `||`](https://github.com/nushell/nushell.github.io/pull/974) -- [jarrodu](https://github.com/jarrodu) created - - [Fix typo](https://github.com/nushell/nushell.github.io/pull/971) -- [sholderbach](https://github.com/sholderbach) created - - [Automate response to PRs trying to update commands](https://github.com/nushell/nushell.github.io/pull/969) -- [waldyrious](https://github.com/waldyrious) created - - [Fix typo in 2023-06-27-nushell_0_82.md](https://github.com/nushell/nushell.github.io/pull/967) - -## Nu_Scripts -- [amtoine](https://github.com/amtoine) created - - [add `$.version` to `package.nuon`](https://github.com/nushell/nu_scripts/pull/548) - - [move the extra menus of Nushell into `custom-menus/extra/`](https://github.com/nushell/nu_scripts/pull/550) - - [make the release note TODOs HTML comments](https://github.com/nushell/nu_scripts/pull/557) - - [refactor: simplify the `nu_release` script](https://github.com/nushell/nu_scripts/pull/540) - - [fix the release note scripts](https://github.com/nushell/nu_scripts/pull/538) - - [update the `make_release/Readme.md` with the whole process](https://github.com/nushell/nu_scripts/pull/541) - - [use `$env.` instead of `let-env `](https://github.com/nushell/nu_scripts/pull/543) -- [jntrnr](https://github.com/jntrnr) created - - [Update some benchmarks. Re-port the gradient benchmark](https://github.com/nushell/nu_scripts/pull/558) -- [JalonWong](https://github.com/JalonWong) created - - [Add a git prompt](https://github.com/nushell/nu_scripts/pull/555) -- [fj0r](https://github.com/fj0r) created - - [ssh complete cache use whitelist](https://github.com/nushell/nu_scripts/pull/553) - - [upgrade to 0.82](https://github.com/nushell/nu_scripts/pull/539) -- [fdncred](https://github.com/fdncred) created - - [fix error background color in oh-my.nu script](https://github.com/nushell/nu_scripts/pull/551) -- [maxim-uvarov](https://github.com/maxim-uvarov) created - - [conda fix](https://github.com/nushell/nu_scripts/pull/547) -- [trantor](https://github.com/trantor) created - - [Update README.md: typo](https://github.com/nushell/nu_scripts/pull/545) -- [dedebenui](https://github.com/dedebenui) created - - [fix pass-completion as `let` cannot be used at module level](https://github.com/nushell/nu_scripts/pull/544) -- [bobhy](https://github.com/bobhy) created - - [full line v2; with git status!](https://github.com/nushell/nu_scripts/pull/542) - -## Reedline -- [sholderbach](https://github.com/sholderbach) created - - [Bump `nu-ansi-term` to 0.49.0](https://github.com/nushell/reedline/pull/613) - - [Update the `Cargo.lock` for tests and demo](https://github.com/nushell/reedline/pull/611) - - [Fix clippy lint for DoubleEndedIterator](https://github.com/nushell/reedline/pull/610) - - [Update (dev-)deps strum/pretty-assertions,rstest](https://github.com/nushell/reedline/pull/600) -- [nibon7](https://github.com/nibon7) created - - [Fix big_word_left_index](https://github.com/nushell/reedline/pull/609) - - [Remove unneeded features of chrono](https://github.com/nushell/reedline/pull/599) -- [NotLebedev](https://github.com/NotLebedev) created - - [Replace crossterm ScrollUp with universal workaround](https://github.com/nushell/reedline/pull/601) -- [WindSoilder](https://github.com/WindSoilder) created - - [always disable bracketed paste after read_line](https://github.com/nushell/reedline/pull/598) diff --git a/blog/2023-08-22-nushell_0_84_0.md b/blog/2023-08-22-nushell_0_84_0.md deleted file mode 100644 index 9158a94de8e..00000000000 --- a/blog/2023-08-22-nushell_0_84_0.md +++ /dev/null @@ -1,416 +0,0 @@ ---- -title: Nushell 0.84.0 -author: The Nu Authors -author_site: https://twitter.com/nu_shell -author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.84.0 of Nu. This release adds adds exporting constants from modules, `scope` commands improvements, cosmetic changes, and many smaller changes to our commands. ---- - -# Nushell 0.84.0 - -Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. - -Today, we're releasing version 0.84.0 of Nu. This release adds exporting constants from modules, `scope` commands improvements, cosmetic changes, and many smaller changes to our commands. - -<!-- more --> - -# Where to get it - -Nu 0.84.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.84.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. - -NOTE: The optional dataframe functionality is available by `cargo install nu --features=dataframe`. - -As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. - -# Themes of this release / New features - -## (Major Breaking Change!) `str replace` matches substring by default ([kubouch](https://github.com/nushell/nushell/pull/10038)) - -::: warning Breaking change -See a full overview of the [breaking changes](#breaking-changes) -::: - -`str replace` now matches a substring instead of a regular expression by default and the `-s`/`--string` flag is deprecated (will be removed altogether in 0.85). Matching a substring by default makes it more consistent with the rest of the Nushell's commands. - -> :bulb: **Note!** -> Since `str replace` is a widely used command, many scripts are going to break. Fixing it is easy: -> * If you used `str replace` **without** the `-s`/`--string` flag, you used regex matching and you should add `--regex` flag to keep the previous functionality. -> * If you used `str replace` **with** the `-s`/`--string` flag, you will get a deprecation warning. To get rid of the warning, simply remove the flag. - -## Constants from modules ([WindSoilder](https://github.com/nushell/nushell/pull/9773), [kubouch](https://github.com/nushell/nushell/pull/10049)) - -You can now use constants in modules and export them. Calling `use` on a module will create record containing all module's constants. You can also import the constants directly, for example with `use module.nu const-name`, without creating the module's record. Example: - -```nushell -> module spam { - export const X = 'x' - export module eggs { - export const Y = 'y' - export const viking = 'eats' - } -} - -> use spam - -> $spam -╭──────┬───────────────────╮ -│ eggs │ {record 2 fields} │ -│ X │ x │ -╰──────┴───────────────────╯ - -> $spam.eggs -╭────────┬──────╮ -│ Y │ y │ -│ viking │ eats │ -╰────────┴──────╯ - -> use spam eggs viking - -> $viking -eats -``` - -The exported values are true constants which means that you can use them in some scenarios where you cannot use normal variables, such as: -```nushell -> module files { - export const MY_CONFIG = '/home/viking/.config/nushell/my_config.nu' -} - -> use files MY_CONFIG - -> source $MY_CONFIG # sources '/home/viking/.config/nushell/my_config.nu' -``` - -## New options for more compact table display ([@zhiburt](https://github.com/nushell/nushell/pull/9983), [#9796](https://github.com/nushell/nushell/pull/9796)) - -To save screen space, you can now display tables with the header directly displayed on the border through the `$env.config.table.header_on_separator` option. - - - -Additionally you can now configure the `padding` left and right of the table cell content either separately or all at once to adjust the layout for your readability needs. - - - -## More consistent `format ...` commands ([@sholderbach](https://github.com/nushell/nushell/pull/9788), [@WindSoilder](https://github.com/nushell/nushell/pull/9902)) - -::: warning Breaking change -See a full overview of the [breaking changes](#breaking-changes) -::: - -With this release we moved several commands that serve to produce string output from a particular data type as `format` subcommands. - -1. `date format` has been renamed to `format date` ([#9788](https://github.com/nushell/nushell/pull/9788)). -2. `into duration --convert` was previously used to provide string representations of `duration`s. This option has been removed and you should now use `format duration`. ([#9902](https://github.com/nushell/nushell/pull/9902)) -3. `format filesize` that was previously moved into the `--features extra` set is back in the core ([#9978](https://github.com/nushell/nushell/pull/9978)). - -## `scope` commands enhancements ([kubouch](https://github.com/nushell/nushell/pull/10023), [kubouch](https://github.com/nushell/nushell/pull/10045)) - -`scope` commands received a significant amount of improvements making them more useful for advanced introspection of Nushell's definitions. - -* `scope externs` now lists known externals (defined with `extern`) -* `scope aliases` is now fixed and lists names and usages of the aliases, not of the aliased commands (this used to cause some confusion) -* `scope modules` now lists all the exportable of the module, including submodules with their contents -* all `scope` commands now list the definition's ID which can be used for reliable tracking of definitions. For example, a command `foo` imported from a module `spam` using `use spam` will be named `spam foo`, therefore, relying solely on names of the definitions can sometimes be misleading. -* `module_name` field is no longer present -* `scope variables` now denotes whether a variable is a constant or not - -## `http` commands now handle headers better ([@jflics6460](https://github.com/nushell/nushell/pull/9771), [@ineu](https://github.com/nushell/nushell/pull/10022) - -You can now pass headers directly as a record to the `-H` flag. -```nushell -http get -H {cookie: "acc=foobar"} http://example.com -``` -When running a `http` command with `--full` to get additional metadata about the response you can now get both the request and the reponse header -```nushell -http get --full -H {cooke: "my=cookie"} | get headers | get response -``` - -## Work on the optional dataframe features ([@ayax79](https://github.com/ayax79)) - -[@ayax79](https://github.com/ayax79) has been working hard to update our dataframe command to work again with the stricter type check by consolidating internal logic ([#9860](https://github.com/nushell/nushell/pull/9860), -[#9951](https://github.com/nushell/nushell/pull/9951)). - -Furthermore, `dfr open` now suppports the avro exchange format and a new `dfr to-avro` command was added in [#10019](https://github.com/nushell/nushell/pull/10019) - -## Changes to other commands -Since last release, some commands have changed, here is a list of some interesting changed - -- [@atahabaki](https://github.com/atahabaki) in [#9841](https://github.com/nushell/nushell/pull/9841), [#9856](https://github.com/nushell/nushell/pull/9856) and [#9940](https://github.com/nushell/nushell/pull/9940): Some refinement of the `str expand` command (it's a really cool command, i recommend you check it out :)) -- [@fdncred](https://github.com/fdncred) in [#9987](https://github.com/nushell/nushell/pull/9987): Allow `select` to take a variable with a list of columns -- [@fdncred](https://github.com/fdncred) in [#10048](https://github.com/nushell/nushell/pull/10048): Allow `int` as a *cellpath* for `select` - -## Command organization ([@storm](https://github.com/nushell/nushell/pull/9926), [@jntrnr](https://github.com/nushell/nushell/pull/10051)) - -In our efforts towards stabilization we moved several commands either behind the `--features extra` build-flag or back into the core set of commands. -The special `str *-case` commands for example have been moved out of the core set, while the `bytes` commands to deal with bytes in arbitrary encodings have returned to the core set. -Furthermore all commands in the core set should now have helpful categories associated with them. - -## Deprecation and removal of commands ([@amtoine](https://github.com/nushell/nushell/pull/9840), [@sholderbach](https://github.com/nushell/nushell/pull/10000)) - -We previously used the term "deprecation" pretty loosely to describe the removal of commands while emitting a helpful error. We intend to now start to use deprecation to warn you before the final removal of a particular option or command. -When we removed a command we will now properly refer to it as removal and started adding warnings where appropriate (e.g. `str replace --string`). As part of this update we removed some very old error helpers nudging you to upgrade to new commands. - -## Documentation - -Thanks to [@rgwood](https://github.com/rgwood), [@sholderbach](https://github.com/sholderbach), -[@kubouch](https://github.com/kubouch) and [@fdncred](https://github.com/fdncred) the documentation -has become a bit better in [#9961](https://github.com/nushell/nushell/pull/9961), -[#9996](https://github.com/nushell/nushell/pull/9996), [#10004](https://github.com/nushell/nushell/pull/10004) -and [#10057](https://github.com/nushell/nushell/pull/10057). - -## Notable bugfixes - -- A panic when parsing the context of `let` assignments has been fixed ([@mengsuenyan](https://github.com/mengsuenyan) in [#9851](https://github.com/nushell/nushell/pull/9851)) -- Invoking `--help` on a script with a `def main` command will now report the script's name instead of a more confusing `main` ([@jntrnr](https://github.com/jntrnr) in [#9948](https://github.com/nushell/nushell/pull/9948)) -- Serious bugs in `parse` that produced incorrect output when given a long input stream have been fixed ([@panicbit](https://github.com/panicbit) in [#9925](https://github.com/nushell/nushell/pull/9925), [#9950](https://github.com/nushell/nushell/pull/9950)) - -## Bugfixes - -Thanks to all the contributors who tackled one or more bugs! -| Name | Link | Description | -| ---------------------------------------------- | ------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| [@mengsuenyan](https://github.com/mengsuenyan) | [#9853](https://github.com/nushell/nushell/pull/9853) | Fix `~ \| path type` returning empty string | -| [@mengsuenyan](https://github.com/mengsuenyan) | [#9851](https://github.com/nushell/nushell/pull/9851) | Fix the panic when type a statement similar to `let f = 'f' $` in the nushell | -| [@jntrnr](https://github.com/jntrnr) | [#9893](https://github.com/nushell/nushell/pull/9893) | Revert [#9693](https://github.com/nushell/nushell/pull/9693) to prevent CPU hangs | -| [@NotLebedev](https://github.com/NotLebedev) | [#9935](https://github.com/nushell/nushell/pull/9935) | Nothing has the correct return type | -| [@amtoine](https://github.com/amtoine) | [#9947](https://github.com/nushell/nushell/pull/9947) | Force `version` to update when installing with `toolkit.nu` | -| [@amtoine](https://github.com/amtoine) | [#9967](https://github.com/nushell/nushell/pull/9967) | Fix panic with `lines` on an error | -| [@rgwood](https://github.com/rgwood) | [#9990](https://github.com/nushell/nushell/pull/9990) | Fix `watch` not handling all file changes | -| [@nibon7](https://github.com/nibon7) | [#9784](https://github.com/nushell/nushell/pull/9784) | Fix a crash when moving the cursor after accepting a suggestion from the help menu | -| [@meskill](https://github.com/meskill) | [#10007](https://github.com/nushell/nushell/pull/10007) | Fix parser to not update plugin.nu file on nu startup | -| [@zhiburt](https://github.com/zhiburt) | [#10011](https://github.com/nushell/nushell/pull/10011) | nu-table: Fix padding 0 width issues | -| [@3lvir4](https://github.com/3lvir4) | [#10012](https://github.com/nushell/nushell/pull/10012) | Remove potential panic from path join | -| [@kubouch](https://github.com/kubouch) | [#10046](https://github.com/nushell/nushell/pull/10046) | Fix wrong path expansion in `save` | -| [@zhiburt](https://github.com/zhiburt) | [#10050](https://github.com/nushell/nushell/pull/10050) | nu-table: Fix issue with truncation and text border | -| [@jntrnr](https://github.com/jntrnr) | [#10052](https://github.com/nushell/nushell/pull/10052) | Fix default_env.nu after latest changes to `str replace` | -| [@fdncred](https://github.com/fdncred) | [#10067](https://github.com/nushell/nushell/pull/10067) | Allow `return` to return any nushell value | -| [@fdncred](https://github.com/fdncred) | [#10063](https://github.com/nushell/nushell/pull/10063) | Fix `into datetime` to accept more date/time formats | - -And also to those who did tackle purely technical challenges!! -| Name | Link | Description | -| ---------------------------------------------- | ------------------------------------------------------- | -------------------------------------------------------- | -| [@IanManske](https://github.com/IanManske) | [#9909](https://github.com/nushell/nushell/pull/9909) | Enable macOS foreground process handling | -| [@jntrnr](https://github.com/jntrnr) | [#9933](https://github.com/nushell/nushell/pull/9933) | Add tests for script subcommands | -| [@jntrnr](https://github.com/jntrnr) | [#9936](https://github.com/nushell/nushell/pull/9936) | Fix a couple clippy warnings | -| [@IanManske](https://github.com/IanManske) | [#9927](https://github.com/nushell/nushell/pull/9927) | Make `Value::columns` return slice instead of cloned Vec | -| [@jntrnr](https://github.com/jntrnr) | [#9949](https://github.com/nushell/nushell/pull/9949) | Move `help commands` to use more structure in signatures | -| [@fdncred](https://github.com/fdncred) | [#9958](https://github.com/nushell/nushell/pull/9958) | Update `strip-ansi-escapes` to use new api | -| [@rgwood](https://github.com/rgwood) | [#9971](https://github.com/nushell/nushell/pull/9971) | Put heavy dataframe dependencies behind feature flag | -| [@sholderbach](https://github.com/sholderbach) | [#9974](https://github.com/nushell/nushell/pull/9974) | Fixup dataframe build after [#9971](https://github.com/nushell/nushell/pull/9971) | -| [@meskill](https://github.com/meskill) | [#9976](https://github.com/nushell/nushell/pull/9976) | test: Clear parent environment to prevent leakage to tests | -| [@kubouch](https://github.com/kubouch) | [#10036](https://github.com/nushell/nushell/pull/10036) | Add additional span to IncorrectValue error | - - -# Breaking changes -- [#9902](https://github.com/nushell/nushell/pull/9902) `date format` has been renamed to `format date` for consistency. -- [#9788](https://github.com/nushell/nushell/pull/9788) The option `into duration --convert` to format durations has been removed. Use the `format duration` command instead. -- [#10038](https://github.com/nushell/nushell/pull/10038) `str replace` now by default matches to __strings__ by default. If you want to use regexes you need to use the `-r` flag. The `--strings` flag has been removed -- [#9632](https://github.com/nushell/nushell/pull/9632) To be unambiguous the duration type now does not report months or years. The largest unit reported is weeks as they have a consistent length compared to months or years. -- [#9926](https://github.com/nushell/nushell/pull/9926) We moved some of the more exotic `str` case-commands behind the `--features extra` build-flag. This affects: - * `str camel-case` - * `str kebab-case` - * `str pascal-case` - * `str screaming-snake-case` - * `str snake-case` - * `str title-case` -- [#10053](https://github.com/nushell/nushell/pull/10053) make the charpage optional for `std clip` -- [#10023](https://github.com/nushell/nushell/pull/10023) The output of the `scope` commands has changed - -### Internal breaking change only affecting plugin authors -- [#9927](https://github.com/nushell/nushell/pull/9927) Make `Value::columns` return slice instead of cloned Vec - - -# Full changelog -## Nushell -- [amtoine](https://github.com/amtoine) created - - [remove Clippy flags from the PR template](https://github.com/nushell/nushell/pull/10087) - - [Revert "deprecate `--format` and `--list` in `into datetime` (#10017)"](https://github.com/nushell/nushell/pull/10055) - - [make the charpage optional for `std clip`](https://github.com/nushell/nushell/pull/10053) - - [deprecate `--format` and `--list` in `into datetime`](https://github.com/nushell/nushell/pull/10017) - - [fix the signature of `input list`](https://github.com/nushell/nushell/pull/9977) - - [fix the default config for `explore`](https://github.com/nushell/nushell/pull/9962) - - [fix panic with `lines` on an error](https://github.com/nushell/nushell/pull/9967) - - [add a test to make sure "nothing" shows up as "nothing" in help](https://github.com/nushell/nushell/pull/9941) - - [force version to update when installing with toolkit](https://github.com/nushell/nushell/pull/9947) - - [remove old deprecated commands](https://github.com/nushell/nushell/pull/9840) - - [Fix default prompt indicators](https://github.com/nushell/nushell/pull/9914) -- [fdncred](https://github.com/fdncred) created - - [update install/build scripts to include `--locked`](https://github.com/nushell/nushell/pull/10086) - - [allow `help` to return a `Type::Table`](https://github.com/nushell/nushell/pull/10082) - - [try and fix `into datetime` to accept more dt formats](https://github.com/nushell/nushell/pull/10063) - - [allow `return` to return any nushell value](https://github.com/nushell/nushell/pull/10067) - - [enable/update some example tests so they work again](https://github.com/nushell/nushell/pull/10058) - - [try to document the more obscure testbin commands](https://github.com/nushell/nushell/pull/10057) - - [allow int as a cellpath for `select`](https://github.com/nushell/nushell/pull/10048) - - [allow `select` to take a $variable with a list of columns](https://github.com/nushell/nushell/pull/9987) - - [update `strip-ansi-escapes` to 0.2.0 and the latest reedline](https://github.com/nushell/nushell/pull/9970) - - [update `strip-ansi-escapes` to use new api](https://github.com/nushell/nushell/pull/9958) - - [add keybinding for search-history](https://github.com/nushell/nushell/pull/9930) - - [add `header_on_separator` options to default_config.nu](https://github.com/nushell/nushell/pull/9922) - - [updates `let-env` signature to remove required params](https://github.com/nushell/nushell/pull/9917) - - [remove `vectorize_over_list` from python plugin](https://github.com/nushell/nushell/pull/9905) - - [update `format` signature to allow `record` to be passed in](https://github.com/nushell/nushell/pull/9898) - - [update `items` signature to allow `any` output](https://github.com/nushell/nushell/pull/9896) - - [update `char` signature with `Table`](https://github.com/nushell/nushell/pull/9895) - - [update to current reedline](https://github.com/nushell/nushell/pull/9877) - - [bump to dev version 0.83.2](https://github.com/nushell/nushell/pull/9866) -- [jntrnr](https://github.com/jntrnr) created - - [Revert "pin serde to avoid https://github.com/serde-rs/serde/issues/2538"](https://github.com/nushell/nushell/pull/10078) - - [move 'bytes' back to commands](https://github.com/nushell/nushell/pull/10051) - - [pin serde to avoid https://github.com/serde-rs/serde/issues/2538](https://github.com/nushell/nushell/pull/10061) - - [fix default-env after latest changes](https://github.com/nushell/nushell/pull/10052) - - [Rename `main` to script name when running scripts](https://github.com/nushell/nushell/pull/9948) - - [Auto-expand table based on terminal width](https://github.com/nushell/nushell/pull/9934) - - [fix the Cargo.lock file](https://github.com/nushell/nushell/pull/9955) - - [Move `help commands` to use more structure in signatures](https://github.com/nushell/nushell/pull/9949) - - [Fix a couple clippy warnings](https://github.com/nushell/nushell/pull/9936) - - [Add tests for script subcommands](https://github.com/nushell/nushell/pull/9933) - - [Revert "Add an option to move header on borders"](https://github.com/nushell/nushell/pull/9908) - - [Re-align how prompt indicators work](https://github.com/nushell/nushell/pull/9907) - - [Simplify default style and match Rust code to config](https://github.com/nushell/nushell/pull/9900) - - [Revert 9693 to prevent CPU hangs](https://github.com/nushell/nushell/pull/9893) -- [sholderbach](https://github.com/sholderbach) created - - [Polish `CONTRIBUTING`, add Rust style](https://github.com/nushell/nushell/pull/10071) - - [Remove global clippy `-A` from `toolkit.nu`](https://github.com/nushell/nushell/pull/10073) - - [Remove clippy global `-A` from CI](https://github.com/nushell/nushell/pull/10072) - - [Pin reedline to 0.23.0](https://github.com/nushell/nushell/pull/10070) - - [Rename misused "deprecation" to removal](https://github.com/nushell/nushell/pull/10000) - - [Improve I/O types of `into decimal`(/float)](https://github.com/nushell/nushell/pull/9998) - - [Add search terms to `reject`](https://github.com/nushell/nushell/pull/9996) - - [Move `format duration`/`filesize` back into core](https://github.com/nushell/nushell/pull/9978) - - [Fixup dataframe build after #9971](https://github.com/nushell/nushell/pull/9974) - - [Add `format duration` to replace `into duration --convert`](https://github.com/nushell/nushell/pull/9788) - - [Update `unicode-linebreak` to `0.1.5`](https://github.com/nushell/nushell/pull/9814) -- [kubouch](https://github.com/kubouch) created - - [Remove "let config" warning](https://github.com/nushell/nushell/pull/10068) - - [ Simplify virtualenv testing](https://github.com/nushell/nushell/pull/10035) - - [Recursively export constants from modules](https://github.com/nushell/nushell/pull/10049) - - [Add a few more fields to `scope` commands](https://github.com/nushell/nushell/pull/10045) - - [Add additional span to IncorrectValue error](https://github.com/nushell/nushell/pull/10036) - - [Allow exporting extern-wrapped](https://github.com/nushell/nushell/pull/10025) - - [Fix wrong path expansion in `save`](https://github.com/nushell/nushell/pull/10046) - - [Change `str replace` to match substring by default](https://github.com/nushell/nushell/pull/10038) - - [Remove dead code from tests](https://github.com/nushell/nushell/pull/10040) - - [Sort entries in `scope` commands; Fix usage of externs](https://github.com/nushell/nushell/pull/10039) - - [Refactor `scope` commands](https://github.com/nushell/nushell/pull/10023) - - [Fix example for `extern-wrapped`](https://github.com/nushell/nushell/pull/10004) -- [zhiburt](https://github.com/zhiburt) created - - [nu-table: fix issue with truncation and text border](https://github.com/nushell/nushell/pull/10050) - - [nu-table: Fix padding 0 width issues](https://github.com/nushell/nushell/pull/10011) - - [nu-table/ Add `table.padding` configuration](https://github.com/nushell/nushell/pull/9983) - - [Add an option to set header on border (style)](https://github.com/nushell/nushell/pull/9920) - - [Add an option to move header on borders](https://github.com/nushell/nushell/pull/9796) -- [sitiom](https://github.com/sitiom) created - - [Change Winget Releaser job to `ubuntu-latest`](https://github.com/nushell/nushell/pull/10032) -- [ineu](https://github.com/ineu) created - - [Make `http -f` display the request headers. Closes #9912](https://github.com/nushell/nushell/pull/10022) -- [3lvir4](https://github.com/3lvir4) created - - [Remove potential panic from path join](https://github.com/nushell/nushell/pull/10012) -- [ayax79](https://github.com/ayax79) created - - [Expose polars avro support](https://github.com/nushell/nushell/pull/10019) - - [Nushell table list columns -> dataframe list columns. Explode / Flatten dataframe support.](https://github.com/nushell/nushell/pull/9951) - - [Merged overloaded commands](https://github.com/nushell/nushell/pull/9860) -- [app/dependabot](https://github.com/app/dependabot) created - - [Bump quick-xml from 0.29.0 to 0.30.0](https://github.com/nushell/nushell/pull/9870) - - [Bump rstest from 0.17.0 to 0.18.1](https://github.com/nushell/nushell/pull/9782) -- [meskill](https://github.com/meskill) created - - [fix(nu-parser): do not update plugin.nu file on nu startup](https://github.com/nushell/nushell/pull/10007) - - [test: clear parent envs to prevent leakage to tests](https://github.com/nushell/nushell/pull/9976) -- [nibon7](https://github.com/nibon7) created - - [Fix a crash when moving the cursor after accepting a suggestion from the help menu](https://github.com/nushell/nushell/pull/9784) -- [rgwood](https://github.com/rgwood) created - - [Fix `watch` not handling all file changes](https://github.com/nushell/nushell/pull/9990) - - [Put heavy dataframe dependencies behind feature flag](https://github.com/nushell/nushell/pull/9971) - - [Fix cross-compiling with cross-rs](https://github.com/nushell/nushell/pull/9972) - - [Fix `match` example whitespace](https://github.com/nushell/nushell/pull/9961) -- [panicbit](https://github.com/panicbit) created - - [parse: collect external stream chunks before matching](https://github.com/nushell/nushell/pull/9950) - - [do not emit None mid-stream during parse](https://github.com/nushell/nushell/pull/9925) -- [bobhy](https://github.com/bobhy) created - - [Fix duration type to not report months or years](https://github.com/nushell/nushell/pull/9632) -- [IanManske](https://github.com/IanManske) created - - [Make `Value::columns` return slice instead of cloned Vec](https://github.com/nushell/nushell/pull/9927) - - [Enable macOS foreground process handling](https://github.com/nushell/nushell/pull/9909) - - [Replace `&Span` with `Span` since `Span` is `Copy`](https://github.com/nushell/nushell/pull/9770) -- [atahabaki](https://github.com/atahabaki) created - - [str-expand: update bracoxide to v0.1.2, fixes #9913](https://github.com/nushell/nushell/pull/9940) - - [str-expand: add path flag](https://github.com/nushell/nushell/pull/9856) - - [str-expand: Add Escaping Example](https://github.com/nushell/nushell/pull/9841) -- [stormasm](https://github.com/stormasm) created - - [Categorification: move commands histogram and version out of the default category](https://github.com/nushell/nushell/pull/9946) - - [Categorification: move from Default category to Filters](https://github.com/nushell/nushell/pull/9945) - - [Categorification: move Path commands out of the default category](https://github.com/nushell/nushell/pull/9937) - - [Categorification: graduate nuon --- from the experimental category to the formats category](https://github.com/nushell/nushell/pull/9932) - - [Categorification: move uncategorized String commands to Category::Strings](https://github.com/nushell/nushell/pull/9931) - - [Cratification: move some str case commands to nu-cmd-extra](https://github.com/nushell/nushell/pull/9926) -- [NotLebedev](https://github.com/NotLebedev) created - - [Nothing return type](https://github.com/nushell/nushell/pull/9935) -- [WindSoilder](https://github.com/WindSoilder) created - - [rename from `date format` to `format date`](https://github.com/nushell/nushell/pull/9902) - - [Module: support defining const and use const variables inside of function](https://github.com/nushell/nushell/pull/9773) -- [mengsuenyan](https://github.com/mengsuenyan) created - - [Fixed the panic when type a statement similar to `let f = 'f' $` in the nushell](https://github.com/nushell/nushell/pull/9851) - - [fixed the bug `~ | path type` return empty string](https://github.com/nushell/nushell/pull/9853) -- [app/](https://github.com/app/) created - - [Turn bare URLs into cliclable links](https://github.com/nushell/nushell/pull/9854) -- [jflics6460](https://github.com/jflics6460) created - - [Accept records for http subcommand headers (-H)](https://github.com/nushell/nushell/pull/9771) - -## Extension -- [balupton](https://github.com/balupton) created - - [readmde: close #148 - link extension page](https://github.com/nushell/vscode-nushell-lang/pull/149) - -## Documentation -- [jwarlander](https://github.com/jwarlander) created - - [Use '--locked' in cargo install snippet for dataframe feature](https://github.com/nushell/nushell.github.io/pull/1010) -- [hustcer](https://github.com/hustcer) created - - [Update table mode config doc, fix #1007](https://github.com/nushell/nushell.github.io/pull/1008) - - [Finish `let-env` removal in Chinese translation](https://github.com/nushell/nushell.github.io/pull/1005) - - [Upgrade some dependencies, and fix some broken assets import](https://github.com/nushell/nushell.github.io/pull/995) -- [conqp](https://github.com/conqp) created - - [Update command to list aliases](https://github.com/nushell/nushell.github.io/pull/1006) -- [sholderbach](https://github.com/sholderbach) created - - [Finish `let-env` removal in German translation](https://github.com/nushell/nushell.github.io/pull/1004) -- [amtoine](https://github.com/amtoine) created - - [remove last mentions to `let-env`](https://github.com/nushell/nushell.github.io/pull/999) - - [patch: release notes for 0.83.1](https://github.com/nushell/nushell.github.io/pull/994) -- [BrewingWeasel](https://github.com/BrewingWeasel) created - - [Remove unused empty column](https://github.com/nushell/nushell.github.io/pull/1003) -- [rgwood](https://github.com/rgwood) created - - [Cookbook cleanup](https://github.com/nushell/nushell.github.io/pull/1001) -- [oatovar](https://github.com/oatovar) created - - [Update testing examples](https://github.com/nushell/nushell.github.io/pull/997) -- [rprtr258](https://github.com/rprtr258) created - - [Update explore.md](https://github.com/nushell/nushell.github.io/pull/1000) -- [LeoniePhiline](https://github.com/LeoniePhiline) created - - [fix(docs): Fix link to "setting environment variables"](https://github.com/nushell/nushell.github.io/pull/996) - - [fix(docs): Link to Command Reference led to HTTP 404](https://github.com/nushell/nushell.github.io/pull/993) - -## Nu_Scripts -- [fdncred](https://github.com/fdncred) created - - [fix the other place in the weather script](https://github.com/nushell/nu_scripts/pull/581) - - [fix weather duration after latest nushell changes](https://github.com/nushell/nu_scripts/pull/580) - - [update prompts scripts with new `str replace` syntax](https://github.com/nushell/nu_scripts/pull/579) - - [update `date format` to `format date` in oh-my.nu](https://github.com/nushell/nu_scripts/pull/570) - - [delete codeowners file](https://github.com/nushell/nu_scripts/pull/568) -- [WindSoilder](https://github.com/WindSoilder) created - - [Update python-venv.nu so we can enter subdirectory without an error](https://github.com/nushell/nu_scripts/pull/574) -- [Neur1n](https://github.com/Neur1n) created - - [minor changes to nu_conda.nu and nu_msvs.nu](https://github.com/nushell/nu_scripts/pull/576) -- [EmilySeville7cfg](https://github.com/EmilySeville7cfg) created - - [Simple json schema generator](https://github.com/nushell/nu_scripts/pull/577) -- [uroybd](https://github.com/uroybd) created - - [feat(completions): Ô£¿ add PDM custom completions](https://github.com/nushell/nu_scripts/pull/573) -- [amtoine](https://github.com/amtoine) created - - [rename `date format` to `format date`](https://github.com/nushell/nu_scripts/pull/571) - - [fix the date schedule in the release scripts](https://github.com/nushell/nu_scripts/pull/561) -- [e2dk4r](https://github.com/e2dk4r) created - - [custom-completions: scoop: fix getting environmental variables](https://github.com/nushell/nu_scripts/pull/567) - -## Reedline -- [sholderbach](https://github.com/sholderbach) created - - [Bump version for 0.23 release](https://github.com/nushell/reedline/pull/626) -- [fdncred](https://github.com/fdncred) created - - [update to strip-ansi-escapes 0.2.0](https://github.com/nushell/reedline/pull/618) - - [update `strip-ansi-escapes` to their latest api](https://github.com/nushell/reedline/pull/617) - - [turn off default prompt styling (bold) to prevent leakage](https://github.com/nushell/reedline/pull/615) diff --git a/blog/2023-09-19-nushell_0_85_0.md b/blog/2023-09-19-nushell_0_85_0.md deleted file mode 100644 index 20c373cd938..00000000000 --- a/blog/2023-09-19-nushell_0_85_0.md +++ /dev/null @@ -1,595 +0,0 @@ ---- -title: Nushell 0.85 -author: The Nu Authors -author_site: https://twitter.com/nu_shell -author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.85 of Nu. This release adds the first uutils command, unlocks more constant evaluation at parse time, and polishes many commands. ---- - -# Nushell 0.85 -Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. - -Today, we're releasing version 0.85 of Nu. This release adds the first uutils command, unlocks more constant evaluation at parse time, and polishes many commands. - -<!-- more --> - -# Where to get it -Nu 0.85 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.85.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. - -NOTE: The optional dataframe functionality is available by `cargo install nu --features=dataframe`. - -As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. - -# Themes of this release / New features -## Nushell + Uutils = ❤️ -📢The Nushell team is thrilled to announce 🥳 that we've begun working with the [`uutils/coreutils` team on integrating some of their foundational core utilies into nushell](https://www.nushell.sh/blog/2023-09-05-why-uu.html). With this release, we've started with the coreutils `cp` command, which we've temporarily named `ucp`. We're starting with `ucp` to allow broad testing while the current nushell `cp` command remains the default. We've already found one [bug](https://github.com/uutils/coreutils/issues/5257) in the coreutils `cp` command and you might find others. Once it stabelizes, probably with the 0.86.0 release, we'll remove the nushell `cp` command and rename `ucp` to `cp`. In keeping with the nushell style, we've only added a handful of parameters. We can, and probably will, add more if the community determines we need them. We're so very excited and would like to thank [terts](https://github.com/tertsdiepraam), from the coreutils team, for his excellent help and special appreciation to [dmatos2012](https://github.com/dmatos2012) for the, very iterative, first `uutils/coreutils` integration PR [#10097](https://github.com/nushell/nushell/pull/10097) for the `cp` command. To read more about how this came to be, checkout [our blog post](https://www.nushell.sh/blog/2023-09-05-why-uu.html). - -## Quite a few bug fixes -Thanks to all the contributors below for helping us solve issues and bugs :pray: -| author | description | url | -| ------------------------------------------------ | --------------------------------------------------------------------------------- | ------------------------------------------------------- | -| [@rgwood](https://github.com/rgwood) | Fix watch not detecting modifications on Windows | [#10109](https://github.com/nushell/nushell/pull/10109) | -| [@ito-hiroki](https://github.com/ito-hiroki) | Fix tab completion order of directories to consistent with order of files | [#10102](https://github.com/nushell/nushell/pull/10102) | -| [@herobs](https://github.com/herobs) | Fix 9156 endian consistency | [#9873](https://github.com/nushell/nushell/pull/9873) | -| [@ayax79](https://github.com/ayax79) | fixed usages of deprecated chrono DateTime::from_utc | [#10161](https://github.com/nushell/nushell/pull/10161) | -| [@zhiburt](https://github.com/zhiburt) | Fix #10154 | [#10162](https://github.com/nushell/nushell/pull/10162) | -| [@ofek](https://github.com/ofek) | Fix example history command pipeline | [#10220](https://github.com/nushell/nushell/pull/10220) | -| [@dead10ck](https://github.com/dead10ck) | Fix unit tests on Android | [#10224](https://github.com/nushell/nushell/pull/10224) | -| [@amtoine](https://github.com/amtoine) | fix default after an empty where | [#10240](https://github.com/nushell/nushell/pull/10240) | -| [@IanManske](https://github.com/IanManske) | Fix `rm` on macOS | [#10282](https://github.com/nushell/nushell/pull/10282) | -| [@horasal](https://github.com/horasal) | handle empty pipeline while parsing let (fix Issue10083) | [#10116](https://github.com/nushell/nushell/pull/10116) | -| [@dmatos2012](https://github.com/dmatos2012) | Fix variables not allowed in ucp | [#10304](https://github.com/nushell/nushell/pull/10304) | -| [@sholderbach](https://github.com/sholderbach) | Update `crates-ci/typos` and fix new typos | [#10313](https://github.com/nushell/nushell/pull/10313) | -| [@GomesGoncalo](https://github.com/GomesGoncalo) | fix #10319: allow json request of value type list | [#10356](https://github.com/nushell/nushell/pull/10356) | -| [@jntrnr](https://github.com/jntrnr) | fix 'let' to properly redirect | [#10360](https://github.com/nushell/nushell/pull/10360) | -| [@amtoine](https://github.com/amtoine) | fix the pretty printing of failing tests in std | [#10373](https://github.com/nushell/nushell/pull/10373) | -| [@J-Kappes](https://github.com/J-Kappes) | fix input --until-bytes: now stops at any of given bytes | [#10235](https://github.com/nushell/nushell/pull/10235) | -| [@zhiburt](https://github.com/zhiburt) | nu-table: Fix expand table unnessary color in trail head config when wrap is used | [#10367](https://github.com/nushell/nushell/pull/10367) | -| [@fdncred](https://github.com/fdncred) | fix some new chrono warnings | [#10384](https://github.com/nushell/nushell/pull/10384) | -| [@horasal](https://github.com/horasal) | prevent crash when use redirection with let/mut | [#10139](https://github.com/nushell/nushell/pull/10139) | -| [@horasal](https://github.com/horasal) | Allow operator in constants | [#10212](https://github.com/nushell/nushell/pull/10212) | -| [@zhiburt](https://github.com/zhiburt) | nu-table: Patch restore lead trail space bg color | [#10351](https://github.com/nushell/nushell/pull/10351) | -| [@zhiburt](https://github.com/zhiburt) | nu-table: Strip custom color in the header when used on border | [#10357](https://github.com/nushell/nushell/pull/10357) | - -## Consistent use of `float` for our floating point type - -::: warning Breaking change -See a full overview of the [breaking changes](#breaking-changes) -::: - -Nushell currently supports two types to represent numbers without units: `int` for integer numbers and `float` for floating point numbers. -The latter type was in important places incorrectly referred to as `decimal`. This hid the fact that as floating point numbers they have limited precision in some circumstances but higher performance compared to a decimal-encoded number. - -With this release we fix this inaccuracy. - -This means we introduce the commands `into float` and `random float` and deprecate the commands `into decimal` and `random decimal`. The old commands will be removed with the next release but continue to work for this release with a warning. -Please use `into float` instead of `into decimal` and `random float` instead of `random decimal`. - -After the type returned by `describe` has been `float` for a while, we now also change which type name is allowed when specifying command argument or input/output types. - -```nu -# Argument with a specfic type -def foo [bar: float] {} -# Command taking only floating point input from the pipeline and returning the same type. -def baz [] float->float {} -``` -Previously both `float` and `decimal` were supported in those positions. - -## Some updates on `explore` - -::: warning Breaking change -See a full overview of the [breaking changes](#breaking-changes) -::: - -The `explore` built-in commands have changed a bit during this release. - -Now, it supports Vim bindings out of the box thanks to [@amtoine](https://github.com/amtoine) in -[#9966](https://github.com/nushell/nushell/pull/9966). -[@rgwood](https://github.com/rgwood) has simplified the available configuration entries which used -to make the command less easy to understand in -[#10258](https://github.com/nushell/nushell/pull/10258) -[#10259](https://github.com/nushell/nushell/pull/10259) and -[#10270](https://github.com/nushell/nushell/pull/10270). - -Thanks to him again, one can now quit the `explore`r by hitting any of `ctrl+c`, `ctrl+d` or -`ctrl+q` (see [#10257](https://github.com/nushell/nushell/pull/10257)). - -## Improvements to parse-time evaluation - -_Conditional `source` and `use` is now possible._ - -The Nushell core team has been asked quite a lot of times to be able to do parse-time conditional -`source`ing or `use`ing in the configuration, e.g. to load different things depending on the system: -```nushell -if $nu.os-info.name == "windows" { - source "my_windows_config.nu" -} else { - source "my_unix_config.nu" -} -``` - -The above snippet does not work because Nushell's scoping rules keep the sourced values inside the block and the sourcing would not have any visible effect outside of the if/else statement (except environment changes). - -While scoping still works the same, a series of PRs by [@kubouch](https://github.com/kubouch) made conditional `source`/`use`/`overlay use` possible: -- [#9499](https://github.com/nushell/nushell/pull/9499), allows parse-time evaluation of commands, pipelines and subexpressions (see also [Looking for help!](#looking-for-help)) -- with [#10326](https://github.com/nushell/nushell/pull/10326), `if` can now be evaluated at parse time -- finally, [#10160](https://github.com/nushell/nushell/pull/10160) makes the `$nu` built-in variable a true constant :partying_face: - -What does this all mean? One can now write something very similar to the proposed snippet -above! For example: -```nushell -const WINDOWS_CONFIG = "my_windows_config.nu" -const UNIX_CONFIG = "my_unix_config.nu" - -const ACTUAL_CONFIG = if $nu.os-info.name == "windows" { - $WINDOWS_CONFIG -} else { - $UNIX_CONFIG -} - -source $ACTUAL_CONFIG -``` - -### Looking for help! - -[#9499](https://github.com/nushell/nushell/pull/9499) allows running selected commands at parse time. For example, -```nushell -const f = ($nu.default-config-dir | path dirname) -``` -is possible because `path dirname` was manually ported to allow parse time evaluation. Only a very limited subset of Nushell's commands is currently allowed to do so: -* `str length` -* `path` commands -* Some core commands: `describe`, `ignore`, `version`, `if` - -We would like to expand this set to allow more commands to run at parse time. If you'd like to help us porting more commands, we'd welcome your help! Please, see [#10239](https://github.com/nushell/nushell/issues/10239) for more information. Porting the commands is not difficult, but requires a bit of consideration, so it's better to reply to the issue or reach out to the core team beforehand. - -## Improving accessibility -Up until now, an issue for users using a screen reader was that Nushell errors and tables are quite -fancy with some unicode characters. -The issue is that screen reader might have trouble reading them, making the understanding of what's -going on the REPL very hard... - -For tables, it's quite easy, you can set `$env.config.table.mode` to something like `"basic"` or -`"none"` and you should be good! -But errors remained fancy -```nushell -Error: nu::shell::external_command - - × External command failed - ╭─[entry #4:1:1] - 1 │ foo - · ─┬─ - · ╰── did you mean 'for'? - ╰──── - help: No such file or directory (os error 2) -``` - -[@JoaquinTrinanes](https://github.com/JoaquinTrinanes) did implement screen reader-friendly errors -in [#10122](https://github.com/nushell/nushell/pull/10122) which will hopefully make the experience -a lot better when it comes to errors. - -## More support for more platforms -In this release, [@dead10ck](https://github.com/dead10ck) made it possible to use Nushell in Termux -([#10013](https://github.com/nushell/nushell/pull/10013)) and fixed a bug on Android -([#10225](https://github.com/nushell/nushell/pull/10225)). - -## Improved history isolation -::: warning Breaking change -See a full overview of the [breaking changes](#breaking-changes) -::: - -Like many other shells, history between open sessions can be isolated in nushell. -However, the former implementation had the disadvantage that it also blocked access to history of former sessions. -It also didn't isolate hints. -This is now fixed with [!10402](https://github.com/nushell/nushell/pull/10402) by [@Hofer-Julian](https://github.com/Hofer-Julian). -Since this was merged shortly before the release, this feature isn't the default yet. -The `file_format` has to be changed to `"sqlite"` and `isolation` has to be set to `true`. -You can find those in the [config file](https://github.com/nushell/nushell/blob/39d93b536a02c95c263925a47b9e4c34587ce021/crates/nu-utils/src/sample_config/default_config.nu#L202) under `$nu.config-path`. -Please test this so we can fix problems before history isolation becomes the default. - -## Enhancing the documentation -Thanks to all the contributors below for helping us making the documentation of Nushell commands better :pray: -| author | description | url | -| ------------- | ------------------------------------------------------------- | ------------------------------------------------------- | -| @Hofer-Julian | Add notice to enable develop mode on Windows | [#10111](https://github.com/nushell/nushell/pull/10111) | -| @fdncred | update query web example because wikipedia changed their page | [#10173](https://github.com/nushell/nushell/pull/10173) | -| @alsuren | Point from keybindings help to the book's reedline chapter | [#10193](https://github.com/nushell/nushell/pull/10193) | -| @sholderbach | Document that `open` looks up `from` subcommands | [#10255](https://github.com/nushell/nushell/pull/10255) | -| @balupton | readme: add dorothy to supported by | [#10262](https://github.com/nushell/nushell/pull/10262) | -| @brunerm99 | feat: Search terms for use, while, and range (#5093) | [#10265](https://github.com/nushell/nushell/pull/10265) | -| @amtoine | add case-insensitive example to `where` | [#10299](https://github.com/nushell/nushell/pull/10299) | - -## Help with tests -Some more technical work but very helpful to make the source code of Nushell better, so thanks to our -contributors who did improve the tests, often going through the whole source base and doing tideous -find and replace :pray: -| author | description | url | -| ------------ | --------------------------------------------- | ------------------------------------------------------- | -| @J-Kappes | Tests: clean up unnecessary use of pipeline() | [#10170](https://github.com/nushell/nushell/pull/10170) | -| @sholderbach | Remove dead tests depending on `inc` | [#10179](https://github.com/nushell/nushell/pull/10179) | -| @sholderbach | Simplify rawstrings in tests | [#10180](https://github.com/nushell/nushell/pull/10180) | - -## Changes to commands -As usual, new release rhyms with changes to commands! -- a bunch of new columns have been added to the `ps` commands: - - [@fdncred](https://github.com/fdncred) in [#10275](https://github.com/nushell/nushell/pull/10275) - and [#10344](https://github.com/nushell/nushell/pull/10344) - - [@WindSoilder](https://github.com/WindSoilder) in - [#10347](https://github.com/nushell/nushell/pull/10347) -- [@nanoqsh](https://github.com/nanoqsh) has made the behaviour of `append` and `prepend` consistent - regarding ranges in [#10231](https://github.com/nushell/nushell/pull/10231) -- [@Tiggax](https://github.com/Tiggax) has started working on making `select`, `get` and `reject` - more consistent in [#10163](https://github.com/nushell/nushell/pull/10163) and - [#10216](https://github.com/nushell/nushell/pull/10216) -- **Breaking change:** `math` constants have been moved from built-in commands to *true* constants in - the standard library by [@amtoine](https://github.com/amtoine) in - [#9678](https://github.com/nushell/nushell/pull/9678) -- the `into duration` command now accepts integers as arguments and the unit can be specified via an - option with the changes introduced by [@amtoine](https://github.com/amtoine) in - [#10286](https://github.com/nushell/nushell/pull/10286) -- thanks to [@fdncred](https://github.com/fdncred) in - [#10354](https://github.com/nushell/nushell/pull/10354), the `commandline` command can now move - you to the end of the line, no need to "move 1000 characters to the right" anymore - -## Some table themes -Want more delight? [@fdncred](https://github.com/fdncred) got you covered. -He added a bunch of new table themes / modes in -[#10279](https://github.com/nushell/nushell/pull/10279). - -## `echo` is evolving -Coming from other shells, e.g. POSIX ones like Bash or Zsh, the distinction between Nushell's `echo` -and `print` commands and the behaviour of `echo` itself could be confusing :thinking: - -- `print` is a more programming-language-friendly command: it does print its arguments to the - terminal directly, consuming them and thus not allowing to pipe the "output" of print further. -- `echo` was only used to create values and pass them down a pipeline, e.g. `echo "foo" | str length` - -[@jntrnr](https://github.com/jntrnr) made the behaviour of `echo` a bit more general -- it will print to the terminal if not redirected -- it will pass the value down to the pipeline if redirected - -```nushell -echo "foo" # will behave exactly as `print` does -echo "foo" | str length # will compute the length of `"foo"` and forward the result without - # "printing" it unless it's the last command being run -``` - -## Pythonesque operators removal - -::: warning Breaking change -See a full overview of the [breaking changes](#breaking-changes) -::: - -Coming from Python, things like -```python -3 * "foo" -[1, 2] * 10 -``` -would probably appear familiar. - -However, they could lead to some strange internal behaviours and hard to debug issues :confused: -```nushell -> [3, "bob", 4] | reduce --fold 1 {|x, y| $x * $y} -bobbobbobbobbobbobbobbobbobbobbobbob -``` - -> **Note** -> in the example above, we are mixing integer and string multiplication, which might get weird! - -In this release, we decided to remove the string and list scalar multiplication in -[#10292](https://github.com/nushell/nushell/pull/10292) and -[#10293](https://github.com/nushell/nushell/pull/10293) from [@sholderbach](https://github.com/sholderbach). - -However, we do not want to leave you without any other way to achieve the same, this is why -[@amtoine](https://github.com/amtoine) did implement the `repeat` command in the standard library -in [#10339](https://github.com/nushell/nushell/pull/10339) -- bring it into your scope with `use std repeat` -- you can do scalar string multiplication with something like `"foo" | repeat 3 | str join` -- you can do scalar list multiplication with something like `[1, 2] | repeat 3 | flatten` - -## Optimizations -[#10378](https://github.com/nushell/nushell/pull/10378) Switched the default allocator to `mimalloc` as it's shown to reduce startup time by upwards of 30% on Windows. If it does not build on unique platforms nushell can be built without this feature, then using the platform's default allocator. - -# New commands -- [`into float`](https://github.com/nushell/nushell/pull/9979) as a replacement for `into decimal` -- [`random float`](https://github.com/nushell/nushell/pull/10320) as a replacement for `random decimal` - -In the standard library we added the following commands: -- [`std repeat`](https://github.com/nushell/nushell/pull/10339) as a command to repeat an element `n` times in a list. -- [`std formats from ndjson`](https://github.com/nushell/nushell/pull/10283) as a way to directly open newline-delimited JSON recrods. You can use `open` for files with the `.ndjson` ending if you `use std formats "from ndjson"`. -- [`std formats from jsonl`](https://github.com/nushell/nushell/pull/10283) as a way to directly open newline-delimited JSON records. You can use `open` for files with the `.jsonl` ending if you `use std formats "from jsonl"`. - -# Deprecations -## Deprecated commands -- [`into decimal`](https://github.com/nushell/nushell/pull/9979): Use `into float` instead -- [`random decimal`](https://github.com/nushell/nushell/pull/10320): Use `random float` instead - -# Breaking changes -* Plugin authors need to update plugins after the span refactor -* Updated plugins need to be recompiled -- [#10235](https://github.com/nushell/nushell/pull/10235) `input --until-bytes` now stops at any of given bytes -- [#10333](https://github.com/nushell/nushell/pull/10333) Consistently use `float` instead of `decimal` in type specifications -- [#10293](https://github.com/nushell/nushell/pull/10293) Remove pythonic `string * list` multiplication -- [#10292](https://github.com/nushell/nushell/pull/10292) Remove pythonic `int * list` multiplication -- [#10338](https://github.com/nushell/nushell/pull/10338) Change `echo` to print when not redirected -- [#10259](https://github.com/nushell/nushell/pull/10259) explore: remove `:config`, `:show-config`, `:tweak` commands -- [#9929](https://github.com/nushell/nushell/pull/9929) Rename the types with spaces in them to use `-` -- [#10254](https://github.com/nushell/nushell/pull/10254) Change LOG_FORMAT to NU_LOG_FORMAT in nu-std library -- [#9678](https://github.com/nushell/nushell/pull/9678) Move math constants to standard library -- [#10231](https://github.com/nushell/nushell/pull/10231) Make `append`/`prepend` consistent for ranges -- [#9966](https://github.com/nushell/nushell/pull/9966) Add support for Vim motions in `explore` -- [#10042](https://github.com/nushell/nushell/pull/10042) Spanned Value step 1: span all value cases -- [#10103](https://github.com/nushell/nushell/pull/10103) Create `Record` type -- [#10064](https://github.com/nushell/nushell/pull/10064) Fully remove `str replace --string` option after deprecation. Just use `str replace` instead. - -# Full changelog -## Nushell -- [tokatoka](https://github.com/tokatoka) created - - [Add 2 fuzzers for nu-path, nu-parser](https://github.com/nushell/nushell/pull/10376) -- [sholderbach](https://github.com/sholderbach) created - - [Clippy in tests](https://github.com/nushell/nushell/pull/10394) - - [Update internal use of `decimal` to `float`](https://github.com/nushell/nushell/pull/10333) - - [Optimize use of range in `std repeat`](https://github.com/nushell/nushell/pull/10353) - - [Remove python-like string multiplication](https://github.com/nushell/nushell/pull/10293) - - [Invert `&Option`s to `Option<&T>`](https://github.com/nushell/nushell/pull/10315) - - [Remove pythonic `int * list` behavior](https://github.com/nushell/nushell/pull/10292) - - [Rename `random decimal` to `random float`](https://github.com/nushell/nushell/pull/10320) - - [Rename `into decimal` to `into float`](https://github.com/nushell/nushell/pull/9979) - - [Deref `&String` arguments to `&str` where appropriate](https://github.com/nushell/nushell/pull/10321) - - [Use slices directly instead of `&Vec`](https://github.com/nushell/nushell/pull/10328) - - [Bump `calamine` and fix clippy](https://github.com/nushell/nushell/pull/10314) - - [Update `crates-ci/typos` and fix new typos](https://github.com/nushell/nushell/pull/10313) - - [Remove `Cargo.lock` in subcrates](https://github.com/nushell/nushell/pull/10280) - - [Move spellcheck config into `.github` folder](https://github.com/nushell/nushell/pull/10267) - - [Remove codecov.io setup](https://github.com/nushell/nushell/pull/10266) - - [Document that `open` looks up `from` subcommands](https://github.com/nushell/nushell/pull/10255) - - [Tweak contributor image to include more users](https://github.com/nushell/nushell/pull/10238) - - [Update `crossterm`/`ratatui`/dev-`reedline`](https://github.com/nushell/nushell/pull/10137) - - [Simplify rawstrings in tests](https://github.com/nushell/nushell/pull/10180) - - [Remove dead tests depending on `inc`](https://github.com/nushell/nushell/pull/10179) - - [Keep `arrow2` out of basic `--workspace` build](https://github.com/nushell/nushell/pull/10178) -- [fdncred](https://github.com/fdncred) created - - [fix some new chrono warnings](https://github.com/nushell/nushell/pull/10384) - - [add helper switch to move cursor to end of buffer](https://github.com/nushell/nushell/pull/10354) - - [add a few more columns to linux `ps -l` output](https://github.com/nushell/nushell/pull/10344) - - [silence some ucp warnings](https://github.com/nushell/nushell/pull/10294) - - [allow update to use metadata](https://github.com/nushell/nushell/pull/10264) - - [add 6 more table themes](https://github.com/nushell/nushell/pull/10279) - - [respect a users locale with the right prompt](https://github.com/nushell/nushell/pull/10273) - - [add more `ps` columns in Windows](https://github.com/nushell/nushell/pull/10275) - - [update format date when using %x %X %r](https://github.com/nushell/nushell/pull/10272) - - [Restore NU_LIB_DIRS and NU_PLUGIN_DIRS defaults](https://github.com/nushell/nushell/pull/10252) - - [allow `--login` to be used with nu's `--commands` parameter](https://github.com/nushell/nushell/pull/10253) - - [add plugin path when there are no signatures](https://github.com/nushell/nushell/pull/10201) - - [update query web example because wikipedia changed their page](https://github.com/nushell/nushell/pull/10173) - - [name hooks internally](https://github.com/nushell/nushell/pull/10127) - - [bump rust-toolchain to 1.70.0](https://github.com/nushell/nushell/pull/10113) -- [FilipAndersson245](https://github.com/FilipAndersson245) created - - [Adds mimalloc as default feature.](https://github.com/nushell/nushell/pull/10378) -- [zhiburt](https://github.com/zhiburt) created - - [nu-table: Fix expand table unnessary color in trail head config when wrap is used](https://github.com/nushell/nushell/pull/10367) - - [nu-table: Strip custom color in the header when used on border](https://github.com/nushell/nushell/pull/10357) - - [nu-table: Patch restore lead trail space bg color](https://github.com/nushell/nushell/pull/10351) - - [nu-explore: Refactorings](https://github.com/nushell/nushell/pull/10247) - - [Fix #10154](https://github.com/nushell/nushell/pull/10162) -- [J-Kappes](https://github.com/J-Kappes) created - - [fix input --until-bytes: now stops at any of given bytes](https://github.com/nushell/nushell/pull/10235) - - [Tests: clean up unnecessary use of pipeline()](https://github.com/nushell/nushell/pull/10170) -- [amtoine](https://github.com/amtoine) created - - [fix the pretty printing of failing tests in std](https://github.com/nushell/nushell/pull/10373) - - [add `std repeat` command to replace `"foo" * 3`](https://github.com/nushell/nushell/pull/10339) - - [add case-insensitive example to `where`](https://github.com/nushell/nushell/pull/10299) - - [allow `into duration` to take an integer amount of ns](https://github.com/nushell/nushell/pull/10286) - - [rename the types with spaces in them to use `-`](https://github.com/nushell/nushell/pull/9929) - - [fix default after an empty where](https://github.com/nushell/nushell/pull/10240) - - [move math constants to standard library](https://github.com/nushell/nushell/pull/9678) - - [support tab completion cycling](https://github.com/nushell/nushell/pull/10199) - - [add support for Vim motions in `explore`](https://github.com/nushell/nushell/pull/9966) -- [WindSoilder](https://github.com/WindSoilder) created - - [Ps: add `cwd` column on linux and macos](https://github.com/nushell/nushell/pull/10347) - - [return error when user break sleep by ctrl-c](https://github.com/nushell/nushell/pull/10234) -- [jntrnr](https://github.com/jntrnr) created - - [fix 'let' to properly redirect](https://github.com/nushell/nushell/pull/10360) - - [Change `echo` to print when not redirected](https://github.com/nushell/nushell/pull/10338) - - [remove profiling from nushell's hot loop](https://github.com/nushell/nushell/pull/10325) - - [Move Value to helpers, separate span call](https://github.com/nushell/nushell/pull/10121) - - [Spanned Value step 1: span all value cases](https://github.com/nushell/nushell/pull/10042) -- [GomesGoncalo](https://github.com/GomesGoncalo) created - - [fix #10319: allow json request of value type list](https://github.com/nushell/nushell/pull/10356) -- [Tiggax](https://github.com/Tiggax) created - - [Remove `select` error if same row/column is provided](https://github.com/nushell/nushell/pull/10350) - - [update `reject` to be able to recive arg list](https://github.com/nushell/nushell/pull/10216) - - [`reject` multiple row args support](https://github.com/nushell/nushell/pull/10163) -- [kubouch](https://github.com/kubouch) created - - [Allow parse-time evaluation of `if`](https://github.com/nushell/nushell/pull/10326) - - [Remove leftover const eval file](https://github.com/nushell/nushell/pull/10324) - - [Add NU_VERSION environment variable on startup](https://github.com/nushell/nushell/pull/10177) - - [Make $nu constant](https://github.com/nushell/nushell/pull/10160) - - [Allow parse-time evaluation of calls, pipelines and subexpressions](https://github.com/nushell/nushell/pull/9499) -- [hustcer](https://github.com/hustcer) created - - [Update Nu to v0.84 for release and nightly-build](https://github.com/nushell/nushell/pull/10334) - - [Upgrade softprops/action-gh-release to v0.1.15 for release and nightly build workflow](https://github.com/nushell/nushell/pull/10331) -- [geniusisme](https://github.com/geniusisme) created - - [provide env to commands and try to start provided path](https://github.com/nushell/nushell/pull/10302) -- [utouto97](https://github.com/utouto97) created - - [add 'from ndjson' into standard library](https://github.com/nushell/nushell/pull/10283) - - [refactor input command](https://github.com/nushell/nushell/pull/10150) -- [nanoqsh](https://github.com/nanoqsh) created - - [Keep order for `par-each`](https://github.com/nushell/nushell/pull/10249) - - [Make `append`/`prepend` consistent for ranges](https://github.com/nushell/nushell/pull/10231) -- [app/dependabot](https://github.com/app/dependabot) created - - [Bump bytesize from 1.2.0 to 1.3.0](https://github.com/nushell/nushell/pull/10306) - - [Bump tempfile from 3.7.0 to 3.8.0](https://github.com/nushell/nushell/pull/10307) - - [Bump actions/checkout from 3 to 4](https://github.com/nushell/nushell/pull/10308) - - [Bump itertools from 0.10.5 to 0.11.0](https://github.com/nushell/nushell/pull/9524) - - [Bump rust-embed from 6.8.1 to 8.0.0](https://github.com/nushell/nushell/pull/10208) - - [Bump git2 from 0.17.2 to 0.18.0](https://github.com/nushell/nushell/pull/10207) - - [Bump winreg from 0.50.0 to 0.51.0](https://github.com/nushell/nushell/pull/10209) - - [Bump notify-debouncer-full from 0.2.0 to 0.3.1](https://github.com/nushell/nushell/pull/10129) -- [dmatos2012](https://github.com/dmatos2012) created - - [Fix variables not allowed in ucp](https://github.com/nushell/nushell/pull/10304) - - [use uutils/coreutils cp command in place of nushell's cp command](https://github.com/nushell/nushell/pull/10097) -- [dzorya](https://github.com/dzorya) created - - [Added a comment that perl is required for feature static-link-openssl…](https://github.com/nushell/nushell/pull/10291) -- [nibon7](https://github.com/nibon7) created - - [Make cursor_shape optional](https://github.com/nushell/nushell/pull/10289) - - [Exit early when encountering parsing errors](https://github.com/nushell/nushell/pull/10213) - - [Auto format let-else block](https://github.com/nushell/nushell/pull/10214) - - [Use built-in is_terminal instead of is_terminal::is_terminal](https://github.com/nushell/nushell/pull/9550) - - [Don't use `oldtime` feature of chrono ](https://github.com/nushell/nushell/pull/9577) -- [alsuren](https://github.com/alsuren) created - - [signpost 'input list --types [key]' from 'keybindings list'](https://github.com/nushell/nushell/pull/10287) - - [Point from keybindings help to the book's reedline chapter](https://github.com/nushell/nushell/pull/10193) -- [IanManske](https://github.com/IanManske) created - - [Fix `rm` on macOS](https://github.com/nushell/nushell/pull/10282) - - [Restore initial foreground process group on exit](https://github.com/nushell/nushell/pull/10021) - - [Create `Record` type](https://github.com/nushell/nushell/pull/10103) -- [rgwood](https://github.com/rgwood) created - - [Start removing colour config from `explore`](https://github.com/nushell/nushell/pull/10270) - - [Exit explore on ctrl+c/d/q](https://github.com/nushell/nushell/pull/10257) - - [explore: remove `:config`, `:show-config`, `:tweak` commands](https://github.com/nushell/nushell/pull/10259) - - [Remove `exit_esc` and `show_banner` config from `explore`](https://github.com/nushell/nushell/pull/10258) - - [Fix watch not detecting modifications on Windows](https://github.com/nushell/nushell/pull/10109) -- [brunerm99](https://github.com/brunerm99) created - - [feat: Search terms for use, while, and range (#5093)](https://github.com/nushell/nushell/pull/10265) -- [balupton](https://github.com/balupton) created - - [readme: add dorothy to supported by](https://github.com/nushell/nushell/pull/10262) -- [stormasm](https://github.com/stormasm) created - - [change LOG_FORMAT to NU_LOG_FORMAT in nu-std library](https://github.com/nushell/nushell/pull/10254) - - [Move hook to nu_cmd_base](https://github.com/nushell/nushell/pull/10146) - - [remove warnings in nu_command tests](https://github.com/nushell/nushell/pull/10145) - - [update rust-toolchain doc to 4 weeks from 3](https://github.com/nushell/nushell/pull/10140) -- [horasal](https://github.com/horasal) created - - [Allow operator in constants](https://github.com/nushell/nushell/pull/10212) - - [treat path contains '?' as pattern](https://github.com/nushell/nushell/pull/10142) - - [prevent crash when use redirection with let/mut](https://github.com/nushell/nushell/pull/10139) - - [skip comments and eols while parsing pipeline](https://github.com/nushell/nushell/pull/10149) - - [handle empty pipeline while parsing let (fix Issue10083)](https://github.com/nushell/nushell/pull/10116) - - [Add encoding auto-detection for `decode`](https://github.com/nushell/nushell/pull/10030) -- [dead10ck](https://github.com/dead10ck) created - - [Clean up trash support on Android](https://github.com/nushell/nushell/pull/10225) - - [Fix unit tests on Android](https://github.com/nushell/nushell/pull/10224) - - [upgrade nix to 0.27](https://github.com/nushell/nushell/pull/10223) - - [Support Termux](https://github.com/nushell/nushell/pull/10013) -- [ofek](https://github.com/ofek) created - - [Fix example history command pipeline](https://github.com/nushell/nushell/pull/10220) -- [MasterMach50](https://github.com/MasterMach50) created - - [changed default env file to use $nu.home_path to find home](https://github.com/nushell/nushell/pull/10192) -- [matthias-Q](https://github.com/matthias-Q) created - - [feat: allow `from csv` to accept 4 byte unicode separator chars](https://github.com/nushell/nushell/pull/10138) - - [Allow for `.parq` file ending as alternative to `.parquet`](https://github.com/nushell/nushell/pull/10112) -- [ayax79](https://github.com/ayax79) created - - [fixed usages of deprecated chrono DateTime::from_utc](https://github.com/nushell/nushell/pull/10161) - - [Updating polars and sqlparser versions](https://github.com/nushell/nushell/pull/10114) -- [SED4906](https://github.com/SED4906) created - - [Update removed "MDI" icons to current MD icons](https://github.com/nushell/nushell/pull/10126) -- [JoaquinTrinanes](https://github.com/JoaquinTrinanes) created - - [Screen reader-friendly errors](https://github.com/nushell/nushell/pull/10122) -- [Hofer-Julian](https://github.com/Hofer-Julian) created - - [toolkit: Renames `pretty-print-command`](https://github.com/nushell/nushell/pull/10110) - - [Add notice to enable develop mode on Windows](https://github.com/nushell/nushell/pull/10111) -- [herobs](https://github.com/herobs) created - - [Fix 9156 endian consistency](https://github.com/nushell/nushell/pull/9873) -- [ito-hiroki](https://github.com/ito-hiroki) created - - [Fix tab completion order of directories to consistent with order of files](https://github.com/nushell/nushell/pull/10102) - -## Extension -- [nerditation](https://github.com/nerditation) created - - [use `which` to search `nu` location, add icon too.](https://github.com/nushell/vscode-nushell-lang/pull/153) -- [adamcstephens](https://github.com/adamcstephens) created - - [fix shebang/firstLine detection](https://github.com/nushell/vscode-nushell-lang/pull/151) - -## Documentation -- [Gryff](https://github.com/Gryff) created - - [Change direnv example to upload $env.PATH as a list](https://github.com/nushell/nushell.github.io/pull/1058) -- [edhowland](https://github.com/edhowland) created - - [Changed Python plugin example to be more portable](https://github.com/nushell/nushell.github.io/pull/1060) -- [dnsem](https://github.com/dnsem) created - - [Support for standard input in script with shebang](https://github.com/nushell/nushell.github.io/pull/1057) -- [petrisch](https://github.com/petrisch) created - - [DE translation for custom_completions.md](https://github.com/nushell/nushell.github.io/pull/1056) - - [Typos in custom_completions](https://github.com/nushell/nushell.github.io/pull/1052) -- [mb21](https://github.com/mb21) created - - [Cookbook setup: fix command to append to PATH](https://github.com/nushell/nushell.github.io/pull/1055) -- [connorjs](https://github.com/connorjs) created - - [Update variables_and_subexpressions.md - remove obsolete section](https://github.com/nushell/nushell.github.io/pull/1054) - - [Update working_with_lists.md - format date](https://github.com/nushell/nushell.github.io/pull/1053) -- [JoaquinTrinanes](https://github.com/JoaquinTrinanes) created - - [Fix external completers typo](https://github.com/nushell/nushell.github.io/pull/1051) - - [Simplify external completer](https://github.com/nushell/nushell.github.io/pull/1049) - - [Error style section](https://github.com/nushell/nushell.github.io/pull/1026) -- [hustcer](https://github.com/hustcer) created - - [Update min required node version and some node modules](https://github.com/nushell/nushell.github.io/pull/1050) -- [sholderbach](https://github.com/sholderbach) created - - [Document that `open` looks up `from`s in scope](https://github.com/nushell/nushell.github.io/pull/1048) -- [stormasm](https://github.com/stormasm) created - - [add a link to the contributor book at the end of the plugins chapter](https://github.com/nushell/nushell.github.io/pull/1045) -- [alsuren](https://github.com/alsuren) created - - [Point out where command docs should be edited](https://github.com/nushell/nushell.github.io/pull/1042) -- [dclausen](https://github.com/dclausen) created - - [Update cheat_sheet.md](https://github.com/nushell/nushell.github.io/pull/1039) -- [simonboots](https://github.com/simonboots) created - - [Fix small typo in modules.md](https://github.com/nushell/nushell.github.io/pull/1038) -- [leetemil](https://github.com/leetemil) created - - [Update docs for exiting shell in shells](https://github.com/nushell/nushell.github.io/pull/1037) -- [adamchalmers](https://github.com/adamchalmers) created - - [Clarify how to check config file paths](https://github.com/nushell/nushell.github.io/pull/1030) - - [Link to escape when discussing escapes](https://github.com/nushell/nushell.github.io/pull/1031) -- [follower](https://github.com/follower) created - - [Move launch instructions earlier in page.](https://github.com/nushell/nushell.github.io/pull/1032) -- [jamesarch](https://github.com/jamesarch) created - - [fix missing command](https://github.com/nushell/nushell.github.io/pull/1034) -- [narve](https://github.com/narve) created - - [Update loading_data.md, correct link to http command](https://github.com/nushell/nushell.github.io/pull/1033) -- [dlamei](https://github.com/dlamei) created - - [fix typo in book](https://github.com/nushell/nushell.github.io/pull/1028) -- [lomm28](https://github.com/lomm28) created - - [nu cheat sheet added](https://github.com/nushell/nushell.github.io/pull/1025) -- [fdncred](https://github.com/fdncred) created - - [update fdncred's item + typo](https://github.com/nushell/nushell.github.io/pull/1022) -- [rgwood](https://github.com/rgwood) created - - [Update Reilly's comments in birthday blog post](https://github.com/nushell/nushell.github.io/pull/1021) -- [app/github-actions](https://github.com/app/github-actions) created - - [Compressed Images](https://github.com/nushell/nushell.github.io/pull/1020) -- [jntrnr](https://github.com/jntrnr) created - - [Add Nushell birthday post](https://github.com/nushell/nushell.github.io/pull/1019) - -## Nu_Scripts -- [amtoine](https://github.com/amtoine) created - - [fix scripts](https://github.com/nushell/nu_scripts/pull/594) - - [add a `typeof` command](https://github.com/nushell/nu_scripts/pull/597) - - [add `$.type` to `package.nuon`](https://github.com/nushell/nu_scripts/pull/582) - - [add the `random-bytes` benchmark](https://github.com/nushell/nu_scripts/pull/595) -- [WindSoilder](https://github.com/WindSoilder) created - - [Improve background job.nu](https://github.com/nushell/nu_scripts/pull/607) - - [use closure instead of block](https://github.com/nushell/nu_scripts/pull/602) -- [Zinvoke](https://github.com/Zinvoke) created - - [FEATURE: add `catppuccin-mocha` theme](https://github.com/nushell/nu_scripts/pull/601) -- [brunerm99](https://github.com/brunerm99) created - - [Change nu_conda list to output active status of environment as well (#604)](https://github.com/nushell/nu_scripts/pull/605) -- [icp1994](https://github.com/icp1994) created - - [feat(hook): add `rusty-paths.nu`](https://github.com/nushell/nu_scripts/pull/596) -- [selfagency](https://github.com/selfagency) created - - [Add support for fnm](https://github.com/nushell/nu_scripts/pull/593) -- [fnuttens](https://github.com/fnuttens) created - - [Replace exa by eza aliases](https://github.com/nushell/nu_scripts/pull/591) -- [maxim-uvarov](https://github.com/maxim-uvarov) created - - [Update `bar` function](https://github.com/nushell/nu_scripts/pull/589) -- [StripedMonkey](https://github.com/StripedMonkey) created - - [Expand git completions](https://github.com/nushell/nu_scripts/pull/587) -- [AntoineSebert](https://github.com/AntoineSebert) created - - [Add `dfr` before `into df` and `into nu`](https://github.com/nushell/nu_scripts/pull/585) - -## Reedline -- [sholderbach](https://github.com/sholderbach) created - - [Remove old `actions-rs/cargo`](https://github.com/nushell/reedline/pull/637) - - [Add a configuration to codecov.io](https://github.com/nushell/reedline/pull/636) - - [Setup coverage with codecov.io](https://github.com/nushell/reedline/pull/635) - - [Bump `crossterm` to 0.27.0](https://github.com/nushell/reedline/pull/625) -- [ysthakur](https://github.com/ysthakur) created - - [Let prompts choose to repaint on enter](https://github.com/nushell/reedline/pull/627) -- [Hofer-Julian](https://github.com/Hofer-Julian) created - - [Minor improvements](https://github.com/nushell/reedline/pull/633) - - [Fix `read_line` docs](https://github.com/nushell/reedline/pull/629) -- [Abdillah](https://github.com/Abdillah) created - - [Add Kitty protocol keyboard enhancement support](https://github.com/nushell/reedline/pull/607) diff --git a/blog/2023-12-12-nushell_0_88_0.md b/blog/2023-12-12-nushell_0_88_0.md deleted file mode 100644 index 4511a055596..00000000000 --- a/blog/2023-12-12-nushell_0_88_0.md +++ /dev/null @@ -1,769 +0,0 @@ ---- -title: Nushell 0.88.0 -author: The Nu Authors -author_site: https://twitter.com/nu_shell -author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.88.0 of Nu. This release adds a spread operator, output stream improvements, dynamic switch support, and much more. ---- -<!-- TODO: complete the excerpt above --> - -# Nushell 0.88.0 - -Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. - -Today, we're releasing version 0.88.0 of Nu. This release adds a spread operator, output stream improvements, dynamic switch support, and much more. - -# Where to get it - -Nu 0.88.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.88.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. - -::: tip Note -The optional dataframe functionality is available by `cargo install nu --features=dataframe`. -::: - -As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. - -# Table of content -- [*Themes of this release / New features*](#themes-of-this-release-new-features-toc) - - [*Hall of fame*](#hall-of-fame-toc) - - [*Bug fixes*](#bug-fixes-toc) - - [*Enhancing the documentation*](#enhancing-the-documentation-toc) - - [*New _spread_ operator for list and record literals*](#new-spread-operator-for-list-and-record-literals-toc) - - [*Passing boolean switches dynamically*](#passing-boolean-switches-dynamically-toc) - - [*Redirection to standard streams is getting better*](#redirection-to-standard-streams-is-getting-better-toc) - - [*One-time theming of tables is there*](#one-time-theming-of-tables-is-there-toc) - - [*Exposing name of script to the wild*](#exposing-name-of-script-to-the-wild-toc) - - [*Parsing human-friendly dates into Nushell values*](#parsing-human-friendly-dates-into-nushell-values-toc) - - [*Show found externals via syntax highlighting in the REPL*](#show-found-externals-via-syntax-highlighting-in-the-repl-toc) - - [*New "out of bound" error*](#new-out-of-bound-error-toc) - - [*Details on the `0.87.1` hotfix release*](#details-on-the-0-87-1-hotfix-release-toc) - - [*Need help to wrap... commands?*](#need-help-to-wrap-commands-toc) - - [*Restricting use of internal variables*](#restricting-use-of-internal-variables-toc) - - [*A small update on the LSP*](#a-small-update-on-the-lsp-toc) - - [*Our set of commands is evolving*](#our-set-of-commands-is-evolving-toc) - - [*New commands*](#new-commands-toc) - - [*Changes to existing commands*](#changes-to-existing-commands-toc) - - [*Deprecated commands*](#deprecated-commands-toc) - - [*Removed commands*](#removed-commands-toc) -- [*Breaking changes*](#breaking-changes-toc) -- [*Full changelog*](#full-changelog-toc) - -# Themes of this release / New features [[toc](#table-of-content)] -<!-- NOTE: if you wanna write a section about a breaking change, when it's a very important one, - please add the following snippet to have a "warning" banner :) - > see [an example](https://www.nushell.sh/blog/2023-09-19-nushell_0_85_0.html#pythonesque-operators-removal) - - ```md - ::: warning Breaking change - See a full overview of the [breaking changes](#breaking-changes) - ::: - ``` ---> -<!-- NOTE: see https://vuepress.github.io/reference/default-theme/markdown.html#custom-containers - for the list of available *containers* ---> - -## Hall of fame [[toc](#table-of-content)] -### Bug fixes [[toc](#table-of-content)] -Thanks to all the contributors below for helping us solve issues and bugs :pray: -| author | description | url | -| ------------------------------------ | ----------- | ------------------------------------------------------- | -| [@dead10ck](https://github.com/dead10ck) | into binary -c: return 0 as single byte | [#11068](https://github.com/nushell/nushell/pull/11068) | -| [@zhiburt](https://github.com/zhiburt) | Fix #11047 | [#11054](https://github.com/nushell/nushell/pull/11054) | -| [@fdncred](https://github.com/fdncred) | tweak `table` example/parameter text | [#11071](https://github.com/nushell/nushell/pull/11071) | -| [@fdncred](https://github.com/fdncred) | add "default" table theme | [#11072](https://github.com/nushell/nushell/pull/11072) | -| [@fdncred](https://github.com/fdncred) | correct table example syntax | [#11074](https://github.com/nushell/nushell/pull/11074) | -| [@fdncred](https://github.com/fdncred) | optimize/clean up a few of the `table` changes | [#11076](https://github.com/nushell/nushell/pull/11076) | -| [@sophiajt](https://github.com/sophiajt) | Fix the output type for 'view files' | [#11077](https://github.com/nushell/nushell/pull/11077) | -| [@danielsomerfield](https://github.com/danielsomerfield) | Fix toolkit to run workspace on 'check pr' (issue #10906) | [#11112](https://github.com/nushell/nushell/pull/11112) | -| [@hustcer](https://github.com/hustcer) | Exit the release job if creating binary package failed | [#11145](https://github.com/nushell/nushell/pull/11145) | -| [@hustcer](https://github.com/hustcer) | Fix release and nightly build workflow | [#11146](https://github.com/nushell/nushell/pull/11146) | -| [@amtoine](https://github.com/amtoine) | fix the link to the `nu_scripts` in `std clip` deprecation | [#11150](https://github.com/nushell/nushell/pull/11150) | -| [@NotLebedev](https://github.com/NotLebedev) | Cp target expansion | [#11152](https://github.com/nushell/nushell/pull/11152) | -| [@MarikaChlebowska](https://github.com/MarikaChlebowska) | Add metadata to some filters | [#11160](https://github.com/nushell/nushell/pull/11160) | -| [@sholderbach](https://github.com/sholderbach) | Revert "Adding support for Polars structs" | [#11171](https://github.com/nushell/nushell/pull/11171) | -| [@sigoden](https://github.com/sigoden) | Fix spans passed to external_completer | [#11008](https://github.com/nushell/nushell/pull/11008) | -| [@nibon7](https://github.com/nibon7) | Add boundary check for str index-of | [#11190](https://github.com/nushell/nushell/pull/11190) | -| [@WindSoilder](https://github.com/WindSoilder) | When using redirection, if a command generates non-zero exit code, the script should stop running | [#11191](https://github.com/nushell/nushell/pull/11191) | -| [@nibon7](https://github.com/nibon7) | Fix span of invalid range | [#11207](https://github.com/nushell/nushell/pull/11207) | -| [@nibon7](https://github.com/nibon7) | Fix capacity overflow caused by large range of ports | [#11210](https://github.com/nushell/nushell/pull/11210) | -| [@IanManske](https://github.com/IanManske) | Fix `get -i` ignoring errors for only the first cellpath | [#11213](https://github.com/nushell/nushell/pull/11213) | -| [@dtolnay](https://github.com/dtolnay) | Fix `Option<&str> == Option<&String>` build error when using rust_decimal/rkyv feature | [#11205](https://github.com/nushell/nushell/pull/11205) | -| [@nibon7](https://github.com/nibon7) | Add checks for ports | [#11214](https://github.com/nushell/nushell/pull/11214) | -| [@ysthakur](https://github.com/ysthakur) | Fix highlighting of spread subexpressions in records | [#11202](https://github.com/nushell/nushell/pull/11202) | -| [@nibon7](https://github.com/nibon7) | Fix overlay_use_main_not_exported hanging when an external spam command exists | [#11261](https://github.com/nushell/nushell/pull/11261) | -| [@AucaCoyan](https://github.com/AucaCoyan) | :bug: Fixes markdown formatting on LSP hover | [#11253](https://github.com/nushell/nushell/pull/11253) | -| [@MarikaChlebowska](https://github.com/MarikaChlebowska) | Add more descriptive error message when passing list to from_csv | [#10962](https://github.com/nushell/nushell/pull/10962) | -| [@sophiajt](https://github.com/sophiajt) | Respect non-zero exit code in subexpressions and blocks | [#8984](https://github.com/nushell/nushell/pull/8984) | -| [@WindSoilder](https://github.com/WindSoilder) | Error on `use path item1 item2`, if item1 is not a module | [#11183](https://github.com/nushell/nushell/pull/11183) | -| [@KAAtheWiseGit](https://github.com/KAAtheWiseGit) | Match `++=` capabilities with `++` | [#11130](https://github.com/nushell/nushell/pull/11130) | -| [@fdncred](https://github.com/fdncred) | Add nu lib dirs default | [#11248](https://github.com/nushell/nushell/pull/11248) | - -### Enhancing the documentation [[toc](#table-of-content)] -Thanks to all the contributors below for helping us making the documentation of Nushell commands better :pray: -| author | description | url | -| ------------------------------------------------ | ---------------------------------------------------------------------------- | ------------------------------------------------------- | -| [@sholderbach](https://github.com/sholderbach) | Curate developer documentation in tree | [#11052](https://github.com/nushell/nushell/pull/11052) | -| [@IanManske](https://github.com/IanManske) | Build `nu-protocol` docs with all features enabled | [#11180](https://github.com/nushell/nushell/pull/11180) | -| [@poliorcetics](https://github.com/poliorcetics) | feat: Add default docs for aliases, generated from the command they point to | [#10825](https://github.com/nushell/nushell/pull/10825) | -| [@amtoine](https://github.com/amtoine) | fix `nu-std` README | [#11244](https://github.com/nushell/nushell/pull/11244) | - -### Working on internals [[toc](#table-of-content)] -Thanks to all the contributors below for working on internals of Nushell, such as refactoring the code :pray: -| author | description | url | -| ---------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------- | -| [@fdncred](https://github.com/fdncred) | bump rust-toolchain to 1.72.1 | [#11079](https://github.com/nushell/nushell/pull/11079) | -| [@nibon7](https://github.com/nibon7) | Apply nightly clippy fixes | [#11083](https://github.com/nushell/nushell/pull/11083) | -| [@drbrain](https://github.com/drbrain) | Convert ShellError::CommandNotFound to named fields | [#11094](https://github.com/nushell/nushell/pull/11094) | -| [@drbrain](https://github.com/drbrain) | Convert ShellError::NetworkFailure to named fields | [#11093](https://github.com/nushell/nushell/pull/11093) | -| [@drbrain](https://github.com/drbrain) | Add Argument::span() and Call::arguments_span() | [#10983](https://github.com/nushell/nushell/pull/10983) | -| [@IanManske](https://github.com/IanManske) | Refactor `Value` cell path functions to fix bugs | [#11066](https://github.com/nushell/nushell/pull/11066) | -| [@sholderbach](https://github.com/sholderbach) | Bump version to `0.87.2` | [#11114](https://github.com/nushell/nushell/pull/11114) | -| [@sholderbach](https://github.com/sholderbach) | Bump `procfs` to 0.16.0 | [#11115](https://github.com/nushell/nushell/pull/11115) | -| [@drbrain](https://github.com/drbrain) | Remove ShellError::FlagNotFound | [#11119](https://github.com/nushell/nushell/pull/11119) | -| [@drbrain](https://github.com/drbrain) | Convert ShellError::AliasNotFound to named fields | [#11118](https://github.com/nushell/nushell/pull/11118) | -| [@drbrain](https://github.com/drbrain) | Convert FileNotFound to named fields | [#11120](https://github.com/nushell/nushell/pull/11120) | -| [@hustcer](https://github.com/hustcer) | Upgrade Nu and script for release workflow | [#11121](https://github.com/nushell/nushell/pull/11121) | -| [@sholderbach](https://github.com/sholderbach) | Use record API in `describe --detailed` | [#11075](https://github.com/nushell/nushell/pull/11075) | -| [@drbrain](https://github.com/drbrain) | Convert FileNotFoundCustom to named fields | [#11123](https://github.com/nushell/nushell/pull/11123) | -| [@drbrain](https://github.com/drbrain) | Convert PluginFailedToLoad to named fields | [#11124](https://github.com/nushell/nushell/pull/11124) | -| [@drbrain](https://github.com/drbrain) | Convert PluginFailedToEncode to named fields | [#11125](https://github.com/nushell/nushell/pull/11125) | -| [@drbrain](https://github.com/drbrain) | Convert PluginFailedToDecode to named fields | [#11126](https://github.com/nushell/nushell/pull/11126) | -| [@sholderbach](https://github.com/sholderbach) | Move more commands to opaque `Record` type | [#11122](https://github.com/nushell/nushell/pull/11122) | -| [@rfaulhaber](https://github.com/rfaulhaber) | Bump `sysinfo` to 0.29.11 | [#11166](https://github.com/nushell/nushell/pull/11166) | -| [@drbrain](https://github.com/drbrain) | Convert more ShellError variants to named fields | [#11173](https://github.com/nushell/nushell/pull/11173) | -| [@WindSoilder](https://github.com/WindSoilder) | add echo_env_mixed testbin to reduce windows only tests | [#11172](https://github.com/nushell/nushell/pull/11172) | -| [@cosineblast](https://github.com/cosineblast) | Remove file I/O from tests that don't need it | [#11182](https://github.com/nushell/nushell/pull/11182) | -| [@drbrain](https://github.com/drbrain) | Convert more ShellError variants to named fields | [#11222](https://github.com/nushell/nushell/pull/11222) | -| [@nibon7](https://github.com/nibon7) | Explicitly indicate duplicate flags | [#11226](https://github.com/nushell/nushell/pull/11226) | -| [@ysthakur](https://github.com/ysthakur) | Reduce code duplication in eval.rs and eval_const.rs | [#11192](https://github.com/nushell/nushell/pull/11192) | -| [@ayax79](https://github.com/ayax79) | Upgrading to polars 0.35 | [#11241](https://github.com/nushell/nushell/pull/11241) | -| [@IanManske](https://github.com/IanManske) | Remove unnecessary boxing of `Stack::recursion_count` | [#11238](https://github.com/nushell/nushell/pull/11238) | -| [@schrieveslaach](https://github.com/schrieveslaach) | Upgrade lsp-server Dependency | [#11252](https://github.com/nushell/nushell/pull/11252) | -| [@drbrain](https://github.com/drbrain) | Convert `Shellerror::GenericError` to named fields | [#11230](https://github.com/nushell/nushell/pull/11230) | -| [@sholderbach](https://github.com/sholderbach) | Bump version to `0.87.1` | [#11056](https://github.com/nushell/nushell/pull/11056) | -| [@dead10ck](https://github.com/dead10ck) | Testing support tweaks: exit status in `Outcome` | [#10692](https://github.com/nushell/nushell/pull/10692) | -| [@nibon7](https://github.com/nibon7) | Simplify `clear` implementation | [#11273](https://github.com/nushell/nushell/pull/11273) | -| [@drbrain](https://github.com/drbrain) | Convert remainder of ShellError variants to named fields | [#11276](https://github.com/nushell/nushell/pull/11276) | - -## New _spread_ operator for list and record literals [[toc](#table-of-content)] - -[#10598](https://github.com/nushell/nushell/issues/10598) asked for a spread operator (`...`), and in [#11006](https://github.com/nushell/nushell/pull/11006) -and [#11144](https://github.com/nushell/nushell/pull/11144/), [@ysthakur](https://github.com/ysthakur/) implemented a spread operator in lists and records, respectively. -Spreading arguments to commands has not been implemented yet. - -The spread operator can help you avoid `append` in lists, e.g., this: -```nushell -let list = ["foo"] -[ - 1, - ...$list, - ...("foo" | split chars), - ...[3 9], - [] -] | to nuon -``` -will give: -```nushell -[1, foo, f, o, o, 3, 9, []] -``` - -In records, it can help you avoid `merge`, e.g., this: -```nushell -let record = { a: "foo" } -{ - ...$record, - y: "bar", - ...{ z: 2 } -} | to nuon -``` -will give: -```nushell -{a: foo, y: bar, z: 2} -``` - -You can spread variables, subexpressions, and either lists (inside list literals) or records (inside record literals). -Note that there needs to be no whitespace between the `...` and the expression being spread. - -## Passing boolean switches dynamically [[toc](#table-of-content)] -In last release, a distinction has been introduced between switches, e.g. `--enable-feature`, and -boolean options, e.g. `--do-something: bool`. -The former is simply used as `--enable-feature` and the latter expects a value as -`--do-something false`. - -Up until now, this had the downside of disallowing one to pass boolean switches to inner calls of -commands. -An example would be two commands, `foo` and `bar`, which both have a `--switch` and where `foo` is -calling `bar` internally with the opposite switch. It would have to look something like -```nushell -def bar [--switch] { - print $"switch in bar: ($switch)" -} - -def foo [--switch] { - print $"switch in foo: ($switch)" - if $switch { - bar - } else { - bar --switch - } -} -``` -or `bar` would have to take a boolean value instead of a switch, which would make the command less -nice to use as part of a public API... -```nushell -def bar [--switch: bool] { - print $"switch in bar: ($switch)" -} - -def foo [--switch] { - print $"switch in foo: ($switch)" - bar --switch (not $switch) -} -``` - -In this release and thanks to the work of [@WindSoilder](https://github.com/WindSoilder) in -[#11057](https://github.com/nushell/nushell/pull/11057), boolean switches can now be passed around. -This will simplify the code above and still preserve the nice signature of `bar` :partying: -```nushell -def bar [--switch] { - print $"switch in bar: ($switch)" -} - -def foo [--switch] { - print $"switch in foo: ($switch)" - bar --switch=(not $switch) -} -``` - -## Redirection to standard streams is getting better [[toc](#table-of-content)] -Once again, [@WindSoilder](https://github.com/WindSoilder) has been working on the redirection -system of Nushell, fixing a bug and adding a new very nice feature: -- [#10851](https://github.com/nushell/nushell/pull/10851): one pipeline output stream can be - redirected and the other one used as input to the rest of the pipe. - Given the following Bash script called `foo.sh` that outputs both to _stdout_ and _stderr_ - ```sh - echo aaaaa - echo bbb 1>&2 - echo cc - ``` - it is now possible to run the following command, redirecting `bbb` to a file and the rest - to the `lines | each { ... }` part of the pipeline: - ```nushell - bash test.sh err> err.txt | lines | each { str length} - ``` - resulting in `[5, 2]` as expected and `bbb` inside `err.txt`. -- [#10764](https://github.com/nushell/nushell/pull/10764): append to file with the `>>` syntax - instead of overwriting with `>` - ```nushell - (1 + 2 + 3) out> sum.txt - "\n" out>> sum.txt - (4 + 5 + 6) out>> sum.txt - ``` - will create a file called `sum.txt` with the following content - ``` - 6 - 15 - ``` - -## One-time theming of tables is there [[toc](#table-of-content)] -A common question and feature request from the community was: _how can i change the theme of Nushell -tables for just one command?_ - -Because of how Nushell works, the way to do that has been the following for a long time -```nushell -do { # use the scope of `do` to not alter the environment of the callee - $env.config.table.mode = "none" # set the theme - ls | table # call table to avoid just passing the value back to the callee and use the outside theme -} -``` - -In [#11058](https://github.com/nushell/nushell/pull/11058), [@zhiburt](https://github.com/zhiburt) -cracked the nut and added the long-wanted `table --theme` option. Below is a simple example: -- let's define a table -```nushell -let table = ls | where type == dir | reject type -``` -- and show it with a particular theme -```nushell -$table | table --theme ascii_rounded -``` -``` -.#--name----size-------modified------. -|0|assets |4.1 KB|2023-12-05 18:32:30| -|1|benches|4.1 KB|2023-12-09 22:33:44| -|2|crates |4.1 KB|2023-12-09 22:33:44| -|3|devdocs|4.1 KB|2023-12-09 22:33:44| -|4|docker |4.1 KB|2023-12-09 22:33:44| -|5|scripts|4.1 KB|2023-12-09 22:33:44| -|6|src |4.1 KB|2023-12-09 22:33:44| -|7|target |4.1 KB|2023-12-09 14:19:04| -|8|tests |4.1 KB|2023-12-05 18:32:30| -|9|wix |4.1 KB|2023-12-05 18:32:30| -'------------------------------------' -``` - -## Exposing name of script to the wild [[toc](#table-of-content)] -Coming from languages such as Python and Bash, it's quite expected to be able to access the name of -the script itself the same way it's been called from the CLI: with `sys.argv[0]` in Python and `$0` -in Bash. - -This was not possible in Nushell until the work of [@p00f](https://github.com/p00f) in -[#11203](https://github.com/nushell/nushell/pull/11203). -This will expose to any script a new environment variable called `$env.PROCESS_PATH` and which will -contain precisely something akin to `argv[0]`! -```nushell -#!/usr/bin/env nu -# in demo.nu - -def main [] { - printf $"I was called as ($env.PROCESS_PATH)" -} -``` -```nushell -demo.nu # will show "I was called as demo.nu" -./demo.nu # will show "I was called as ./demo.nu" -/path/to/demo.nu # will show "I was called as /path/to/demo.nu" -``` - -## Parsing human-friendly dates into Nushell values [[toc](#table-of-content)] -In [#11051](https://github.com/nushell/nushell/pull/11051), [@fdncred](https://github.com/fdncred) -added to `into datetime` the ability to parse _human readable_ dates into Nushell `datetime`. -This allows to write crazy things like -```nushell -"Now" | into datetime # same as `date now` -"A week ago" | into datetime # same as `(date now) - 1wk` -``` - -::: tip Note -see the full list of examples with `into datetime --list-human` -::: - -## Show found externals via syntax highlighting in the [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) [[toc](#table-of-content)] -We've added a new experimental feature that changes the syntax highlighting of text in the command position in the repl. Here's how it works. As you type, if a command is found with the current letter you've typed, the command will be highlighted according to your configuration of your color theme, specifically `shape_external_resolved`. As you keep typing, `which` fires to find out if the command is found or not. This allows you to know whether you've created a typo before you ever hit enter in the nushell repl. - -Since this might have a performance impact, we've put this behind a configuration point named `highlight_resolved_externals` in the config.nu file. Set it to `true` to enable this functionality and `false` to disable it. It defaults to `false`. - -Right now, with a dark theme, here's one way of configuring these colors, in the config.nu color theme, that showcases this funcitonality. Also, make sure you have `highlight_resolved_externals` set to `true`. - -```nushell - shape_internalcall: cyan_bold # internal commands that are found will be this color - shape_external: darkorange # external "commands" that do not exist, will be this color - shape_external_resolved: light_yellow_bold # external commands that are found with `which`, will be this color -``` -You can read more about it and see a gif in [#11135](https://github.com/nushell/nushell/pull/11135) where [@fdncred](https://github.com/fdncred) implemented the feature. - -## New "out of bound" error [[toc](#table-of-content)] -[@nibon7](https://github.com/nibon7) introduces in -[#11201](https://github.com/nushell/nushell/pull/11201) a new error which is -pretty common to programming languages: the "out of bound" error. - -This will cause the following command to give an "out of bound" error: -```nushell -"foo" | str index-of '' --range 10..11 -``` - -## Details on the `0.87.1` hotfix release [[toc](#table-of-content)] -In between the last `0.87.0` release and the one from today, there has been a quick hotfix release -to address two major bugs to two quite important filesystem commands: `rm` and `cp`. - -Below are some details about these two bug fixes: -- [@IanManske](https://github.com/IanManske) fixed `rm` in - [#11064](https://github.com/nushell/nushell/pull/11064) which has - [trouble removing files after a `cd`](https://github.com/nushell/nushell/issues/11061) -- [@kubouch](https://github.com/kubouch) fixed a similar one about `cp` in - [#11080](https://github.com/nushell/nushell/pull/11080), addressing - [#10832](https://github.com/nushell/nushell/issues/10832) - -## Need help to wrap... commands? [[toc](#table-of-content)] -In the previous release, the `extern-wrapped` command has been deprecated and it is -[now being removed](#removed-commands-toc). -An issue did persist though, making `def --wrapped` not a suitable replacement for the old command... -which was fixed in [#11235](https://github.com/nushell/nushell/pull/11235) by the changes from -[@KAAtheWiseGit](https://github.com/KAAtheWiseGit): `def --wrapped` commands won't create a help -page anymore, allowing to send `-h` and `--help` to other commands: -```nushell -def --wrapped foo [...rest] { echo $rest } -foo --help -h -``` -will give no help page -``` -─┬────── -0│--help -1│-h -─┴────── -``` - -## Restricting use of internal variables [[toc](#table-of-content)] -Nushell features some internal variables that users can't redeclare, i.e. `$nu`, `$env` and `$in`. -::: tip Note -`$env` is the special of the three because one can mutate it with -```nushell -$env.FOO = "i'm foo" -``` -but it is impossible to do `let env = 123` -::: - -However, up until now and the work of [@KAAtheWiseGit](https://github.com/KAAtheWiseGit) -in [#11169](https://github.com/nushell/nushell/pull/11169) and -[#11228](https://github.com/nushell/nushell/pull/11228), it was possible to redefined these variables -in command definition: the code would parse and run, but you would get the internal values instead of -the ones passed to the command, which is a nasty silent bug! -From now on, the following will give an error -```nushell -def foo [nu] { print $nu } -``` -```nushell -def bar [env] { print $env } -``` -```nushell -def baz [in] { print $in } -``` - -Also, because `$nu` and `$env` don't have spans by construction, i.e. they are not defined in any -script where a span would make sense but rather internally when Nushell starts, accessing their -`metadata` does not make sense. This release makes the error more helpful: -```nushell -metadata $env -``` -``` -Error: × Built-in variables `$env` and `$nu` have no metadata - ╭─[entry #1:1:1] - 1 │ metadata $env - · ──┬─ - · ╰── no metadata available - ╰──── -``` - -## A small update on the LSP [[toc](#table-of-content)] -[@schrieveslaach](https://github.com/schrieveslaach) has been working again on the built-in LSP of -Nushell. -With [#10941](https://github.com/nushell/nushell/pull/10941), completions should get better with -this release :partying: - -## Our set of commands is evolving [[toc](#table-of-content)] -As usual, new release rhymes with changes to commands! - -### New commands [[toc](#table-of-content)] -- `is-terminal` by [@drbrain](https://github.com/drbrain) in [#10970](https://github.com/nushell/nushell/pull/10970) -- `std null-device` by [@WindSoilder](https://github.com/WindSoilder) in [#11070](https://github.com/nushell/nushell/pull/11070) -- `mktemp` by [@tskinn](https://github.com/tskinn) in [#11005](https://github.com/nushell/nushell/pull/11005) -- `stor` by [@fdncred](https://github.com/fdncred) in [#11170](https://github.com/nushell/nushell/pull/11170) => see the [section below](#a-local-in-memory-database-with-stor) - -#### A local in-memory database with `stor` - -With this release we've implemented a new sqlite family of commands called `stor`. `stor` is meant to be short for "storing data in an in-memory sqlite database". That's right, this family of commands supports an _in-memory_ database. This in-memory database will be accessible as long as they share the same executable instance. A new instance is created with each new nushell instance and the in-memory database cannot be shared between instances. We're exited to see what new things you'll invent with this technology, although we still consider it in the experimental phase. Please feel free to submit PRs to make the usage of it better and more robust. There are examples of how to use each command [in the PR](https://github.com/nushell/nushell/pull/11170). - -Here the summary you get when you execute the `stor` command. -```nushell -Usage: - > stor - -Subcommands: - stor create - Create a table in the in-memory sqlite database - stor delete - Delete a table or specified rows in the in-memory sqlite database - stor export - Export the in-memory sqlite database to a sqlite database file - stor import - Import a sqlite database file into the in-memory sqlite database - stor insert - Insert information into a specified table in the in-memory sqlite database - stor open - Opens the in-memory sqlite database - stor reset - Reset the in-memory database by dropping all tables - stor update - Update information in a specified table in the in-memory sqlite database - -Flags: - -h, --help - Display the help message for this command - -Input/output types: - ╭─#─┬──input──┬─output─╮ - │ 0 │ nothing │ string │ - ╰───┴─────────┴────────╯ -``` - -### Changes to existing commands [[toc](#table-of-content)] -- thanks to [@KAAtheWiseGit](https://github.com/KAAtheWiseGit) in [#11195](https://github.com/nushell/nushell/pull/11195), `input list` will accept more input/output types -- the `list<string> -> string` I/O pair has been added to the `last` command by [@amtoine](https://github.com/amtoine) in [#11137](https://github.com/nushell/nushell/pull/11137) -- with the work of [@IanManske](https://github.com/IanManske) in [#11258](https://github.com/nushell/nushell/pull/11258), `insert`, `update` and `upsert` should now work more consistently with `list`s, e.g. -```nushell -[0, 2] | update 0 {|i| $i + 1 } # will give [1, 2] -[0, 1, 2] | insert 5 5 # will give "index too large" error -``` - -### Deprecated commands [[toc](#table-of-content)] -- `std clip` in [#11097](https://github.com/nushell/nushell/pull/11097): this command was handy but did not fit the [philosophy of the standard library](https://github.com/nushell/nushell/tree/main/crates/nu-std#--welcome-to-the-standard-library-of-nushell--) -- `std testing` in [#11151](https://github.com/nushell/nushell/pull/11151): even though in a VERY EARLY stage of its development, we would like to focus our efforts on the [Nupm](https://github.com/nushell/nupm) project and especially its simple `nupm test` command - -### Removed commands [[toc](#table-of-content)] -as part of the [deprecation plan of last release](https://www.nushell.sh/blog/2023-11-14-nushell_0_87_0.html#deprecated-commands-toc), -the following commands and options have been removed by [@amtoine](https://github.com/amtoine): -- `extern-wrapped` and `export extern-wrapped` in favor of `def --wrapped` in [#11000](https://github.com/nushell/nushell/pull/11000) -- `--not` from `glob` in favor of `--exclude` in [#10839](https://github.com/nushell/nushell/pull/10839) -- `size` in favor of `str stats` in [#10784](https://github.com/nushell/nushell/pull/10784) -- `unfold` in favor of `generate` in [#10773](https://github.com/nushell/nushell/pull/10773) -- `def-env` and `export def-env` in favor of `def --env` in [#10999](https://github.com/nushell/nushell/pull/10999) - -# Breaking changes [[toc](#table-of-content)] -- [#8984](https://github.com/nushell/nushell/pull/8984) Respect non-zero exit code in subexpressions and blocks - -Starting with this release, if a subexpression (eg `(echo foo.txt)`) or block (eg `if true { echo foo.txt }` evaluated to a non-zero exit code, it will no longer be lost and instead will be the exit code of that expression. This allows them to act more naturally when an external command fails. - -- [#11144](https://github.com/nushell/nushell/pull/11144) No longer allow `{a: 1, a: 2}` - -We now error if you repeat the same field name when creating a record, for example `{a: 1, a: 2}`. - -- [#10999](https://github.com/nushell/nushell/pull/10999) remove `def-env` and `export def-env` -- [#11000](https://github.com/nushell/nushell/pull/11000) remove `extern-wrapped` and `export extern-wrapped` - -We've removed the deprecated commands `def-env` and `export def-env`. Instead, use `def --env`. Likewise, we've done the same for `extern-wrapped` and `export extern-wrapped`. Instead, use `def --wrapped`. - -- [#10773](https://github.com/nushell/nushell/pull/10773) remove the `unfold` command - -We've renamed the previous `unfold` command. Instead, use the `generate` command. - -- [#10784](https://github.com/nushell/nushell/pull/10784) remove `size` command in favor of `str stats` - -We've also removed the `size` command, whch had an ambiguous name. Now, use `str stats` to get information about string content. - -- [#10839](https://github.com/nushell/nushell/pull/10839) remove `--not` from `glob` - -This releae replace the confusing `--not` flag of `glob` to instead be `glob --exclude`. - -- [#11058](https://github.com/nushell/nushell/pull/11058) nu-table/ Add `-t/theme` argument && Replace `-n/start-number` with `-i/index` - -To make how to update the table numbering more clear, we've replaced `table -n` with `table -i`/`table --index`. - -# Full changelog [[toc](#table-of-content)] -## Nushell -- [amtoine](https://github.com/amtoine) created - - [remove the `unfold` command](https://github.com/nushell/nushell/pull/10773) - - [remove `size` command in favor of `str stats`](https://github.com/nushell/nushell/pull/10784) - - [remove `--not` from `glob`](https://github.com/nushell/nushell/pull/10839) - - [remove `def-env` and `export def-env`](https://github.com/nushell/nushell/pull/10999) - - [remove `extern-wrapped` and `export extern-wrapped`](https://github.com/nushell/nushell/pull/11000) - - [deprecate `std clip`](https://github.com/nushell/nushell/pull/11097) - - [add `list<string> -> string` to `last`](https://github.com/nushell/nushell/pull/11137) - - [fix the link to the `nu_scripts` in `std clip` deprecation](https://github.com/nushell/nushell/pull/11150) - - [deprecate `std testing`](https://github.com/nushell/nushell/pull/11151) - - [fix `nu-std` README](https://github.com/nushell/nushell/pull/11244) - - [add `nothing -> table` to `format date`](https://github.com/nushell/nushell/pull/11290) -- [app/dependabot](https://github.com/app/dependabot) created - - [Bump winreg from 0.51.0 to 0.52.0](https://github.com/nushell/nushell/pull/11102) - - [Bump uuid from 1.5.0 to 1.6.0](https://github.com/nushell/nushell/pull/11104) - - [Bump ureq from 2.8.0 to 2.9.1](https://github.com/nushell/nushell/pull/11163) - - [Bump openssl from 0.10.59 to 0.10.60](https://github.com/nushell/nushell/pull/11176) - - [Bump actions-rust-lang/setup-rust-toolchain from 1.5.0 to 1.6.0](https://github.com/nushell/nushell/pull/11223) -- [AucaCoyan](https://github.com/AucaCoyan) created - - [:bug: Fixes markdown formatting on LSP hover](https://github.com/nushell/nushell/pull/11253) -- [ayax79](https://github.com/ayax79) created - - [Upgrading to polars 0.35](https://github.com/nushell/nushell/pull/11241) -- [cosineblast](https://github.com/cosineblast) created - - [Remove file I/O from tests that don't need it](https://github.com/nushell/nushell/pull/11182) -- [danielsomerfield](https://github.com/danielsomerfield) created - - [Fix toolkit to run workspace on 'check pr' (issue #10906)](https://github.com/nushell/nushell/pull/11112) -- [dead10ck](https://github.com/dead10ck) created - - [Testing support tweaks: exit status in `Outcome`](https://github.com/nushell/nushell/pull/10692) - - [into binary -c: return 0 as single byte](https://github.com/nushell/nushell/pull/11068) -- [drbrain](https://github.com/drbrain) created - - [Add is-terminal to determine if stdin/out/err are a terminal](https://github.com/nushell/nushell/pull/10970) - - [Add Argument::span() and Call::arguments_span()](https://github.com/nushell/nushell/pull/10983) - - [Convert ShellError::NetworkFailure to named fields](https://github.com/nushell/nushell/pull/11093) - - [Convert ShellError::CommandNotFound to named fields](https://github.com/nushell/nushell/pull/11094) - - [Convert ShellError::AliasNotFound to named fields](https://github.com/nushell/nushell/pull/11118) - - [Remove ShellError::FlagNotFound](https://github.com/nushell/nushell/pull/11119) - - [Convert FileNotFound to named fields](https://github.com/nushell/nushell/pull/11120) - - [Convert FileNotFoundCustom to named fields](https://github.com/nushell/nushell/pull/11123) - - [Convert PluginFailedToLoad to named fields](https://github.com/nushell/nushell/pull/11124) - - [Convert PluginFailedToEncode to named fields](https://github.com/nushell/nushell/pull/11125) - - [Convert PluginFailedToDecode to named fields](https://github.com/nushell/nushell/pull/11126) - - [Convert more ShellError variants to named fields](https://github.com/nushell/nushell/pull/11173) - - [Convert more ShellError variants to named fields](https://github.com/nushell/nushell/pull/11222) - - [Convert `Shellerror::GenericError` to named fields](https://github.com/nushell/nushell/pull/11230) - - [Convert remainder of ShellError variants to named fields](https://github.com/nushell/nushell/pull/11276) - - [Ensure that command usage starts uppercase and ends period](https://github.com/nushell/nushell/pull/11278) -- [dtolnay](https://github.com/dtolnay) created - - [Fix `Option<&str> == Option<&String>` build error when using rust_decimal/rkyv feature](https://github.com/nushell/nushell/pull/11205) -- [fdncred](https://github.com/fdncred) created - - [allow parsing of human readable datetimes](https://github.com/nushell/nushell/pull/11051) - - [tweak `table` example/parameter text](https://github.com/nushell/nushell/pull/11071) - - [add "default" table theme](https://github.com/nushell/nushell/pull/11072) - - [correct table example syntax](https://github.com/nushell/nushell/pull/11074) - - [optimize/clean up a few of the `table` changes](https://github.com/nushell/nushell/pull/11076) - - [bump rust-toolchain to 1.72.1](https://github.com/nushell/nushell/pull/11079) - - [add shape `ExternalResolved` to show found externals via syntax highlighting in the repl](https://github.com/nushell/nushell/pull/11135) - - [Add `stor` family of commands](https://github.com/nushell/nushell/pull/11170) - - [add some tests for `stor create`](https://github.com/nushell/nushell/pull/11194) - - [Add nu lib dirs default](https://github.com/nushell/nushell/pull/11248) -- [hustcer](https://github.com/hustcer) created - - [Upgrade Nu and script for release workflow](https://github.com/nushell/nushell/pull/11121) - - [Exit the release job if creating binary package failed](https://github.com/nushell/nushell/pull/11145) - - [Fix release and nightly build workflow](https://github.com/nushell/nushell/pull/11146) -- [IanManske](https://github.com/IanManske) created - - [Fix `rm` path handling](https://github.com/nushell/nushell/pull/11064) - - [Refactor `Value` cell path functions to fix bugs](https://github.com/nushell/nushell/pull/11066) - - [Build `nu-protocol` docs with all features enabled](https://github.com/nushell/nushell/pull/11180) - - [Fix `get -i` ignoring errors for only the first cellpath](https://github.com/nushell/nushell/pull/11213) - - [Remove unnecessary boxing of `Stack::recursion_count`](https://github.com/nushell/nushell/pull/11238) - - [Fix replacement closures for `update`, `insert`, and `upsert`](https://github.com/nushell/nushell/pull/11258) -- [KAAtheWiseGit](https://github.com/KAAtheWiseGit) created - - [Match `++=` capabilities with `++`](https://github.com/nushell/nushell/pull/11130) - - [Forbid reserved variable names for function arguments](https://github.com/nushell/nushell/pull/11169) - - [Allow more types for `input list`](https://github.com/nushell/nushell/pull/11195) - - [Add special error for calling `metadata` on $env and $nu](https://github.com/nushell/nushell/pull/11228) - - [Do not create help for wrapped command](https://github.com/nushell/nushell/pull/11235) -- [kubouch](https://github.com/kubouch) created - - [Send only absolute paths to uu_cp](https://github.com/nushell/nushell/pull/11080) -- [MarikaChlebowska](https://github.com/MarikaChlebowska) created - - [Add more descriptive error message when passing list to from_csv](https://github.com/nushell/nushell/pull/10962) - - [Add metadata to some filters](https://github.com/nushell/nushell/pull/11160) -- [nibon7](https://github.com/nibon7) created - - [Apply nightly clippy fixes](https://github.com/nushell/nushell/pull/11083) - - [Add boundary check for str index-of](https://github.com/nushell/nushell/pull/11190) - - [Add OutOfBounds error](https://github.com/nushell/nushell/pull/11201) - - [Fix span of invalid range](https://github.com/nushell/nushell/pull/11207) - - [Fix capacity overflow caused by large range of ports](https://github.com/nushell/nushell/pull/11210) - - [Add checks for ports](https://github.com/nushell/nushell/pull/11214) - - [Explicitly indicate duplicate flags](https://github.com/nushell/nushell/pull/11226) - - [Fix overlay_use_main_not_exported hanging when an external spam command exists](https://github.com/nushell/nushell/pull/11261) - - [Simplify `clear` implementation](https://github.com/nushell/nushell/pull/11273) -- [NotLebedev](https://github.com/NotLebedev) created - - [Cp target expansion](https://github.com/nushell/nushell/pull/11152) -- [p00f](https://github.com/p00f) created - - [expose argv[0] as `$env.PROCESS_PATH`](https://github.com/nushell/nushell/pull/11203) -- [poliorcetics](https://github.com/poliorcetics) created - - [feat: Add default docs for aliases, generated from the command they point to](https://github.com/nushell/nushell/pull/10825) -- [rfaulhaber](https://github.com/rfaulhaber) created - - [Bump `sysinfo` to 0.29.11](https://github.com/nushell/nushell/pull/11166) -- [schrieveslaach](https://github.com/schrieveslaach) created - - [Implement LSP Text Document Synchronization](https://github.com/nushell/nushell/pull/10941) - - [Upgrade lsp-server Dependency](https://github.com/nushell/nushell/pull/11252) -- [sholderbach](https://github.com/sholderbach) created - - [Bump version for `0.87.0` release](https://github.com/nushell/nushell/pull/11031) - - [Move to clearer reedline keyboard enhancement API](https://github.com/nushell/nushell/pull/11045) - - [Curate developer documentation in tree](https://github.com/nushell/nushell/pull/11052) - - [Pin reedline to 0.26 release](https://github.com/nushell/nushell/pull/11053) - - [Bump version to `0.87.1`](https://github.com/nushell/nushell/pull/11056) - - [Use record API in `describe --detailed`](https://github.com/nushell/nushell/pull/11075) - - [Bump version to `0.87.2`](https://github.com/nushell/nushell/pull/11114) - - [Bump `procfs` to 0.16.0](https://github.com/nushell/nushell/pull/11115) - - [Move more commands to opaque `Record` type](https://github.com/nushell/nushell/pull/11122) - - [Revert "Adding support for Polars structs"](https://github.com/nushell/nushell/pull/11171) -- [sigoden](https://github.com/sigoden) created - - [Fix spans passed to external_completer](https://github.com/nushell/nushell/pull/11008) -- [sophiajt](https://github.com/sophiajt) created - - [Respect non-zero exit code in subexpressions and blocks](https://github.com/nushell/nushell/pull/8984) - - [Fix the output type for 'view files'](https://github.com/nushell/nushell/pull/11077) -- [tskinn](https://github.com/tskinn) created - - [Add `mktemp` command](https://github.com/nushell/nushell/pull/11005) -- [WindSoilder](https://github.com/WindSoilder) created - - [Support `o>>`, `e>>`, `o+e>>` to append output to an external file](https://github.com/nushell/nushell/pull/10764) - - [Redirect: support redirect stderr with piping stdout to next commands.](https://github.com/nushell/nushell/pull/10851) - - [fix custom command's default value](https://github.com/nushell/nushell/pull/11043) - - [enable to pass switch values dynamically](https://github.com/nushell/nushell/pull/11057) - - [std: add cross platform null-device name](https://github.com/nushell/nushell/pull/11070) - - [add echo_env_mixed testbin to reduce windows only tests](https://github.com/nushell/nushell/pull/11172) - - [Error on `use path item1 item2`, if item1 is not a module](https://github.com/nushell/nushell/pull/11183) - - [When using redirection, if a command generates non-zero exit code, the script should stop running](https://github.com/nushell/nushell/pull/11191) -- [ysthakur](https://github.com/ysthakur) created - - [Spread operator for list literals](https://github.com/nushell/nushell/pull/11006) - - [Spread operator in record literals](https://github.com/nushell/nushell/pull/11144) - - [Reduce code duplication in eval.rs and eval_const.rs](https://github.com/nushell/nushell/pull/11192) - - [Fix highlighting of spread subexpressions in records](https://github.com/nushell/nushell/pull/11202) -- [zhiburt](https://github.com/zhiburt) created - - [Fix #11047](https://github.com/nushell/nushell/pull/11054) - - [nu-table/ Add `-t/theme` argument && Replace `-n/start-number` with `-i/index`](https://github.com/nushell/nushell/pull/11058) - -## Extension -- [glcraft](https://github.com/glcraft) created - - [Syntax highlight: add "export" to "module"](https://github.com/nushell/vscode-nushell-lang/pull/166) - - [Improve type parsing in function def](https://github.com/nushell/vscode-nushell-lang/pull/167) - - [Textmate improvements](https://github.com/nushell/vscode-nushell-lang/pull/168) - - [Textmate: improvement on record entries and closure](https://github.com/nushell/vscode-nushell-lang/pull/169) - -## Documentation -- [132ikl](https://github.com/132ikl) created - - [Add a snippet to suggest using the ? operator for environmental variables](https://github.com/nushell/nushell.github.io/pull/1142) -- [amtoine](https://github.com/amtoine) created - - [Release notes for `0.87.0`](https://github.com/nushell/nushell.github.io/pull/1114) -- [app/dependabot](https://github.com/app/dependabot) created - - [Bump vite from 4.4.9 to 4.4.12](https://github.com/nushell/nushell.github.io/pull/1165) -- [app/github-actions](https://github.com/app/github-actions) created - - [Compressed Images](https://github.com/nushell/nushell.github.io/pull/1147) -- [arnau](https://github.com/arnau) created - - [Add a cookbook comparing jq and nushell](https://github.com/nushell/nushell.github.io/pull/1150) - - [Unifies all cookbook codeblocks to use the same style.](https://github.com/nushell/nushell.github.io/pull/1151) - - [Rename def-env to def --env](https://github.com/nushell/nushell.github.io/pull/1155) -- [CAESIUS-TIM](https://github.com/CAESIUS-TIM) created - - [:memo: Replace `decimal` with `float`](https://github.com/nushell/nushell.github.io/pull/1161) - - [[zh-CN] Update README, and Getting Started (入门篇)](https://github.com/nushell/nushell.github.io/pull/1168) -- [FMotalleb](https://github.com/FMotalleb) created - - [Update coming_from_bash.md](https://github.com/nushell/nushell.github.io/pull/1158) -- [Hofer-Julian](https://github.com/Hofer-Julian) created - - [Fix jq comparison](https://github.com/nushell/nushell.github.io/pull/1162) -- [hustcer](https://github.com/hustcer) created - - [Refresh command docs for Nu v0.87](https://github.com/nushell/nushell.github.io/pull/1144) -- [KAAtheWiseGit](https://github.com/KAAtheWiseGit) created - - [Fix append to mutable variable operator](https://github.com/nushell/nushell.github.io/pull/1164) -- [Ktoks](https://github.com/Ktoks) created - - [Update creating_errors.md](https://github.com/nushell/nushell.github.io/pull/1154) -- [MarikaChlebowska](https://github.com/MarikaChlebowska) created - - [Replace usage of removed `date format` with `format date` in examples](https://github.com/nushell/nushell.github.io/pull/1157) -- [ppenguin](https://github.com/ppenguin) created - - [Add `parse` examples to *Parsing*](https://github.com/nushell/nushell.github.io/pull/1152) -- [sholderbach](https://github.com/sholderbach) created - - [Clean up contributor book](https://github.com/nushell/nushell.github.io/pull/1153) -- [sophiajt](https://github.com/sophiajt) created - - [Add 2023 survey results](https://github.com/nushell/nushell.github.io/pull/1143) -- [stfacc](https://github.com/stfacc) created - - [Improve workaround for carapace ERR output](https://github.com/nushell/nushell.github.io/pull/1159) -- [ysthakur](https://github.com/ysthakur) created - - [Add section on spread operator](https://github.com/nushell/nushell.github.io/pull/1160) - -## Nu_Scripts -- [Abdillah](https://github.com/Abdillah) created - - [completions/git: fix support for path relative to current directory](https://github.com/nushell/nu_scripts/pull/666) -- [amtoine](https://github.com/amtoine) created - - [add a "bulk rename" command to the stdlib candidates](https://github.com/nushell/nu_scripts/pull/643) - - [add missing tasks to the release note PR](https://github.com/nushell/nu_scripts/pull/665) - - [add `clip` from standard library](https://github.com/nushell/nu_scripts/pull/674) -- [AucaCoyan](https://github.com/AucaCoyan) created - - [:sparkles: Add `rustup` completions](https://github.com/nushell/nu_scripts/pull/689) - - [Add rustup completions](https://github.com/nushell/nu_scripts/pull/690) - - [:sparkles: Add `pnpm` completions](https://github.com/nushell/nu_scripts/pull/692) -- [drbrain](https://github.com/drbrain) created - - [Improve git branch cleanup script](https://github.com/nushell/nu_scripts/pull/685) -- [Euphrasiologist](https://github.com/Euphrasiologist) created - - [Create basic-git.nu](https://github.com/nushell/nu_scripts/pull/687) - - [Adding the `A` case](https://github.com/nushell/nu_scripts/pull/688) -- [fj0r](https://github.com/fj0r) created - - [cwdhist: can place the path anywhere in the buffer](https://github.com/nushell/nu_scripts/pull/669) - - [rename `cmd parse` to `argx` to improve importing](https://github.com/nushell/nu_scripts/pull/671) - - [nu-complete kube deploys and pods](https://github.com/nushell/nu_scripts/pull/682) - - [generate completions from tree-shaped data](https://github.com/nushell/nu_scripts/pull/683) - - [container-create -w: mount $env.PWD as workdir](https://github.com/nushell/nu_scripts/pull/686) -- [fnuttens](https://github.com/fnuttens) created - - [Add bat aliases](https://github.com/nushell/nu_scripts/pull/678) -- [glcraft](https://github.com/glcraft) created - - [Add `record` module](https://github.com/nushell/nu_scripts/pull/679) -- [kjelly](https://github.com/kjelly) created - - [get deploy complete for ka/kl in kubernetes module](https://github.com/nushell/nu_scripts/pull/680) -- [RGBCube](https://github.com/RGBCube) created - - [Fix typo in bat aliases](https://github.com/nushell/nu_scripts/pull/684) -- [sholderbach](https://github.com/sholderbach) created - - [Change uses of `size` to `str stats`](https://github.com/nushell/nu_scripts/pull/647) - - [Change `nu-deps` script to not care about waves](https://github.com/nushell/nu_scripts/pull/667) - - [Update `nu_release.nu` for 0.87 release](https://github.com/nushell/nu_scripts/pull/668) -- [WindSoilder](https://github.com/WindSoilder) created - - [remove null-stream](https://github.com/nushell/nu_scripts/pull/670) - - [Using def --env instead of def-env](https://github.com/nushell/nu_scripts/pull/673) - -## Reedline -- [ClementNerma](https://github.com/ClementNerma) created - - [Allow to construct ReedlineError values from the outside](https://github.com/nushell/reedline/pull/676) - - [Allow to build HistoryItemId values from the outside](https://github.com/nushell/reedline/pull/677) - - [ Make history-related items (de-)serializable](https://github.com/nushell/reedline/pull/678) -- [crides](https://github.com/crides) created - - [vi mode: map `cw`/`cW` to `ce`/`cE` by default](https://github.com/nushell/reedline/pull/668) -- [Hofer-Julian](https://github.com/Hofer-Julian) created - - [Also run clippy on examples](https://github.com/nushell/reedline/pull/666) -- [sholderbach](https://github.com/sholderbach) created - - [Properly handle optional event modes](https://github.com/nushell/reedline/pull/659) - - [Bump version for `0.26.0` release](https://github.com/nushell/reedline/pull/664) - - [Build docs.rs docs with all features](https://github.com/nushell/reedline/pull/672) diff --git a/blog/2024-01-09-nushell_0_89_0.md b/blog/2024-01-09-nushell_0_89_0.md deleted file mode 100644 index 21bfd2f680d..00000000000 --- a/blog/2024-01-09-nushell_0_89_0.md +++ /dev/null @@ -1,444 +0,0 @@ ---- -title: Nushell 0.89.0 -author: The Nu Authors -author_site: https://twitter.com/nu_shell -author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.89.0 of Nu. This release adds spreading of argument lists to command calls, better editor integration, and many bugfixes. ---- -<!-- TODO: complete the excerpt above --> - -# Nushell 0.89.0 - -Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. - -<!-- TODO: write this excerpt --> -Today, we're releasing version 0.89.0 of Nu. This release adds spreading of argument lists to command calls, better editor integration, and many bugfixes. - -# Where to get it - -Nu 0.89.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.89.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. - -::: tip Note -The optional dataframe functionality is available by `cargo install nu --features=dataframe`. -::: - -As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. - -# Table of content -- [Nushell 0.89.0](#nushell-0890) -- [Where to get it](#where-to-get-it) -- [Table of content](#table-of-content) -- [Themes of this release / New features \[toc\]](#themes-of-this-release--new-features-toc) - - [Removal of directory module auto-exports](#update-19012024-breaking-change-removal-of-directory-module-auto-exports-toc) - - [Spread operator for commands](#spread-operator-for-commands) - - [Editor Improvements](#editor-improvements) - - [Deprecation of `--flag: bool`](#deprecation-of---flag-bool) - - [Our set of commands is evolving \[toc\]](#our-set-of-commands-is-evolving-toc) - - [New commands \[toc\]](#new-commands-toc) - - [`ulimit` for Unix-based systems](#ulimit-for-unix-based-systems) -- [Breaking changes \[toc\]](#breaking-changes-toc) -- [Full changelog \[toc\]](#full-changelog-toc) - - [Nushell](#nushell) - - [Documentation](#documentation) - - [Nu\_Scripts](#nu_scripts) - - [Reedline](#reedline) -<!-- TODO: please add links to the other sections here - - the following command should help pre-generate a great deal of the table of content. - be careful with the format and false-positives :wink: - ```nushell - const TOC_MARKER = "[[toc](#table-of-content)]" - rg '^#+ ' blog/... - | lines - | where ($it | str ends-with $" ($TOC_MARKER)") - | str replace $" ($TOC_MARKER)" '' - | each { - str replace '# ' '- ' - | str replace --all '#' ' ' - | str replace --regex '- (.*)' '- [*$1*](#$1-toc)' - } - | to text - ``` ---> -- [*Breaking changes*](#breaking-changes-toc) -- [*Full changelog*](#full-changelog-toc) - -# Themes of this release / New features [[toc](#table-of-content)] -<!-- NOTE: if you wanna write a section about a breaking change, when it's a very important one, - please add the following snippet to have a "warning" banner :) - > see [an example](https://www.nushell.sh/blog/2023-09-19-nushell_0_85_0.html#pythonesque-operators-removal) - - ```md - ::: warning Breaking change - See a full overview of the [breaking changes](#breaking-changes) - ::: - ``` ---> -<!-- NOTE: see https://vuepress.github.io/reference/default-theme/markdown.html#custom-containers - for the list of available *containers* ---> - -## (Update 19.01.2024, Breaking change!) Removal of directory module auto-exports [[toc](#table-of-content)] - -_Release note gremlin hid this note from us and we forgot to add it. We're sorry!_ - -[@amtoine](https://github.com/amtoine) in [#11157](https://github.com/nushell/nushell/pull/11157) removed the directory module autoexport of all .nu files inside the directory. This removes the ability to "dump .nu files into a directory" and have them automatically exported. Previously, if you had the following file structure: - -``` -spam -├── bar.nu -├── baz.nu -├── foo.nu -└── mod.nu -``` -all you had to do was to call `use spam` and the `.nu` files would be added as submodules of `spam`. Now, to achieve the same effect, you would need to put -```nushell -export module foo.nu -export module bar.nu -export module baz.nu -``` -to the `mod.nu`. - -This change adds one manual step you need to perform to export submodules from modules, but it gives you more control and confidence. In the previous system, .nu files would be auto-exported _even if you didn't want to_! For example, to prevent `baz.nu` from being auto-exported, you would need to put it inside a new directory that doesn't contain `mod.nu` (and thus is not considered a Nushell module), like this: -``` -spam -├── bar.nu -├── foo.nu -└── utils - └── baz.nu -``` -We felt like this workaround was quite cumbersome, and the implicit behavior wasn't in the disciplined spirit of Nushell. Rather than having this auto-exporting as an _implicit_ feature of `use`, we're currently exploring ways to allow doing it _explicitly_, for example with a separate command. - -## Spread operator for commands - -In [#11289](https://github.com/nushell/nushell/pull/11289), [@ysthakur](https://github.com/ysthakur/) -implemented a spread operator for calling commands (previously, it could only be used in list and record literals). - -Now, if you have a command with a rest parameter: - -```nushell -def foo [ ...args ] { $args | to nuon } -``` - -You can spread arguments to it like this: - -```nushell -> let x = [foo bar baz] -> foo ...[1 2] ...$x -[1, 2, foo, bar, baz] -``` - -See [the docs](/book/operators.html#spread-operator) for more information. - -## Editor Improvements - -Thanks to @AucaCoyan's [#11284](https://github.com/nushell/nushell/pull/11284) and [#11320](https://github.com/nushell/nushell/pull/11320), Nushell's VSCode extension and builtin LSP server now show the same command's message on hover as abtained with `help` in Nushell. - -## Deprecation of `--flag: bool` - -In the last release, we allowed passing flags dynamically: -```nushell -def spam [--foo] { - print $foo -} - -let value = false -spam --foo=$value -# prints false -``` -However, it is easy to confuse with `--foo: bool`. To disambiguate, we are deprecating the setting optional parameters with boolean type (`--flag: bool`). Doing so will trigger a warning: -```nushell -def spam [--foo: bool] { $foo } -Error: × Deprecated: --flag: bool - ╭─[entry #3:1:1] - 1 │ def spam [--foo: bool] { $foo } - · ──┬─ - · ╰── `--flag: bool` is deprecated and will be removed in 0.90. Please use `--flag` instead, more info: https://www.nushell.sh/book/custom_commands.html - ╰──── -``` - -## Our set of commands is evolving [[toc](#table-of-content)] -As usual, new release rhyms with changes to commands! - -### New commands [[toc](#table-of-content)] - -#### `ulimit` for Unix-based systems - -The new `ulimit` command added by [@nibon7](https://github.com/nushell/nushell/pull/11324) can now be used on Unix-based systems for setting or checking the resource limits, such as the stack size or virtual memory size, for the current user. - -To list the currrent limits: -```nushell -ulimit -a -``` - -Setting the limits is done via flags available in `help ulimit`. - -<!-- NOTE: to start investigating the contributions of last release, i like to list them all in a raw table. - to achieve this, one can use the [`list-merged-prs` script from `nu_scripts`](https://github.com/nushell/nu_scripts/blob/main/make_release/release-note/list-merged-prs) - as follows: - - ```nushell - use ./make_release/release-note/list-merged-prs - - const LAST_RELEASE = null - - let matching_releases = ^gh api /repos/nushell/nushell/releases - | from json - | where tag_name == $LAST_RELEASE - - match ($matching_releases | length) { - 0 => { - error make --unspanned { msg: "no matching releases... did you set the last release?" } - }, - 1 => {}, - _ => { - error make --unspanned { msg: $"too many matching releases... is ($LAST_RELEASE) correct?" } - }, - } - - let last_release_date = $matching_releases | into record | get published_at | into datetime - - let prs = list-merged-prs nushell/nushell $last_release_date - | where author != "app/dependabot" - | sort-by mergedAt - | update url {|it| $"[#($it.number)]\(($it.url)\)" } - | update author { $"[@($in)]\(https://github.com/($in)\)" } - | select author title url - | rename --column {url: pr} - - $prs | to md --pretty - ``` ---> - -# Breaking changes [[toc](#table-of-content)] -<!-- TODO: - paste the output of - ```nu - ./make_release/release-note/list-merged-prs nushell/nushell --label breaking-change --pretty --no-author - ``` - here ---> - -- [#11131](https://github.com/nushell/nushell/pull/11131) remove `std clip` -- [#11414](https://github.com/nushell/nushell/pull/11414) Lock out new direct construction of `Record` -- [#11367](https://github.com/nushell/nushell/pull/11367) Remove `Expr::MatchPattern` -- [#11355](https://github.com/nushell/nushell/pull/11355) Rename extra's `format` to `format pattern` -- [#11356](https://github.com/nushell/nushell/pull/11356) Remove `Value::MatchPattern` -- [#11313](https://github.com/nushell/nushell/pull/11313) Bubble up errors passed to `complete` -- [#11157](https://github.com/nushell/nushell/pull/11157) disable directory submodule auto export - - -# Full changelog [[toc](#table-of-content)] -<!-- TODO: - paste the output of - ```nu - ./make_release/release-note/get-full-changelog - ``` - here ---> - -## Nushell -- [amtoine](https://github.com/amtoine) created - - [remove `std clip`](https://github.com/nushell/nushell/pull/11131) - - [improve completions of `use` and `overlay use`](https://github.com/nushell/nushell/pull/11330) - - [disable directory submodule auto export](https://github.com/nushell/nushell/pull/11157) -- [abusch](https://github.com/abusch) created - - [fix: closure captures can also be constants](https://github.com/nushell/nushell/pull/11493) -- [WindSoilder](https://github.com/WindSoilder) created - - [update reedline version to latest main](https://github.com/nushell/nushell/pull/11490) - - [Deprecate `--flag: bool` in custom command](https://github.com/nushell/nushell/pull/11365) - - [enable flag value type checking](https://github.com/nushell/nushell/pull/11311) - - [Fix piping output logic](https://github.com/nushell/nushell/pull/11317) -- [NotLebedev](https://github.com/NotLebedev) created - - [Xml errors fix](https://github.com/nushell/nushell/pull/11487) -- [nibon7](https://github.com/nibon7) created - - [Bump terminal_size to 0.3](https://github.com/nushell/nushell/pull/11486) - - [Fix cross building for target x86_64-pc-windows-gnu on linux](https://github.com/nushell/nushell/pull/11485) - - [Bump sysinfo from 0.29 to 0.30](https://github.com/nushell/nushell/pull/11484) - - [Replace `winapi` with `windows`](https://github.com/nushell/nushell/pull/11481) - - [Don't panic when `http_client` fails](https://github.com/nushell/nushell/pull/11422) - - [Don't create a thread if stderr_stream is None](https://github.com/nushell/nushell/pull/11421) - - [Fix an infinite loop if the input stream and output stream are the same](https://github.com/nushell/nushell/pull/11384) - - [Bump windows from 0.48.0 to 0.52.0 ](https://github.com/nushell/nushell/pull/11325) - - [Fix build for BSDs](https://github.com/nushell/nushell/pull/11372) - - [Allow `filesize` type as a valid limit value](https://github.com/nushell/nushell/pull/11349) - - [Allow `int` type as a valid limit value](https://github.com/nushell/nushell/pull/11346) - - [Add ulimit command](https://github.com/nushell/nushell/pull/11324) -- [yukitomoda](https://github.com/yukitomoda) created - - [Refactor tests (using cococo instead of ^echo)](https://github.com/nushell/nushell/pull/11479) - - [Fix the test which fails on windows](https://github.com/nushell/nushell/pull/11478) - - [Fix rm for symlinks pointing to directory on windows (issue #11461)](https://github.com/nushell/nushell/pull/11463) -- [hustcer](https://github.com/hustcer) created - - [Try to fix riscv64 building by using unbuntu-latest](https://github.com/nushell/nushell/pull/11476) - - [Downgrade openssl-src to fix riscv64 build target, close #11345](https://github.com/nushell/nushell/pull/11353) -- [rsteube](https://github.com/rsteube) created - - [Revert "Return external file completions if not empty (#10898)"](https://github.com/nushell/nushell/pull/11446) -- [fdncred](https://github.com/fdncred) created - - [bump rust toolchain to 1.73.0](https://github.com/nushell/nushell/pull/11445) - - [Revert "Bump reedline development version"](https://github.com/nushell/nushell/pull/11425) - - [add special emoji handling for debug --raw](https://github.com/nushell/nushell/pull/11368) - - [Revert "Only run $env.PROMPT_COMMAND once per prompt"](https://github.com/nushell/nushell/pull/11340) - - [update reedline to latest + include PR 675 for testing](https://github.com/nushell/nushell/pull/11339) -- [ysthakur](https://github.com/ysthakur) created - - [Allow spreading arguments to commands](https://github.com/nushell/nushell/pull/11289) - - [More specific errors for missing values in records](https://github.com/nushell/nushell/pull/11423) - - [Only run $env.PROMPT_COMMAND once per prompt (copy of #10986)](https://github.com/nushell/nushell/pull/11366) - - [Don't redraw prompt when transient prompt disabled](https://github.com/nushell/nushell/pull/10788) -- [cyradotpink](https://github.com/cyradotpink) created - - [Allow `http` commands' automatic redirect-following to be disabled](https://github.com/nushell/nushell/pull/11329) -- [SebastianIonel](https://github.com/SebastianIonel) created - - [Fix the bug for "bytes remove --end" .](https://github.com/nushell/nushell/pull/11428) -- [IanManske](https://github.com/IanManske) created - - [Remove unnecessary `replace_in_variable`](https://github.com/nushell/nushell/pull/11424) - - [Simplify `SIGQUIT` handling](https://github.com/nushell/nushell/pull/11381) - - [Make `Call::get_flag_expr` return `&Expression` instead of owned value ](https://github.com/nushell/nushell/pull/11388) - - [Remove `Expr::MatchPattern`](https://github.com/nushell/nushell/pull/11367) - - [Refactor `group-by` with closure grouper](https://github.com/nushell/nushell/pull/11370) - - [Remove `Value::MatchPattern`](https://github.com/nushell/nushell/pull/11356) - - [Satisfy clippy lint in benchmark](https://github.com/nushell/nushell/pull/11350) -- [sholderbach](https://github.com/sholderbach) created - - [Simplify the feature gates for `stor` commands](https://github.com/nushell/nushell/pull/11416) - - [Make polars deps optional for `cargo test --all`](https://github.com/nushell/nushell/pull/11415) - - [Lock out new direct construction of `Record`](https://github.com/nushell/nushell/pull/11414) - - [Check for clean repo after tests](https://github.com/nushell/nushell/pull/11409) - - [Bump reedline development version](https://github.com/nushell/nushell/pull/11406) - - [Fix sandboxing of redirection tests](https://github.com/nushell/nushell/pull/11407) - - [Bump `fancy-regex` to single `0.12.0` version](https://github.com/nushell/nushell/pull/11389) - - [Construct `Record`s only through checked helpers](https://github.com/nushell/nushell/pull/11386) - - [Expand the workspace `members` in `Cargo.toml`](https://github.com/nushell/nushell/pull/11387) - - [Properly update to the reedline repo patch](https://github.com/nushell/nushell/pull/11342) - - [Bump version to `0.88.2`](https://github.com/nushell/nushell/pull/11333) - - [Bump version to `0.88.1`](https://github.com/nushell/nushell/pull/11303) - - [Revert lock file changes due to openssl build fail](https://github.com/nushell/nushell/pull/11328) - - [Bump version for `0.88.0` release](https://github.com/nushell/nushell/pull/11298) -- [lavafroth](https://github.com/lavafroth) created - - [fix: prevent greedy matching of directory names](https://github.com/nushell/nushell/pull/11403) -- [AucaCoyan](https://github.com/AucaCoyan) created - - [:memo: Update `str trim` CLI help doc](https://github.com/nushell/nushell/pull/11383) - - [:sparkles: Make `hover` equal to `help` command](https://github.com/nushell/nushell/pull/11320) - - [:recycle: Match `--ide-hover` with `help` command](https://github.com/nushell/nushell/pull/11284) -- [hardfau1t](https://github.com/hardfau1t) created - - [fix(cd): on android/termux fails to cd into /sdcard](https://github.com/nushell/nushell/pull/10329) -- [0323pin](https://github.com/0323pin) created - - [Fix build on NetBSD](https://github.com/nushell/nushell/pull/11364) -- [stormasm](https://github.com/stormasm) created - - [nu-cli repl get_command_finished_marker() does not need to be pub](https://github.com/nushell/nushell/pull/11362) -- [KAAtheWiseGit](https://github.com/KAAtheWiseGit) created - - [Rename extra's `format` to `format pattern`](https://github.com/nushell/nushell/pull/11355) - - [Bubble up errors passed to `complete`](https://github.com/nushell/nushell/pull/11313) - - [Add `format` meta command](https://github.com/nushell/nushell/pull/11334) - - [Replace bash with POSIX sh in tests](https://github.com/nushell/nushell/pull/11293) -- [crides](https://github.com/crides) created - - [fix shell integration markers](https://github.com/nushell/nushell/pull/11352) -- [CAD97](https://github.com/CAD97) created - - [Only run $env.PROMPT_COMMAND once per prompt](https://github.com/nushell/nushell/pull/10986) -- [Hofer-Julian](https://github.com/Hofer-Julian) created - - [Move history into their own module](https://github.com/nushell/nushell/pull/11308) - - [Move `stor` commands to category `Database`](https://github.com/nushell/nushell/pull/11315) -- [ayax79](https://github.com/ayax79) created - - [Polars Struct support without unsafe blocks](https://github.com/nushell/nushell/pull/11229) -- [drbrain](https://github.com/drbrain) created - - [Enforce required, optional, and rest positional arguments start with an uppercase and end with a period.](https://github.com/nushell/nushell/pull/11285) -- [AntoineSebert](https://github.com/AntoineSebert) created - - [fix-`open`-is-ambiguous](https://github.com/nushell/nushell/pull/11302) -- [sophiajt](https://github.com/sophiajt) created - - [bump reedline dep to 0.27](https://github.com/nushell/nushell/pull/11299) - -## Documentation -- [amtoine](https://github.com/amtoine) created - - [mark feature-gated commands more clearly](https://github.com/nushell/nushell.github.io/pull/1183) - - [logo contest announcement](https://github.com/nushell/nushell.github.io/pull/1180) - - [Release notes for `0.88.0`](https://github.com/nushell/nushell.github.io/pull/1146) -- [TWSiO](https://github.com/TWSiO) created - - [Adding warning to nu_plugin_formats commands](https://github.com/nushell/nushell.github.io/pull/1199) -- [yukitomoda](https://github.com/yukitomoda) created - - [JA update installation.md](https://github.com/nushell/nushell.github.io/pull/1198) - - [JA update shells_in_shells.md](https://github.com/nushell/nushell.github.io/pull/1197) - - [fix a description of usage scenario](https://github.com/nushell/nushell.github.io/pull/1196) - - [Update shells_in_shells.md](https://github.com/nushell/nushell.github.io/pull/1195) - - [update the list of commands which are interpreted by CMD](https://github.com/nushell/nushell.github.io/pull/1192) -- [hustcer](https://github.com/hustcer) created - - [Upgrade Vuepress, some Vuepress plugins and shiki syntax highlighter](https://github.com/nushell/nushell.github.io/pull/1194) - - [Refresh command docs for Nu v0.88](https://github.com/nushell/nushell.github.io/pull/1171) -- [aserowy](https://github.com/aserowy) created - - [external completer: fixed cookbook example to exchange the first span entry only](https://github.com/nushell/nushell.github.io/pull/1193) -- [YukiOnodera](https://github.com/YukiOnodera) created - - [I've revised the Japanese translation](https://github.com/nushell/nushell.github.io/pull/1179) -- [zolodev](https://github.com/zolodev) created - - [Update aliases adding new section](https://github.com/nushell/nushell.github.io/pull/1190) -- [ysthakur](https://github.com/ysthakur) created - - [Add info on spread operator in commands for 0.89 release notes](https://github.com/nushell/nushell.github.io/pull/1188) - - [Add information on spread operator](https://github.com/nushell/nushell.github.io/pull/1176) -- [frogshead](https://github.com/frogshead) created - - [fix typo](https://github.com/nushell/nushell.github.io/pull/1185) -- [Trent-Fellbootman](https://github.com/Trent-Fellbootman) created - - [Update types_of_data.md](https://github.com/nushell/nushell.github.io/pull/1184) - - [Update thinking_in_nu.md](https://github.com/nushell/nushell.github.io/pull/1172) -- [WindSoilder](https://github.com/WindSoilder) created - - [add information about switches](https://github.com/nushell/nushell.github.io/pull/1182) -- [app/github-actions](https://github.com/app/github-actions) created - - [Compressed Images](https://github.com/nushell/nushell.github.io/pull/1181) -- [MediosZ](https://github.com/MediosZ) created - - [Sync zh-CN shells_in_shells.](https://github.com/nushell/nushell.github.io/pull/1178) -- [braddunbar](https://github.com/braddunbar) created - - [Typo in history menu section](https://github.com/nushell/nushell.github.io/pull/1177) -- [IndigoLily](https://github.com/IndigoLily) created - - [Fix various spelling/grammar issues in release notes for `0.88.0`](https://github.com/nushell/nushell.github.io/pull/1175) -- [Tamnac](https://github.com/Tamnac) created - - [Add time command to nushell_map.md](https://github.com/nushell/nushell.github.io/pull/1173) -- [mb21](https://github.com/mb21) created - - [Extend globbing section in moving_around.md](https://github.com/nushell/nushell.github.io/pull/1125) -- [RGBCube](https://github.com/RGBCube) created - - [Update background_task.md](https://github.com/nushell/nushell.github.io/pull/1166) - -## Nu_Scripts -- [fj0r](https://github.com/fj0r) created - - [comma: upgrade template](https://github.com/nushell/nu_scripts/pull/725) - - [kubernetes to docker-compose](https://github.com/nushell/nu_scripts/pull/726) - - [comma test runner](https://github.com/nushell/nu_scripts/pull/715) - - [merge container-inspect into container-process-list](https://github.com/nushell/nu_scripts/pull/711) - - [comma: support filter, watch, poll](https://github.com/nushell/nu_scripts/pull/707) - - [new module comma and some updates](https://github.com/nushell/nu_scripts/pull/704) -- [bobhy](https://github.com/bobhy) created - - [Show activated python VE at beginning of prompt.](https://github.com/nushell/nu_scripts/pull/722) -- [AucaCoyan](https://github.com/AucaCoyan) created - - [:bug: fix `(default)` and `(installed)` on rustup completions](https://github.com/nushell/nu_scripts/pull/721) - - [:bug: rename `yarn` for `yarn-v4` and add `run` cmpl](https://github.com/nushell/nu_scripts/pull/720) - - [:sparkles: `code` completions](https://github.com/nushell/nu_scripts/pull/719) - - [:sparkles: add completion to `gh pr checkout <tab>`](https://github.com/nushell/nu_scripts/pull/714) - - [:sparkles: add more `gh` completions](https://github.com/nushell/nu_scripts/pull/713) - - [:sparkles: Add the first layer of depth to the cmds](https://github.com/nushell/nu_scripts/pull/708) - - [:sparkles: First `gh` completions](https://github.com/nushell/nu_scripts/pull/706) - - [:bug: Fix `rustup` use completions and modify README](https://github.com/nushell/nu_scripts/pull/696) -- [edhowland](https://github.com/edhowland) created - - [Adds Modules/recursion : Examples of Fun with Recursive functions in Nu](https://github.com/nushell/nu_scripts/pull/717) -- [frogshead](https://github.com/frogshead) created - - [fix broken links in modules readme](https://github.com/nushell/nu_scripts/pull/718) - - [fix broken link on README.md](https://github.com/nushell/nu_scripts/pull/716) -- [robbienohra](https://github.com/robbienohra) created - - [fix: missing regex flag](https://github.com/nushell/nu_scripts/pull/712) -- [adrian5](https://github.com/adrian5) created - - [Add tokyo-moon theme variant](https://github.com/nushell/nu_scripts/pull/710) -- [kjelly](https://github.com/kjelly) created - - [fix git-v2 and kubernetes](https://github.com/nushell/nu_scripts/pull/703) -- [zyfmix](https://github.com/zyfmix) created - - [Fix: nushell at 0.88.0 start and end are deprecated](https://github.com/nushell/nu_scripts/pull/698) -- [RGBCube](https://github.com/RGBCube) created - - [Rewrite and expand background task module](https://github.com/nushell/nu_scripts/pull/691) -- [TeaDrinkingProgrammer](https://github.com/TeaDrinkingProgrammer) created - - [Added updated and improved version of the conda scripts](https://github.com/nushell/nu_scripts/pull/694) - -## Reedline -- [WindSoilder](https://github.com/WindSoilder) created - - [Try fix prompt_start_row reset to 0 when opening a file without newline in Nushell ](https://github.com/nushell/reedline/pull/697) - - [fix clippy, add typo dict](https://github.com/nushell/reedline/pull/698) -- [sholderbach](https://github.com/sholderbach) created - - [Fix clippy from the future](https://github.com/nushell/reedline/pull/687) - - [Bump `itertools` to `0.12.0` from `0.10.x`](https://github.com/nushell/reedline/pull/686) - - [Bump version to 0.27.1](https://github.com/nushell/reedline/pull/683) - - [Try to fix the docs.rs build](https://github.com/nushell/reedline/pull/682) - - [Bump version for 0.27 release](https://github.com/nushell/reedline/pull/681) -- [nibon7](https://github.com/nibon7) created - - [Fix `prompt_start_row` reset to 0 when opening a file without newline in Nushell](https://github.com/nushell/reedline/pull/688) -- [danielsomerfield](https://github.com/danielsomerfield) created - - [Better behaviour on resize](https://github.com/nushell/reedline/pull/675) diff --git a/blog/README.md b/blog/README.md deleted file mode 100644 index 15f9f1b337d..00000000000 --- a/blog/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Nu Blog - -[RSS](/rss.xml) / [Atom](/atom.xml) - -<BlogPosts /> diff --git a/book/cheat_sheet.md b/book/cheat_sheet.md deleted file mode 100644 index def5666f897..00000000000 --- a/book/cheat_sheet.md +++ /dev/null @@ -1,549 +0,0 @@ -# Nushell cheat sheet - -## Data types - -```nu - > "12" | into int -``` - -> **converts string to integer** - ---- - -```nu - > date now | date to-timezone "Europe/London" -``` - -> **converts present date to provided time zone** - ---- - -```nu - > {'name': 'nu', 'stars': 5, 'language': 'Python'} | upsert language 'Rust' -``` - -> **updates a record's language and if none is specified inserts provided value** - ---- - -```nu - > [one two three] | to yaml -``` - -> **converts list of strings to yaml** - ---- - -```nu - > [[framework, language]; [Django, Python] [Lavarel, PHP]] -``` - -> **prints the table** - ---- - -```nu - > [{name: 'Robert' age: 34 position: 'Designer'} - {name: 'Margaret' age: 30 position: 'Software Developer'} - {name: 'Natalie' age: 50 position: 'Accountant'} - ] | select name position -``` - -> **selects two columns from the table and prints their values** - -## Strings - -```nu - > let name = "Alice" - > $"greetings, ($name)!" -``` - -> **prints `greetings, Alice!`** - ---- - -```nu - > let string_list = "one,two,three" | split row "," - $string_list - - ╭───┬───────╮ - │ 0 │ one │ - │ 1 │ two │ - │ 2 │ three │ - ╰───┴───────╯ -``` - -> **splits the string with specified delimiter and saves the list to `string_list` variable** - ---- - -```nu - "Hello, world!" | str contains "o, w" -``` - -> **checks if a string contains a substring and returns `boolean`** - ---- - -```nu - let str_list = [zero one two] - $str_list | str join ',' -``` - -> **joins the list of strings using provided delimiter** - ---- - -```nu - > 'Hello World!' | str substring 4..8 -``` - -> **created a slice from a given string with start (4) and end (8) indices** - ---- - -```nu - > 'Nushell 0.80' | parse '{shell} {version}' - - ╭───┬─────────┬─────────╮ - │ # │ shell │ version │ - ├───┼─────────┼─────────┤ - │ 0 │ Nushell │ 0.80 │ - ╰───┴─────────┴─────────╯ -``` - -> **parses the string to columns** - -```nu - > "acronym,long\nAPL,A Programming Language" | from csv -``` - -> **parses comma separated values (csv)** - -```nu - > $'(ansi purple_bold)This text is a bold purple!(ansi reset)' -``` - -> **ansi command colors the text (alsways end with `ansi reset` to reset color to default)** - -## Lists - -```nu - > [foo bar baz] | insert 1 'beeze' - - ╭───┬───────╮ - │ 0 │ foo │ - │ 1 │ beeze │ - │ 2 │ bar │ - │ 3 │ baz │ - ╰───┴───────╯ -``` - -> **inserts `beeze` value at st index in the list** - ---- - -```nu - > [1, 2, 3, 4] | update 1 10 -``` - -> **updates 2nd value to 10** - ---- - -```nu - > let numbers = [1, 2, 3, 4, 5] - > $numbers | prepend 0 -``` - -> **adds value at the beginning of the list** - ---- - -```nu - > let numbers = [1, 2, 3, 4, 5] - > $numbers | append 6 -``` - -> **adds value at the end of the list** - ---- - -```nu - > let flowers = [cammomile marigold rose forget-me-not] - > let flowers = ($flowers | first 2) - > $flowers -``` - -> **creates slice of first two values from `flowers` list** - ---- - -```nu - > let planets = [Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune] - > $planets | each { |it| $"($it) is a planet of solar system" } -``` - -> **iterates over a list; `it` is current list value** - ---- - -```nu - > $planets | enumerate | each { |it| $"($it.index + 1) - ($it.item)" } -``` - -> **iterates over a list and provides index and value in `it`** - ---- - -```nu - > let scores = [3 8 4] - > $"total = ($scores | reduce { |it, acc| $acc + $it })" -``` - -> **reduces the list to a single value, `reduce` gives access to accumulator that is applied -> to each element in the list** - ---- - -```nu - > $"total = ($scores | reduce --fold 1 { |it, acc| $acc * $it })" -``` - -> **initial value for accumulator value can be set with `--fold`** - ---- - -```nu - > let planets = [Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune] - > $planets.2 - > Earth -``` - -> **gives access to the 3rd item in the list** - ---- - -```nu - > let planets = [Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune] - > $planets | any {|it| $it | str starts-with "E" } - > true -``` - -> **checks if any string in the list starts with `E`** - ---- - -```nu - > let cond = {|x| $x < 0 }; [-1 -2 9 1] | take while $cond - ╭───┬────╮ - │ 0 │ -1 │ - │ 1 │ -2 │ - ╰───┴────╯ -``` - -> **creates slice of items that satisfy provided condition** - -## Tables - -```nu - > ls | sort-by size -``` - -> **sorting table by size of files** - ---- - -```nu - > ls | sort-by size | first 5 -``` - -> **sorting table by size of files and show first 5 entries** - ---- - -```nu - > let $a = [[first_column second_column third_column]; [foo bar snooze]] - > let $b = [[first_column second_column third_column]; [hex seeze feeze]] - > $a | append $b - - ╭───┬──────────────┬───────────────┬──────────────╮ - │ # │ first_column │ second_column │ third_column │ - ├───┼──────────────┼───────────────┼──────────────┤ - │ 0 │ foo │ bar │ snooze │ - │ 1 │ hex │ seeze │ feeze │ - ╰───┴──────────────┴───────────────┴──────────────╯ -``` - -> **concatenate two tables with same columns** - ---- - -```nu - > let teams_scores = [[team score plays]; ['Boston Celtics' 311 3] ['Golden State Warriors', 245 2]] - > $teams_scores | drop column - - ╭───┬───────────────────────┬───────╮ - │ # │ team │ score │ - ├───┼───────────────────────┼───────┤ - │ 0 │ Boston Celtics │ 311 │ - │ 1 │ Golden State Warriors │ 245 │ - ╰───┴───────────────────────┴───────╯ -``` - -> **remove the last column of a table** - -## Files & Filesystem - -```nu - > start file.txt -``` - -> **opens a text file with the default text editor** - ---- - -```nu - > 'lorem ipsum ' | save file.txt -``` - -> **saves a string to text file** - ---- - -```nu - > 'dolor sit amet' | save --append file.txt -``` - -> **appends a string to the end of file.txt** - ---- - -```nu - > { a: 1, b: 2 } | save file.json -``` - -> **saves a record to file.json** - ---- - -```nu - > glob **/*.{rs,toml} --depth 2 -``` - -> **searches for `.rs` and `.toml` files recursively up to 2 folders deep** - ---- - -```nu - > watch . --glob=**/*.rs {|| cargo test } -``` - -> **runs cargo test whenever a Rust file changes** - ---- - -## Custom Commands - -```nu - def greet [name: string] { - $"hello ($name)" - } -``` - -> **custom command with parameter type set to string** - ---- - -```nu - def greet [name = "nushell"] { - $"hello ($name)" - } -``` - -> **custom command with default parameter set to nushell** - ---- - -```nu - def greet [ - name: string - --age: int - ] { - [$name $age] - } - - > greet world --age 10 -``` - -> **passing named parameter by defining flag for custom commands** - ---- - -```nu - def greet [ - name: string - --age (-a): int - --twice - ] { - if $twice { - [$name $age $name $age] - } else { - [$name $age] - } - } - > greet -a 10 --twice hello -``` - -> **using flag as a switch with a shorthand flag (-a) for the age** - ---- - -```nu - def greet [...name: string] { - print "hello all:" - for $n in $name { - print $n - } - } - - > greet earth mars jupiter venus -``` - -> **custom command which takes any number of positional arguments using rest params** - -## Variables & Subexpressions - -```nu - > let val = 42 - > print $val - 42 -``` - -> **an immutable variable cannot change its value after declaration** - ---- - -```nu - > let val = 42 - > do { let val = 101; $val } - 101 - > $val - 42 -``` - -> **shadowing variable (declaring variable with the same name in a different scope)** - ---- - -```nu - > mut val = 42 - > $val += 27 - > $val - 69 -``` - -> **declaring a mutable variable with mut key word** - ---- - -```nu - > mut x = 0 - > [1 2 3] | each { $x += 1 } -``` - -> **closures and nested defs cannot capture mutable variables from their environment. -> This expression results in error.** - -```nu - > const plugin = 'path/to/plugin' - > register $plugin -``` - -> **a constant variable is immutable value which is fully evaluated at parse-time** - ---- - -```nu - > let files = (ls) - > $files.name?.0? -``` - -> **using question mark operator to return null instead of error if provided path is incorrect** - ---- - -```nu - > let big_files = (ls | where size > 10kb) - > $big_files -``` - -> **using subexpression by wrapping the expression with parentheses ()** - ---- - -## Modules - -```nu - > module greetings { - export def hello [name: string] { - $"hello ($name)!" - } - - export def hi [where: string] { - $"hi ($where)!" - } - } - - > use greetings hello - > hello "world" -``` - -> **using inline module** - ---- - -```nu - # greetings.nu - export-env { - $env.MYNAME = "Arthur, King of the Britons" - } - export def hello [] { - $"hello ($env.MYNAME)" - } - - > use greetings.nu - > $env.MYNAME - Arthur, King of the Britons - > greetings hello - hello Arthur, King of the Britons! -``` - -> **importing module from file and using its environment in current scope** - ---- - -```nu - # greetings.nu - export def hello [name: string] { - $"hello ($name)!" - } - - export def hi [where: string] { - $"hi ($where)!" - } - - export def main [] { - "greetings and salutations!" - } - - > use greetings.nu - > greetings - greetings and salutations! - > greetings hello world - hello world! -``` - -> **using main command in module** - ---- diff --git a/book/coming_to_nu.md b/book/coming_to_nu.md deleted file mode 100644 index 047b967cb31..00000000000 --- a/book/coming_to_nu.md +++ /dev/null @@ -1,9 +0,0 @@ -# Coming to Nu - -If you are familiar with other shells or programming languages, you might find this chapter useful to get up to speed. - -[Coming from Bash](coming_from_bash.md) shows how some patterns typical for Bash, or POSIX shells in general, can be mapped to Nushell. -Similarly, [Coming from CMD.EXE](coming_from_cmd.md) shows how built-in commands in the Windows Command Prompt can be mapped to Nushell. - -Similar comparisons are made for some [other shells and domain-specific languages](nushell_map.md), [imperative languages](nushell_map_imperative.md), and [functional languages](nushell_map_functional.md). -A separate comparison is made specifically for [operators](nushell_operator_map.md). diff --git a/book/control_flow.md b/book/control_flow.md deleted file mode 100644 index 23c62c77b9c..00000000000 --- a/book/control_flow.md +++ /dev/null @@ -1,361 +0,0 @@ -# Control Flow - -Nushell provides several commands that help determine how different groups of code are executed. In programming languages this functionality is often referred to as _control flow_. - -::: tip -One thing to note is that all of the commands discussed on this page use [blocks](/book/types_of_data.html#blocks). This means you can mutate [environmental variables](/book/environment.html) and other [mutable variables](http://localhost:8080/book/variables_and_subexpressions.html#mutable-variables) in them. -::: - -## Already covered - -Below we cover some commands related to control flow, but before we get to them, it's worthwhile to note there are several pieces of functionality and concepts that have already been covered in other sections that are also related to control flow or that can be used in the same situations. These include: - -- Pipes on the [pipelines](/book/pipelines.html) page. -- Closures on the [types of data](/book/types_of_data.html) page. -- Iteration commands on the [working with lists](/book/working_with_lists.html) page. Such as: - - [`each`](/commands/docs/each.html) - - [`where`](/commands/docs/where.html) - - [`reduce`](/commands/docs/reduce.html) - -## Choice (Conditionals) - -The following commands execute code based on some given condition. - -::: tip -The choice/conditional commands are expressions so they return values, unlike the other commands on this page. This means the following works. - -```nu -> 'foo' | if $in == 'foo' { 1 } else { 0 } | $in + 2 -3 -``` - -::: - -### `if` - -[`if`](/commands/docs/if.html) evaluates branching [blocks](/book/types_of_data.html#blocks) of code based on the results of one or more conditions similar to the "if" functionality in other programming languages. For example: - -```nu -> if $x > 0 { 'positive' } -``` - -Returns `'positive`' when the condition is `true` (`$x` is greater than zero) and `null` when the condition is `false` (`$x` is less than or equal to zero). - -We can add an `else` branch to the `if` after the first block which executes and returns the resulting value from the `else` block when the condition is `false`. For example: - -```nu -> if $x > 0 { 'positive' } else { 'non-positive' } -``` - -This time it returns `'positive'` when the condition is `true` (`$x` is greater than zero) and `'non-positive`' when the condition is `false` (`$x` is less than or equal to zero). - -We can also chain multiple `if`s together like the following: - -```nu -> if $x > 0 { 'positive' } else if $x == 0 { 'zero' } else { "negative" } -``` - -When the first condition is `true` (`$x` is greater than zero) it will return `'positive'`, when the first condition is `false` and the next condition is `true` (`$x` equals zero) it will return `'zero'`, otherwise it will return `'negative'` (when `$x` is less than zero). - -### `match` - -[`match`](/commands/docs/match.html) executes one of several conditional branches based on the value given to match. You can also do some [pattern matching](/cookbook/pattern_matching.html) to unpack values in composite types like lists and records. - -Basic usage of [`match`](/commands/docs/match.html) can conditionally run different code like a "switch" statement common in other languages. [`match`](/commands/docs/match.html) checks if the value after the word [`match`](/commands/docs/match.html) is equal to the value at the start of each branch before the `=>` and if it does, it executes the code after that branch's `=>`. - -```nu -> match 3 { - 1 => 'one', - 2 => { - let w = 'w' - 't' + $w + 'o' - }, - 3 => 'three', - 4 => 'four' -} -three -``` - -The branches can either return a single value or, as shown in the second branch, can return the results of a [block](/book/types_of_data.html#blocks). - -#### Catch all branch - -You can have also have a catch all condition for if the given value doesn't match any of the other conditions by having a branch whose matching value is `_`. - -```nu -> let foo = match 7 { - 1 => 'one', - 2 => 'two', - 3 => 'three', - _ => 'other number' -} -> $foo -other number -``` - -(Reminder, [`match`](/commands/docs/match.html) is an expression which is why we can assign the result to `$foo` here). - -#### Pattern Matching - -You can "unpack" values from types like lists and records with [pattern matching](/cookbook/pattern_matching.html). You can then assign variables to the parts you want to unpack and use them in the matched expressions. - -```nu -> let foo = { name: 'bar', count: 7 } -> match $foo { - { name: 'bar', count: $it } => ($it + 3), - { name: _, count: $it } => ($it + 7), - _ => 1 -} -10 -``` - -The `_` in the second branch means it matches any record with field `name` and `count`, not just ones where `name` is `'bar'`. - -#### Guards - -You can also add an additional condition to each branch called a "guard" to determine if the branch should be matched. To do so, after the matched pattern put `if` and then the condition before the `=>`. - -```nu -> let foo = { name: 'bar', count: 7 } -> match $foo { - { name: 'bar', count: $it } if $it < 5 => ($it + 3), - { name: 'bar', count: $it } if $it >= 5 => ($it + 7), - _ => 1 -} -14 -``` - ---- - -You can find more details about [`match`](/commands/docs/match.html) in the [pattern matching cookbook page](https://www.nushell.sh/cookbook/pattern_matching.html). - -## Loops - -The loop commands allow you to repeat a block of code multiple times. - -### Loops and other iterating commands - -The functionality of the loop commands is similar to commands that apply a closure over elements in a list or table like [`each`](/commands/docs/each.html) or [`where`](/commands/docs/where.html) and many times you can accomplish the same thing with either. For example: - -```nu -> mut result = [] -> for $it in [1 2 3] { $result = ($result | append ($it + 1)) } -> $result -╭───┬───╮ -│ 0 │ 2 │ -│ 1 │ 3 │ -│ 2 │ 4 │ -╰───┴───╯ - - -> [1 2 3] | each { $in + 1 } -╭───┬───╮ -│ 0 │ 2 │ -│ 1 │ 3 │ -│ 2 │ 4 │ -╰───┴───╯ -``` - -While it may be tempting to use loops if you're familiar with them in other languages, it is considered more in the [Nushell-style](book/thinking_in_nu.html) (idiomatic) to use commands that apply closures when you can solve a problem either way. The reason for this is because of a pretty big downside with using loops. - -#### Loop disadvantages - -The biggest downside of loops is that they are statements, unlike [`each`](/commands/docs/each.html) which is an expression. Expressions, like [`each`](/commands/docs/each.html) always result in some output value, however statements do not. - -This means that they don't work well with immutable variables and using immutable variables is considered a more [Nushell-style](/book/thinking_in_nu.html#variables-are-immutable). Without a mutable variable declared beforehand in the example in the previous section, it would be impossible to use [`for`](/commands/docs/each.html) to get the list of numbers with incremented numbers, or any value at all. - -Statements also don't work in Nushell pipelines which require some output. In fact Nushell will give an error if you try: - -```nu -> [1 2 3] | for x in $in { $x + 1 } | $in ++ [5 6 7] -Error: nu::parser::unexpected_keyword - - × Statement used in pipeline. - ╭─[entry #5:1:1] - 1 │ [1 2 3] | for x in $in { $x + 1 } | $in ++ [5 6 7] - · ─┬─ - · ╰── not allowed in pipeline - ╰──── - help: 'for' keyword is not allowed in pipeline. Use 'for' by itself, outside of a pipeline. -``` - -Because Nushell is very pipeline oriented, this means using expression commands like [`each`](/commands/docs/each.html) is typically more natural than loop statements. - -#### Loop advantages - -If loops have such a big disadvantage, why do they exist? Well, one reason is that closures, like [`each`](/commands/docs/each.html) uses, can't modify mutable variables in the surrounding environment. If you try to modify a mutable variable in a closure you will get an error: - -```nu -> mut foo = [] -> [1 2 3] | each { $foo = ($foo | append ($in + 1)) } -Error: nu::parser::expected_keyword - - × Capture of mutable variable. - ╭─[entry #8:1:1] - 1 │ [1 2 3] | each { $foo = ($foo | append ($in + 1)) } - · ──┬─ - · ╰── capture of mutable variable - ╰──── -``` - -If you modify an environmental variable in a closure, you can, but it will only modify it within the scope of the closure, leaving it unchanged everywhere else. Loops, however, use [blocks](/book/types_of_data.html#blocks) which means they can modify a regular mutable variable or an environmental variable within the larger scope. - -```nu -> mut result = [] -> for $it in [1 2 3] { $result = ($result | append ($it + 1)) } -> $result -╭───┬───╮ -│ 0 │ 2 │ -│ 1 │ 3 │ -│ 2 │ 4 │ -╰───┴───╯ -``` - -### `for` - -[`for`](/commands/docs/for.html) loops over a range or collection like a list or a table. - -```nu -> for x in [1 2 3] { $x * $x | print } -1 -4 -9 -``` - -#### Expression command alternatives - -- [`each`](/commands/docs/each.html) -- [`par-each`](/commands/docs/par-each.html) -- [`where`](/commands/docs/where.html)/[`filter`](/commands/docs/filter.html) -- [`reduce`](/commands/docs/reduce.html) - -### `while` - -[`while`](/commands/docs/while.html) loops the same block of code until the given condition is `false`. - -```nu -> mut x = 0; while $x < 10 { $x = $x + 1 }; $x -10 -``` - -#### Expression command alternatives - -The "until" and other "while" commands - -- [`take until`](/commands/docs/take_until.html) -- [`take while`](/commands/docs/take_while.html) -- [`skip until`](/commands/docs/skip_until.html) -- [`skip while`](/commands/docs/skip_while.html) - -### `loop` - -[`loop`](/commands/docs/loop.html) loops a block infinitely. You can use [`break`](/commands/docs/break.html) (as described in the next section) to limit how many times it loops. It can also be handy for continuously running scripts, like an interactive prompt. - -```nu -> mut x = 0; loop { if $x > 10 { break }; $x = $x + 1 }; $x -11 -``` - -### `break` - -[`break`](/commands/docs/break.html) will stop executing the code in a loop and resume execution after the loop. Effectively "break"ing out of the loop. - -```nu -> for x in 1..10 { if $x > 3 { break }; print $x } -1 -2 -3 -``` - -### `continue` - -[`continue`](/commands/docs/continue.html) will stop execution of the current loop, skipping the rest of the code in the loop, and will go to the next loop. If the loop would normally end, like if [`for`](/commands/docs/for.html) has iterated through all the given elements, or if [`while`](/commands/docs/while.html)'s condition is now false, it won't loop again and execution will continue after the loop block. - -```nu -> mut x = -1; while $x <= 6 { $x = $x + 1; if $x mod 3 == 0 { continue }; print $x } -1 -2 -4 -5 -7 -``` - -## Errors - -### `error make` - -[`error make`](/commands/docs/error_make.html) creates an error that stops execution of the code and any code that called it, until either it is handled by a [`try`](/commands/docs/try.html) block, or it ends the script and outputs the error message. This functionality is the same as "exceptions" in other languages. - -```nu -> print 'printed'; error make { msg: 'Some error info' }; print 'unprinted' -printed -Error: × Some error info - ╭─[entry #9:1:1] - 1 │ print 'printed'; error make { msg: 'Some error info' }; print 'unprinted' - · ─────┬──── - · ╰── originates from here - ╰──── -``` - -The record passed to it provides some information to the code that catches it or the resulting error message. - -You can find more information about [`error make`](/commands/docs/error_make.html) and error concepts on the [Creating your own errors page](/book/creating_errors.html). - -### `try` - -[`try`](/commands/docs/try.html) will catch errors created anywhere in the [`try`](/commands/docs/try.html)'s code block and resume execution of the code after the block. - -```nu -> try { error make { msg: 'Some error info' }}; print 'Resuming' -Resuming -``` - -This includes catching built in errors. - -```nu -> try { 1 / 0 }; print 'Resuming' -Resuming -``` - -The resulting value will be `nothing` if an error occurs and the returned value of the block if an error did not occur. - -If you include a `catch` block after the [`try`](/commands/docs/try.html) block, it will execute the code in the `catch` block if an error occurred in the [`try`](/commands/docs/try.html) block. - -```nu -> try { 1 / 0 } catch { 'An error happened!' } | $in ++ ' And now I am resuming.' -An error happened! And now I am resuming. -``` - -It will not execute the `catch` block if an error did not occur. - -## Other - -### `return` - -[`return`](/commands/docs/return.html) Ends a closure or command early where it is called, without running the rest of the command/closure, and returns the given value. Not often necessary since the last value in a closure or command is also returned, but it can sometimes be convenient. - -```nu -def 'positive-check' [it] { - if $it > 0 { - return 'positive' - }; - - 'non-positive' -} -``` - -```nu -> positive-check 3 -positive - -> positive-check (-3) -non-positive - -> let positive_check = {|it| if $it > 0 { return 'positive' }; 'non-positive' } - -> do $positive_check 3 -positive - -> do $positive_check (-3) -non-positive -``` diff --git a/book/escaping.md b/book/escaping.md deleted file mode 100644 index 0b819c70ae1..00000000000 --- a/book/escaping.md +++ /dev/null @@ -1,19 +0,0 @@ -# Escaping to the system - -Nu provides a set of commands that you can use across different OSes ("internal" commands), and having this consistency is helpful. Sometimes, though, you want to run an external command that has the same name as an internal Nu command. To run the external [`ls`](/commands/docs/ls.md) or [`date`](/commands/docs/date.md) command, for example, you use the caret (^) command. Escaping with the caret prefix calls the command that's in the user's PATH (e.g. `/bin/ls` instead of Nu's internal [`ls`](/commands/docs/ls.md) command). - -Nu internal command: - -```nu -> ls -``` - -Escape to external command: - -```nu -> ^ls -``` - -## Windows note - -When running an external command on Windows, nushell [used to](https://www.nushell.sh/blog/2022-08-16-nushell-0_67.html#windows-cmd-exe-changes-rgwood) use [Cmd.exe](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd) to run the command, as a number of common commands on Windows are actually shell builtins and not available as separate executables. [Coming from CMD.EXE](coming_from_cmd.md) contains a list of these commands and how to map them to nushell native concepts. diff --git a/book/getting_started.md b/book/getting_started.md deleted file mode 100644 index 956254238cc..00000000000 --- a/book/getting_started.md +++ /dev/null @@ -1,9 +0,0 @@ -# Getting Started - -Let's get started! :elephant: - -First, to be able to use Nushell, we need to [install it](installation.md). - -The next sections will give you a [short tour of Nushell by example](quick_tour.md) (including how to get help from within Nushell), and show you how to [move around your file system](moving_around.md). - -Finally, because Nushell takes some design decisions that are quite different from typical shells or dynamic scripting languages, make sure to check [Thinking in Nu](thinking_in_nu.md) that explains some of these concepts. diff --git a/book/introduction.md b/book/introduction.md deleted file mode 100644 index 6ebb4de923c..00000000000 --- a/book/introduction.md +++ /dev/null @@ -1,73 +0,0 @@ -# Quick Tour - -Nu takes cues from a lot of familiar territory: traditional shells like bash, object based shells like PowerShell, gradually typed languages like TypeScript, functional programming, systems programming, and more. But rather than trying to be a jack of all trades, Nu focuses its energy on doing a few things well: - -- Being a flexible cross-platform shell with a modern feel -- Solving problems as a modern programming language that works with the structure of your data -- Giving clear error messages and clean IDE support - -The easiest way to see what Nu can do is to start with some examples, so let's dive in. - -The first thing you'll notice when you run a command like [`ls`](/commands/docs/ls.md) is that instead of a block of text coming back, you get a structured table. - -@[code](@snippets/introduction/ls_example.sh) - -The table is more than just showing the directory in a different way. Just like tables in a spreadsheet, this table allows us to work with the data more interactively. - -The first thing we'll do is to sort our table by size. To do this, we'll take the output from [`ls`](/commands/docs/ls.md) and feed it into a command that can sort tables based on the contents of a column. - -@[code](@snippets/introduction/ls_sort_by_reverse_example.sh) - -You can see that to make this work we didn't pass commandline arguments to [`ls`](/commands/docs/ls.md). Instead, we used the [`sort-by`](/commands/docs/sort-by.md) command that Nu provides to do the sorting of the output of the [`ls`](/commands/docs/ls.md) command. To see the biggest files on top, we also used [`reverse`](/commands/docs/reverse.md). - -Nu provides many commands that can work on tables. For example, we could filter the contents of the [`ls`](/commands/docs/ls.md) table so that it only shows files over 1 kilobyte: - -@[code](@snippets/introduction/ls_where_example.sh) - -Just as in the Unix philosophy, being able to have commands talk to each other gives us ways to mix-and-match in many different combinations. Let's look at a different command: - -@[code](@snippets/introduction/ps_example.sh) - -You may be familiar with the [`ps`](/commands/docs/ps.md) command if you've used Linux. With it, we can get a list of all the current processes that the system is running, what their status is, and what their name is. We can also see the CPU load for the processes. - -What if we wanted to show the processes that were actively using the CPU? Just like we did with the [`ls`](/commands/docs/ls.md) command earlier, we can also work with the table that the [`ps`](/commands/docs/ps.md) command gives back to us: - -@[code](@snippets/introduction/ps_where_example.sh) - -So far, we've been using [`ls`](/commands/docs/ls.md) and [`ps`](/commands/docs/ps.md) to list files and processes. Nu also offers other commands that can create tables of useful information. Next, let's explore [`date`](/commands/docs/date.md) and [`sys`](/commands/docs/sys.md). - -Running [`date now`](/commands/docs/date_now.md) gives us information about the current day and time: - -@[code](@snippets/introduction/date_example.sh) - -To get the date as a table we can feed it into [`date to-table`](/commands/docs/date_to-table.md) - -@[code](@snippets/introduction/date_table_example.sh) - -Running [`sys`](/commands/docs/sys.md) gives information about the system that Nu is running on: - -@[code](@snippets/introduction/sys_example.sh) - -This is a bit different than the tables we saw before. The [`sys`](/commands/docs/sys.md) command gives us a table that contains structured tables in the cells instead of simple values. To take a look at this data, we need to _get_ the column to view: - -@[code](@snippets/introduction/sys_get_example.sh) - -The [`get`](/commands/docs/get.md) command lets us jump into the contents of a column of the table. Here, we're looking into the "host" column, which contains information about the host that Nu is running on. The name of the OS, the hostname, the CPU, and more. Let's get the name of the users on the system: - -@[code](@snippets/introduction/sys_get_nested_example.sh) - -Right now, there's just one user on the system named "jt". You'll notice that we can pass a column path (the `host.sessions.name` part) and not just the name of the column. Nu will take the column path and go to the corresponding bit of data in the table. - -You might have noticed something else that's different. Rather than having a table of data, we have just a single element: the string "jt". Nu works with both tables of data as well as strings. Strings are an important part of working with commands outside of Nu. - -Let's see how strings work outside of Nu in action. We'll take our example from before and run the external [`echo`](/commands/docs/echo.md) command (the `^` tells Nu to not use the built-in [`echo`](/commands/docs/echo.md) command): - -@[code](@snippets/introduction/sys_get_external_echo_example.sh) - -If this looks very similar to what we had before, you have a keen eye! It is similar, but with one important difference: we've called `^echo` with the value we saw earlier. This allows us to pass data out of Nu into [`echo`](/commands/docs/echo.md) (or any command outside of Nu, like `git` for example). - -### Getting Help - -Help text for any of Nu's built-in commands can be discovered with the [`help`](/commands/docs/help.md) command. To see all commands, run [`help commands`](/commands/docs/help_commands.md). You can also search for a topic by doing `help -f <topic>`. - -@[code](@snippets/introduction/help_example.sh) diff --git a/book/moving_around.md b/book/moving_around.md deleted file mode 100644 index f7a4758fb9c..00000000000 --- a/book/moving_around.md +++ /dev/null @@ -1,66 +0,0 @@ -# Moving around your system - -Early shells allow you to move around your filesystem and run commands, and modern shells like Nu allow you to do the same. Let's take a look at some of the common commands you might use when interacting with your system. - -## Viewing directory contents - -@[code](@snippets/moving_around/ls_example.sh) - -As we've seen in other chapters, [`ls`](/commands/docs/ls.md) is a command for viewing the contents of a path. Nu will return the contents as a table that we can use. - -The [`ls`](/commands/docs/ls.md) command also takes an optional argument, to change what you'd like to view. For example, we can list the files that end in ".md" - -@[code](@snippets/moving_around/ls_shallow_glob_example.sh) - -## Glob patterns (wildcards) - -The asterisk (\*) in the above optional argument "\*.md" is sometimes called a wildcard or a glob. It lets us match anything. You could read the glob "\*.md" as "match any filename, so long as it ends with '.md' " - -The most general glob is `*`, which will match all paths. More often, you'll see this pattern used as part of another pattern, for example `*.bak` and `temp*`. - -In Nushell, we also support double `*` to talk about traversing deeper paths that are nested inside of other directories. For example, `ls **/*` will list all the non-hidden paths nested under the current directory. - -@[code](@snippets/moving_around/ls_deep_glob_example.sh) - -Here, we're looking for any file that ends with ".md", and the two asterisks further say "in any directory starting from here". - -In other shells (like bash), glob expansion happens in the shell and the invoked program (`ls` in the example above) receives a list of matched files. In Nushell however, the string you enter is passed "as is" to the command, and some commands (like `ls`, `mv`, `cp` and `rm`) interpret their input string as a glob pattern. For example the [`ls` command's help page](https://www.nushell.sh/commands/docs/ls.html) shows that it takes the parameter: `pattern: the glob pattern to use (optional)`. - -Globbing syntax in these commands not only supports `*`, but also matching [single characters with `?` and character groups with `[...]`](https://docs.rs/nu-glob/latest/nu_glob/struct.Pattern.html). Note that this is a more limited syntax than what the dedicated [`glob` Nushell command](https://www.nushell.sh/commands/docs/glob.html) supports. - -Escaping `*`, `?`, `[]` works by quoting them with single quotes or double quotes. To show the contents of a directory named `[slug]`, use `ls "[slug]"` or `ls '[slug]'`. -Note that backtick quote doesn't escape glob, for example: <code>cp `test dir/*`</code> will copy all files inside `test dir` to current direcroty. - -## Changing the current directory - -@[code](@snippets/moving_around/cd_example.sh) - -To change from the current directory to a new one, we use the [`cd`](/commands/docs/cd.md) command. Just as in other shells, we can use either the name of the directory, or if we want to go up a directory we can use the `..` shortcut. - -Changing the current working directory can also be done if [`cd`](/commands/docs/cd.md) is omitted and a path by itself is given: - -@[code](@snippets/moving_around/cd_without_command_example.sh) - -**Note:** changing the directory with [`cd`](/commands/docs/cd.md) changes the `PWD` environment variable. This means that a change of a directory is kept to the current block. Once you exit the block, you'll return to the previous directory. You can learn more about working with this in the [environment chapter](./environment.md). - -## Filesystem commands - -Nu also provides some basic filesystem commands that work cross-platform. - -We can move an item from one place to another using the [`mv`](/commands/docs/mv.md) command: - -@[code](@snippets/moving_around/mv_example.sh) - -We can copy an item from one location to another with the [`cp`](/commands/docs/cp.md) command: - -@[code](@snippets/moving_around/cp_example.sh) - -We can remove an item with the [`rm`](/commands/docs/rm.md) command: - -@[code](@snippets/moving_around/rm_example.sh) - -The three commands also can use the glob capabilities we saw earlier with [`ls`](/commands/docs/ls.md). - -Finally, we can create a new directory using the [`mkdir`](/commands/docs/mkdir.md) command: - -@[code](@snippets/moving_around/mkdir_example.sh) diff --git a/book/nushell_map.md b/book/nushell_map.md deleted file mode 100644 index c011e9ab91a..00000000000 --- a/book/nushell_map.md +++ /dev/null @@ -1,75 +0,0 @@ -# Nu map from other shells and domain specific languages - -The idea behind this table is to help you understand how Nu builtins and plugins relate to other known shells and domain specific languages. We've tried to produce a map of relevant Nu commands and what their equivalents are in other languages. Contributions are welcome. - -Note: this table assumes Nu 0.43 or later. - - -| Nushell | SQL | .Net LINQ (C#) | PowerShell (without external modules) | Bash | -| ---------------------- | ----------------------------- | ---------------------------------------------------- | ------------------------------------------ | ----------------------------------------------- | -| alias | | | alias | alias | -| append | | Append | -Append | | -| math avg | avg | Average | Measure-Object, measure | | -| calc, `<math expression>` | math operators | Aggregate, Average, Count, Max, Min, Sum | | bc | -| cd | | | Set-Location, cd | cd | -| clear | | | Clear-Host | clear | -| config | | | $Profile | vi .bashrc, .profile | -| cp | | | Copy-Item, cp, copy | cp | -| date | NOW() / getdate() | DateTime class | Get-Date | date | -| du | | | | du | -| each | cursor | | ForEach-Object, foreach, for | | -| exit | | | exit | exit | -| http | | HttpClient,WebClient, HttpWebRequest/Response | Invoke-WebRequest | wget | -| first | top, limit | First, FirstOrDefault | Select-Object -First | head | -| format | | String.Format | String.Format | | -| from | import flatfile, openjson, cast(variable as xml) | | Import/ConvertFrom-{Csv,Xml,Html,Json} | | -| get | | Select | (cmd).column | | -| group-by | group by | GroupBy, group | Group-Object, group | | -| help | sp_help | | Get-Help, help, man | man | -| history | | | Get-History, history | history | -| is-empty | is null | String.InNullOrEmpty | String.InNullOrEmpty | | -| kill | | | Stop-Process, kill | kill | -| last | | Last, LastOrDefault | Select-Object -Last | tail | -| length | count | Count | Measure-Object, measure | wc | -| lines | | | File.ReadAllLines | | -| ls | | | Get-ChildItem, dir, ls | ls | -| mkdir | | | mkdir, md | mkdir | -| mv | | | Move-Item, mv, move, mi | mv | -| nth | limit x offset y, rownumber = | ElementAt | [x], indexing operator, ElementAt | | -| open | | | Get-Content, gc, cat, type | cat | -| print | print, union all | | Write-Output, write | echo | -| transpose | pivot | | | | -| ps | | | Get-Process, ps, gps | ps | -| pwd | | | Get-Location, pwd | pwd | -| range | | Range | 1..10, 'a'..'f' | | -| reduce | | Aggregate | | | -| rename | | | Rename-Item, ren, rni | mv | -| reverse | | Reverse | [Array]::Reverse($var) | | -| rm | | | Remove-Item, del, erase, rd, ri, rm, rmdir | rm | -| save | | | Write-Output, Out-File | > foo.txt | -| select | select | Select | Select-Object, select | | -| shuffle | | Random | Sort-Object {Get-Random} | | -| size | | | Measure-Object, measure | wc | -| skip | where row_number() | Skip | Select-Object -Skip | | -| skip until | | SkipWhile | | | -| skip while | | SkipWhile | | | -| sort-by | order by | OrderBy, OrderByDescending, ThenBy, ThenByDescending | Sort-Object, sort | | -| split-by | | Split | Split | | -| str | string functions | String class | String class | | -| str join | concat_ws | Join | Join-String | | -| str trim | rtrim, ltrim | Trim, TrimStart, TrimEnd | Trim | | -| sum | sum | Sum | Measure-Object, measure | | -| sys | | | Get-ComputerInfo | uname, lshw, lsblk, lscpu, lsusb, hdparam, free | -| table | | | Format-Table, ft, Format-List, fl | | -| take | top, limit | Take | Select-Object -First | head | -| take until | | TakeWhile | | | -| take while | | TakeWhile | | | -| timeit | | | Measure-Command | time | -| to | | | Export/ConvertTo-{Csv,Xml,Html,Json} | | -| touch | | | Set-Content | touch | -| uniq | distinct | Distinct | Get-Unique, gu | uniq | -| upsert | As | | | | -| version | select @@version | | $PSVersionTable | | -| with-env | | | $env:FOO = 'bar' | export foo = "bar" | -| where | where | Where | Where-Object, where, "?" operator | | -| which | | | | which | diff --git a/book/nushell_map_imperative.md b/book/nushell_map_imperative.md deleted file mode 100644 index 12d91c5f92d..00000000000 --- a/book/nushell_map_imperative.md +++ /dev/null @@ -1,76 +0,0 @@ -# Nu map from imperative languages - -The idea behind this table is to help you understand how Nu built-ins and plugins relate to imperative languages. We've tried to produce a map of programming-relevant Nu commands and what their equivalents are in other languages. Contributions are welcome. - -Note: this table assumes Nu 0.43 or later. - -| Nushell | Python | Kotlin (Java) | C++ | Rust | -| ------------ | ------------------------------------ | --------------------------------------------------- | ----------------------- | -------------------------------------------------- | -| append | list.append, set.add | add | push_back, emplace_back | push, push_back | -| math avg | statistics.mean | | | | -| calc, = math | math operators | math operators | math operators | math operators | -| count | len | size, length | length | len | -| cp | shutil.copy | | | fs::copy | -| date | datetime.date.today | java.time.LocalDate.now | | | -| drop | list[:-3] | | | | -| du | shutil.disk_usage | | | | -| each | for | for | for | for | -| exit | exit | System.exit, kotlin.system.exitProcess | exit | exit | -| http get | urllib.request.urlopen | | | | -| first | list[:x] | List[0], peek | vector[0], top | Vec[0] | -| format | format | format | format | format! | -| from | csv, json, sqlite3 | | | | -| get | dict[\"key\"] | Map[\"key\"] | map[\"key\"] | HashMap["key"], get, entry | -| group-by | itertools.groupby | groupBy | | group_by | -| headers | keys | | | | -| help | help | | | | -| insert | dict[\"key\"] = val | | map.insert({ 20, 130 }) | map.insert(\"key\", val) | -| is-empty | is None, is [] | isEmpty | empty | is_empty | -| take | list[:x] | | | &Vec[..x] | -| take until | itertools.takewhile | | | | -| take while | itertools.takewhile | | | | -| kill | os.kill | | | | -| last | list[-x:] | | | &Vec[Vec.len()-1] | -| lines | split, splitlines | split | views::split | split, split_whitespace, rsplit, lines | -| ls | os.listdir | | | fs::read_dir | -| match | match | when | | match | -| merge | dict.append | | | map.extend | -| mkdir | os.mkdir | | | fs::create_dir | -| mv | shutil.move | | | fs::rename | -| get | list[x] | List[x] | vector[x] | Vec[x] | -| open | open | | | | -| transpose | zip(\*matrix) | | | | -| http post | urllib.request.urlopen | | | | -| prepend | deque.appendleft | | | | -| print | print | println | printf | println! | -| ps | os.listdir('/proc') | | | | -| pwd | os.getcwd | | | env::current_dir | -| range | range | .., until, downTo, step | iota | .. | -| reduce | functools.reduce | reduce | reduce | fold, rfold, scan | -| reject | del | | | | -| rename | dict[\"key2\"] = dict.pop(\"key\") | | | map.insert(\"key2\", map.remove(\"key\").unwrap()); | -| reverse | reversed, list.reverse | reverse, reversed, asReversed | reverse | rev | -| rm | os.remove | | | | -| save | io.TextIOWrapper.write | | | | -| select | {k:dict[k] for k in keys} | | | | -| shuffle | random.shuffle | | | | -| size | len | | | len | -| skip | list[x:] | | | &Vec[x..],skip | -| skip until | itertools.dropwhile | | | | -| skip while | itertools.dropwhile | | | skip_while | -| sort-by | sorted, list.sort | sortedBy, sortedWith, Arrays.sort, Collections.sort | sort | sort | -| split row | str.split{,lines}, re.split | split | views::split | split | -| str | str functions | String functions | string functions | &str, String functions | -| str join | str.join | joinToString | | join | -| str trim | strip, rstrip, lstrip | trim, trimStart, trimEnd | regex | trim, trim*{start,end}, strip*{suffix,prefix} | -| sum | sum | sum | reduce | sum | -| sys | sys | | | | -| to | import csv, json, sqlite3 | | | | -| touch | open(path, 'a').close() | | | | -| uniq | set | Set | set | HashSet | -| upsert | dict[\"key\"] = val | | | | -| version | sys.version, sys.version_info | | | | -| with-env | os.environ | | | | -| where | filter | filter | filter | filter | -| which | shutil.which | | | | -| wrap | { "key" : val } | | | | diff --git a/book/quick_tour.md b/book/quick_tour.md deleted file mode 100644 index 231cb3e7b02..00000000000 --- a/book/quick_tour.md +++ /dev/null @@ -1,67 +0,0 @@ -# Quick Tour - -The easiest way to see what Nu can do is to start with some examples, so let's dive in. - -The first thing you'll notice when you run a command like [`ls`](/commands/docs/ls.md) is that instead of a block of text coming back, you get a structured table. - -@[code](@snippets/introduction/ls_example.sh) - -The table does more than show the directory in a different way. Just like tables in a spreadsheet, this table allows us to work with the data more interactively. - -The first thing we'll do is to sort our table by size. To do this, we'll take the output from [`ls`](/commands/docs/ls.md) and feed it into a command that can sort tables based on the contents of a column. - -@[code](@snippets/introduction/ls_sort_by_reverse_example.sh) - -You can see that to make this work we didn't pass commandline arguments to [`ls`](/commands/docs/ls.md). Instead, we used the [`sort-by`](/commands/docs/sort-by.md) command that Nu provides to do the sorting of the output of the [`ls`](/commands/docs/ls.md) command. To see the biggest files on top, we also used [`reverse`](/commands/docs/reverse.md). - -Nu provides many commands that can work on tables. For example, we could use [`where`](/commands/docs/where.md) to filter the contents of the [`ls`](/commands/docs/ls.md) table so that it only shows files over 1 kilobyte: - -@[code](@snippets/introduction/ls_where_example.sh) - -Just as in the Unix philosophy, being able to have commands talk to each other gives us ways to mix-and-match in many different combinations. Let's look at a different command: - -@[code](@snippets/introduction/ps_example.sh) - -You may be familiar with the [`ps`](/commands/docs/ps.md) command if you've used Linux. With it, we can get a list of all the current processes that the system is running, what their status is, and what their name is. We can also see the CPU load for the processes. - -What if we wanted to show the processes that were actively using the CPU? Just like we did with the [`ls`](/commands/docs/ls.md) command earlier, we can also work with the table that the [`ps`](/commands/docs/ps.md) command gives back to us: - -@[code](@snippets/introduction/ps_where_example.sh) - -So far, we've been using [`ls`](/commands/docs/ls.md) and [`ps`](/commands/docs/ps.md) to list files and processes. Nu also offers other commands that can create tables of useful information. Next, let's explore [`date`](/commands/docs/date.md) and [`sys`](/commands/docs/sys.md). - -Running [`date now`](/commands/docs/date_now.md) gives us information about the current day and time: - -@[code](@snippets/introduction/date_example.sh) - -To get the date as a table we can feed it into [`date to-table`](/commands/docs/date_to-table.md) - -@[code](@snippets/introduction/date_table_example.sh) - -Running [`sys`](/commands/docs/sys.md) gives information about the system that Nu is running on: - -@[code](@snippets/introduction/sys_example.sh) - -This is a bit different than the tables we saw before. The [`sys`](/commands/docs/sys.md) command gives us a table that contains structured tables in the cells instead of simple values. To take a look at this data, we need to _get_ the column to view: - -@[code](@snippets/introduction/sys_get_example.sh) - -The [`get`](/commands/docs/get.md) command lets us jump into the contents of a column of the table. Here, we're looking into the "host" column, which contains information about the host that Nu is running on. The name of the OS, the hostname, the CPU, and more. Let's get the name of the users on the system: - -@[code](@snippets/introduction/sys_get_nested_example.sh) - -Right now, there's just one user on the system named "jt". You'll notice that we can pass a column path (the `host.sessions.name` part) and not just the name of the column. Nu will take the column path and go to the corresponding bit of data in the table. - -You might have noticed something else that's different. Rather than having a table of data, we have just a single element: the string "jt". Nu works with both tables of data as well as strings. Strings are an important part of working with commands outside of Nu. - -Let's see how strings work outside of Nu in action. We'll take our example from before and run the external [`echo`](/commands/docs/echo.md) command (the `^` tells Nu to not use the built-in [`echo`](/commands/docs/echo.md) command): - -@[code](@snippets/introduction/sys_get_external_echo_example.sh) - -If this looks very similar to what we had before, you have a keen eye! It is similar, but with one important difference: we've called `^echo` with the value we saw earlier. This allows us to pass data out of Nu into [`echo`](/commands/docs/echo.md) (or any command outside of Nu, like `git` for example). - -### Getting Help - -Help text for any of Nu's built-in commands can be discovered with the [`help`](/commands/docs/help.md) command. To see all commands, run [`help commands`](/commands/docs/help_commands.md). You can also search for a topic by doing `help -f <topic>`. - -@[code](@snippets/introduction/help_example.sh) diff --git a/book/table_of_contents.md b/book/table_of_contents.md deleted file mode 100644 index 3d35b062021..00000000000 --- a/book/table_of_contents.md +++ /dev/null @@ -1,41 +0,0 @@ -# Table of Contents - -- [Installation](installation.md) - Installing Nushell -- [Introduction](README.md) - Getting started -- [Thinking in Nushell](thinking_in_nushell.md) - Thinking in Nushell -- [Moving around](moving_around.md) - Moving around in Nushell -- [Types of data](types_of_data.md) - Types of data in Nushell -- [Loading data](loading_data.md) - Loading data and using it -- [Strings](working_with_strings.md) - Strings, escape characters, and string interpolation -- [Working with lists](working_with_lists.md) - Working with Nu lists -- [Working with tables](working_with_tables.md) - Working with Nu tables -- [Pipeline](pipeline.md) - How the pipeline works -- [Configuration](configuration.md) - How to configure Nushell -- [3rd Party Prompts](3rdpartyprompts.md) - How to configure 3rd party prompts -- [Custom commands](custom_commands.md) - Creating your own commands -- [Aliases](aliases.md) - How to alias commands -- [Operators](operators.md) - Operators supported by Nushell -- [Variables and subexpressions](variables_and_subexpressions.md) - Working with variables and working with subexpressions -- [Control flow](control_flow.md) - Working with the control flow commands -- [Environment](environment.md) - Working with environment variables -- [Stdout, stderr, and exit codes](stdout_stderr_exit_codes.md) - Working with stdout, stderr, and exit codes -- [Modules](modules.md) - Creating and using your own modules -- [Hooks](hooks.md) - Adding code snippets to be run automatically -- [Scripts](scripts.md) - Creating your own scripts -- [Metadata](metadata.md) - An explanation of Nu's metadata system -- [Creating your own errors](creating_errors.md) - Creating your own error messages -- [Shells](shells_in_shells.md) - Working with multiple locations -- [Escaping commands](escaping.md) - Escaping to native commands of the same name -- [Plugins](plugins.md) - Enhancing Nushell with more features using plugins -- [Parallelism](parallelism.md) - Running your code in parallel -- [Line editor](line_editor.md) - Nushell's line editor -- [Dataframes](dataframes.md) - Working with dataframes in Nushell -- [Explore](explore.md) - Using the Nushell TUI -- [Coloring and Theming](coloring_and_theming.md) - How to change the colors and themes in Nushell -- [Regular Expressions](regular_expressions.md) - Guide to use regex -- [Coming from Bash](coming_from_bash.md) - Guide for those coming to Nushell from Bash -- [Nushell map from shells/DSL](nushell_map.md) - Guide to show how Nushell compares with SQL, LINQ, PowerShell, and Bash -- [Nushell map from imperative languages](nushell_map_imperative.md) - Guide to show how Nushell compares with Python, Kotlin, C++, C#, and Rust -- [Nushell map from functional languages](nushell_map_functional.md) - Guide to show how Nushell compares with Clojure, Tablecloth (OCaml / Elm) and Haskell -- [Nushell operator map](nushell_operator_map.md) - Guide to show how Nushell operators compare with those in general purpose programming languages -- [Command Reference](/commands/) - List of all Nushell's commands diff --git a/commands/README.md b/commands/README.md deleted file mode 100644 index 8e9a4b95aff..00000000000 --- a/commands/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Command Reference - -If you're new to Nushell, [the quick tour](/book/quick_tour.md) can show you the most important commands. You don't need to know them all! - -To see all commands from inside Nushell, run [`help commands`](/commands/docs/help.md). - -<script> - import pages from '@temp/pages' - export default { - computed: { - commands() { - return pages - .filter(p => p.path.indexOf('/commands/docs/') >= 0) - .sort((a,b) => (a.title > b.title) ? 1 : ((b.title > a.title) ? -1 : 0)); - } - } - } -</script> - -<table> - <tr> - <th>Command</th> - <th>Categories</th> - <th>Description</th> - <th>Feature</th> - </tr> - <tr v-for="command in commands"> - <td><a :href="command.path">{{ command.title }}</a></td> - <td style="white-space: pre-wrap;">{{ command.frontmatter.categories }}</td> - <td style="white-space: pre-wrap;">{{ command.frontmatter.usage }}</td> - <td style="white-space: pre-wrap;">{{ command.frontmatter.feature }}</td> - </tr> -</table> diff --git a/commands/docs/bits.md b/commands/docs/bits.md deleted file mode 100644 index 362aa4eda1e..00000000000 --- a/commands/docs/bits.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: bits -categories: | - bits -version: 0.90.0 -bits: | - Various commands for working with bits. -usage: | - Various commands for working with bits. -feature: extra ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for bits - -<div class='command-title'>{{ $frontmatter.bits }}</div> - - -::: warning - Command `bits` was not included in the official binaries by default, you have to build it with `--features=extra` flag -::: -## Signature - -```> bits {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ---------------------------------------- | ------- | -------------------------------------- | -| [`bits and`](/commands/docs/bits_and.md) | Builtin | Performs bitwise and for ints. | -| [`bits not`](/commands/docs/bits_not.md) | Builtin | Performs logical negation on each bit. | -| [`bits or`](/commands/docs/bits_or.md) | Builtin | Performs bitwise or for ints. | -| [`bits rol`](/commands/docs/bits_rol.md) | Builtin | Bitwise rotate left for ints. | -| [`bits ror`](/commands/docs/bits_ror.md) | Builtin | Bitwise rotate right for ints. | -| [`bits shl`](/commands/docs/bits_shl.md) | Builtin | Bitwise shift left for ints. | -| [`bits shr`](/commands/docs/bits_shr.md) | Builtin | Bitwise shift right for ints. | -| [`bits xor`](/commands/docs/bits_xor.md) | Builtin | Performs bitwise xor for ints. | \ No newline at end of file diff --git a/commands/docs/bytes.md b/commands/docs/bytes.md deleted file mode 100644 index 59722299d7f..00000000000 --- a/commands/docs/bytes.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: bytes -categories: | - bytes -version: 0.90.0 -bytes: | - Various commands for working with byte data. -usage: | - Various commands for working with byte data. -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for bytes - -<div class='command-title'>{{ $frontmatter.bytes }}</div> - -## Signature - -```> bytes {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ---------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------ | -| [`bytes add`](/commands/docs/bytes_add.md) | Builtin | Add specified bytes to the input. | -| [`bytes at`](/commands/docs/bytes_at.md) | Builtin | Get bytes defined by a range. | -| [`bytes build`](/commands/docs/bytes_build.md) | Builtin | Create bytes from the arguments. | -| [`bytes collect`](/commands/docs/bytes_collect.md) | Builtin | Concatenate multiple binary into a single binary, with an optional separator between each. | -| [`bytes ends-with`](/commands/docs/bytes_ends-with.md) | Builtin | Check if bytes ends with a pattern. | -| [`bytes index-of`](/commands/docs/bytes_index-of.md) | Builtin | Returns start index of first occurrence of pattern in bytes, or -1 if no match. | -| [`bytes length`](/commands/docs/bytes_length.md) | Builtin | Output the length of any bytes in the pipeline. | -| [`bytes remove`](/commands/docs/bytes_remove.md) | Builtin | Remove bytes. | -| [`bytes replace`](/commands/docs/bytes_replace.md) | Builtin | Find and replace binary. | -| [`bytes reverse`](/commands/docs/bytes_reverse.md) | Builtin | Reverse the bytes in the pipeline. | -| [`bytes starts-with`](/commands/docs/bytes_starts-with.md) | Builtin | Check if bytes starts with a pattern. | \ No newline at end of file diff --git a/commands/docs/date.md b/commands/docs/date.md deleted file mode 100644 index 5598046bd69..00000000000 --- a/commands/docs/date.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: date -categories: | - date -version: 0.90.0 -date: | - Date-related commands. -usage: | - Date-related commands. -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for date - -<div class='command-title'>{{ $frontmatter.date }}</div> - -## Signature - -```> date {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ------------------------------------------------------------ | ------- | --------------------------------------------------------- | -| [`date format`](/commands/docs/date_format.md) | Builtin | Removed command: use `format date` instead. | -| [`date humanize`](/commands/docs/date_humanize.md) | Builtin | Print a 'humanized' format for the date, relative to now. | -| [`date list-timezone`](/commands/docs/date_list-timezone.md) | Builtin | List supported time zones. | -| [`date now`](/commands/docs/date_now.md) | Builtin | Get the current date. | -| [`date to-record`](/commands/docs/date_to-record.md) | Builtin | Convert the date into a record. | -| [`date to-table`](/commands/docs/date_to-table.md) | Builtin | Convert the date into a structured table. | -| [`date to-timezone`](/commands/docs/date_to-timezone.md) | Builtin | Convert a date to a given time zone. | \ No newline at end of file diff --git a/commands/docs/dfr.md b/commands/docs/dfr.md deleted file mode 100644 index b1c877b2fe8..00000000000 --- a/commands/docs/dfr.md +++ /dev/null @@ -1,147 +0,0 @@ ---- -title: dfr -categories: | - dataframe -version: 0.90.0 -dataframe: | - Operate with data in a dataframe format. -usage: | - Operate with data in a dataframe format. -feature: dataframe ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for dataframe - -<div class='command-title'>{{ $frontmatter.dataframe }}</div> - - -::: warning -Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag -::: -## Signature - -```> dfr {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| -------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------ | -| [`dfr agg`](/commands/docs/dfr_agg.md) | Builtin | Performs a series of aggregations from a group-by. | -| [`dfr agg-groups`](/commands/docs/dfr_agg-groups.md) | Builtin | Creates an agg_groups expression. | -| [`dfr all-false`](/commands/docs/dfr_all-false.md) | Builtin | Returns true if all values are false. | -| [`dfr all-true`](/commands/docs/dfr_all-true.md) | Builtin | Returns true if all values are true. | -| [`dfr append`](/commands/docs/dfr_append.md) | Builtin | Appends a new dataframe. | -| [`dfr arg-max`](/commands/docs/dfr_arg-max.md) | Builtin | Return index for max value in series. | -| [`dfr arg-min`](/commands/docs/dfr_arg-min.md) | Builtin | Return index for min value in series. | -| [`dfr arg-sort`](/commands/docs/dfr_arg-sort.md) | Builtin | Returns indexes for a sorted series. | -| [`dfr arg-true`](/commands/docs/dfr_arg-true.md) | Builtin | Returns indexes where values are true. | -| [`dfr arg-unique`](/commands/docs/dfr_arg-unique.md) | Builtin | Returns indexes for unique values. | -| [`dfr arg-where`](/commands/docs/dfr_arg-where.md) | Builtin | Creates an expression that returns the arguments where expression is true. | -| [`dfr as`](/commands/docs/dfr_as.md) | Builtin | Creates an alias expression. | -| [`dfr as-date`](/commands/docs/dfr_as-date.md) | Builtin | Converts string to date. | -| [`dfr as-datetime`](/commands/docs/dfr_as-datetime.md) | Builtin | Converts string to datetime. | -| [`dfr cache`](/commands/docs/dfr_cache.md) | Builtin | Caches operations in a new LazyFrame. | -| [`dfr col`](/commands/docs/dfr_col.md) | Builtin | Creates a named column expression. | -| [`dfr collect`](/commands/docs/dfr_collect.md) | Builtin | Collect lazy dataframe into eager dataframe. | -| [`dfr columns`](/commands/docs/dfr_columns.md) | Builtin | Show dataframe columns. | -| [`dfr concat-str`](/commands/docs/dfr_concat-str.md) | Builtin | Creates a concat string expression. | -| [`dfr concatenate`](/commands/docs/dfr_concatenate.md) | Builtin | Concatenates strings with other array. | -| [`dfr contains`](/commands/docs/dfr_contains.md) | Builtin | Checks if a pattern is contained in a string. | -| [`dfr count`](/commands/docs/dfr_count.md) | Builtin | Creates a count expression. | -| [`dfr count-null`](/commands/docs/dfr_count-null.md) | Builtin | Counts null values. | -| [`dfr cumulative`](/commands/docs/dfr_cumulative.md) | Builtin | Cumulative calculation for a series. | -| [`dfr datepart`](/commands/docs/dfr_datepart.md) | Builtin | Creates an expression for capturing the specified datepart in a column. | -| [`dfr drop`](/commands/docs/dfr_drop.md) | Builtin | Creates a new dataframe by dropping the selected columns. | -| [`dfr drop-duplicates`](/commands/docs/dfr_drop-duplicates.md) | Builtin | Drops duplicate values in dataframe. | -| [`dfr drop-nulls`](/commands/docs/dfr_drop-nulls.md) | Builtin | Drops null values in dataframe. | -| [`dfr dtypes`](/commands/docs/dfr_dtypes.md) | Builtin | Show dataframe data types. | -| [`dfr dummies`](/commands/docs/dfr_dummies.md) | Builtin | Creates a new dataframe with dummy variables. | -| [`dfr explode`](/commands/docs/dfr_explode.md) | Builtin | Explodes a dataframe or creates a explode expression. | -| [`dfr expr-not`](/commands/docs/dfr_expr-not.md) | Builtin | Creates a not expression. | -| [`dfr fetch`](/commands/docs/dfr_fetch.md) | Builtin | Collects the lazyframe to the selected rows. | -| [`dfr fill-nan`](/commands/docs/dfr_fill-nan.md) | Builtin | Replaces NaN values with the given expression. | -| [`dfr fill-null`](/commands/docs/dfr_fill-null.md) | Builtin | Replaces NULL values with the given expression. | -| [`dfr filter`](/commands/docs/dfr_filter.md) | Builtin | Filter dataframe based in expression. | -| [`dfr filter-with`](/commands/docs/dfr_filter-with.md) | Builtin | Filters dataframe using a mask or expression as reference. | -| [`dfr first`](/commands/docs/dfr_first.md) | Builtin | Show only the first number of rows or create a first expression | -| [`dfr flatten`](/commands/docs/dfr_flatten.md) | Builtin | An alias for dfr explode. | -| [`dfr get`](/commands/docs/dfr_get.md) | Builtin | Creates dataframe with the selected columns. | -| [`dfr get-day`](/commands/docs/dfr_get-day.md) | Builtin | Gets day from date. | -| [`dfr get-hour`](/commands/docs/dfr_get-hour.md) | Builtin | Gets hour from date. | -| [`dfr get-minute`](/commands/docs/dfr_get-minute.md) | Builtin | Gets minute from date. | -| [`dfr get-month`](/commands/docs/dfr_get-month.md) | Builtin | Gets month from date. | -| [`dfr get-nanosecond`](/commands/docs/dfr_get-nanosecond.md) | Builtin | Gets nanosecond from date. | -| [`dfr get-ordinal`](/commands/docs/dfr_get-ordinal.md) | Builtin | Gets ordinal from date. | -| [`dfr get-second`](/commands/docs/dfr_get-second.md) | Builtin | Gets second from date. | -| [`dfr get-week`](/commands/docs/dfr_get-week.md) | Builtin | Gets week from date. | -| [`dfr get-weekday`](/commands/docs/dfr_get-weekday.md) | Builtin | Gets weekday from date. | -| [`dfr get-year`](/commands/docs/dfr_get-year.md) | Builtin | Gets year from date. | -| [`dfr group-by`](/commands/docs/dfr_group-by.md) | Builtin | Creates a group-by object that can be used for other aggregations. | -| [`dfr implode`](/commands/docs/dfr_implode.md) | Builtin | Aggregates a group to a Series. | -| [`dfr into-df`](/commands/docs/dfr_into-df.md) | Builtin | Converts a list, table or record into a dataframe. | -| [`dfr into-lazy`](/commands/docs/dfr_into-lazy.md) | Builtin | Converts a dataframe into a lazy dataframe. | -| [`dfr into-nu`](/commands/docs/dfr_into-nu.md) | Builtin | Converts a dataframe or an expression into into nushell value for access and exploration. | -| [`dfr is-duplicated`](/commands/docs/dfr_is-duplicated.md) | Builtin | Creates mask indicating duplicated values. | -| [`dfr is-in`](/commands/docs/dfr_is-in.md) | Builtin | Creates an is-in expression. | -| [`dfr is-not-null`](/commands/docs/dfr_is-not-null.md) | Builtin | Creates mask where value is not null. | -| [`dfr is-null`](/commands/docs/dfr_is-null.md) | Builtin | Creates mask where value is null. | -| [`dfr is-unique`](/commands/docs/dfr_is-unique.md) | Builtin | Creates mask indicating unique values. | -| [`dfr join`](/commands/docs/dfr_join.md) | Builtin | Joins a lazy frame with other lazy frame. | -| [`dfr last`](/commands/docs/dfr_last.md) | Builtin | Creates new dataframe with tail rows or creates a last expression. | -| [`dfr lit`](/commands/docs/dfr_lit.md) | Builtin | Creates a literal expression. | -| [`dfr lowercase`](/commands/docs/dfr_lowercase.md) | Builtin | Lowercase the strings in the column. | -| [`dfr ls`](/commands/docs/dfr_ls.md) | Builtin | Lists stored dataframes. | -| [`dfr max`](/commands/docs/dfr_max.md) | Builtin | Creates a max expression or aggregates columns to their max value. | -| [`dfr mean`](/commands/docs/dfr_mean.md) | Builtin | Creates a mean expression for an aggregation or aggregates columns to their mean value. | -| [`dfr median`](/commands/docs/dfr_median.md) | Builtin | Aggregates columns to their median value | -| [`dfr melt`](/commands/docs/dfr_melt.md) | Builtin | Unpivot a DataFrame from wide to long format. | -| [`dfr min`](/commands/docs/dfr_min.md) | Builtin | Creates a min expression or aggregates columns to their min value. | -| [`dfr n-unique`](/commands/docs/dfr_n-unique.md) | Builtin | Counts unique values. | -| [`dfr not`](/commands/docs/dfr_not.md) | Builtin | Inverts boolean mask. | -| [`dfr open`](/commands/docs/dfr_open.md) | Builtin | Opens CSV, JSON, JSON lines, arrow, avro, or parquet file to create dataframe. | -| [`dfr otherwise`](/commands/docs/dfr_otherwise.md) | Builtin | Completes a when expression. | -| [`dfr quantile`](/commands/docs/dfr_quantile.md) | Builtin | Aggregates the columns to the selected quantile. | -| [`dfr query`](/commands/docs/dfr_query.md) | Builtin | Query dataframe using SQL. Note: The dataframe is always named 'df' in your query's from clause. | -| [`dfr rename`](/commands/docs/dfr_rename.md) | Builtin | Rename a dataframe column. | -| [`dfr replace`](/commands/docs/dfr_replace.md) | Builtin | Replace the leftmost (sub)string by a regex pattern. | -| [`dfr replace-all`](/commands/docs/dfr_replace-all.md) | Builtin | Replace all (sub)strings by a regex pattern. | -| [`dfr reverse`](/commands/docs/dfr_reverse.md) | Builtin | Reverses the LazyFrame | -| [`dfr rolling`](/commands/docs/dfr_rolling.md) | Builtin | Rolling calculation for a series. | -| [`dfr sample`](/commands/docs/dfr_sample.md) | Builtin | Create sample dataframe. | -| [`dfr schema`](/commands/docs/dfr_schema.md) | Builtin | Show schema for a dataframe. | -| [`dfr select`](/commands/docs/dfr_select.md) | Builtin | Selects columns from lazyframe. | -| [`dfr set`](/commands/docs/dfr_set.md) | Builtin | Sets value where given mask is true. | -| [`dfr set-with-idx`](/commands/docs/dfr_set-with-idx.md) | Builtin | Sets value in the given index. | -| [`dfr shape`](/commands/docs/dfr_shape.md) | Builtin | Shows column and row size for a dataframe. | -| [`dfr shift`](/commands/docs/dfr_shift.md) | Builtin | Shifts the values by a given period. | -| [`dfr slice`](/commands/docs/dfr_slice.md) | Builtin | Creates new dataframe from a slice of rows. | -| [`dfr sort-by`](/commands/docs/dfr_sort-by.md) | Builtin | Sorts a lazy dataframe based on expression(s). | -| [`dfr std`](/commands/docs/dfr_std.md) | Builtin | Creates a std expression for an aggregation of std value from columns in a dataframe. | -| [`dfr str-lengths`](/commands/docs/dfr_str-lengths.md) | Builtin | Get lengths of all strings. | -| [`dfr str-slice`](/commands/docs/dfr_str-slice.md) | Builtin | Slices the string from the start position until the selected length. | -| [`dfr strftime`](/commands/docs/dfr_strftime.md) | Builtin | Formats date based on string rule. | -| [`dfr sum`](/commands/docs/dfr_sum.md) | Builtin | Creates a sum expression for an aggregation or aggregates columns to their sum value. | -| [`dfr summary`](/commands/docs/dfr_summary.md) | Builtin | For a dataframe, produces descriptive statistics (summary statistics) for its numeric columns. | -| [`dfr take`](/commands/docs/dfr_take.md) | Builtin | Creates new dataframe using the given indices. | -| [`dfr to-arrow`](/commands/docs/dfr_to-arrow.md) | Builtin | Saves dataframe to arrow file. | -| [`dfr to-avro`](/commands/docs/dfr_to-avro.md) | Builtin | Saves dataframe to avro file. | -| [`dfr to-csv`](/commands/docs/dfr_to-csv.md) | Builtin | Saves dataframe to CSV file. | -| [`dfr to-jsonl`](/commands/docs/dfr_to-jsonl.md) | Builtin | Saves dataframe to a JSON lines file. | -| [`dfr to-parquet`](/commands/docs/dfr_to-parquet.md) | Builtin | Saves dataframe to parquet file. | -| [`dfr unique`](/commands/docs/dfr_unique.md) | Builtin | Returns unique values from a dataframe. | -| [`dfr uppercase`](/commands/docs/dfr_uppercase.md) | Builtin | Uppercase the strings in the column. | -| [`dfr value-counts`](/commands/docs/dfr_value-counts.md) | Builtin | Returns a dataframe with the counts for unique values in series. | -| [`dfr var`](/commands/docs/dfr_var.md) | Builtin | Create a var expression for an aggregation. | -| [`dfr when`](/commands/docs/dfr_when.md) | Builtin | Creates and modifies a when expression. | -| [`dfr with-column`](/commands/docs/dfr_with-column.md) | Builtin | Adds a series to the dataframe. | \ No newline at end of file diff --git a/commands/docs/export.md b/commands/docs/export.md deleted file mode 100644 index 2139a644443..00000000000 --- a/commands/docs/export.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: export -categories: | - core -version: 0.90.0 -core: | - Export definitions or environment variables from a module. -usage: | - Export definitions or environment variables from a module. -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for core - -<div class='command-title'>{{ $frontmatter.core }}</div> - -## Signature - -```> export {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------- | -| nothing | nothing | - -## Examples - -Export a definition from a module -```nu -> module utils { export def my-command [] { "hello" } }; use utils my-command; my-command -hello -``` - -## Notes -This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html - -## Subcommands: - -| name | type | usage | -| -------------------------------------------------- | ------- | -------------------------------------------------------------------------------- | -| [`export alias`](/commands/docs/export_alias.md) | Builtin | Alias a command (with optional flags) to a new name and export it from a module. | -| [`export const`](/commands/docs/export_const.md) | Builtin | Use parse-time constant from a module and export them from this module. | -| [`export def`](/commands/docs/export_def.md) | Builtin | Define a custom command and export it from a module. | -| [`export extern`](/commands/docs/export_extern.md) | Builtin | Define an extern and export it from a module. | -| [`export module`](/commands/docs/export_module.md) | Builtin | Export a custom module from a module. | -| [`export use`](/commands/docs/export_use.md) | Builtin | Use definitions from a module and export them from this module. | \ No newline at end of file diff --git a/commands/docs/format.md b/commands/docs/format.md deleted file mode 100644 index 357aff7a5d3..00000000000 --- a/commands/docs/format.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: format -categories: | - strings -version: 0.90.0 -strings: | - Various commands for formatting data. -usage: | - Various commands for formatting data. -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for strings - -<div class='command-title'>{{ $frontmatter.strings }}</div> - -## Signature - -```> format {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ------------------------------------------------------ | ------- | -------------------------------------------------------- | -| [`format date`](/commands/docs/format_date.md) | Builtin | Format a given date using a format string. | -| [`format duration`](/commands/docs/format_duration.md) | Builtin | Outputs duration with a specified unit of time. | -| [`format filesize`](/commands/docs/format_filesize.md) | Builtin | Converts a column of filesizes to some specified format. | -| [`format pattern`](/commands/docs/format_pattern.md) | Builtin | Format columns into a string using a simple pattern. | \ No newline at end of file diff --git a/commands/docs/from.md b/commands/docs/from.md deleted file mode 100644 index ab951ad8fdf..00000000000 --- a/commands/docs/from.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: from -categories: | - formats -version: 0.90.0 -formats: | - Parse a string or binary data into structured data. -usage: | - Parse a string or binary data into structured data. -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for formats - -<div class='command-title'>{{ $frontmatter.formats }}</div> - -## Signature - -```> from {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ------------------------------------------ | -------------- | -------------------------------------------------------------------------------------------------------------------------- | -| [`from csv`](/commands/docs/from_csv.md) | Builtin | Parse text as .csv and create table. | -| [`from eml`](/commands/docs/from_eml.md) | Builtin,Plugin | Parse text as .eml and create record. | -| [`from ics`](/commands/docs/from_ics.md) | Builtin,Plugin | Parse text as .ics and create table. | -| [`from ini`](/commands/docs/from_ini.md) | Builtin,Plugin | Parse text as .ini and create table. | -| [`from json`](/commands/docs/from_json.md) | Builtin | Convert from json to structured data. | -| [`from nuon`](/commands/docs/from_nuon.md) | Builtin | Convert from nuon to structured data. | -| [`from ods`](/commands/docs/from_ods.md) | Builtin | Parse OpenDocument Spreadsheet(.ods) data and create table. | -| [`from ssv`](/commands/docs/from_ssv.md) | Builtin | Parse text as space-separated values and create a table. The default minimum number of spaces counted as a separator is 2. | -| [`from toml`](/commands/docs/from_toml.md) | Builtin | Parse text as .toml and create record. | -| [`from tsv`](/commands/docs/from_tsv.md) | Builtin | Parse text as .tsv and create table. | -| [`from url`](/commands/docs/from_url.md) | Builtin | Parse url-encoded string as a record. | -| [`from vcf`](/commands/docs/from_vcf.md) | Builtin,Plugin | Parse text as .vcf and create table. | -| [`from xlsx`](/commands/docs/from_xlsx.md) | Builtin | Parse binary Excel(.xlsx) data and create table. | -| [`from xml`](/commands/docs/from_xml.md) | Builtin | Parse text as .xml and create record. | -| [`from yaml`](/commands/docs/from_yaml.md) | Builtin | Parse text as .yaml/.yml and create table. | -| [`from yml`](/commands/docs/from_yml.md) | Builtin | Parse text as .yaml/.yml and create table. | \ No newline at end of file diff --git a/commands/docs/help.md b/commands/docs/help.md deleted file mode 100644 index d4f68cabc15..00000000000 --- a/commands/docs/help.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: help -categories: | - core -version: 0.90.0 -core: | - Display help information about different parts of Nushell. -usage: | - Display help information about different parts of Nushell. -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for core - -<div class='command-title'>{{ $frontmatter.core }}</div> - -## Signature - -```> help {flags} ...rest``` - -## Flags - - - `--find, -f {string}`: string to find in command names, usage, and search terms - -## Parameters - - - `...rest`: The name of command, alias or module to get help on. - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | any | - -## Examples - -show help for single command, alias, or module -```nu -> help match - -``` - -show help for single sub-command, alias, or module -```nu -> help str lpad - -``` - -search for string in command names, usage and search terms -```nu -> help --find char - -``` - -## Notes -`help word` searches for "word" in commands, aliases and modules, in that order. - -## Subcommands: - -| name | type | usage | -| ---------------------------------------------------- | ------- | ------------------------------------ | -| [`help aliases`](/commands/docs/help_aliases.md) | Builtin | Show help on nushell aliases. | -| [`help commands`](/commands/docs/help_commands.md) | Builtin | Show help on nushell commands. | -| [`help escapes`](/commands/docs/help_escapes.md) | Builtin | Show help on nushell string escapes. | -| [`help externs`](/commands/docs/help_externs.md) | Builtin | Show help on nushell externs. | -| [`help modules`](/commands/docs/help_modules.md) | Builtin | Show help on nushell modules. | -| [`help operators`](/commands/docs/help_operators.md) | Builtin | Show help on nushell operators. | \ No newline at end of file diff --git a/commands/docs/http.md b/commands/docs/http.md deleted file mode 100644 index e43c799144e..00000000000 --- a/commands/docs/http.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: http -categories: | - network -version: 0.90.0 -network: | - Various commands for working with http methods. -usage: | - Various commands for working with http methods. -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for network - -<div class='command-title'>{{ $frontmatter.network }}</div> - -## Signature - -```> http {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ------------------------------------------------ | ------- | --------------------------------------------------------- | -| [`http delete`](/commands/docs/http_delete.md) | Builtin | Delete the specified resource. | -| [`http get`](/commands/docs/http_get.md) | Builtin | Fetch the contents from a URL. | -| [`http head`](/commands/docs/http_head.md) | Builtin | Get the headers from a URL. | -| [`http options`](/commands/docs/http_options.md) | Builtin | Requests permitted communication options for a given URL. | -| [`http patch`](/commands/docs/http_patch.md) | Builtin | Patch a body to a URL. | -| [`http post`](/commands/docs/http_post.md) | Builtin | Post a body to a URL. | -| [`http put`](/commands/docs/http_put.md) | Builtin | Put a body to a URL. | \ No newline at end of file diff --git a/commands/docs/into.md b/commands/docs/into.md deleted file mode 100644 index d8f4554189e..00000000000 --- a/commands/docs/into.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: into -categories: | - conversions -version: 0.90.0 -conversions: | - Commands to convert data from one type to another. -usage: | - Commands to convert data from one type to another. -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for conversions - -<div class='command-title'>{{ $frontmatter.conversions }}</div> - -## Signature - -```> into {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ---------------------------------------------------- | ------- | ------------------------------------------ | -| [`into binary`](/commands/docs/into_binary.md) | Builtin | Convert value to a binary primitive. | -| [`into bits`](/commands/docs/into_bits.md) | Builtin | Convert value to a binary primitive. | -| [`into bool`](/commands/docs/into_bool.md) | Builtin | Convert value to boolean. | -| [`into cell-path`](/commands/docs/into_cell-path.md) | Builtin | Convert value to a cell-path. | -| [`into datetime`](/commands/docs/into_datetime.md) | Builtin | Convert text or timestamp into a datetime. | -| [`into duration`](/commands/docs/into_duration.md) | Builtin | Convert value to duration. | -| [`into filesize`](/commands/docs/into_filesize.md) | Builtin | Convert value to filesize. | -| [`into float`](/commands/docs/into_float.md) | Builtin | Convert data into floating point number. | -| [`into int`](/commands/docs/into_int.md) | Builtin | Convert value to integer. | -| [`into record`](/commands/docs/into_record.md) | Builtin | Convert value to record. | -| [`into sqlite`](/commands/docs/into_sqlite.md) | Builtin | Convert table into a SQLite database. | -| [`into string`](/commands/docs/into_string.md) | Builtin | Convert value to string. | -| [`into value`](/commands/docs/into_value.md) | Builtin | Infer nushell datatype for each cell. | \ No newline at end of file diff --git a/commands/docs/keybindings.md b/commands/docs/keybindings.md deleted file mode 100644 index fb85b4ab2b7..00000000000 --- a/commands/docs/keybindings.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: keybindings -categories: | - platform -version: 0.90.0 -platform: | - Keybindings related commands. -usage: | - Keybindings related commands. -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for platform - -<div class='command-title'>{{ $frontmatter.platform }}</div> - -## Signature - -```> keybindings {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -For more information on input and keybindings, check: - https://www.nushell.sh/book/line_editor.html - -## Subcommands: - -| name | type | usage | -| -------------------------------------------------------------- | ------- | -------------------------------------------------------------- | -| [`keybindings default`](/commands/docs/keybindings_default.md) | Builtin | List default keybindings. | -| [`keybindings list`](/commands/docs/keybindings_list.md) | Builtin | List available options that can be used to create keybindings. | -| [`keybindings listen`](/commands/docs/keybindings_listen.md) | Builtin | Get input from the user. | \ No newline at end of file diff --git a/commands/docs/math.md b/commands/docs/math.md deleted file mode 100644 index 039cd293a09..00000000000 --- a/commands/docs/math.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: math -categories: | - math -version: 0.90.0 -math: | - Use mathematical functions as aggregate functions on a list of numbers or tables. -usage: | - Use mathematical functions as aggregate functions on a list of numbers or tables. -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for math - -<div class='command-title'>{{ $frontmatter.math }}</div> - -## Signature - -```> math {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| -------------------------------------------------- | ------- | ------------------------------------------------------------------------------------- | -| [`math abs`](/commands/docs/math_abs.md) | Builtin | Returns the absolute value of a number. | -| [`math arccos`](/commands/docs/math_arccos.md) | Builtin | Returns the arccosine of the number. | -| [`math arccosh`](/commands/docs/math_arccosh.md) | Builtin | Returns the inverse of the hyperbolic cosine function. | -| [`math arcsin`](/commands/docs/math_arcsin.md) | Builtin | Returns the arcsine of the number. | -| [`math arcsinh`](/commands/docs/math_arcsinh.md) | Builtin | Returns the inverse of the hyperbolic sine function. | -| [`math arctan`](/commands/docs/math_arctan.md) | Builtin | Returns the arctangent of the number. | -| [`math arctanh`](/commands/docs/math_arctanh.md) | Builtin | Returns the inverse of the hyperbolic tangent function. | -| [`math avg`](/commands/docs/math_avg.md) | Builtin | Returns the average of a list of numbers. | -| [`math ceil`](/commands/docs/math_ceil.md) | Builtin | Returns the ceil of a number (smallest integer greater than or equal to that number). | -| [`math cos`](/commands/docs/math_cos.md) | Builtin | Returns the cosine of the number. | -| [`math cosh`](/commands/docs/math_cosh.md) | Builtin | Returns the hyperbolic cosine of the number. | -| [`math exp`](/commands/docs/math_exp.md) | Builtin | Returns e raised to the power of x. | -| [`math floor`](/commands/docs/math_floor.md) | Builtin | Returns the floor of a number (largest integer less than or equal to that number). | -| [`math ln`](/commands/docs/math_ln.md) | Builtin | Returns the natural logarithm. Base: (math e). | -| [`math log`](/commands/docs/math_log.md) | Builtin | Returns the logarithm for an arbitrary base. | -| [`math max`](/commands/docs/math_max.md) | Builtin | Returns the maximum of a list of values, or of columns in a table. | -| [`math median`](/commands/docs/math_median.md) | Builtin | Computes the median of a list of numbers. | -| [`math min`](/commands/docs/math_min.md) | Builtin | Finds the minimum within a list of values or tables. | -| [`math mode`](/commands/docs/math_mode.md) | Builtin | Returns the most frequent element(s) from a list of numbers or tables. | -| [`math product`](/commands/docs/math_product.md) | Builtin | Returns the product of a list of numbers or the products of each column of a table. | -| [`math round`](/commands/docs/math_round.md) | Builtin | Returns the input number rounded to the specified precision. | -| [`math sin`](/commands/docs/math_sin.md) | Builtin | Returns the sine of the number. | -| [`math sinh`](/commands/docs/math_sinh.md) | Builtin | Returns the hyperbolic sine of the number. | -| [`math sqrt`](/commands/docs/math_sqrt.md) | Builtin | Returns the square root of the input number. | -| [`math stddev`](/commands/docs/math_stddev.md) | Builtin | Returns the standard deviation of a list of numbers, or of each column in a table. | -| [`math sum`](/commands/docs/math_sum.md) | Builtin | Returns the sum of a list of numbers or of each column in a table. | -| [`math tan`](/commands/docs/math_tan.md) | Builtin | Returns the tangent of the number. | -| [`math tanh`](/commands/docs/math_tanh.md) | Builtin | Returns the hyperbolic tangent of the number. | -| [`math variance`](/commands/docs/math_variance.md) | Builtin | Returns the variance of a list of numbers or of each column in a table. | \ No newline at end of file diff --git a/commands/docs/overlay.md b/commands/docs/overlay.md deleted file mode 100644 index e72d4da289c..00000000000 --- a/commands/docs/overlay.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: overlay -categories: | - core -version: 0.90.0 -core: | - Commands for manipulating overlays. -usage: | - Commands for manipulating overlays. -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for core - -<div class='command-title'>{{ $frontmatter.core }}</div> - -## Signature - -```> overlay {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html - - You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ------------------------------------------------ | ------- | -------------------------------------------- | -| [`overlay hide`](/commands/docs/overlay_hide.md) | Builtin | Hide an active overlay. | -| [`overlay list`](/commands/docs/overlay_list.md) | Builtin | List all active overlays. | -| [`overlay new`](/commands/docs/overlay_new.md) | Builtin | Create an empty overlay. | -| [`overlay use`](/commands/docs/overlay_use.md) | Builtin | Use definitions from a module as an overlay. | \ No newline at end of file diff --git a/commands/docs/path.md b/commands/docs/path.md deleted file mode 100644 index cebdcefafef..00000000000 --- a/commands/docs/path.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: path -categories: | - path -version: 0.90.0 -path: | - Explore and manipulate paths. -usage: | - Explore and manipulate paths. -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for path - -<div class='command-title'>{{ $frontmatter.path }}</div> - -## Signature - -```> path {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -There are three ways to represent a path: - -* As a path literal, e.g., '/home/viking/spam.txt' -* As a structured path: a table with 'parent', 'stem', and 'extension' (and -* 'prefix' on Windows) columns. This format is produced by the 'path parse' - subcommand. -* As a list of path parts, e.g., '[ / home viking spam.txt ]'. Splitting into - parts is done by the `path split` command. - -All subcommands accept all three variants as an input. Furthermore, the 'path -join' subcommand can be used to join the structured path or path parts back into -the path literal. - -## Subcommands: - -| name | type | usage | -| -------------------------------------------------------- | ------- | ----------------------------------------------------------------------- | -| [`path basename`](/commands/docs/path_basename.md) | Builtin | Get the final component of a path. | -| [`path dirname`](/commands/docs/path_dirname.md) | Builtin | Get the parent directory of a path. | -| [`path exists`](/commands/docs/path_exists.md) | Builtin | Check whether a path exists. | -| [`path expand`](/commands/docs/path_expand.md) | Builtin | Try to expand a path to its absolute form. | -| [`path join`](/commands/docs/path_join.md) | Builtin | Join a structured path or a list of path parts. | -| [`path parse`](/commands/docs/path_parse.md) | Builtin | Convert a path into structured data. | -| [`path relative-to`](/commands/docs/path_relative-to.md) | Builtin | Express a path as relative to another path. | -| [`path split`](/commands/docs/path_split.md) | Builtin | Split a path into a list based on the system's path separator. | -| [`path type`](/commands/docs/path_type.md) | Builtin | Get the type of the object a path refers to (e.g., file, dir, symlink). | \ No newline at end of file diff --git a/commands/docs/query.md b/commands/docs/query.md deleted file mode 100644 index b8c2c28d487..00000000000 --- a/commands/docs/query.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: query -categories: | - filters -version: 0.90.0 -filters: | - Show all the query commands -usage: | - Show all the query commands -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for filters - -<div class='command-title'>{{ $frontmatter.filters }}</div> - -## Signature - -```> query {flags} ``` - - -## Input/output types: - -| input | output | -| ----- | ------ | -| any | any | - - -## Subcommands: - -| name | type | usage | -| -------------------------------------------- | -------------- | --------------------------------------------------------------------------------- | -| [`query db`](/commands/docs/query_db.md) | Builtin | Query a database using SQL. | -| [`query json`](/commands/docs/query_json.md) | Builtin,Plugin | execute json query on json file (open --raw \<file\> | query json 'query string') | -| [`query web`](/commands/docs/query_web.md) | Builtin,Plugin | execute selector query on html/web | -| [`query xml`](/commands/docs/query_xml.md) | Builtin,Plugin | execute xpath query on xml | \ No newline at end of file diff --git a/commands/docs/random.md b/commands/docs/random.md deleted file mode 100644 index d3c56d23cc3..00000000000 --- a/commands/docs/random.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: random -categories: | - random -version: 0.90.0 -random: | - Generate a random value. -usage: | - Generate a random value. -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for random - -<div class='command-title'>{{ $frontmatter.random }}</div> - -## Signature - -```> random {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ------------------------------------------------ | ------- | -------------------------------------------------- | -| [`random bool`](/commands/docs/random_bool.md) | Builtin | Generate a random boolean value. | -| [`random chars`](/commands/docs/random_chars.md) | Builtin | Generate random chars. | -| [`random dice`](/commands/docs/random_dice.md) | Builtin | Generate a random dice roll. | -| [`random float`](/commands/docs/random_float.md) | Builtin | Generate a random float within a range [min..max]. | -| [`random int`](/commands/docs/random_int.md) | Builtin | Generate a random integer [min..max]. | -| [`random uuid`](/commands/docs/random_uuid.md) | Builtin | Generate a random uuid4 string. | \ No newline at end of file diff --git a/commands/docs/roll.md b/commands/docs/roll.md deleted file mode 100644 index 0f7c73a0d85..00000000000 --- a/commands/docs/roll.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: roll -categories: | - filters -version: 0.90.0 -filters: | - Rolling commands for tables. -usage: | - Rolling commands for tables. -feature: extra ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for filters - -<div class='command-title'>{{ $frontmatter.filters }}</div> - - -::: warning - Command `roll` was not included in the official binaries by default, you have to build it with `--features=extra` flag -::: -## Signature - -```> roll {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| -------------------------------------------- | ------- | ---------------------------------- | -| [`roll down`](/commands/docs/roll_down.md) | Builtin | Roll table rows down. | -| [`roll left`](/commands/docs/roll_left.md) | Builtin | Roll record or table columns left. | -| [`roll right`](/commands/docs/roll_right.md) | Builtin | Roll table columns right. | -| [`roll up`](/commands/docs/roll_up.md) | Builtin | Roll table rows up. | \ No newline at end of file diff --git a/commands/docs/scope.md b/commands/docs/scope.md deleted file mode 100644 index 545c01293c5..00000000000 --- a/commands/docs/scope.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: scope -categories: | - core -version: 0.90.0 -core: | - Commands for getting info about what is in scope. -usage: | - Commands for getting info about what is in scope. -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for core - -<div class='command-title'>{{ $frontmatter.core }}</div> - -## Signature - -```> scope {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - - -## Subcommands: - -| name | type | usage | -| ------------------------------------------------------------ | ------- | -------------------------------------------------------- | -| [`scope aliases`](/commands/docs/scope_aliases.md) | Builtin | Output info on the aliases in the current scope. | -| [`scope commands`](/commands/docs/scope_commands.md) | Builtin | Output info on the commands in the current scope. | -| [`scope engine-stats`](/commands/docs/scope_engine-stats.md) | Builtin | Output stats on the engine in the current state. | -| [`scope externs`](/commands/docs/scope_externs.md) | Builtin | Output info on the known externals in the current scope. | -| [`scope modules`](/commands/docs/scope_modules.md) | Builtin | Output info on the modules in the current scope. | -| [`scope variables`](/commands/docs/scope_variables.md) | Builtin | Output info on the variables in the current scope. | \ No newline at end of file diff --git a/commands/docs/split.md b/commands/docs/split.md deleted file mode 100644 index e8c807fd919..00000000000 --- a/commands/docs/split.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: split -categories: | - strings -version: 0.90.0 -strings: | - Split contents across desired subcommand (like row, column) via the separator. -usage: | - Split contents across desired subcommand (like row, column) via the separator. -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for strings - -<div class='command-title'>{{ $frontmatter.strings }}</div> - -## Signature - -```> split {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ------------------------------------------------ | ------- | ------------------------------------------------------- | -| [`split chars`](/commands/docs/split_chars.md) | Builtin | Split a string into a list of characters. | -| [`split column`](/commands/docs/split_column.md) | Builtin | Split a string into multiple columns using a separator. | -| [`split list`](/commands/docs/split_list.md) | Builtin | Split a list into multiple lists using a separator. | -| [`split row`](/commands/docs/split_row.md) | Builtin | Split a string into multiple rows using a separator. | -| [`split words`](/commands/docs/split_words.md) | Builtin | Split a string's words into separate rows. | \ No newline at end of file diff --git a/commands/docs/stor.md b/commands/docs/stor.md deleted file mode 100644 index 7159d39922c..00000000000 --- a/commands/docs/stor.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: stor -categories: | - database -version: 0.90.0 -database: | - Various commands for working with the in-memory sqlite database. -usage: | - Various commands for working with the in-memory sqlite database. -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for database - -<div class='command-title'>{{ $frontmatter.database }}</div> - -## Signature - -```> stor {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ---------------------------------------------- | ------- | --------------------------------------------------------------------------- | -| [`stor create`](/commands/docs/stor_create.md) | Builtin | Create a table in the in-memory sqlite database. | -| [`stor delete`](/commands/docs/stor_delete.md) | Builtin | Delete a table or specified rows in the in-memory sqlite database. | -| [`stor export`](/commands/docs/stor_export.md) | Builtin | Export the in-memory sqlite database to a sqlite database file. | -| [`stor import`](/commands/docs/stor_import.md) | Builtin | Import a sqlite database file into the in-memory sqlite database. | -| [`stor insert`](/commands/docs/stor_insert.md) | Builtin | Insert information into a specified table in the in-memory sqlite database. | -| [`stor open`](/commands/docs/stor_open.md) | Builtin | Opens the in-memory sqlite database. | -| [`stor reset`](/commands/docs/stor_reset.md) | Builtin | Reset the in-memory database by dropping all tables. | -| [`stor update`](/commands/docs/stor_update.md) | Builtin | Update information in a specified table in the in-memory sqlite database. | \ No newline at end of file diff --git a/commands/docs/str.md b/commands/docs/str.md deleted file mode 100644 index e02b3674369..00000000000 --- a/commands/docs/str.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: str -categories: | - strings -version: 0.90.0 -strings: | - Various commands for working with string data. -usage: | - Various commands for working with string data. -feature: extra ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for strings - -<div class='command-title'>{{ $frontmatter.strings }}</div> - - -::: warning - Command `str` was not included in the official binaries by default, you have to build it with `--features=extra` flag -::: -## Signature - -```> str {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ------------------------------------------------------------------------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| [`str camel-case`](/commands/docs/str_camel-case.md) | Builtin | Convert a string to camelCase. | -| [`str capitalize`](/commands/docs/str_capitalize.md) | Builtin | Capitalize first letter of text. | -| [`str contains`](/commands/docs/str_contains.md) | Builtin | Checks if string input contains a substring. | -| [`str distance`](/commands/docs/str_distance.md) | Builtin | Compare two strings and return the edit distance/Levenshtein distance. | -| [`str downcase`](/commands/docs/str_downcase.md) | Builtin | Make text lowercase. | -| [`str ends-with`](/commands/docs/str_ends-with.md) | Builtin | Check if an input ends with a string. | -| [`str escape-glob`](/commands/docs/str_escape-glob.md) | Builtin | Escape glob pattern. | -| [`str expand`](/commands/docs/str_expand.md) | Builtin | Generates all possible combinations defined in brace expansion syntax. | -| [`str index-of`](/commands/docs/str_index-of.md) | Builtin | Returns start index of first occurrence of string in input, or -1 if no match. | -| [`str join`](/commands/docs/str_join.md) | Builtin | Concatenate multiple strings into a single string, with an optional separator between each. | -| [`str kebab-case`](/commands/docs/str_kebab-case.md) | Builtin | Convert a string to kebab-case. | -| [`str length`](/commands/docs/str_length.md) | Builtin | Output the length of any strings in the pipeline. | -| [`str pascal-case`](/commands/docs/str_pascal-case.md) | Builtin | Convert a string to PascalCase. | -| [`str replace`](/commands/docs/str_replace.md) | Builtin | Find and replace text. | -| [`str reverse`](/commands/docs/str_reverse.md) | Builtin | Reverse every string in the pipeline. | -| [`str screaming-snake-case`](/commands/docs/str_screaming-snake-case.md) | Builtin | Convert a string to SCREAMING_SNAKE_CASE. | -| [`str snake-case`](/commands/docs/str_snake-case.md) | Builtin | Convert a string to snake_case. | -| [`str starts-with`](/commands/docs/str_starts-with.md) | Builtin | Check if an input starts with a string. | -| [`str stats`](/commands/docs/str_stats.md) | Builtin | Gather word count statistics on the text. | -| [`str substring`](/commands/docs/str_substring.md) | Builtin | Get part of a string. Note that the start is included but the end is excluded, and that the first character of a string is index 0. | -| [`str title-case`](/commands/docs/str_title-case.md) | Builtin | Convert a string to Title Case. | -| [`str trim`](/commands/docs/str_trim.md) | Builtin | Trim whitespace or specific character. | -| [`str upcase`](/commands/docs/str_upcase.md) | Builtin | Make text uppercase. | \ No newline at end of file diff --git a/commands/docs/to.md b/commands/docs/to.md deleted file mode 100644 index 3fb51f1e063..00000000000 --- a/commands/docs/to.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: to -categories: | - formats -version: 0.90.0 -formats: | - Translate structured data to a format. -usage: | - Translate structured data to a format. -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for formats - -<div class='command-title'>{{ $frontmatter.formats }}</div> - -## Signature - -```> to {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| -------------------------------------- | ------- | ------------------------------------------------------------- | -| [`to csv`](/commands/docs/to_csv.md) | Builtin | Convert table into .csv text . | -| [`to html`](/commands/docs/to_html.md) | Builtin | Convert table into simple HTML. | -| [`to json`](/commands/docs/to_json.md) | Builtin | Converts table data into JSON text. | -| [`to md`](/commands/docs/to_md.md) | Builtin | Convert table into simple Markdown. | -| [`to nuon`](/commands/docs/to_nuon.md) | Builtin | Converts table data into Nuon (Nushell Object Notation) text. | -| [`to text`](/commands/docs/to_text.md) | Builtin | Converts data into simple text. | -| [`to toml`](/commands/docs/to_toml.md) | Builtin | Convert record into .toml text. | -| [`to tsv`](/commands/docs/to_tsv.md) | Builtin | Convert table into .tsv text. | -| [`to xml`](/commands/docs/to_xml.md) | Builtin | Convert special record structure into .xml text. | -| [`to yaml`](/commands/docs/to_yaml.md) | Builtin | Convert table into .yaml/.yml text. | \ No newline at end of file diff --git a/commands/docs/url.md b/commands/docs/url.md deleted file mode 100644 index c7211688283..00000000000 --- a/commands/docs/url.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: url -categories: | - network -version: 0.90.0 -network: | - Various commands for working with URLs. -usage: | - Various commands for working with URLs. -feature: default ---- -<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> - -# <code>{{ $frontmatter.title }}</code> for network - -<div class='command-title'>{{ $frontmatter.network }}</div> - -## Signature - -```> url {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ------------------------------------------------------ | ------- | --------------------------------------------------------------------- | -| [`url build-query`](/commands/docs/url_build-query.md) | Builtin | Converts record or table into query string applying percent-encoding. | -| [`url decode`](/commands/docs/url_decode.md) | Builtin | Converts a percent-encoded web safe string to a string. | -| [`url encode`](/commands/docs/url_encode.md) | Builtin | Converts a string to a percent encoded web safe string. | -| [`url join`](/commands/docs/url_join.md) | Builtin | Converts a record to url. | -| [`url parse`](/commands/docs/url_parse.md) | Builtin | Parses a url. | \ No newline at end of file diff --git a/cookbook/help.md b/cookbook/help.md deleted file mode 100644 index 473f0dc2cbf..00000000000 --- a/cookbook/help.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: Help ---- - -# Help - -The `help` command is a good way to become familiar with all that Nu has to offer. - -### How to see all supported commands: - -```nu -help commands -``` - ---- - -### Specific information on a command - -To find more specific information on a command, use `help <COMMAND>`. This works for regular commands (i.e. `http`) and subcommands (i.e. `http get`): - -```nu -help http get -``` - -Output: - -``` -Fetch the contents from a URL. - -Performs HTTP GET operation. - -Search terms: network, fetch, pull, request, download, curl, wget - -Usage: - > http get {flags} <URL> - -Flags: - -h, --help - Display the help message for this command - -u, --user <Any> - the username when authenticating - -p, --password <Any> - the password when authenticating - -t, --timeout <Int> - timeout period in seconds - -H, --headers <Any> - custom headers you want to add - -r, --raw - fetch contents as text rather than a table - -Signatures: - <nothing> | http get <string> -> <any> - -Parameters: - URL <string>: the URL to fetch the contents from - -Examples: - http get content from example.com - > http get https://www.example.com - - http get content from example.com, with username and password - > http get -u myuser -p mypass https://www.example.com - - http get content from example.com, with custom header - > http get -H [my-header-key my-header-value] https://www.example.com -``` diff --git a/de/README.md b/de/README.md deleted file mode 100644 index 7dcf446501c..00000000000 --- a/de/README.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -home: true -heroImage: null -heroText: Nushell -tagline: Eine neue Art von Shell. -actionText: Loslegen → -actionLink: /de/book/ -features: - - title: Pipelines um jedes Betriebssystem zu steuern - details: Nu läuft auf Linux, macOS und Windows. Einmal lernen - überall verwenden. - - title: Alles sind Daten. - details: Pipelines in Nu nutzen strukturierte Daten die einfach ausgewählt, gefiltert und sortiert werden können. Nie wieder Strings parsen, sondern direkt anfangen Probleme zu lösen. - - title: Leistungsfähige Plugins - details: Nu kann dank des leistungsfähigen Plugin-Systems einfach erweitert werden. ---- - -<img src="https://www.nushell.sh/frontpage/ls-example.png" alt="Screenshot zeigt die Verwendung des ls-Befehls" class="hero"/> - -### Nu funktioniert mit existierenden Daten - -Nu versteht [JSON, YAML, XML, Excel und noch mehr](/book/loading_data.md). Es ist einfach Daten in eine Nu Pipeline zu laden ganz egal ob diese in einer Datei, einer Datenbank oder einer Web-API liegen: - -<img src="https://www.nushell.sh/frontpage/fetch-example.png" alt="Screenshot zeigt das Laden von Daten von einer Web-API" class="hero"/> - -### Nu hat tolle Fehlermeldungen - -Nu arbeitet mit typisierten Daten, wodurch Fehler abgefangen werden, die andere Shells nicht erkennen. Und falls etwas schiefgeht bekommt genau mitgeteilt wo und weshalb: - -<img src="https://www.nushell.sh/frontpage/miette-example.png" alt="Screenshot zeigt eine Fehlermeldung, wenn Nu einen type error abfängt" class="hero"/> - -## Nu installieren - -Nushell ist verfügbar [als kompiliertes Programm](https://github.com/nushell/nushell/releases), [von einem Packetmanager](https://repology.org/project/nushell/versions), und als [Source Code](https://github.com/nushell/nushell). Die detaillierten Installationsanweisungen sind [hier](/de/book/installation.md) zu finden. Oder direkt loslegen: - -#### macOS / Linux: - -```sh -$ brew install nushell -``` - -#### Windows: - -```powershell -$ winget install nushell -``` - -## Community - -Wenn es irgendwelche Fragen gibt, am besten unserem (englischsprachigen) [Discord Server](https://discord.gg/NtAbbGn) beitreten. Dort gibt es sehr viele Menschen die gerne weiterhelfen ganz egal ob man neu zu Nu ist oder nicht. - -Dazu beitragen diese Seiten zu verbessern durch [Feedback](https://github.com/nushell/nushell.github.io/issues) oder eine [Pull Request](https://github.com/nushell/nushell.github.io/pulls). diff --git a/de/book/coming_from_bash.md b/de/book/coming_from_bash.md deleted file mode 100644 index 5988fc381f3..00000000000 --- a/de/book/coming_from_bash.md +++ /dev/null @@ -1,51 +0,0 @@ -# Vergleich zu Bash - -Hinweis: Diese Tabelle geht von Nu 0.59 oder neuer aus. - -| Bash | Nu | Funktion | -| ------------------------------------ | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | -| `ls` | `ls` | Auflisten der Dateien des aktuellen Pfads | -| `ls <dir>` | `ls <dir>` | Auflisten der Dateien am angegebenen Pfad | -| `ls pattern*` | `ls pattern*` | Auflisten von Dateien, die dem gegebenen Schema/Pattern folgen | -| `ls -la` | `ls --long --all` or `ls -la` | Auflisten aller Dateien (inklusive versteckte) mit allen verfügbaren Informationen | -| `ls -d */` | `ls \| where type == Dir` | Auflisten von Ordnern | -| `find . -name *.rs` | `ls **/*.rs` | Rekursives auflisten aller Dateien, die zum gegebenen Schema/Pattern passen | -| `cd <directory>` | `cd <directory>` | Wechseln an den angegebenen Pfad | -| `cd` | `cd` | Wechseln in den HOME-Ordner | -| `cd -` | `cd -` | Wechseln an den vorherigen Pfad | -| `mkdir <path>` | `mkdir <path>` | Erzeugen des angegebenen Pfads | -| `mkdir -p <path>` | `mkdir <path>` | Erzeugen des angegebenen Pfads und weiterer Ordner wenn nötig | -| `touch test.txt` | `touch test.txt` | Erstellen einer Datei | -| `> <path>` | `\| save <path>` | Speichern eines String in eine Datei | -| `>> <path>` | `\| save --append <path>` | Anhängen eines Strings an eine Datei | -| `cat <path>` | `open --raw <path>` | Einlesen des Inhalts der angegebenen Datei (in Textform) | -| | `open <path>` | Einlesen einer Datei in Form von strukturierten Daten | -| `mv <source> <dest>` | `mv <source> <dest>` | Bewegen einer Datei an einen neuen Ort | -| `cp <source> <dest>` | `cp <source> <dest>` | Kopieren einer Datei an einen Ort | -| `cp -r <source> <dest>` | `cp -r <source> <dest>` | Kopieren eines Ordners an einen Ort (rekursiv) | -| `rm <path>` | `rm <path>` | Entfernen der angegebenen Datei | -| | `rm -t <path>` | Angegebene Datei in den Papierkorb des Systems werfen | -| `rm -rf <path>` | `rm -r <path>` | Entfernen des angegebenen Pfads rekursiv | -| `chmod` | `<Noch nicht möglich>` | Ändern von Dateiattributen | -| `date -d <date>` | `"<date>" \| into datetime -f <format>` | Datum ausgeben ([Dokumentation des Formats](https://docs.rs/chrono/0.4.15/chrono/format/strftime/index.html)) | -| `sed` | `str find-replace` | Suchen und ersetzen eines Pattern in einem String | -| `grep <pattern>` | `where $it =~ <substring>` or `find <substring>` | Filtern von Strings die den Substring beinhalten | -| `man <command>` | `help <command>` | Hilfe zu einem Befehl ansehen | -| | `help commands` | Alle verfügbaren Befehle anzeigen | -| | `help --find <string>` | Nach einem Text in allen verfügbaren Befehlen suchen | -| `command1 && command2` | `command1; command2` | Ausführen eines Befehls und wenn Ausführung erfolgreich wird ein weiterer Befehl ausgeführt | -| `stat $(which git)` | `stat (which git).path` | Ausgabe eines Befehls als Eingabe für einen anderen Befehl verwenden | -| `echo $PATH` | `echo $env.PATH` | Aktuelle PATH-Variable anzeigen | -| `<update ~/.bashrc>` | `vim $nu.config-path` | PATH permanent ändern | -| `export PATH = $PATH:/usr/other/bin` | `$env.PATH = ($env.PATH \| append /usr/other/bin)` | PATH temporär ändern | -| `export` | `echo $env` | Anzeigen der aktuellen Umgebungsvariablen | -| `<update ~/.bashrc>` | `vim $nu.config-path` | Umgebungsvariablen permanent ändern | -| `FOO=BAR ./bin` | `FOO=BAR ./bin` | Umgebungsvariablen temporär ändern | -| `export FOO=BAR` | `$env.FOO = BAR` | Umgebungsvariable für aktuelle Sitzung setzen | -| `echo $FOO` | `echo $env.FOO` | Umgebungsvariablen nutzen | -| `unset FOO` | `hide FOO` | Umgebungsvariable für aktuelle Sitzung verbergen | -| `alias s="git status -sb"` | `alias s = git status -sb` | Alias temporär definieren | -| `<update ~/.bashrc>` | `vim $nu.config-path` | Alias permanent hinzufügen und ändern (für neue Shells) | -| `bash -c <commands>` | `nu -c <commands>` | Ausführen einer Pipeline an Befehlen (benötigt 0.9.1 oder neuer) | -| `bash <script file>` | `nu <script file>` | Ausführen einer Skriptdatei (benötigt 0.9.1 oder neuer) | -| `\` | `(` gefolgt von `)` | Fortsetzen von Zeilen | diff --git a/es/README.md b/es/README.md deleted file mode 100755 index ab693699469..00000000000 --- a/es/README.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -home: true -heroImage: null -heroText: Nushell -tagline: Un nuevo tipo de shell. -actionText: Empieza → -actionLink: /es/book/ -features: - - title: Pipelines potentes para controlar tu sistema - details: Pipelines permiten trabajar con tu sistema como nunca antes. Tienes el control del sistema, listo para tu siguiente comando. - - title: Todo es data. - details: En lugar de tener la necesidad de recordar todos los parámetros de todos los comandos, podemos usar los mismos, independientemente de su procedencia. - - title: Plugins - details: Nu no puede incluir todo lo que quieras hacer con él, por lo que puedes extenderlo usando su sistema fuerte de plugins. -footer: Sugerencias o propuestas de cambios son bienvenidas. Escríbenos ---- - -### Instalación rápida - -#### Ultima versión - -Instala la última versión en la [pagina de releases](https://github.com/nushell/nushell/releases) - -Desde la fuente en [crates.io](https://crates.io): - -```sh -$ cargo install nu -``` - -#### Instalación a través de resolvedores de paquetes - -En [Homebrew](https://brew.sh/): - -```sh -$ brew install nushell -``` - -En [Scoop](https://scoop.sh): - -```powershell -$ scoop install nu -``` - -#### Inicia la shell - -``` -$ nu -``` diff --git a/es/book/explorando.md b/es/book/explorando.md deleted file mode 100644 index 0a3c7370992..00000000000 --- a/es/book/explorando.md +++ /dev/null @@ -1,53 +0,0 @@ -# Explorando en el sistema - -Shells de antes permiten explorar el sistema de archivos y ejecutar comandos. Shells modernas como Nu permiten hacer lo mismo. Miremos algunos comandos comunes que puedas usar cuando interactues con el sistema. - -## Ver contenido de un directorio - -@[code](@snippets/moving_around/ls_example.sh) - -Cómo hemos visto en otros capítulos, `ls` es un comando para mirar el contenido de una ruta. Nu devolverá el contenido en una tabla que podemos usar. - -El comando `ls` también recibe un argumento opcional para cambiar qué te gustaría ver. Por ejemplo, podemos enumerar los archivos que terminan en ".md" - -@[code](@snippets/moving_around/ls_shallow_glob_example.sh) - -El asterisco (\*) en el argumento que pasamos "\*.md" a veces se llama comodín o glob. Nos permite complementar cualquier cosa. Puedes leer el glob "\*.md" como "complementa cualquier archivo siempre y cuando termine en '.md'" - -Nu también usa globs modernos permitiendo acceder directorios más profundos. - -@[code](@snippets/moving_around/ls_deep_glob_example.sh) - -Aquí, buscamos cualquier archivo que termine con ".md", y los dos asteriscos dicen además "en cualquier directorio que comience desde aquí". - -## Cambiar el directorio actual - -@[code](@snippets/moving_around/cd_example.sh) - -Para cambiar del directorio actual a uno nuevo usamos el comando `cd`. Al igual que en otras shells, podemos usar tanto el nombre del directorio o si deseamos subir a un directorio podemos usar el acceso directo `..`. - -También se puede cambiar el directorio si se omite `cd` y se proporciona una ruta por si sola: - -@[code](@snippets/moving_around/cd_without_command_example.sh) - -## Comandos del sistema de archivos - -Nu también proporciona algunos comandos básicos del sistema de archivos que funcionan multiplataforma. - -Podemos mover un item de un lugar a otro usando el comando `mv`: - -@[code](@snippets/moving_around/mv_example.sh) - -Podemos copiar un item de un lugar a otro: - -@[code](@snippets/moving_around/cp_example.sh) - -Podemos eliminar un item. - -@[code](@snippets/moving_around/rm_example.sh) - -Los tres comandos también pueden usar las capacidades de glob que vimos previamente con `ls`. - -Finalmente, podemos crear un directorio usando el comando `mkdir`: - -@[code](@snippets/moving_around/mkdir_example.sh) diff --git a/es/book/llegando_de_bash.md b/es/book/llegando_de_bash.md deleted file mode 100644 index 618fa8f0a94..00000000000 --- a/es/book/llegando_de_bash.md +++ /dev/null @@ -1,50 +0,0 @@ -# Llegando desde Bash - -Nota: Esta tabla asume Nushell 0.14.1 or posterior. - -| Bash | Nu | Task | -| ------------------------------------ | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | -| `ls` | `ls` | Lists the files in the current directory | -| `ls <dir>` | `ls <dir>` | Lists the files in the given directory | -| `ls pattern*` | `ls pattern*` | Lists files that match a given pattern | -| `ls -la` | `ls --long --all` or `ls -la` | List files with all available information, including hidden files | -| `ls -d */` | `ls \| where type == Dir` | List directories | -| `find . -name *.rs` | `ls **/*.rs` | Find recursively all files that match a given pattern | -| `cd <directory>` | `cd <directory>` | Change to the given directory | -| `cd` | `cd` | Change to the home directory | -| `mkdir <path>` | `mkdir <path>` | Creates the given path | -| `mkdir -p <path>` | `mkdir <path>` | Creates the given path, creating parents as necessary | -| `touch test.txt` | `touch test.txt` | Create a file | -| `> <path>` | `\| save --raw <path>` | Save string into a file | -| `cat <path>` | `open --raw <path>` | Display the contents of the given file | -| | `open <path>` | Read a file as structured data | -| `mv <source> <dest>` | `mv <source> <dest>` | Move file to new location | -| `cp <source> <dest>` | `cp <source> <dest>` | Copy file to new location | -| `cp -r <source> <dest>` | `cp -r <source> <dest>` | Copy directory to a new location, recursively | -| `rm <path>` | `rm <path>` | Remove the given file | -| | `rm -t <path>` | Move the given file to the system trash | -| `rm -rf <path>` | `rm -r <path>` | Recursively removes the given path | -| `chmod` | `<not yet possible>` | Changes the file attributes | -| `date -d <date>` | `echo <date> \| str to-datetime -f <format>` | Parse a date ([format documentation](https://docs.rs/chrono/0.4.15/chrono/format/strftime/index.html)) | -| `sed` | `str find-replace` | Find and replace a pattern in a string | -| `grep <pattern>` | `where $it =~ <substring>` | Filter strings that contain the substring | -| `man <command>` | `help <command>` | Get the help for a given command | -| | `help commands` | List all available commands | -| | `help --find <string>` | Search for match in all available commands | -| `command1 && command2` | `command1; command2` | Run a command, and if it's successful run a second | -| `stat $(which git)` | `stat (which git).path` | Use command output as argument for other command | -| `echo $PATH` | `echo $nu.path` | See the current path | -| `<update ~/.bashrc>` | `config set path [<dir1> <dir2> ...]` | Update PATH permanently | -| `export PATH = $PATH:/usr/other/bin` | `pathvar add <path>` | Update PATH temporarily | -| `export` | `echo $nu.env` | List the current environment variables | -| `<update ~/.bashrc>` | `echo $nu.env \| insert var value \| config set_into env` | Update environment variables permanently | -| `FOO=BAR ./bin` | `FOO=BAR ./bin` | Update environment temporarily | -| `export FOO=BAR` | `$env.FOO = BAR` | Set environment variable for current session | -| `unset FOO` | `$env.FOO = $nothing` | Unset environment variable for current session | -| `alias s="git status -sb"` | `alias s = git status -sb` | Define an alias temporarily | -| `<update ~/.bashrc>` | `config set [startup ["alias myecho [msg] { echo Hello $msg }"]]` | Add a first alias permanently (for new shells) | -| `<update ~/.bashrc>` | `config get startup \| append "alias s [] { git status -sb }" \| config set_into startup` | Add an additional alias permanently (for new shells) | -| `<update ~/.bashrc>` | `<update nu/config.toml>` | Add and edit alias permanently (for new shells), find path for the file with `config path` | -| `bash -c <commands>` | `nu -c <commands>` | Run a pipeline of commands (requires 0.9.1 or later) | -| `bash <script file>` | `nu <script file>` | Run a script file (requires 0.9.1 or later) | -| `\` | `<not yet possible>` | Line continuation is not yet supported. | diff --git a/ja/README.md b/ja/README.md deleted file mode 100755 index e4e30b3fd61..00000000000 --- a/ja/README.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -home: true -heroImage: null -heroText: Nushell -tagline: 新しいタイプのシェル -actionText: 始める → -actionLink: /ja/book/ -features: - - title: あらゆるOSを制御するパイプライン - details: Nuは、Linux、macOS、Windowsで動作します。一度身に付ければ、どこでも使えるようになります。 - - title: すべてはデータである - details: Nuパイプラインは構造化されたデータを使用するため、毎回同じ方法で安全に選択、フィルタリング、ソートを行うことができます。文字列をパースするのをやめて、問題を解決しましょう。 - - title: 強力なプラグイン - details: 強力なプラグインシステムを使って、Nuを簡単に拡張することができます。 ---- - -<img src="https://www.nushell.sh/frontpage/ls-example.png" alt="Screenshot showing using the ls command" class="hero"/> - -### Nu は既存のデータとの連携が可能 - -Nu はでは[JSON, YAML, XML, Excel and more](/book/loading_data.md)を標準サポートしています。ファイル、データベース、Web API など、どのようなデータでも簡単に Nu パイプラインに取り込むことができます。 - -<img src="https://www.nushell.sh/frontpage/fetch-example.png" alt="Screenshot showing fetch with a web API" class="hero"/> - -### Nu のエラーメッセージは非常に分かりやすい - -Nu は型付けされたデータを操作するので、他のシェルでは見つけられないバグを発見することができます。そして、壊れたときには、どこで、なぜ壊れたかを正確に教えてくれます。 - -<img src="https://www.nushell.sh/frontpage/miette-example.png" alt="Screenshot showing Nu catching a type error" class="hero"/> - -## Nu をインストールする - -Nushell は、[バイナリのダウンロード](https://github.com/nushell/nushell/releases)、[パッケージマネージャによるインストール](https://repology.org/project/nushell/versions)、[ソースコードによるインストール](https://github.com/nushell/nushell)を提供しています。 [詳細なインストール方法](/book/installation.md)を読むかもしくは、下記のようにインストールすることもできます。 - -#### macOS / Linux: - -```sh -$ brew install nushell -``` - -#### Windows: - -```powershell -$ winget install nushell -``` - -## Nu を Github Actions で利用する - -Github Actions で `Nushell` を使うこともできます。 [`setup-nu`](https://github.com/marketplace/actions/setup-nu) が用意されているので、それを使ってください。 - -## コミュニティ - -Nu に関する質問がある場合は[Discord](https://discord.gg/NtAbbGn)に参加してください! - -サイトの改善には、[フィードバック](https://github.com/nushell/nushell.github.io/issues)や[PR](https://github.com/nushell/nushell.github.io/pulls)をお寄せください。 diff --git a/ja/book/coming_from_bash.md b/ja/book/coming_from_bash.md deleted file mode 100644 index 6ddc7a111a8..00000000000 --- a/ja/book/coming_from_bash.md +++ /dev/null @@ -1,49 +0,0 @@ -# Bash から来た人向け - -注: このテーブルは Nu 1.14.1 以降を想定しています。 - -| Bash | Nu | Task | -| ------------------------------------ | ----------------------------------------------- | ------------------------------------------------------------------------------------------ | -| `ls` | `ls` | Lists the files in the current directory | -| `ls <dir>` | `ls <dir>` | Lists the files in the given directory | -| `ls pattern*` | `ls pattern*` | Lists files that match a given pattern | -| `ls -la` | `ls --long --all` or `ls -la` | List files with all available information, including hidden files | -| `ls -d */` | `ls \| where type == Dir` | List directories | -| `find . -name *.rs` | `ls **/*.rs` | Find recursively all files that match a given pattern | -| `cd <directory>` | `cd <directory>` | Change to the given directory | -| `cd` | `cd` | Change to the home directory | -| `mkdir <path>` | `mkdir <path>` | Creates the given path | -| `mkdir -p <path>` | `mkdir <path>` | Creates the given path, creating parents as necessary | -| `touch test.txt` | `touch test.txt` | Create a file | -| `> <path>` | `\| save --raw <path>` | Save string into a file | -| `cat <path>` | `open --raw <path>` | Display the contents of the given file | -| | `open <path>` | Read a file as structured data | -| `mv <source> <dest>` | `mv <source> <dest>` | Move file to new location | -| `cp <source> <dest>` | `cp <source> <dest>` | Copy file to new location | -| `cp -r <source> <dest>` | `cp -r <source> <dest>` | Copy directory to a new location, recursively | -| `rm <path>` | `rm <path>` | Remove the given file | -| | `rm -t <path>` | Move the given file to the system trash | -| `rm -rf <path>` | `rm -r <path>` | Recursively removes the given path | -| `chmod` | `<not yet possible>` | Changes the file attributes | -| `date -d <date>` | `echo <date> \| str to-datetime -f <format>` | Parse a date ([format documentation](https://docs.rs/chrono/0.4.15/chrono/format/strftime/index.html)) | -| `sed` | `str find-replace` | Find and replace a pattern in a string | -| `grep <pattern>` | `where $it =~ <substring>` | Filter strings that contain the substring | -| `man <command>` | `help <command>` | Get the help for a given command | -| | `help commands` | List all available commands | -| | `help --find <string>` | Search for match in all available commands | -| `command1 && command2` | `command1; command2` | Run a command, and if it's successful run a second | -| `stat $(which git)` | `stat (which git).path` | Use command output as argument for other command | -| `echo $PATH` | `echo $nu.path` | See the current path | -| `<update ~/.bashrc>` | `config set path [<dir1> <dir2> ...]` | Update PATH permanently | -| `export PATH = $PATH:/usr/other/bin` | `pathvar add <path>` | Update PATH temporarily | -| `export` | `echo $nu.env` | List the current environment variables | -| `<update ~/.bashrc>` | `echo $nu.env \| insert var value \| config set_into env` | Update environment variables permanently | -| `FOO=BAR ./bin` | `FOO=BAR ./bin` | Update environment temporarily | -| `export FOO=BAR` | `$env.FOO = BAR` | Set environment variable for current session | -| `unset FOO` | `$env.FOO = $nothing` | Unset environment variable for current session | -| `alias s="git status -sb"` | `alias s = git status -sb` | Define an alias temporarily | -| `<update ~/.bashrc>` | `alias --save myecho [msg] { echo Hello $msg }` | Define an alias for all sessions (persist it in startup config) | -| `<update ~/.bashrc>` | `<update nu/config.toml>` | Add and edit alias permanently (for new shells), find path for the file with `config path` | -| `bash -c <commands>` | `nu -c <commands>` | Run a pipeline of commands (requires 0.9.1 or later) | -| `bash <script file>` | `nu <script file>` | Run a script file (requires 0.9.1 or later) | -| `\` | `<not yet possible>` | Line continuation is not yet supported. | diff --git a/ja/book/table_of_contents.md b/ja/book/table_of_contents.md deleted file mode 100644 index a3c08d15c04..00000000000 --- a/ja/book/table_of_contents.md +++ /dev/null @@ -1,14 +0,0 @@ -# 目次 - -- [インストール](installation.md) - nushell のインストール -- [はじめに](introduction.md) - nushell をはじめよう -- [ファイルシステムの操作](moving_around.md) - nushell からファイルシステムを扱おう -- [データ型](types_of_data.md) - nushell のデータ型 -- [データの読み込み](loading_data.md) - データの読み込みとその利用方法 -- [テーブル](working_with_tables.md) - テーブルを利用してみよう -- [パイプライン](pipeline.md) - パイプラインの仕組み -- [設定](configuration.md) - nushell の設定 -- [メタデータ](metadata.md) - nushell におけるメタデータについて -- [シェル](shells_in_shells.md) - 複数の場所で作業しよう -- [コマンドのエスケープ](escaping.md) - Nu コマンドと同じ名前のコマンドを実行するには -- [プラグイン](plugins.md) - プラグインを利用して nushell を拡張する diff --git a/lang-guide/lang-guide.md b/lang-guide/lang-guide.md index 3fc7619d537..f7d6e3600bd 100644 --- a/lang-guide/lang-guide.md +++ b/lang-guide/lang-guide.md @@ -1,4 +1,6 @@ -# The Nushell Language +--- +title: The Nushell Language +--- ## Basic Types diff --git a/make_docs.nu b/make_docs.nu index e11a1eb0dea..bc433680344 100644 --- a/make_docs.nu +++ b/make_docs.nu @@ -2,7 +2,7 @@ # # # Examples # using the standard library -# ```nushell +# ```nu # use std.nu # # std assert eq ("foo/bar baz/foooo" | safe-path) "foo/bar_baz/foooo" diff --git a/package-lock.json b/package-lock.json index b892c87d1d3..170a008c748 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,207 +7,481 @@ "": { "name": "nushell.github.io", "version": "0.0.0", - "hasInstallScript": true, "license": "MIT", + "dependencies": { + "@astrojs/check": "^0.5.6", + "@astrojs/starlight": "^0.21.1", + "astro": "^4.4.11", + "sharp": "^0.33.2", + "typescript": "^5.3.3" + }, "devDependencies": { - "@vuepress/plugin-back-to-top": "2.0.0-rc.0", - "@vuepress/plugin-docsearch": "2.0.0-rc.0", - "@vuepress/plugin-git": "2.0.0-rc.0", - "@vuepress/plugin-medium-zoom": "2.0.0-rc.0", - "@vuepress/plugin-shiki": "^2.0.0-rc.0", - "@vuepress/theme-default": "2.0.0-rc.0", - "lefthook": "^1.6.1", - "patch-package": "^8.0.0", - "prettier": "^3.2.4", - "shiki": "^1.0.0-beta.2", - "vuepress": "2.0.0-rc.0", - "vuepress-plugin-feed2": "2.0.0-rc.10", - "vuepress-plugin-sitemap2": "2.0.0-rc.10" + "@biomejs/biome": "1.5.3", + "prettier": "^3.2.5", + "prettier-plugin-astro": "^0.13.0" }, "engines": { "node": ">=18.12.0", "npm": ">=9.0.0" } }, - "node_modules/@algolia/autocomplete-core": { - "version": "1.9.3", - "resolved": "https://registry.npmmirror.com/@algolia/autocomplete-core/-/autocomplete-core-1.9.3.tgz", - "integrity": "sha512-009HdfugtGCdC4JdXUbVJClA0q0zh24yyePn+KUGk3rP7j8FEe/m5Yo/z65gn6nP/cM39PxpzqKrL7A6fP6PPw==", - "dev": true, + "node_modules/@ampproject/remapping": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", "dependencies": { - "@algolia/autocomplete-plugin-algolia-insights": "1.9.3", - "@algolia/autocomplete-shared": "1.9.3" + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" } }, - "node_modules/@algolia/autocomplete-plugin-algolia-insights": { - "version": "1.9.3", - "resolved": "https://registry.npmmirror.com/@algolia/autocomplete-plugin-algolia-insights/-/autocomplete-plugin-algolia-insights-1.9.3.tgz", - "integrity": "sha512-a/yTUkcO/Vyy+JffmAnTWbr4/90cLzw+CC3bRbhnULr/EM0fGNvM13oQQ14f2moLMcVDyAx/leczLlAOovhSZg==", - "dev": true, + "node_modules/@astrojs/check": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/@astrojs/check/-/check-0.5.6.tgz", + "integrity": "sha512-i7j5ogoSg/Bu2NV5zVvwCo9R4kGWXWsJDejxpCu9F7iNNlR333u8EwpP4bpeKASDtjOA1rXKo9ogUTEVlIAHqA==", "dependencies": { - "@algolia/autocomplete-shared": "1.9.3" + "@astrojs/language-server": "^2.7.6", + "chokidar": "^3.5.3", + "fast-glob": "^3.3.1", + "kleur": "^4.1.5", + "yargs": "^17.7.2" + }, + "bin": { + "astro-check": "dist/bin.js" + }, + "peerDependencies": { + "typescript": "^5.0.0" + } + }, + "node_modules/@astrojs/compiler": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.5.3.tgz", + "integrity": "sha512-jzj01BRv/fmo+9Mr2FhocywGzEYiyiP2GVHje1ziGNU6c97kwhYGsnvwMkHrncAy9T9Vi54cjaMK7UE4ClX4vA==" + }, + "node_modules/@astrojs/internal-helpers": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.2.1.tgz", + "integrity": "sha512-06DD2ZnItMwUnH81LBLco3tWjcZ1lGU9rLCCBaeUCGYe9cI0wKyY2W3kDyoW1I6GmcWgt1fu+D1CTvz+FIKf8A==" + }, + "node_modules/@astrojs/language-server": { + "version": "2.7.6", + "resolved": "https://registry.npmjs.org/@astrojs/language-server/-/language-server-2.7.6.tgz", + "integrity": "sha512-NhMSmMAuKBMXnvpfn9eYPR7R6zOasAjRb+ta8L+rCHHuKzUc0lBgAF5M6rx01FJqlpGqeqao13eYt4287Ze49g==", + "dependencies": { + "@astrojs/compiler": "^2.4.0", + "@jridgewell/sourcemap-codec": "^1.4.15", + "@volar/kit": "~2.0.4", + "@volar/language-core": "~2.0.4", + "@volar/language-server": "~2.0.4", + "@volar/language-service": "~2.0.4", + "@volar/typescript": "~2.0.4", + "fast-glob": "^3.2.12", + "volar-service-css": "0.0.30", + "volar-service-emmet": "0.0.30", + "volar-service-html": "0.0.30", + "volar-service-prettier": "0.0.30", + "volar-service-typescript": "0.0.30", + "volar-service-typescript-twoslash-queries": "0.0.30", + "vscode-html-languageservice": "^5.1.2", + "vscode-uri": "^3.0.8" + }, + "bin": { + "astro-ls": "bin/nodeServer.js" }, "peerDependencies": { - "search-insights": ">= 1 < 3" + "prettier": "^3.0.0", + "prettier-plugin-astro": ">=0.11.0" + }, + "peerDependenciesMeta": { + "prettier": { + "optional": true + }, + "prettier-plugin-astro": { + "optional": true + } } }, - "node_modules/@algolia/autocomplete-preset-algolia": { - "version": "1.9.3", - "resolved": "https://registry.npmmirror.com/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.9.3.tgz", - "integrity": "sha512-d4qlt6YmrLMYy95n5TB52wtNDr6EgAIPH81dvvvW8UmuWRgxEtY0NJiPwl/h95JtG2vmRM804M0DSwMCNZlzRA==", - "dev": true, - "dependencies": { - "@algolia/autocomplete-shared": "1.9.3" + "node_modules/@astrojs/markdown-remark": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@astrojs/markdown-remark/-/markdown-remark-4.2.1.tgz", + "integrity": "sha512-2RQBIwrq+2qPYtp99bH+eL5hfbK0BoxXla85lHsRpIX/IsGqFrPX6pXI2cbWPihBwGbKCdxS6uZNX2QerZWwpQ==", + "dependencies": { + "@astrojs/prism": "^3.0.0", + "github-slugger": "^2.0.0", + "import-meta-resolve": "^4.0.0", + "mdast-util-definitions": "^6.0.0", + "rehype-raw": "^7.0.0", + "rehype-stringify": "^10.0.0", + "remark-gfm": "^4.0.0", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.0.0", + "remark-smartypants": "^2.0.0", + "shikiji": "^0.9.18", + "unified": "^11.0.4", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.1" + } + }, + "node_modules/@astrojs/mdx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@astrojs/mdx/-/mdx-2.1.1.tgz", + "integrity": "sha512-AgGFdE7HOGmoFooGvMSatkA9FiSKwyVW7ImHot/bXJ6uAbFfu6iG2ht18Cf1pT22Hda/6iSCGWusFvBv0/EnKQ==", + "dependencies": { + "@astrojs/markdown-remark": "4.2.1", + "@mdx-js/mdx": "^3.0.0", + "acorn": "^8.11.2", + "es-module-lexer": "^1.4.1", + "estree-util-visit": "^2.0.0", + "github-slugger": "^2.0.0", + "gray-matter": "^4.0.3", + "hast-util-to-html": "^9.0.0", + "kleur": "^4.1.4", + "rehype-raw": "^7.0.0", + "remark-gfm": "^4.0.0", + "remark-smartypants": "^2.0.0", + "source-map": "^0.7.4", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.1" + }, + "engines": { + "node": ">=18.14.1" }, "peerDependencies": { - "@algolia/client-search": ">= 4.9.1 < 6", - "algoliasearch": ">= 4.9.1 < 6" + "astro": "^4.0.0" } }, - "node_modules/@algolia/autocomplete-shared": { - "version": "1.9.3", - "resolved": "https://registry.npmmirror.com/@algolia/autocomplete-shared/-/autocomplete-shared-1.9.3.tgz", - "integrity": "sha512-Wnm9E4Ye6Rl6sTTqjoymD+l8DjSTHsHboVRYrKgEt8Q7UHm9nYbqhN/i0fhUYA3OAEH7WA8x3jfpnmJm3rKvaQ==", - "dev": true, + "node_modules/@astrojs/prism": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-3.0.0.tgz", + "integrity": "sha512-g61lZupWq1bYbcBnYZqdjndShr/J3l/oFobBKPA3+qMat146zce3nz2kdO4giGbhYDt4gYdhmoBz0vZJ4sIurQ==", + "dependencies": { + "prismjs": "^1.29.0" + }, + "engines": { + "node": ">=18.14.1" + } + }, + "node_modules/@astrojs/sitemap": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@astrojs/sitemap/-/sitemap-3.0.5.tgz", + "integrity": "sha512-60eLzNjMza3ABypiQPUC6ElOSZNZeY5CwSwgJ03hfeonl+Db9x12CCzBFdTw7A5Mq+O54xEZVUrR0tB+yWgX8w==", + "dependencies": { + "sitemap": "^7.1.1", + "zod": "^3.22.4" + } + }, + "node_modules/@astrojs/starlight": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/@astrojs/starlight/-/starlight-0.21.1.tgz", + "integrity": "sha512-nQ5EwKnB3eI8jxQrbgzZJJcyxeIiL3GzsAhl//1fE541MlD+PKy53v1PsYPi/RILdjt1Pg39rf1fkJC/rhXRgw==", + "dependencies": { + "@astrojs/mdx": "^2.1.1", + "@astrojs/sitemap": "^3.0.5", + "@pagefind/default-ui": "^1.0.3", + "@types/hast": "^3.0.3", + "@types/mdast": "^4.0.3", + "astro-expressive-code": "^0.33.4", + "bcp-47": "^2.1.0", + "hast-util-from-html": "^2.0.1", + "hast-util-select": "^6.0.2", + "hast-util-to-string": "^3.0.0", + "hastscript": "^8.0.0", + "mdast-util-directive": "^3.0.0", + "mdast-util-to-markdown": "^2.1.0", + "pagefind": "^1.0.3", + "rehype": "^13.0.1", + "remark-directive": "^3.0.0", + "unified": "^11.0.4", + "unist-util-remove": "^4.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.1" + }, "peerDependencies": { - "@algolia/client-search": ">= 4.9.1 < 6", - "algoliasearch": ">= 4.9.1 < 6" + "astro": "^4.2.7" } }, - "node_modules/@algolia/cache-browser-local-storage": { - "version": "4.22.0", - "resolved": "https://registry.npmmirror.com/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.22.0.tgz", - "integrity": "sha512-uZ1uZMLDZb4qODLfTSNHxSi4fH9RdrQf7DXEzW01dS8XK7QFtFh29N5NGKa9S+Yudf1vUMIF+/RiL4i/J0pWlQ==", - "dev": true, + "node_modules/@astrojs/telemetry": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@astrojs/telemetry/-/telemetry-3.0.4.tgz", + "integrity": "sha512-A+0c7k/Xy293xx6odsYZuXiaHO0PL+bnDoXOc47sGDF5ffIKdKQGRPFl2NMlCF4L0NqN4Ynbgnaip+pPF0s7pQ==", "dependencies": { - "@algolia/cache-common": "4.22.0" + "ci-info": "^3.8.0", + "debug": "^4.3.4", + "dlv": "^1.1.3", + "dset": "^3.1.2", + "is-docker": "^3.0.0", + "is-wsl": "^3.0.0", + "which-pm-runs": "^1.1.0" + }, + "engines": { + "node": ">=18.14.1" } }, - "node_modules/@algolia/cache-common": { - "version": "4.22.0", - "resolved": "https://registry.npmmirror.com/@algolia/cache-common/-/cache-common-4.22.0.tgz", - "integrity": "sha512-TPwUMlIGPN16eW67qamNQUmxNiGHg/WBqWcrOoCddhqNTqGDPVqmgfaM85LPbt24t3r1z0zEz/tdsmuq3Q6oaA==", - "dev": true + "node_modules/@astrojs/telemetry/node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } }, - "node_modules/@algolia/cache-in-memory": { - "version": "4.22.0", - "resolved": "https://registry.npmmirror.com/@algolia/cache-in-memory/-/cache-in-memory-4.22.0.tgz", - "integrity": "sha512-kf4Cio9NpPjzp1+uXQgL4jsMDeck7MP89BYThSvXSjf2A6qV/0KeqQf90TL2ECS02ovLOBXkk98P7qVarM+zGA==", - "dev": true, + "node_modules/@babel/code-frame": { + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", "dependencies": { - "@algolia/cache-common": "4.22.0" + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@algolia/client-account": { - "version": "4.22.0", - "resolved": "https://registry.npmmirror.com/@algolia/client-account/-/client-account-4.22.0.tgz", - "integrity": "sha512-Bjb5UXpWmJT+yGWiqAJL0prkENyEZTBzdC+N1vBuHjwIJcjLMjPB6j1hNBRbT12Lmwi55uzqeMIKS69w+0aPzA==", - "dev": true, + "node_modules/@babel/compat-data": { + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", + "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.9.tgz", + "integrity": "sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw==", + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-compilation-targets": "^7.23.6", + "@babel/helper-module-transforms": "^7.23.3", + "@babel/helpers": "^7.23.9", + "@babel/parser": "^7.23.9", + "@babel/template": "^7.23.9", + "@babel/traverse": "^7.23.9", + "@babel/types": "^7.23.9", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", + "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", "dependencies": { - "@algolia/client-common": "4.22.0", - "@algolia/client-search": "4.22.0", - "@algolia/transporter": "4.22.0" + "@babel/types": "^7.23.6", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@algolia/client-analytics": { - "version": "4.22.0", - "resolved": "https://registry.npmmirror.com/@algolia/client-analytics/-/client-analytics-4.22.0.tgz", - "integrity": "sha512-os2K+kHUcwwRa4ArFl5p/3YbF9lN3TLOPkbXXXxOvDpqFh62n9IRZuzfxpHxMPKAQS3Et1s0BkKavnNP02E9Hg==", - "dev": true, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", + "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", "dependencies": { - "@algolia/client-common": "4.22.0", - "@algolia/client-search": "4.22.0", - "@algolia/requester-common": "4.22.0", - "@algolia/transporter": "4.22.0" + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@algolia/client-common": { - "version": "4.22.0", - "resolved": "https://registry.npmmirror.com/@algolia/client-common/-/client-common-4.22.0.tgz", - "integrity": "sha512-BlbkF4qXVWuwTmYxVWvqtatCR3lzXwxx628p1wj1Q7QP2+LsTmGt1DiUYRuy9jG7iMsnlExby6kRMOOlbhv2Ag==", - "dev": true, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", + "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", "dependencies": { - "@algolia/requester-common": "4.22.0", - "@algolia/transporter": "4.22.0" + "@babel/compat-data": "^7.23.5", + "@babel/helper-validator-option": "^7.23.5", + "browserslist": "^4.22.2", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@algolia/client-personalization": { - "version": "4.22.0", - "resolved": "https://registry.npmmirror.com/@algolia/client-personalization/-/client-personalization-4.22.0.tgz", - "integrity": "sha512-pEOftCxeBdG5pL97WngOBi9w5Vxr5KCV2j2D+xMVZH8MuU/JX7CglDSDDb0ffQWYqcUN+40Ry+xtXEYaGXTGow==", - "dev": true, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dependencies": { - "@algolia/client-common": "4.22.0", - "@algolia/requester-common": "4.22.0", - "@algolia/transporter": "4.22.0" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@algolia/client-search": { - "version": "4.22.0", - "resolved": "https://registry.npmmirror.com/@algolia/client-search/-/client-search-4.22.0.tgz", - "integrity": "sha512-bn4qQiIdRPBGCwsNuuqB8rdHhGKKWIij9OqidM1UkQxnSG8yzxHdb7CujM30pvp5EnV7jTqDZRbxacbjYVW20Q==", - "dev": true, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", + "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", + "dependencies": { + "@babel/types": "^7.22.15" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", + "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", "dependencies": { - "@algolia/client-common": "4.22.0", - "@algolia/requester-common": "4.22.0", - "@algolia/transporter": "4.22.0" + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/helper-validator-identifier": "^7.22.20" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@algolia/logger-common": { - "version": "4.22.0", - "resolved": "https://registry.npmmirror.com/@algolia/logger-common/-/logger-common-4.22.0.tgz", - "integrity": "sha512-HMUQTID0ucxNCXs5d1eBJ5q/HuKg8rFVE/vOiLaM4Abfeq1YnTtGV3+rFEhOPWhRQxNDd+YHa4q864IMc0zHpQ==", - "dev": true + "node_modules/@babel/helper-plugin-utils": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "engines": { + "node": ">=6.9.0" + } }, - "node_modules/@algolia/logger-console": { - "version": "4.22.0", - "resolved": "https://registry.npmmirror.com/@algolia/logger-console/-/logger-console-4.22.0.tgz", - "integrity": "sha512-7JKb6hgcY64H7CRm3u6DRAiiEVXMvCJV5gRE672QFOUgDxo4aiDpfU61g6Uzy8NKjlEzHMmgG4e2fklELmPXhQ==", - "dev": true, + "node_modules/@babel/helper-simple-access": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", "dependencies": { - "@algolia/logger-common": "4.22.0" + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@algolia/requester-browser-xhr": { - "version": "4.22.0", - "resolved": "https://registry.npmmirror.com/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.22.0.tgz", - "integrity": "sha512-BHfv1h7P9/SyvcDJDaRuIwDu2yrDLlXlYmjvaLZTtPw6Ok/ZVhBR55JqW832XN/Fsl6k3LjdkYHHR7xnsa5Wvg==", - "dev": true, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dependencies": { - "@algolia/requester-common": "4.22.0" + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@algolia/requester-common": { - "version": "4.22.0", - "resolved": "https://registry.npmmirror.com/@algolia/requester-common/-/requester-common-4.22.0.tgz", - "integrity": "sha512-Y9cEH/cKjIIZgzvI1aI0ARdtR/xRrOR13g5psCxkdhpgRN0Vcorx+zePhmAa4jdQNqexpxtkUdcKYugBzMZJgQ==", - "dev": true + "node_modules/@babel/helper-string-parser": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "engines": { + "node": ">=6.9.0" + } }, - "node_modules/@algolia/requester-node-http": { - "version": "4.22.0", - "resolved": "https://registry.npmmirror.com/@algolia/requester-node-http/-/requester-node-http-4.22.0.tgz", - "integrity": "sha512-8xHoGpxVhz3u2MYIieHIB6MsnX+vfd5PS4REgglejJ6lPigftRhTdBCToe6zbwq4p0anZXjjPDvNWMlgK2+xYA==", - "dev": true, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", + "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.9.tgz", + "integrity": "sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ==", "dependencies": { - "@algolia/requester-common": "4.22.0" + "@babel/template": "^7.23.9", + "@babel/traverse": "^7.23.9", + "@babel/types": "^7.23.9" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@algolia/transporter": { - "version": "4.22.0", - "resolved": "https://registry.npmmirror.com/@algolia/transporter/-/transporter-4.22.0.tgz", - "integrity": "sha512-ieO1k8x2o77GNvOoC+vAkFKppydQSVfbjM3YrSjLmgywiBejPTvU1R1nEvG59JIIUvtSLrZsLGPkd6vL14zopA==", - "dev": true, + "node_modules/@babel/highlight": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dependencies": { - "@algolia/cache-common": "4.22.0", - "@algolia/logger-common": "4.22.0", - "@algolia/requester-common": "4.22.0" + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.23.6", - "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.23.6.tgz", - "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==", - "dev": true, + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz", + "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==", "bin": { "parser": "bin/babel-parser.js" }, @@ -215,238 +489,449 @@ "node": ">=6.0.0" } }, - "node_modules/@docsearch/css": { - "version": "3.5.2", - "resolved": "https://registry.npmmirror.com/@docsearch/css/-/css-3.5.2.tgz", - "integrity": "sha512-SPiDHaWKQZpwR2siD0KQUwlStvIAnEyK6tAE2h2Wuoq8ue9skzhlyVQ1ddzOxX6khULnAALDiR/isSF3bnuciA==", - "dev": true - }, - "node_modules/@docsearch/js": { - "version": "3.5.2", - "resolved": "https://registry.npmmirror.com/@docsearch/js/-/js-3.5.2.tgz", - "integrity": "sha512-p1YFTCDflk8ieHgFJYfmyHBki1D61+U9idwrLh+GQQMrBSP3DLGKpy0XUJtPjAOPltcVbqsTjiPFfH7JImjUNg==", - "dev": true, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz", + "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==", "dependencies": { - "@docsearch/react": "3.5.2", - "preact": "^10.0.0" + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@docsearch/react": { - "version": "3.5.2", - "resolved": "https://registry.npmmirror.com/@docsearch/react/-/react-3.5.2.tgz", - "integrity": "sha512-9Ahcrs5z2jq/DcAvYtvlqEBHImbm4YJI8M9y0x6Tqg598P40HTEkX7hsMcIuThI+hTFxRGZ9hll0Wygm2yEjng==", - "dev": true, + "node_modules/@babel/plugin-transform-react-jsx": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.23.4.tgz", + "integrity": "sha512-5xOpoPguCZCRbo/JeHlloSkTA8Bld1J/E1/kLfD1nsuiW1m8tduTA1ERCgIZokDflX/IBzKcqR3l7VlRgiIfHA==", "dependencies": { - "@algolia/autocomplete-core": "1.9.3", - "@algolia/autocomplete-preset-algolia": "1.9.3", - "@docsearch/css": "3.5.2", - "algoliasearch": "^4.19.1" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-jsx": "^7.23.3", + "@babel/types": "^7.23.4" + }, + "engines": { + "node": ">=6.9.0" }, "peerDependencies": { - "@types/react": ">= 16.8.0 < 19.0.0", - "react": ">= 16.8.0 < 19.0.0", - "react-dom": ">= 16.8.0 < 19.0.0", - "search-insights": ">= 1 < 3" + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz", + "integrity": "sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==", + "dependencies": { + "@babel/code-frame": "^7.23.5", + "@babel/parser": "^7.23.9", + "@babel/types": "^7.23.9" }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "react": { - "optional": true - }, - "react-dom": { - "optional": true - }, - "search-insights": { - "optional": true - } + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/aix-ppc64/-/aix-ppc64-0.19.11.tgz", - "integrity": "sha512-FnzU0LyE3ySQk7UntJO4+qIiQgI7KoODnZg5xzXIrFJlKd2P2gwHsHY4927xj9y5PJmJSzULiUCWmv7iWnNa7g==", + "node_modules/@babel/traverse": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.9.tgz", + "integrity": "sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==", + "dependencies": { + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.9", + "@babel/types": "^7.23.9", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz", + "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==", + "dependencies": { + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@biomejs/biome": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.5.3.tgz", + "integrity": "sha512-yvZCa/g3akwTaAQ7PCwPWDCkZs3Qa5ONg/fgOUT9e6wAWsPftCjLQFPXBeGxPK30yZSSpgEmRCfpGTmVbUjGgg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "biome": "bin/biome" + }, + "engines": { + "node": ">=14.*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/biome" + }, + "optionalDependencies": { + "@biomejs/cli-darwin-arm64": "1.5.3", + "@biomejs/cli-darwin-x64": "1.5.3", + "@biomejs/cli-linux-arm64": "1.5.3", + "@biomejs/cli-linux-arm64-musl": "1.5.3", + "@biomejs/cli-linux-x64": "1.5.3", + "@biomejs/cli-linux-x64-musl": "1.5.3", + "@biomejs/cli-win32-arm64": "1.5.3", + "@biomejs/cli-win32-x64": "1.5.3" + } + }, + "node_modules/@biomejs/cli-darwin-arm64": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.5.3.tgz", + "integrity": "sha512-ImU7mh1HghEDyqNmxEZBoMPr8SxekkZuYcs+gynKlNW+TALQs7swkERiBLkG9NR0K1B3/2uVzlvYowXrmlW8hw==", "cpu": [ - "ppc64" + "arm64" ], "dev": true, "optional": true, "os": [ - "aix" + "darwin" ], "engines": { - "node": ">=12" + "node": ">=14.*" } }, - "node_modules/@esbuild/android-arm": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.19.11.tgz", - "integrity": "sha512-5OVapq0ClabvKvQ58Bws8+wkLCV+Rxg7tUVbo9xu034Nm536QTII4YzhaFriQ7rMrorfnFKUsArD2lqKbFY4vw==", + "node_modules/@biomejs/cli-darwin-x64": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.5.3.tgz", + "integrity": "sha512-vCdASqYnlpq/swErH7FD6nrFz0czFtK4k/iLgj0/+VmZVjineFPgevOb+Sr9vz0tk0GfdQO60bSpI74zU8M9Dw==", "cpu": [ - "arm" + "x64" ], "dev": true, "optional": true, "os": [ - "android" + "darwin" ], "engines": { - "node": ">=12" + "node": ">=14.*" } }, - "node_modules/@esbuild/android-arm64": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.19.11.tgz", - "integrity": "sha512-aiu7K/5JnLj//KOnOfEZ0D90obUkRzDMyqd/wNAUQ34m4YUPVhRZpnqKV9uqDGxT7cToSDnIHsGooyIczu9T+Q==", + "node_modules/@biomejs/cli-linux-arm64": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.5.3.tgz", + "integrity": "sha512-cupBQv0sNF1OKqBfx7EDWMSsKwRrBUZfjXawT4s6hKV6ALq7p0QzWlxr/sDmbKMLOaLQtw2Qgu/77N9rm+f9Rg==", "cpu": [ "arm64" ], "dev": true, "optional": true, "os": [ - "android" + "linux" ], "engines": { - "node": ">=12" + "node": ">=14.*" } }, - "node_modules/@esbuild/android-x64": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.19.11.tgz", - "integrity": "sha512-eccxjlfGw43WYoY9QgB82SgGgDbibcqyDTlk3l3C0jOVHKxrjdc9CTwDUQd0vkvYg5um0OH+GpxYvp39r+IPOg==", + "node_modules/@biomejs/cli-linux-arm64-musl": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.5.3.tgz", + "integrity": "sha512-DYuMizUYUBYfS0IHGjDrOP1RGipqWfMGEvNEJ398zdtmCKLXaUvTimiox5dvx4X15mBK5M2m8wgWUgOP1giUpQ==", "cpu": [ - "x64" + "arm64" ], "dev": true, "optional": true, "os": [ - "android" + "linux" ], "engines": { - "node": ">=12" + "node": ">=14.*" } }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.19.11.tgz", - "integrity": "sha512-ETp87DRWuSt9KdDVkqSoKoLFHYTrkyz2+65fj9nfXsaV3bMhTCjtQfw3y+um88vGRKRiF7erPrh/ZuIdLUIVxQ==", + "node_modules/@biomejs/cli-linux-x64": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.5.3.tgz", + "integrity": "sha512-YQrSArQvcv4FYsk7Q91Yv4uuu5F8hJyORVcv3zsjCLGkjIjx2RhjYLpTL733SNL7v33GmOlZY0eFR1ko38tuUw==", "cpu": [ - "arm64" + "x64" ], "dev": true, "optional": true, "os": [ - "darwin" + "linux" ], "engines": { - "node": ">=12" + "node": ">=14.*" } }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.19.11.tgz", - "integrity": "sha512-fkFUiS6IUK9WYUO/+22omwetaSNl5/A8giXvQlcinLIjVkxwTLSktbF5f/kJMftM2MJp9+fXqZ5ezS7+SALp4g==", + "node_modules/@biomejs/cli-linux-x64-musl": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.5.3.tgz", + "integrity": "sha512-UUHiAnlDqr2Y/LpvshBFhUYMWkl2/Jn+bi3U6jKuav0qWbbBKU/ByHgR4+NBxpKBYoCtWxhnmatfH1bpPIuZMw==", "cpu": [ "x64" ], "dev": true, "optional": true, "os": [ - "darwin" + "linux" ], "engines": { - "node": ">=12" + "node": ">=14.*" } }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.11.tgz", - "integrity": "sha512-lhoSp5K6bxKRNdXUtHoNc5HhbXVCS8V0iZmDvyWvYq9S5WSfTIHU2UGjcGt7UeS6iEYp9eeymIl5mJBn0yiuxA==", + "node_modules/@biomejs/cli-win32-arm64": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.5.3.tgz", + "integrity": "sha512-HxatYH7vf/kX9nrD+pDYuV2GI9GV8EFo6cfKkahAecTuZLPxryHx1WEfJthp5eNsE0+09STGkKIKjirP0ufaZA==", "cpu": [ "arm64" ], "dev": true, "optional": true, "os": [ - "freebsd" + "win32" ], "engines": { - "node": ">=12" + "node": ">=14.*" } }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.19.11.tgz", - "integrity": "sha512-JkUqn44AffGXitVI6/AbQdoYAq0TEullFdqcMY/PCUZ36xJ9ZJRtQabzMA+Vi7r78+25ZIBosLTOKnUXBSi1Kw==", + "node_modules/@biomejs/cli-win32-x64": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.5.3.tgz", + "integrity": "sha512-fMvbSouZEASU7mZH8SIJSANDm5OqsjgtVXlbUqxwed6BP7uuHRSs396Aqwh2+VoW8fwTpp6ybIUoC9FrzB0kyA==", "cpu": [ "x64" ], "dev": true, "optional": true, "os": [ - "freebsd" + "win32" ], "engines": { - "node": ">=12" + "node": ">=14.*" } }, - "node_modules/@esbuild/linux-arm": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.19.11.tgz", - "integrity": "sha512-3CRkr9+vCV2XJbjwgzjPtO8T0SZUmRZla+UL1jw+XqHZPkPgZiyWvbDvl9rqAN8Zl7qJF0O/9ycMtjU67HN9/Q==", + "node_modules/@ctrl/tinycolor": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz", + "integrity": "sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/@emmetio/abbreviation": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@emmetio/abbreviation/-/abbreviation-2.3.3.tgz", + "integrity": "sha512-mgv58UrU3rh4YgbE/TzgLQwJ3pFsHHhCLqY20aJq+9comytTXUDNGG/SMtSeMJdkpxgXSXunBGLD8Boka3JyVA==", + "dependencies": { + "@emmetio/scanner": "^1.0.4" + } + }, + "node_modules/@emmetio/css-abbreviation": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@emmetio/css-abbreviation/-/css-abbreviation-2.1.8.tgz", + "integrity": "sha512-s9yjhJ6saOO/uk1V74eifykk2CBYi01STTK3WlXWGOepyKa23ymJ053+DNQjpFcy1ingpaO7AxCcwLvHFY9tuw==", + "dependencies": { + "@emmetio/scanner": "^1.0.4" + } + }, + "node_modules/@emmetio/scanner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@emmetio/scanner/-/scanner-1.0.4.tgz", + "integrity": "sha512-IqRuJtQff7YHHBk4G8YZ45uB9BaAGcwQeVzgj/zj8/UdOhtQpEIupUhSk8dys6spFIWVZVeK20CzGEnqR5SbqA==" + }, + "node_modules/@emnapi/runtime": { + "version": "0.45.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-0.45.0.tgz", + "integrity": "sha512-Txumi3td7J4A/xTTwlssKieHKTGl3j4A1tglBx72auZ49YK7ePY6XZricgIg9mnZT4xPfA+UPCUdnhRuEFDL+w==", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", "cpu": [ - "arm" + "ppc64" ], - "dev": true, "optional": true, "os": [ - "linux" + "aix" ], "engines": { "node": ">=12" } }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.19.11.tgz", - "integrity": "sha512-LneLg3ypEeveBSMuoa0kwMpCGmpu8XQUh+mL8XXwoYZ6Be2qBnVtcDI5azSvh7vioMDhoJFZzp9GWp9IWpYoUg==", + "node_modules/@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", "cpu": [ - "arm64" + "arm" ], - "dev": true, "optional": true, "os": [ - "linux" + "android" ], "engines": { "node": ">=12" } }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.19.11.tgz", - "integrity": "sha512-caHy++CsD8Bgq2V5CodbJjFPEiDPq8JJmBdeyZ8GWVQMjRD0sU548nNdwPNvKjVpamYYVL40AORekgfIubwHoA==", + "node_modules/@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", "cpu": [ - "ia32" + "arm64" ], - "dev": true, "optional": true, "os": [ - "linux" + "android" ], "engines": { "node": ">=12" } }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.19.11.tgz", - "integrity": "sha512-ppZSSLVpPrwHccvC6nQVZaSHlFsvCQyjnvirnVjbKSHuE5N24Yl8F3UwYUUR1UEPaFObGD2tSvVKbvR+uT1Nrg==", + "node_modules/@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", "cpu": [ - "loong64" + "x64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "cpu": [ + "loong64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -456,13 +941,12 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.19.11.tgz", - "integrity": "sha512-B5x9j0OgjG+v1dF2DkH34lr+7Gmv0kzX6/V0afF41FkPMMqaQ77pH7CrhWeR22aEeHKaeZVtZ6yFwlxOKPVFyg==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", "cpu": [ "mips64el" ], - "dev": true, "optional": true, "os": [ "linux" @@ -472,13 +956,12 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.19.11.tgz", - "integrity": "sha512-MHrZYLeCG8vXblMetWyttkdVRjQlQUb/oMgBNurVEnhj4YWOr4G5lmBfZjHYQHHN0g6yDmCAQRR8MUHldvvRDA==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", "cpu": [ "ppc64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -488,13 +971,12 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.19.11.tgz", - "integrity": "sha512-f3DY++t94uVg141dozDu4CCUkYW+09rWtaWfnb3bqe4w5NqmZd6nPVBm+qbz7WaHZCoqXqHz5p6CM6qv3qnSSQ==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", "cpu": [ "riscv64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -504,13 +986,12 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.19.11.tgz", - "integrity": "sha512-A5xdUoyWJHMMlcSMcPGVLzYzpcY8QP1RtYzX5/bS4dvjBGVxdhuiYyFwp7z74ocV7WDc0n1harxmpq2ePOjI0Q==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", "cpu": [ "s390x" ], - "dev": true, "optional": true, "os": [ "linux" @@ -520,13 +1001,12 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.19.11.tgz", - "integrity": "sha512-grbyMlVCvJSfxFQUndw5mCtWs5LO1gUlwP4CDi4iJBbVpZcqLVT29FxgGuBJGSzyOxotFG4LoO5X+M1350zmPA==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -536,13 +1016,12 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.19.11.tgz", - "integrity": "sha512-13jvrQZJc3P230OhU8xgwUnDeuC/9egsjTkXN49b3GcS5BKvJqZn86aGM8W9pd14Kd+u7HuFBMVtrNGhh6fHEQ==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "netbsd" @@ -552,13 +1031,12 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.19.11.tgz", - "integrity": "sha512-ysyOGZuTp6SNKPE11INDUeFVVQFrhcNDVUgSQVDzqsqX38DjhPEPATpid04LCoUr2WXhQTEZ8ct/EgJCUDpyNw==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "openbsd" @@ -568,13 +1046,12 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.19.11.tgz", - "integrity": "sha512-Hf+Sad9nVwvtxy4DXCZQqLpgmRTQqyFyhT3bZ4F2XlJCjxGmRFF0Shwn9rzhOYRB61w9VMXUkxlBy56dk9JJiQ==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "sunos" @@ -584,13 +1061,12 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.19.11.tgz", - "integrity": "sha512-0P58Sbi0LctOMOQbpEOvOL44Ne0sqbS0XWHMvvrg6NE5jQ1xguCSSw9jQeUk2lfrXYsKDdOe6K+oZiwKPilYPQ==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -600,13 +1076,12 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.19.11.tgz", - "integrity": "sha512-6YOrWS+sDJDmshdBIQU+Uoyh7pQKrdykdefC1avn76ss5c+RN6gut3LZA4E2cH5xUEp5/cA0+YxRaVtRAb0xBg==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "win32" @@ -616,13 +1091,12 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.19.11.tgz", - "integrity": "sha512-vfkhltrjCAb603XaFhqhAF4LGDi2M4OrCRrFusyQ+iTLQ/o60QQXxc9cZC/FFpihBI9N1Grn6SMKVJ4KP7Fuiw==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -631,2797 +1105,6613 @@ "node": ">=12" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "node_modules/@expressive-code/core": { + "version": "0.33.4", + "resolved": "https://registry.npmjs.org/@expressive-code/core/-/core-0.33.4.tgz", + "integrity": "sha512-IywACrwcR/7cIPBQ1qG/RsgvNp85/CAX6okxR0Niztrd7rh4IcEhAsz51jX/NPNnhU9yPynTT+mLdM1URqrnvw==", + "dependencies": { + "@ctrl/tinycolor": "^3.6.0", + "hast-util-to-html": "^8.0.4", + "hastscript": "^7.2.0", + "postcss": "^8.4.21", + "postcss-nested": "^6.0.1" + } }, - "node_modules/@mdit-vue/plugin-component": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/@mdit-vue/plugin-component/-/plugin-component-1.0.0.tgz", - "integrity": "sha512-ZXsJwxkG5yyTHARIYbR74cT4AZ0SfMokFFjiHYCbypHIeYWgJhso4+CZ8+3V9EWFG3EHlGoKNGqKp9chHnqntQ==", - "dev": true, + "node_modules/@expressive-code/core/node_modules/@types/hast": { + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.10.tgz", + "integrity": "sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==", "dependencies": { - "@types/markdown-it": "^13.0.1", - "markdown-it": "^13.0.1" + "@types/unist": "^2" } }, - "node_modules/@mdit-vue/plugin-frontmatter": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/@mdit-vue/plugin-frontmatter/-/plugin-frontmatter-1.0.0.tgz", - "integrity": "sha512-MMA7Ny+YPZA7eDOY1t4E+rKuEWO39mzDdP/M68fKdXJU6VfcGkPr7gnpnJfW2QBJ5qIvMrK/3lDAA2JBy5TfpA==", - "dev": true, + "node_modules/@expressive-code/core/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/@expressive-code/core/node_modules/hast-util-from-parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-7.1.2.tgz", + "integrity": "sha512-Nz7FfPBuljzsN3tCQ4kCBKqdNhQE2l0Tn+X1ubgKBPRoiDIu1mL08Cfw4k7q71+Duyaw7DXDN+VTAp4Vh3oCOw==", "dependencies": { - "@mdit-vue/types": "1.0.0", - "@types/markdown-it": "^13.0.1", - "gray-matter": "^4.0.3", - "markdown-it": "^13.0.1" + "@types/hast": "^2.0.0", + "@types/unist": "^2.0.0", + "hastscript": "^7.0.0", + "property-information": "^6.0.0", + "vfile": "^5.0.0", + "vfile-location": "^4.0.0", + "web-namespaces": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@mdit-vue/plugin-headers": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/@mdit-vue/plugin-headers/-/plugin-headers-1.0.0.tgz", - "integrity": "sha512-0rK/iKy6x13d/Pp5XxdLBshTD0+YjZvtHIaIV+JO+/H2WnOv7oaRgs48G5d44z3XJVUE2u6fNnTlI169fef0/A==", - "dev": true, + "node_modules/@expressive-code/core/node_modules/hast-util-parse-selector": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-3.1.1.tgz", + "integrity": "sha512-jdlwBjEexy1oGz0aJ2f4GKMaVKkA9jwjr4MjAAI22E5fM/TXVZHuS5OpONtdeIkRKqAaryQ2E9xNQxijoThSZA==", "dependencies": { - "@mdit-vue/shared": "1.0.0", - "@mdit-vue/types": "1.0.0", - "@types/markdown-it": "^13.0.1", - "markdown-it": "^13.0.1" + "@types/hast": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@mdit-vue/plugin-sfc": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/@mdit-vue/plugin-sfc/-/plugin-sfc-1.0.0.tgz", - "integrity": "sha512-agMUe0fY4YHxsZivSvplBwRwrFvsIf/JNUJCAYq1+2Sg9+2hviTBZwjZDxYqHDHOVLtiNr+wuo68tE24mAx3AQ==", - "dev": true, + "node_modules/@expressive-code/core/node_modules/hast-util-raw": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-7.2.3.tgz", + "integrity": "sha512-RujVQfVsOrxzPOPSzZFiwofMArbQke6DJjnFfceiEbFh7S05CbPt0cYN+A5YeD3pso0JQk6O1aHBnx9+Pm2uqg==", + "dependencies": { + "@types/hast": "^2.0.0", + "@types/parse5": "^6.0.0", + "hast-util-from-parse5": "^7.0.0", + "hast-util-to-parse5": "^7.0.0", + "html-void-elements": "^2.0.0", + "parse5": "^6.0.0", + "unist-util-position": "^4.0.0", + "unist-util-visit": "^4.0.0", + "vfile": "^5.0.0", + "web-namespaces": "^2.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@expressive-code/core/node_modules/hast-util-to-html": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-8.0.4.tgz", + "integrity": "sha512-4tpQTUOr9BMjtYyNlt0P50mH7xj0Ks2xpo8M943Vykljf99HW6EzulIoJP1N3eKOSScEHzyzi9dm7/cn0RfGwA==", + "dependencies": { + "@types/hast": "^2.0.0", + "@types/unist": "^2.0.0", + "ccount": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-raw": "^7.0.0", + "hast-util-whitespace": "^2.0.0", + "html-void-elements": "^2.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "stringify-entities": "^4.0.0", + "zwitch": "^2.0.4" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@expressive-code/core/node_modules/hast-util-to-parse5": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-7.1.0.tgz", + "integrity": "sha512-YNRgAJkH2Jky5ySkIqFXTQiaqcAtJyVE+D5lkN6CdtOqrnkLfGYYrEcKuHOJZlp+MwjSwuD3fZuawI+sic/RBw==", "dependencies": { - "@mdit-vue/types": "1.0.0", - "@types/markdown-it": "^13.0.1", - "markdown-it": "^13.0.1" + "@types/hast": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "web-namespaces": "^2.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@mdit-vue/plugin-title": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/@mdit-vue/plugin-title/-/plugin-title-1.0.0.tgz", - "integrity": "sha512-8yC60fCZ95xcJ/cvJH4Lv43Rs4k+33UGyKrRWj5J8TNyMwUyGcwur0XyPM+ffJH4/Bzq4myZLsj/TTFSkXRxvw==", - "dev": true, + "node_modules/@expressive-code/core/node_modules/hast-util-whitespace": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz", + "integrity": "sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@expressive-code/core/node_modules/hastscript": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-7.2.0.tgz", + "integrity": "sha512-TtYPq24IldU8iKoJQqvZOuhi5CyCQRAbvDOX0x1eW6rsHSxa/1i2CCiptNTotGHJ3VoHRGmqiv6/D3q113ikkw==", "dependencies": { - "@mdit-vue/shared": "1.0.0", - "@mdit-vue/types": "1.0.0", - "@types/markdown-it": "^13.0.1", - "markdown-it": "^13.0.1" + "@types/hast": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-parse-selector": "^3.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@mdit-vue/plugin-toc": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/@mdit-vue/plugin-toc/-/plugin-toc-1.0.0.tgz", - "integrity": "sha512-WN8blfX0X/5Nolic0ClDWP7eVo9IB+U4g0jbycX3lolIZX5Bai1UpsD3QYZr5VVsPbQJMKMGvTrCEtCNTGvyWQ==", - "dev": true, + "node_modules/@expressive-code/core/node_modules/html-void-elements": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-2.0.1.tgz", + "integrity": "sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/@expressive-code/core/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + }, + "node_modules/@expressive-code/core/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", "dependencies": { - "@mdit-vue/shared": "1.0.0", - "@mdit-vue/types": "1.0.0", - "@types/markdown-it": "^13.0.1", - "markdown-it": "^13.0.1" + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@mdit-vue/shared": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/@mdit-vue/shared/-/shared-1.0.0.tgz", - "integrity": "sha512-nbYBfmEi+pR2Lm0Z6TMVX2/iBjfr/kGEsHW8CC0rQw+3+sG5dY6VG094HuFAkiAmmvZx9DZZb+7ZMWp9vkwCRw==", - "dev": true, + "node_modules/@expressive-code/core/node_modules/unist-util-position": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.4.tgz", + "integrity": "sha512-kUBE91efOWfIVBo8xzh/uZQ7p9ffYRtUbMRZBNFYwf0RK8koUMx6dGUfwylLOKmaT2cs4wSW96QoYUSXAyEtpg==", "dependencies": { - "@mdit-vue/types": "1.0.0", - "@types/markdown-it": "^13.0.1", - "markdown-it": "^13.0.1" + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@mdit-vue/types": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/@mdit-vue/types/-/types-1.0.0.tgz", - "integrity": "sha512-xeF5+sHLzRNF7plbksywKCph4qli20l72of2fMlZQQ7RECvXYrRkE9+bjRFQCyULC7B8ydUYbpbkux5xJlVWyw==", - "dev": true + "node_modules/@expressive-code/core/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmmirror.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, + "node_modules/@expressive-code/core/node_modules/unist-util-visit": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", + "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.1.1" }, - "engines": { - "node": ">= 8" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmmirror.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" + "node_modules/@expressive-code/core/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmmirror.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, + "node_modules/@expressive-code/core/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" }, - "engines": { - "node": ">= 8" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.9.2", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.2.tgz", - "integrity": "sha512-RKzxFxBHq9ysZ83fn8Iduv3A283K7zPPYuhL/z9CQuyFrjwpErJx0h4aeb/bnJ+q29GRLgJpY66ceQ/Wcsn3wA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] + "node_modules/@expressive-code/core/node_modules/vfile-location": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.1.0.tgz", + "integrity": "sha512-YF23YMyASIIJXpktBa4vIGLJ5Gs88UB/XePgqPmTa7cDA+JeO3yclbpheQYCHjVHBn/yePzrXuygIL+xbvRYHw==", + "dependencies": { + "@types/unist": "^2.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.9.2", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.2.tgz", - "integrity": "sha512-yZ+MUbnwf3SHNWQKJyWh88ii2HbuHCFQnAYTeeO1Nb8SyEiWASEi5dQUygt3ClHWtA9My9RQAYkjvrsZ0WK8Xg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] + "node_modules/@expressive-code/core/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.9.2", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.2.tgz", - "integrity": "sha512-vqJ/pAUh95FLc/G/3+xPqlSBgilPnauVf2EXOQCZzhZJCXDXt/5A8mH/OzU6iWhb3CNk5hPJrh8pqJUPldN5zw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] + "node_modules/@expressive-code/plugin-frames": { + "version": "0.33.4", + "resolved": "https://registry.npmjs.org/@expressive-code/plugin-frames/-/plugin-frames-0.33.4.tgz", + "integrity": "sha512-6HE5f8dAPjzmhs7yZJHVyH+w/UwVpktjlTvrUumrytHo6hidGlkB5lptWJlSAd9JXzev5BQEb4xrqQ0xQqO5+A==", + "dependencies": { + "@expressive-code/core": "^0.33.4", + "hastscript": "^7.2.0" + } }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.9.2", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.2.tgz", - "integrity": "sha512-otPHsN5LlvedOprd3SdfrRNhOahhVBwJpepVKUN58L0RnC29vOAej1vMEaVU6DadnpjivVsNTM5eNt0CcwTahw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] + "node_modules/@expressive-code/plugin-frames/node_modules/@types/hast": { + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.10.tgz", + "integrity": "sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==", + "dependencies": { + "@types/unist": "^2" + } }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.9.2", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.2.tgz", - "integrity": "sha512-ewG5yJSp+zYKBYQLbd1CUA7b1lSfIdo9zJShNTyc2ZP1rcPrqyZcNlsHgs7v1zhgfdS+kW0p5frc0aVqhZCiYQ==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] + "node_modules/@expressive-code/plugin-frames/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.9.2", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.2.tgz", - "integrity": "sha512-pL6QtV26W52aCWTG1IuFV3FMPL1m4wbsRG+qijIvgFO/VBsiXJjDPE/uiMdHBAO6YcpV4KvpKtd0v3WFbaxBtg==", - "cpu": [ - "arm64" - ], - "dev": true, + "node_modules/@expressive-code/plugin-frames/node_modules/hast-util-parse-selector": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-3.1.1.tgz", + "integrity": "sha512-jdlwBjEexy1oGz0aJ2f4GKMaVKkA9jwjr4MjAAI22E5fM/TXVZHuS5OpONtdeIkRKqAaryQ2E9xNQxijoThSZA==", + "dependencies": { + "@types/hast": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@expressive-code/plugin-frames/node_modules/hastscript": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-7.2.0.tgz", + "integrity": "sha512-TtYPq24IldU8iKoJQqvZOuhi5CyCQRAbvDOX0x1eW6rsHSxa/1i2CCiptNTotGHJ3VoHRGmqiv6/D3q113ikkw==", + "dependencies": { + "@types/hast": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-parse-selector": "^3.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@expressive-code/plugin-shiki": { + "version": "0.33.4", + "resolved": "https://registry.npmjs.org/@expressive-code/plugin-shiki/-/plugin-shiki-0.33.4.tgz", + "integrity": "sha512-XnDchHqCGk046hgQnu83t9+SDrRjsvpvUEBiI0wl4RljVDr1E0yllx0y6C1yEuKfFfasib6BxX/PkItgQdi/0Q==", + "dependencies": { + "@expressive-code/core": "^0.33.4", + "shiki": "^1.1.7" + } + }, + "node_modules/@expressive-code/plugin-text-markers": { + "version": "0.33.4", + "resolved": "https://registry.npmjs.org/@expressive-code/plugin-text-markers/-/plugin-text-markers-0.33.4.tgz", + "integrity": "sha512-hl3E+8iZJMYGDaKsN4bOPOEBb9QeFjg+zQkOJRtjJgsmIYmaZpoQTzTg/JMduE8PLNsD30nAMwG/AbjN/klwZQ==", + "dependencies": { + "@expressive-code/core": "^0.33.4", + "hastscript": "^7.2.0", + "unist-util-visit-parents": "^5.1.3" + } + }, + "node_modules/@expressive-code/plugin-text-markers/node_modules/@types/hast": { + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.10.tgz", + "integrity": "sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==", + "dependencies": { + "@types/unist": "^2" + } + }, + "node_modules/@expressive-code/plugin-text-markers/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/@expressive-code/plugin-text-markers/node_modules/hast-util-parse-selector": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-3.1.1.tgz", + "integrity": "sha512-jdlwBjEexy1oGz0aJ2f4GKMaVKkA9jwjr4MjAAI22E5fM/TXVZHuS5OpONtdeIkRKqAaryQ2E9xNQxijoThSZA==", + "dependencies": { + "@types/hast": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@expressive-code/plugin-text-markers/node_modules/hastscript": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-7.2.0.tgz", + "integrity": "sha512-TtYPq24IldU8iKoJQqvZOuhi5CyCQRAbvDOX0x1eW6rsHSxa/1i2CCiptNTotGHJ3VoHRGmqiv6/D3q113ikkw==", + "dependencies": { + "@types/hast": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-parse-selector": "^3.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@expressive-code/plugin-text-markers/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@expressive-code/plugin-text-markers/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.2.tgz", + "integrity": "sha512-itHBs1rPmsmGF9p4qRe++CzCgd+kFYktnsoR1sbIAfsRMrJZau0Tt1AH9KVnufc2/tU02Gf6Ibujx+15qRE03w==", + "cpu": [ + "arm64" + ], "optional": true, "os": [ - "linux" - ] + "darwin" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.0.1" + } }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.9.2", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.2.tgz", - "integrity": "sha512-On+cc5EpOaTwPSNetHXBuqylDW+765G/oqB9xGmWU3npEhCh8xu0xqHGUA+4xwZLqBbIZNcBlKSIYfkBm6ko7g==", + "node_modules/@img/sharp-darwin-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.2.tgz", + "integrity": "sha512-/rK/69Rrp9x5kaWBjVN07KixZanRr+W1OiyKdXcbjQD6KbW+obaTeBBtLUAtbBsnlTTmWthw99xqoOS7SsySDg==", "cpu": [ - "arm64" + "x64" ], - "dev": true, "optional": true, "os": [ - "linux" - ] + "darwin" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.0.1" + } }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.9.2", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.2.tgz", - "integrity": "sha512-Wnx/IVMSZ31D/cO9HSsU46FjrPWHqtdF8+0eyZ1zIB5a6hXaZXghUKpRrC4D5DcRTZOjml2oBhXoqfGYyXKipw==", + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.1.tgz", + "integrity": "sha512-kQyrSNd6lmBV7O0BUiyu/OEw9yeNGFbQhbxswS1i6rMDwBBSX+e+rPzu3S+MwAiGU3HdLze3PanQ4Xkfemgzcw==", "cpu": [ - "riscv64" + "arm64" ], - "dev": true, "optional": true, "os": [ - "linux" - ] + "darwin" + ], + "engines": { + "macos": ">=11", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.9.2", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.2.tgz", - "integrity": "sha512-ym5x1cj4mUAMBummxxRkI4pG5Vht1QMsJexwGP8547TZ0sox9fCLDHw9KCH9c1FO5d9GopvkaJsBIOkTKxksdw==", + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.1.tgz", + "integrity": "sha512-eVU/JYLPVjhhrd8Tk6gosl5pVlvsqiFlt50wotCvdkFGf+mDNBJxMh+bvav+Wt3EBnNZWq8Sp2I7XfSjm8siog==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ - "linux" - ] + "darwin" + ], + "engines": { + "macos": ">=10.13", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.9.2", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.2.tgz", - "integrity": "sha512-m0hYELHGXdYx64D6IDDg/1vOJEaiV8f1G/iO+tejvRCJNSwK4jJ15e38JQy5Q6dGkn1M/9KcyEOwqmlZ2kqaZg==", + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.1.tgz", + "integrity": "sha512-FtdMvR4R99FTsD53IA3LxYGghQ82t3yt0ZQ93WMZ2xV3dqrb0E8zq4VHaTOuLEAuA83oDawHV3fd+BsAPadHIQ==", "cpu": [ - "x64" + "arm" ], - "dev": true, "optional": true, "os": [ "linux" - ] + ], + "engines": { + "glibc": ">=2.28", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.9.2", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.2.tgz", - "integrity": "sha512-x1CWburlbN5JjG+juenuNa4KdedBdXLjZMp56nHFSHTOsb/MI2DYiGzLtRGHNMyydPGffGId+VgjOMrcltOksA==", + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.1.tgz", + "integrity": "sha512-bnGG+MJjdX70mAQcSLxgeJco11G+MxTz+ebxlz8Y3dxyeb3Nkl7LgLI0mXupoO+u1wRNx/iRj5yHtzA4sde1yA==", "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ - "win32" - ] + "linux" + ], + "engines": { + "glibc": ">=2.26", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.9.2", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.2.tgz", - "integrity": "sha512-VVzCB5yXR1QlfsH1Xw1zdzQ4Pxuzv+CPr5qpElpKhVxlxD3CRdfubAG9mJROl6/dmj5gVYDDWk8sC+j9BI9/kQ==", + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.1.tgz", + "integrity": "sha512-3+rzfAR1YpMOeA2zZNp+aYEzGNWK4zF3+sdMxuCS3ey9HhDbJ66w6hDSHDMoap32DueFwhhs3vwooAB2MaK4XQ==", "cpu": [ - "ia32" + "s390x" ], - "dev": true, "optional": true, "os": [ - "win32" - ] + "linux" + ], + "engines": { + "glibc": ">=2.28", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.9.2", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.2.tgz", - "integrity": "sha512-SYRedJi+mweatroB+6TTnJYLts0L0bosg531xnQWtklOI6dezEagx4Q0qDyvRdK+qgdA3YZpjjGuPFtxBmddBA==", + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.1.tgz", + "integrity": "sha512-3NR1mxFsaSgMMzz1bAnnKbSAI+lHXVTqAHgc1bgzjHuXjo4hlscpUxc0vFSAPKI3yuzdzcZOkq7nDPrP2F8Jgw==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ - "win32" - ] - }, - "node_modules/@shikijs/core": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmmirror.com/@shikijs/core/-/core-1.0.0-beta.2.tgz", - "integrity": "sha512-H0r+V4/47hXZzFW2qXRqjLwNtiUE5bQankMw2m2RE1hLgHSjp/skyBZYDXjhG9y7ei3sIZAj8s4vx31EzxxrhQ==", - "dev": true - }, - "node_modules/@sindresorhus/merge-streams": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/@sindresorhus/merge-streams/-/merge-streams-1.0.0.tgz", - "integrity": "sha512-rUV5WyJrJLoloD4NDN1V1+LDMDWOa4OTsT4yYJwQNpTU6FWxkxHpL7eu4w+DmiH8x/EAM1otkPE1+LaspIbplw==", - "dev": true, + "linux" + ], "engines": { - "node": ">=18" - } - }, - "node_modules/@types/debug": { - "version": "4.1.12", - "resolved": "https://registry.npmmirror.com/@types/debug/-/debug-4.1.12.tgz", - "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", - "dev": true, - "dependencies": { - "@types/ms": "*" - } - }, - "node_modules/@types/fs-extra": { - "version": "11.0.4", - "resolved": "https://registry.npmmirror.com/@types/fs-extra/-/fs-extra-11.0.4.tgz", - "integrity": "sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==", - "dev": true, - "dependencies": { - "@types/jsonfile": "*", - "@types/node": "*" - } - }, - "node_modules/@types/hash-sum": { - "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/@types/hash-sum/-/hash-sum-1.0.2.tgz", - "integrity": "sha512-UP28RddqY8xcU0SCEp9YKutQICXpaAq9N8U2klqF5hegGha7KzTOL8EdhIIV3bOSGBzjEpN9bU/d+nNZBdJYVw==", - "dev": true - }, - "node_modules/@types/jsonfile": { - "version": "6.1.4", - "resolved": "https://registry.npmmirror.com/@types/jsonfile/-/jsonfile-6.1.4.tgz", - "integrity": "sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/linkify-it": { - "version": "3.0.5", - "resolved": "https://registry.npmmirror.com/@types/linkify-it/-/linkify-it-3.0.5.tgz", - "integrity": "sha512-yg6E+u0/+Zjva+buc3EIb+29XEg4wltq7cSmd4Uc2EE/1nUVmxyzpX6gUXD0V8jIrG0r7YeOGVIbYRkxeooCtw==", - "dev": true - }, - "node_modules/@types/markdown-it": { - "version": "13.0.7", - "resolved": "https://registry.npmmirror.com/@types/markdown-it/-/markdown-it-13.0.7.tgz", - "integrity": "sha512-U/CBi2YUUcTHBt5tjO2r5QV/x0Po6nsYwQU4Y04fBS6vfoImaiZ6f8bi3CjTCxBPQSO1LMyUqkByzi8AidyxfA==", - "dev": true, - "dependencies": { - "@types/linkify-it": "*", - "@types/mdurl": "*" + "glibc": ">=2.26", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@types/markdown-it-emoji": { - "version": "2.0.4", - "resolved": "https://registry.npmmirror.com/@types/markdown-it-emoji/-/markdown-it-emoji-2.0.4.tgz", - "integrity": "sha512-H6ulk/ZmbDxOayPwI/leJzrmoW1YKX1Z+MVSCHXuYhvqckV4I/c+hPTf6UiqJyn2avWugfj30XroheEb6/Ekqg==", - "dev": true, - "dependencies": { - "@types/markdown-it": "*" + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.1.tgz", + "integrity": "sha512-5aBRcjHDG/T6jwC3Edl3lP8nl9U2Yo8+oTl5drd1dh9Z1EBfzUKAJFUDTDisDjUwc7N4AjnPGfCA3jl3hY8uDg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@types/mdurl": { - "version": "1.0.5", - "resolved": "https://registry.npmmirror.com/@types/mdurl/-/mdurl-1.0.5.tgz", - "integrity": "sha512-6L6VymKTzYSrEf4Nev4Xa1LCHKrlTlYCBMTlQKFuddo1CvQcE52I0mwfOJayueUC7MJuXOeHTcIU683lzd0cUA==", - "dev": true - }, - "node_modules/@types/ms": { - "version": "0.7.34", - "resolved": "https://registry.npmmirror.com/@types/ms/-/ms-0.7.34.tgz", - "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==", - "dev": true - }, - "node_modules/@types/node": { - "version": "20.10.6", - "resolved": "https://registry.npmmirror.com/@types/node/-/node-20.10.6.tgz", - "integrity": "sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==", - "dev": true, - "dependencies": { - "undici-types": "~5.26.4" + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.1.tgz", + "integrity": "sha512-dcT7inI9DBFK6ovfeWRe3hG30h51cBAP5JXlZfx6pzc/Mnf9HFCQDLtYf4MCBjxaaTfjCCjkBxcy3XzOAo5txw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@types/sax": { - "version": "1.2.7", - "resolved": "https://registry.npmmirror.com/@types/sax/-/sax-1.2.7.tgz", - "integrity": "sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==", - "dev": true, - "dependencies": { - "@types/node": "*" + "node_modules/@img/sharp-linux-arm": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.2.tgz", + "integrity": "sha512-Fndk/4Zq3vAc4G/qyfXASbS3HBZbKrlnKZLEJzPLrXoJuipFNNwTes71+Ki1hwYW5lch26niRYoZFAtZVf3EGA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.0.1" } }, - "node_modules/@types/web-bluetooth": { - "version": "0.0.20", - "resolved": "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz", - "integrity": "sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==", - "dev": true - }, - "node_modules/@vitejs/plugin-vue": { - "version": "4.6.2", - "resolved": "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-4.6.2.tgz", - "integrity": "sha512-kqf7SGFoG+80aZG6Pf+gsZIVvGSCKE98JbiWqcCV9cThtg91Jav0yvYFC9Zb+jKetNGF6ZKeoaxgZfND21fWKw==", - "dev": true, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.2.tgz", + "integrity": "sha512-pz0NNo882vVfqJ0yNInuG9YH71smP4gRSdeL09ukC2YLE6ZyZePAlWKEHgAzJGTiOh8Qkaov6mMIMlEhmLdKew==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^14.18.0 || >=16.0.0" + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" }, - "peerDependencies": { - "vite": "^4.0.0 || ^5.0.0", - "vue": "^3.2.25" + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.0.1" } }, - "node_modules/@vue/compiler-core": { - "version": "3.4.3", - "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.4.3.tgz", - "integrity": "sha512-u8jzgFg0EDtSrb/hG53Wwh1bAOQFtc1ZCegBpA/glyvTlgHl+tq13o1zvRfLbegYUw/E4mSTGOiCnAJ9SJ+lsg==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.23.6", - "@vue/shared": "3.4.3", - "entities": "^4.5.0", - "estree-walker": "^2.0.2", - "source-map-js": "^1.0.2" + "node_modules/@img/sharp-linux-s390x": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.2.tgz", + "integrity": "sha512-MBoInDXDppMfhSzbMmOQtGfloVAflS2rP1qPcUIiITMi36Mm5YR7r0ASND99razjQUpHTzjrU1flO76hKvP5RA==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.0.1" } }, - "node_modules/@vue/compiler-core/node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, + "node_modules/@img/sharp-linux-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.2.tgz", + "integrity": "sha512-xUT82H5IbXewKkeF5aiooajoO1tQV4PnKfS/OZtb5DDdxS/FCI/uXTVZ35GQ97RZXsycojz/AJ0asoz6p2/H/A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.0.1" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.2.tgz", + "integrity": "sha512-F+0z8JCu/UnMzg8IYW1TMeiViIWBVg7IWP6nE0p5S5EPQxlLd76c8jYemG21X99UzFwgkRo5yz2DS+zbrnxZeA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.1" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.2.tgz", + "integrity": "sha512-+ZLE3SQmSL+Fn1gmSaM8uFusW5Y3J9VOf+wMGNnTtJUMUxFhv+P4UPaYEYT8tqnyYVaOVGgMN/zsOxn9pSsO2A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.1" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.2.tgz", + "integrity": "sha512-fLbTaESVKuQcpm8ffgBD7jLb/CQLcATju/jxtTXR1XCLwbOQt+OL5zPHSDMmp2JZIeq82e18yE0Vv7zh6+6BfQ==", + "cpu": [ + "wasm32" + ], + "optional": true, + "dependencies": { + "@emnapi/runtime": "^0.45.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.2.tgz", + "integrity": "sha512-okBpql96hIGuZ4lN3+nsAjGeggxKm7hIRu9zyec0lnfB8E7Z6p95BuRZzDDXZOl2e8UmR4RhYt631i7mfmKU8g==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.2.tgz", + "integrity": "sha512-E4magOks77DK47FwHUIGH0RYWSgRBfGdK56kIHSVeB9uIS4pPFr4N2kIVsXdQQo4LzOsENKV5KAhRlRL7eMAdg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.22", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", + "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@mdx-js/mdx": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.0.0.tgz", + "integrity": "sha512-Icm0TBKBLYqroYbNW3BPnzMGn+7mwpQOK310aZ7+fkCtiU3aqv2cdcX+nd0Ydo3wI5Rx8bX2Z2QmGb/XcAClCw==", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdx": "^2.0.0", + "collapse-white-space": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-build-jsx": "^3.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "estree-util-to-js": "^2.0.0", + "estree-walker": "^3.0.0", + "hast-util-to-estree": "^3.0.0", + "hast-util-to-jsx-runtime": "^2.0.0", + "markdown-extensions": "^2.0.0", + "periscopic": "^3.0.0", + "remark-mdx": "^3.0.0", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.0.0", + "source-map": "^0.7.0", + "unified": "^11.0.0", + "unist-util-position-from-estree": "^2.0.0", + "unist-util-stringify-position": "^4.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@medv/finder": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@medv/finder/-/finder-3.1.0.tgz", + "integrity": "sha512-ojkXjR3K0Zz3jnCR80tqPL+0yvbZk/lEodb6RIVjLz7W8RVA2wrw8ym/CzCpXO9SYVUIKHFUpc7jvf8UKfIM3w==" + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@pagefind/darwin-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pagefind/darwin-arm64/-/darwin-arm64-1.0.4.tgz", + "integrity": "sha512-2OcthvceX2xhm5XbgOmW+lT45oLuHqCmvFeFtxh1gsuP5cO8vcD8ZH8Laj4pXQFCcK6eAdSShx+Ztx/LsQWZFQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@pagefind/darwin-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pagefind/darwin-x64/-/darwin-x64-1.0.4.tgz", + "integrity": "sha512-xkdvp0D9Ld/ZKsjo/y1bgfhTEU72ITimd2PMMQtts7jf6JPIOJbsiErCvm37m/qMFuPGEq/8d+fZ4pydOj08HQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@pagefind/default-ui": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pagefind/default-ui/-/default-ui-1.0.4.tgz", + "integrity": "sha512-edkcaPSKq67C49Vehjo+LQCpT615v4d7JRhfGzFPccePvdklaL+VXrfghN/uIfsdoG+HoLI1PcYy2iFcB9CTkw==" + }, + "node_modules/@pagefind/linux-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pagefind/linux-arm64/-/linux-arm64-1.0.4.tgz", + "integrity": "sha512-jGBrcCzIrMnNxLKVtogaQyajVfTAXM59KlBEwg6vTn8NW4fQ6nuFbbhlG4dTIsaamjEM5e8ZBEAKZfTB/qd9xw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@pagefind/linux-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pagefind/linux-x64/-/linux-x64-1.0.4.tgz", + "integrity": "sha512-LIn/QcvcEtLEBqKe5vpSbSC2O3fvqbRCWOTIklslqSORisCsvzsWbP6j+LYxE9q0oWIfkdMoWV1vrE/oCKRxHg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@pagefind/windows-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pagefind/windows-x64/-/windows-x64-1.0.4.tgz", + "integrity": "sha512-QlBCVeZfj9fc9sbUgdOz76ZDbeK4xZihOBAFqGuRJeChfM8pnVeH9iqSnXgO3+m9oITugTf7PicyRUFAG76xeQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.6.tgz", + "integrity": "sha512-MVNXSSYN6QXOulbHpLMKYi60ppyO13W9my1qogeiAqtjb2yR4LSmfU2+POvDkLzhjYLXz9Rf9+9a3zFHW1Lecg==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.6.tgz", + "integrity": "sha512-T14aNLpqJ5wzKNf5jEDpv5zgyIqcpn1MlwCrUXLrwoADr2RkWA0vOWP4XxbO9aiO3dvMCQICZdKeDrFl7UMClw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.6.tgz", + "integrity": "sha512-CqNNAyhRkTbo8VVZ5R85X73H3R5NX9ONnKbXuHisGWC0qRbTTxnF1U4V9NafzJbgGM0sHZpdO83pLPzq8uOZFw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.6.tgz", + "integrity": "sha512-zRDtdJuRvA1dc9Mp6BWYqAsU5oeLixdfUvkTHuiYOHwqYuQ4YgSmi6+/lPvSsqc/I0Omw3DdICx4Tfacdzmhog==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.6.tgz", + "integrity": "sha512-oNk8YXDDnNyG4qlNb6is1ojTOGL/tRhbbKeE/YuccItzerEZT68Z9gHrY3ROh7axDc974+zYAPxK5SH0j/G+QQ==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.6.tgz", + "integrity": "sha512-Z3O60yxPtuCYobrtzjo0wlmvDdx2qZfeAWTyfOjEDqd08kthDKexLpV97KfAeUXPosENKd8uyJMRDfFMxcYkDQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.6.tgz", + "integrity": "sha512-gpiG0qQJNdYEVad+1iAsGAbgAnZ8j07FapmnIAQgODKcOTjLEWM9sRb+MbQyVsYCnA0Im6M6QIq6ax7liws6eQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.6.tgz", + "integrity": "sha512-+uCOcvVmFUYvVDr27aiyun9WgZk0tXe7ThuzoUTAukZJOwS5MrGbmSlNOhx1j80GdpqbOty05XqSl5w4dQvcOA==", + "cpu": [ + "riscv64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.6.tgz", + "integrity": "sha512-HUNqM32dGzfBKuaDUBqFB7tP6VMN74eLZ33Q9Y1TBqRDn+qDonkAUyKWwF9BR9unV7QUzffLnz9GrnKvMqC/fw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.6.tgz", + "integrity": "sha512-ch7M+9Tr5R4FK40FHQk8VnML0Szi2KRujUgHXd/HjuH9ifH72GUmw6lStZBo3c3GB82vHa0ZoUfjfcM7JiiMrQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.6.tgz", + "integrity": "sha512-VD6qnR99dhmTQ1mJhIzXsRcTBvTjbfbGGwKAHcu+52cVl15AC/kplkhxzW/uT0Xl62Y/meBKDZvoJSJN+vTeGA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.6.tgz", + "integrity": "sha512-J9AFDq/xiRI58eR2NIDfyVmTYGyIZmRcvcAoJ48oDld/NTR8wyiPUu2X/v1navJ+N/FGg68LEbX3Ejd6l8B7MQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.6.tgz", + "integrity": "sha512-jqzNLhNDvIZOrt69Ce4UjGRpXJBzhUBzawMwnaDAwyHriki3XollsewxWzOzz+4yOFDkuJHtTsZFwMxhYJWmLQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@shikijs/core": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.1.7.tgz", + "integrity": "sha512-gTYLUIuD1UbZp/11qozD3fWpUTuMqPSf3svDMMrL0UmlGU7D9dPw/V1FonwAorCUJBltaaESxq90jrSjQyGixg==" + }, + "node_modules/@types/acorn": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@types/acorn/-/acorn-4.0.6.tgz", + "integrity": "sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==", + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.5.tgz", + "integrity": "sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==", + "dependencies": { + "@babel/types": "^7.20.7" + } + }, + "node_modules/@types/debug": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", + "dependencies": { + "@types/ms": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" + }, + "node_modules/@types/estree-jsx": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.4.tgz", + "integrity": "sha512-5idy3hvI9lAMqsyilBM+N+boaCf1MgoefbDxN6KEO5aK17TOHwFAYT9sjxzeKAiIWRUBgLxmZ9mPcnzZXtTcRQ==", + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/mdast": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.3.tgz", + "integrity": "sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/mdx": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@types/mdx/-/mdx-2.0.11.tgz", + "integrity": "sha512-HM5bwOaIQJIQbAYfax35HCKxx7a3KrK3nBtIqJgSOitivTD1y3oW9P3rxY9RkXYPUk7y/AjAohfHKmFpGE79zw==" + }, + "node_modules/@types/ms": { + "version": "0.7.34", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", + "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" + }, + "node_modules/@types/nlcst": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/nlcst/-/nlcst-1.0.4.tgz", + "integrity": "sha512-ABoYdNQ/kBSsLvZAekMhIPMQ3YUZvavStpKYs7BjLLuKVmIMA0LUgZ7b54zzuWJRbHF80v1cNf4r90Vd6eMQDg==", + "dependencies": { + "@types/unist": "^2" + } + }, + "node_modules/@types/nlcst/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/@types/node": { + "version": "20.11.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.16.tgz", + "integrity": "sha512-gKb0enTmRCzXSSUJDq6/sPcqrfCv2mkkG6Jt/clpn5eiCbKTY+SgZUxo+p8ZKMof5dCp9vHQUAB7wOUTod22wQ==", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/parse5": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@types/parse5/-/parse5-6.0.3.tgz", + "integrity": "sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==" + }, + "node_modules/@types/sax": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/sax/-/sax-1.2.7.tgz", + "integrity": "sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==" + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" + }, + "node_modules/@volar/kit": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/kit/-/kit-2.0.4.tgz", + "integrity": "sha512-USRx/o0jKz7o8+lEKWMxWqbqvC46XFrf3IE6CZBYzRo9kM7RERQLwUYaoT2bOcHt5DQWublpnTgdgHMm37Gysg==", + "dependencies": { + "@volar/language-service": "2.0.4", + "@volar/typescript": "2.0.4", + "typesafe-path": "^0.2.2", + "vscode-languageserver-textdocument": "^1.0.11", + "vscode-uri": "^3.0.8" + }, + "peerDependencies": { + "typescript": "*" + } + }, + "node_modules/@volar/language-core": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.0.4.tgz", + "integrity": "sha512-VhC8i03P0x9LKGLTBi81xNTNWm40yxQ/Iba8IpH+LFr+Yb7c/D7fF90Cvf31MzPDM4G5rjIOlCfs+eQKPBkwQw==", + "dependencies": { + "@volar/source-map": "2.0.4" + } + }, + "node_modules/@volar/language-server": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/language-server/-/language-server-2.0.4.tgz", + "integrity": "sha512-VnljhooQjT6RhmvwwJK9+3YYs2ovFmav4IVNHiQgnTMfiOiyABzcghwvJrJrI39rJDI6LNOWF7BYUJq7K07BKQ==", + "dependencies": { + "@volar/language-core": "2.0.4", + "@volar/language-service": "2.0.4", + "@volar/snapshot-document": "2.0.4", + "@volar/typescript": "2.0.4", + "@vscode/l10n": "^0.0.16", + "path-browserify": "^1.0.1", + "request-light": "^0.7.0", + "vscode-languageserver": "^9.0.1", + "vscode-languageserver-protocol": "^3.17.5", + "vscode-languageserver-textdocument": "^1.0.11", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/@volar/language-service": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/language-service/-/language-service-2.0.4.tgz", + "integrity": "sha512-DoanyU9I9Nl85lUytDl8jgyk+nrUDR5CFNVMrxWXGXclP4WTqBayBgSFAeF1L/5AwP3MywmWoK4GLAEVvl8D+Q==", + "dependencies": { + "@volar/language-core": "2.0.4", + "vscode-languageserver-protocol": "^3.17.5", + "vscode-languageserver-textdocument": "^1.0.11", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/@volar/snapshot-document": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/snapshot-document/-/snapshot-document-2.0.4.tgz", + "integrity": "sha512-YzgdmvpdRFxiBFCOVWga67naAtbPtKmPaFtGnmxWx+KXrjGkpUXT/2tzeKn5FLdtoYV+DRTdpMdP/45ArnVwZQ==", + "dependencies": { + "vscode-languageserver-protocol": "^3.17.5", + "vscode-languageserver-textdocument": "^1.0.11" + } + }, + "node_modules/@volar/source-map": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.0.4.tgz", + "integrity": "sha512-BbxUinEMoJZqrHsSj1aBa0boCBnN3BoXnf7j9IBwjxosxGXOhCvqmH2L9raJemadaKjeVR8ZQLhV7AOhyoHt/Q==", + "dependencies": { + "muggle-string": "^0.4.0" + } + }, + "node_modules/@volar/typescript": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.0.4.tgz", + "integrity": "sha512-KF7yh7GIo4iWuAQOKf/ONeFHdQA+wFriitW8LtGZB4iOOT6MdlRlYNsRL8do7XxmXvsBKcs4jTMtGn+uZRwlWg==", + "dependencies": { + "@volar/language-core": "2.0.4", + "path-browserify": "^1.0.1" + } + }, + "node_modules/@vscode/emmet-helper": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/@vscode/emmet-helper/-/emmet-helper-2.9.2.tgz", + "integrity": "sha512-MaGuyW+fa13q3aYsluKqclmh62Hgp0BpKIqS66fCxfOaBcVQ1OnMQxRRgQUYnCkxFISAQlkJ0qWWPyXjro1Qrg==", + "dependencies": { + "emmet": "^2.4.3", + "jsonc-parser": "^2.3.0", + "vscode-languageserver-textdocument": "^1.0.1", + "vscode-languageserver-types": "^3.15.1", + "vscode-uri": "^2.1.2" + } + }, + "node_modules/@vscode/emmet-helper/node_modules/vscode-uri": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-2.1.2.tgz", + "integrity": "sha512-8TEXQxlldWAuIODdukIb+TR5s+9Ds40eSJrw+1iDDA9IFORPjMELarNQE3myz5XIkWWpdprmJjm1/SxMlWOC8A==" + }, + "node_modules/@vscode/l10n": { + "version": "0.0.16", + "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.16.tgz", + "integrity": "sha512-JT5CvrIYYCrmB+dCana8sUqJEcGB1ZDXNLMQ2+42bW995WmNoenijWMUdZfwmuQUTQcEVVIa2OecZzTYWUW9Cg==" + }, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ansi-align": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", + "dependencies": { + "string-width": "^4.1.0" + } + }, + "node_modules/ansi-align/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-align/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/ansi-align/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-align/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==" + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/aria-query": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/array-iterate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/array-iterate/-/array-iterate-2.0.1.tgz", + "integrity": "sha512-I1jXZMjAgCMmxT4qxXfPXa6SthSoE8h6gkSI9BGGNv8mP8G/v0blc+qFnZu6K42vTOiuME596QaLO0TP3Lk0xg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/astring": { + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/astring/-/astring-1.8.6.tgz", + "integrity": "sha512-ISvCdHdlTDlH5IpxQJIex7BWBywFWgjJSVdwst+/iQCoEYnyOaQ95+X1JGshuBjGp6nxKUy1jMgE3zPqN7fQdg==", + "bin": { + "astring": "bin/astring" + } + }, + "node_modules/astro": { + "version": "4.4.11", + "resolved": "https://registry.npmjs.org/astro/-/astro-4.4.11.tgz", + "integrity": "sha512-mJ1k67xzAJO1vTTpATe76uSWhOgiEj3Id7narE6X2rMMOBjR8vJM+9Cmv/Wbpot6uMwFo780skUowlMptK96fQ==", + "dependencies": { + "@astrojs/compiler": "^2.5.3", + "@astrojs/internal-helpers": "0.2.1", + "@astrojs/markdown-remark": "4.2.1", + "@astrojs/telemetry": "3.0.4", + "@babel/core": "^7.23.3", + "@babel/generator": "^7.23.3", + "@babel/parser": "^7.23.3", + "@babel/plugin-transform-react-jsx": "^7.22.5", + "@babel/traverse": "^7.23.3", + "@babel/types": "^7.23.3", + "@medv/finder": "^3.1.0", + "@types/babel__core": "^7.20.4", + "acorn": "^8.11.2", + "aria-query": "^5.3.0", + "axobject-query": "^4.0.0", + "boxen": "^7.1.1", + "chokidar": "^3.5.3", + "ci-info": "^4.0.0", + "clsx": "^2.0.0", + "common-ancestor-path": "^1.0.1", + "cookie": "^0.6.0", + "cssesc": "^3.0.0", + "debug": "^4.3.4", + "deterministic-object-hash": "^2.0.1", + "devalue": "^4.3.2", + "diff": "^5.1.0", + "dlv": "^1.1.3", + "dset": "^3.1.3", + "es-module-lexer": "^1.4.1", + "esbuild": "^0.19.6", + "estree-walker": "^3.0.3", + "execa": "^8.0.1", + "fast-glob": "^3.3.2", + "flattie": "^1.1.0", + "github-slugger": "^2.0.0", + "gray-matter": "^4.0.3", + "html-escaper": "^3.0.3", + "http-cache-semantics": "^4.1.1", + "js-yaml": "^4.1.0", + "kleur": "^4.1.4", + "magic-string": "^0.30.3", + "mdast-util-to-hast": "13.0.2", + "mime": "^3.0.0", + "ora": "^7.0.1", + "p-limit": "^5.0.0", + "p-queue": "^8.0.1", + "path-to-regexp": "^6.2.1", + "preferred-pm": "^3.1.2", + "prompts": "^2.4.2", + "rehype": "^13.0.1", + "resolve": "^1.22.4", + "semver": "^7.5.4", + "shikiji": "^0.9.19", + "shikiji-core": "^0.9.19", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0", + "tsconfck": "^3.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.1", + "vite": "^5.1.4", + "vitefu": "^0.2.5", + "which-pm": "^2.1.1", + "yargs-parser": "^21.1.1", + "zod": "^3.22.4" + }, + "bin": { + "astro": "astro.js" + }, + "engines": { + "node": ">=18.14.1", + "npm": ">=6.14.0" + }, + "optionalDependencies": { + "sharp": "^0.32.6" + } + }, + "node_modules/astro-expressive-code": { + "version": "0.33.4", + "resolved": "https://registry.npmjs.org/astro-expressive-code/-/astro-expressive-code-0.33.4.tgz", + "integrity": "sha512-PtXLjd89WBA1WsDYlt3V1LZs9Pa8FFoXilaGDSyfxtbYJ2OPHjWh2JJvCiXmfXmY3HkPJ2oW9Jjo6om5vUlVcg==", + "dependencies": { + "hast-util-to-html": "^8.0.4", + "remark-expressive-code": "^0.33.4" + }, + "peerDependencies": { + "astro": "^3.3.0 || ^4.0.0-beta" + } + }, + "node_modules/astro-expressive-code/node_modules/@types/hast": { + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.10.tgz", + "integrity": "sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==", + "dependencies": { + "@types/unist": "^2" + } + }, + "node_modules/astro-expressive-code/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/astro-expressive-code/node_modules/hast-util-from-parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-7.1.2.tgz", + "integrity": "sha512-Nz7FfPBuljzsN3tCQ4kCBKqdNhQE2l0Tn+X1ubgKBPRoiDIu1mL08Cfw4k7q71+Duyaw7DXDN+VTAp4Vh3oCOw==", + "dependencies": { + "@types/hast": "^2.0.0", + "@types/unist": "^2.0.0", + "hastscript": "^7.0.0", + "property-information": "^6.0.0", + "vfile": "^5.0.0", + "vfile-location": "^4.0.0", + "web-namespaces": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/astro-expressive-code/node_modules/hast-util-parse-selector": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-3.1.1.tgz", + "integrity": "sha512-jdlwBjEexy1oGz0aJ2f4GKMaVKkA9jwjr4MjAAI22E5fM/TXVZHuS5OpONtdeIkRKqAaryQ2E9xNQxijoThSZA==", + "dependencies": { + "@types/hast": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/astro-expressive-code/node_modules/hast-util-raw": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-7.2.3.tgz", + "integrity": "sha512-RujVQfVsOrxzPOPSzZFiwofMArbQke6DJjnFfceiEbFh7S05CbPt0cYN+A5YeD3pso0JQk6O1aHBnx9+Pm2uqg==", + "dependencies": { + "@types/hast": "^2.0.0", + "@types/parse5": "^6.0.0", + "hast-util-from-parse5": "^7.0.0", + "hast-util-to-parse5": "^7.0.0", + "html-void-elements": "^2.0.0", + "parse5": "^6.0.0", + "unist-util-position": "^4.0.0", + "unist-util-visit": "^4.0.0", + "vfile": "^5.0.0", + "web-namespaces": "^2.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/astro-expressive-code/node_modules/hast-util-to-html": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-8.0.4.tgz", + "integrity": "sha512-4tpQTUOr9BMjtYyNlt0P50mH7xj0Ks2xpo8M943Vykljf99HW6EzulIoJP1N3eKOSScEHzyzi9dm7/cn0RfGwA==", + "dependencies": { + "@types/hast": "^2.0.0", + "@types/unist": "^2.0.0", + "ccount": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-raw": "^7.0.0", + "hast-util-whitespace": "^2.0.0", + "html-void-elements": "^2.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "stringify-entities": "^4.0.0", + "zwitch": "^2.0.4" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/astro-expressive-code/node_modules/hast-util-to-parse5": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-7.1.0.tgz", + "integrity": "sha512-YNRgAJkH2Jky5ySkIqFXTQiaqcAtJyVE+D5lkN6CdtOqrnkLfGYYrEcKuHOJZlp+MwjSwuD3fZuawI+sic/RBw==", + "dependencies": { + "@types/hast": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "web-namespaces": "^2.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/astro-expressive-code/node_modules/hast-util-whitespace": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz", + "integrity": "sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/astro-expressive-code/node_modules/hastscript": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-7.2.0.tgz", + "integrity": "sha512-TtYPq24IldU8iKoJQqvZOuhi5CyCQRAbvDOX0x1eW6rsHSxa/1i2CCiptNTotGHJ3VoHRGmqiv6/D3q113ikkw==", + "dependencies": { + "@types/hast": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-parse-selector": "^3.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/astro-expressive-code/node_modules/html-void-elements": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-2.0.1.tgz", + "integrity": "sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/astro-expressive-code/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + }, + "node_modules/astro-expressive-code/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/astro-expressive-code/node_modules/unist-util-position": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.4.tgz", + "integrity": "sha512-kUBE91efOWfIVBo8xzh/uZQ7p9ffYRtUbMRZBNFYwf0RK8koUMx6dGUfwylLOKmaT2cs4wSW96QoYUSXAyEtpg==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/astro-expressive-code/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/astro-expressive-code/node_modules/unist-util-visit": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", + "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.1.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/astro-expressive-code/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/astro-expressive-code/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/astro-expressive-code/node_modules/vfile-location": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.1.0.tgz", + "integrity": "sha512-YF23YMyASIIJXpktBa4vIGLJ5Gs88UB/XePgqPmTa7cDA+JeO3yclbpheQYCHjVHBn/yePzrXuygIL+xbvRYHw==", + "dependencies": { + "@types/unist": "^2.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/astro-expressive-code/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/astro/node_modules/sharp": { + "version": "0.32.6", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.6.tgz", + "integrity": "sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.2", + "node-addon-api": "^6.1.0", + "prebuild-install": "^7.1.1", + "semver": "^7.5.4", + "simple-get": "^4.0.1", + "tar-fs": "^3.0.4", + "tunnel-agent": "^0.6.0" + }, + "engines": { + "node": ">=14.15.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/axobject-query": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.0.0.tgz", + "integrity": "sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==", + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/b4a": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz", + "integrity": "sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==", + "optional": true + }, + "node_modules/bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/bare-events": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.2.0.tgz", + "integrity": "sha512-Yyyqff4PIFfSuthCZqLlPISTWHmnQxoPuAvkmgzsJEmG3CesdIv6Xweayl0JkCZJSB2yYIdJyEz97tpxNhgjbg==", + "optional": true + }, + "node_modules/bare-fs": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-2.1.5.tgz", + "integrity": "sha512-5t0nlecX+N2uJqdxe9d18A98cp2u9BETelbjKpiVgQqzzmVNFYWEAjQHqS+2Khgto1vcwhik9cXucaj5ve2WWA==", + "optional": true, + "dependencies": { + "bare-events": "^2.0.0", + "bare-os": "^2.0.0", + "bare-path": "^2.0.0", + "streamx": "^2.13.0" + } + }, + "node_modules/bare-os": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-2.1.3.tgz", + "integrity": "sha512-YMKOQzoMouGCrYgJ0rassKvmbTz+TYDOKKmu4JkfNXS/qKn+If1ODCMEXnmknQXfnB1PS8bR+uHu6xBgwAQXew==", + "optional": true + }, + "node_modules/bare-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-2.1.0.tgz", + "integrity": "sha512-DIIg7ts8bdRKwJRJrUMy/PICEaQZaPGZ26lsSx9MJSwIhSrcdHn7/C8W+XmnG/rKi6BaRcz+JO00CjZteybDtw==", + "optional": true, + "dependencies": { + "bare-os": "^2.1.0" + } + }, + "node_modules/base-64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz", + "integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bcp-47": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/bcp-47/-/bcp-47-2.1.0.tgz", + "integrity": "sha512-9IIS3UPrvIa1Ej+lVDdDwO7zLehjqsaByECw0bu2RRGP73jALm6FYbzI5gWbgHLvNdkvfXB5YrSbocZdOS0c0w==", + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/bcp-47-match": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/bcp-47-match/-/bcp-47-match-2.0.3.tgz", + "integrity": "sha512-JtTezzbAibu8G0R9op9zb3vcWZd9JF6M0xOYGPn0fNCd7wOpRB1mU2mH9T8gaBGbAAyIIVgB2G7xG0GP98zMAQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/bl": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", + "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", + "dependencies": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" + }, + "node_modules/boxen": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.1.1.tgz", + "integrity": "sha512-2hCgjEmP8YLWQ130n2FerGv7rYpfBmnmp9Uy2Le1vge6X3gZIfSmEzP5QTDElFxcvVcXlEn8Aq6MU/PZygIOog==", + "dependencies": { + "ansi-align": "^3.0.1", + "camelcase": "^7.0.1", + "chalk": "^5.2.0", + "cli-boxes": "^3.0.0", + "string-width": "^5.1.2", + "type-fest": "^2.13.0", + "widest-line": "^4.0.1", + "wrap-ansi": "^8.1.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/boxen/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/boxen/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "node_modules/boxen/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.22.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.3.tgz", + "integrity": "sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001580", + "electron-to-chromium": "^1.4.648", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.13" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/camelcase": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-7.0.1.tgz", + "integrity": "sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001585", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001585.tgz", + "integrity": "sha512-yr2BWR1yLXQ8fMpdS/4ZZXpseBgE7o4g41x3a6AJOqZuOi+iE/WdJYAuZ6Y95i4Ohd2Y+9MzIWRR+uGABH4s3Q==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/character-entities": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", + "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-reference-invalid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", + "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "optional": true + }, + "node_modules/ci-info": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.0.0.tgz", + "integrity": "sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-boxes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", + "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cliui/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/cliui/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/clsx": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz", + "integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/collapse-white-space": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-2.1.0.tgz", + "integrity": "sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/color/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/comma-separated-tokens": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/common-ancestor-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz", + "integrity": "sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==" + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-selector-parser": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/css-selector-parser/-/css-selector-parser-3.0.4.tgz", + "integrity": "sha512-pnmS1dbKsz6KA4EW4BznyPL2xxkNDRg62hcD0v8g6DEw2W7hxOln5M953jsp9hmw5Dg57S6o/A8GOn37mbAgcQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/mdevils" + }, + { + "type": "patreon", + "url": "https://patreon.com/mdevils" + } + ] + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decode-named-character-reference": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz", + "integrity": "sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==", + "dependencies": { + "character-entities": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "optional": true, + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "optional": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/detect-libc": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/deterministic-object-hash": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/deterministic-object-hash/-/deterministic-object-hash-2.0.2.tgz", + "integrity": "sha512-KxektNH63SrbfUyDiwXqRb1rLwKt33AmMv+5Nhsw1kqZ13SJBRTgZHtGbE+hH3a1mVW1cz+4pqSWVPAtLVXTzQ==", + "dependencies": { + "base-64": "^1.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/devalue": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/devalue/-/devalue-4.3.2.tgz", + "integrity": "sha512-KqFl6pOgOW+Y6wJgu80rHpo2/3H07vr8ntR9rkkFIRETewbf5GaYYcakYfiKz89K+sLsuPkQIZaXDMjUObZwWg==" + }, + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/diff": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", + "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/direction": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/direction/-/direction-2.0.1.tgz", + "integrity": "sha512-9S6m9Sukh1cZNknO1CWAr2QAWsbKLafQiyM5gZ7VgXHeuaoUwffKN4q6NC4A/Mf9iiPlOXQEKW/Mv/mh9/3YFA==", + "bin": { + "direction": "cli.js" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==" + }, + "node_modules/dset": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/dset/-/dset-3.1.3.tgz", + "integrity": "sha512-20TuZZHCEZ2O71q9/+8BwKwZ0QtD9D8ObhrihJPr+vLLYlSuAU3/zL4cSlgbfeoGHTjCSJBa7NGcrF9/Bx/WJQ==", + "engines": { + "node": ">=4" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" + }, + "node_modules/electron-to-chromium": { + "version": "1.4.661", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.661.tgz", + "integrity": "sha512-AFg4wDHSOk5F+zA8aR+SVIOabu7m0e7BiJnigCvPXzIGy731XENw/lmNxTySpVFtkFEy+eyt4oHhh5FF3NjQNw==" + }, + "node_modules/emmet": { + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/emmet/-/emmet-2.4.6.tgz", + "integrity": "sha512-dJfbdY/hfeTyf/Ef7Y7ubLYzkBvPQ912wPaeVYpAxvFxkEBf/+hJu4H6vhAvFN6HlxqedlfVn2x1S44FfQ97pg==", + "dependencies": { + "@emmetio/abbreviation": "^2.3.3", + "@emmetio/css-abbreviation": "^2.1.8" + } + }, + "node_modules/emoji-regex": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", + "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==" + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "optional": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-module-lexer": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", + "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==" + }, + "node_modules/esbuild": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/estree-util-attach-comments": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/estree-util-attach-comments/-/estree-util-attach-comments-3.0.0.tgz", + "integrity": "sha512-cKUwm/HUcTDsYh/9FgnuFqpfquUbwIqwKM26BVCGDPVgvaCl/nDCCjUfiLlx6lsEZ3Z4RFxNbOQ60pkaEwFxGw==", + "dependencies": { + "@types/estree": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-build-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/estree-util-build-jsx/-/estree-util-build-jsx-3.0.1.tgz", + "integrity": "sha512-8U5eiL6BTrPxp/CHbs2yMgP8ftMhR5ww1eIKoWRMlqvltHF8fZn5LRDvTKuxD3DUn+shRbLGqXemcP51oFCsGQ==", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "estree-walker": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-is-identifier-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-3.0.0.tgz", + "integrity": "sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-to-js": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/estree-util-to-js/-/estree-util-to-js-2.0.0.tgz", + "integrity": "sha512-WDF+xj5rRWmD5tj6bIqRi6CkLIXbbNQUcxQHzGysQzvHmdYG2G7p/Tf0J0gpxGgkeMZNTIjT/AoSvC9Xehcgdg==", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "astring": "^1.8.0", + "source-map": "^0.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-visit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/estree-util-visit/-/estree-util-visit-2.0.0.tgz", + "integrity": "sha512-m5KgiH85xAhhW8Wta0vShLcUvOsh3LLPI2YVwcbio1l7E09NTLL1EyMZFM1OyWowoH0skScNbhOPl4kcBgzTww==", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" + }, + "node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/expressive-code": { + "version": "0.33.4", + "resolved": "https://registry.npmjs.org/expressive-code/-/expressive-code-0.33.4.tgz", + "integrity": "sha512-vb6DLHjG+jbLJGTvOUhxagsru7oUiBrQEsL9+hcWJvlxIqQ5mRFqjamQS9kCIhXXbfYWiYI7/wfTGxQxuHxsZQ==", + "dependencies": { + "@expressive-code/core": "^0.33.4", + "@expressive-code/plugin-frames": "^0.33.4", + "@expressive-code/plugin-shiki": "^0.33.4", + "@expressive-code/plugin-text-markers": "^0.33.4" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", + "optional": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-yarn-workspace-root2": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root2/-/find-yarn-workspace-root2-1.2.16.tgz", + "integrity": "sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==", + "dependencies": { + "micromatch": "^4.0.2", + "pkg-dir": "^4.2.0" + } + }, + "node_modules/flattie": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/flattie/-/flattie-1.1.0.tgz", + "integrity": "sha512-xU99gDEnciIwJdGcBmNHnzTJ/w5AT+VFJOu6sTB6WM8diOYNA3Sa+K1DiEBQ7XH4QikQq3iFW1U+jRVcotQnBw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "optional": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-east-asian-width": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz", + "integrity": "sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "optional": true + }, + "node_modules/github-slugger": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz", + "integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==" + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/gray-matter": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz", + "integrity": "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==", + "dependencies": { + "js-yaml": "^3.13.1", + "kind-of": "^6.0.2", + "section-matter": "^1.0.0", + "strip-bom-string": "^1.0.0" + }, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/gray-matter/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/gray-matter/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hast-util-from-html": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.1.tgz", + "integrity": "sha512-RXQBLMl9kjKVNkJTIO6bZyb2n+cUH8LFaSSzo82jiLT6Tfc+Pt7VQCS+/h3YwG4jaNE2TA2sdJisGWR+aJrp0g==", + "dependencies": { + "@types/hast": "^3.0.0", + "devlop": "^1.1.0", + "hast-util-from-parse5": "^8.0.0", + "parse5": "^7.0.0", + "vfile": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-parse5": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.1.tgz", + "integrity": "sha512-Er/Iixbc7IEa7r/XLtuG52zoqn/b3Xng/w6aZQ0xGVxzhw5xUFxcRqdPzP6yFi/4HBYRaifaI5fQ1RH8n0ZeOQ==", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "hastscript": "^8.0.0", + "property-information": "^6.0.0", + "vfile": "^6.0.0", + "vfile-location": "^5.0.0", + "web-namespaces": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-has-property": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-has-property/-/hast-util-has-property-3.0.0.tgz", + "integrity": "sha512-MNilsvEKLFpV604hwfhVStK0usFY/QmM5zX16bo7EjnAEGofr5YyI37kzopBlZJkHD4t887i+q/C8/tr5Q94cA==", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-parse-selector": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz", + "integrity": "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-raw": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.0.2.tgz", + "integrity": "sha512-PldBy71wO9Uq1kyaMch9AHIghtQvIwxBUkv823pKmkTM3oV1JxtsTNYdevMxvUHqcnOAuO65JKU2+0NOxc2ksA==", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "@ungap/structured-clone": "^1.0.0", + "hast-util-from-parse5": "^8.0.0", + "hast-util-to-parse5": "^8.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "parse5": "^7.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0", + "web-namespaces": "^2.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-select": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/hast-util-select/-/hast-util-select-6.0.2.tgz", + "integrity": "sha512-hT/SD/d/Meu+iobvgkffo1QecV8WeKWxwsNMzcTJsKw1cKTQKSR/7ArJeURLNJF9HDjp9nVoORyNNJxrvBye8Q==", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "bcp-47-match": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "css-selector-parser": "^3.0.0", + "devlop": "^1.0.0", + "direction": "^2.0.0", + "hast-util-has-property": "^3.0.0", + "hast-util-to-string": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "not": "^0.1.0", + "nth-check": "^2.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-estree": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hast-util-to-estree/-/hast-util-to-estree-3.1.0.tgz", + "integrity": "sha512-lfX5g6hqVh9kjS/B9E2gSkvHH4SZNiQFiqWS0x9fENzEl+8W12RqdRxX6d/Cwxi30tPQs3bIO+aolQJNp1bIyw==", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-attach-comments": "^3.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-object": "^0.4.0", + "unist-util-position": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-html": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.0.tgz", + "integrity": "sha512-IVGhNgg7vANuUA2XKrT6sOIIPgaYZnmLx3l/CCOAK0PtgfoHrZwX7jCSYyFxHTrGmC6S9q8aQQekjp4JPZF+cw==", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-raw": "^9.0.0", + "hast-util-whitespace": "^3.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "stringify-entities": "^4.0.0", + "zwitch": "^2.0.4" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-jsx-runtime": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.0.tgz", + "integrity": "sha512-H/y0+IWPdsLLS738P8tDnrQ8Z+dj12zQQ6WC11TIM21C8WFVoIxcqWXf2H3hiTVZjF1AWqoimGwrTWecWrnmRQ==", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-object": "^1.0.0", + "unist-util-position": "^5.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-jsx-runtime/node_modules/inline-style-parser": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.2.tgz", + "integrity": "sha512-EcKzdTHVe8wFVOGEYXiW9WmJXPjqi1T+234YpJr98RiFYKHV3cdy1+3mkTE+KHTHxFFLH51SfaGOoUdW+v7ViQ==" + }, + "node_modules/hast-util-to-jsx-runtime/node_modules/style-to-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.5.tgz", + "integrity": "sha512-rDRwHtoDD3UMMrmZ6BzOW0naTjMsVZLIjsGleSKS/0Oz+cgCfAPRspaqJuE8rDzpKha/nEvnM0IF4seEAZUTKQ==", + "dependencies": { + "inline-style-parser": "0.2.2" + } + }, + "node_modules/hast-util-to-parse5": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz", + "integrity": "sha512-3KKrV5ZVI8if87DVSi1vDeByYrkGzg4mEfeu4alwgmmIeARiBLKCZS2uw5Gb6nU9x9Yufyj3iudm6i7nl52PFw==", + "dependencies": { + "@types/hast": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "web-namespaces": "^2.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-string": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-to-string/-/hast-util-to-string-3.0.0.tgz", + "integrity": "sha512-OGkAxX1Ua3cbcW6EJ5pT/tslVb90uViVkcJ4ZZIMW/R33DX/AkcJcRrPebPwJkHYwlDHXz4aIwvAAaAdtrACFA==", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-whitespace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hastscript": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-8.0.0.tgz", + "integrity": "sha512-dMOtzCEd3ABUeSIISmrETiKuyydk1w0pa+gE/uormcTpSYuaNJPbX1NU3JLyscSLjwAQM8bWMhhIlnCqnRvDTw==", + "dependencies": { + "@types/hast": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-parse-selector": "^4.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/html-escaper": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-3.0.3.tgz", + "integrity": "sha512-RuMffC89BOWQoY0WKGpIhn5gX3iI54O6nRA0yC124NYVtzjmFWBIiFd8M0x+ZdX0P9R4lADg1mgP8C7PxGOWuQ==" + }, + "node_modules/html-void-elements": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", + "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" + }, + "node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/import-meta-resolve": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.0.0.tgz", + "integrity": "sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "optional": true + }, + "node_modules/inline-style-parser": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz", + "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==" + }, + "node_modules/is-alphabetical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", + "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-alphanumerical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", + "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-buffer": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "engines": { + "node": ">=4" + } + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-decimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", + "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "bin": { + "is-docker": "cli.js" + }, "engines": { - "node": ">=0.12" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-hexadecimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz", + "integrity": "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-interactive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-reference": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz", + "integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==", + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-wsl": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", + "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonc-parser": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.3.1.tgz", + "integrity": "sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg==" + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/load-yaml-file": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz", + "integrity": "sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==", + "dependencies": { + "graceful-fs": "^4.1.5", + "js-yaml": "^3.13.0", + "pify": "^4.0.1", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/load-yaml-file/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/load-yaml-file/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", + "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", + "dependencies": { + "chalk": "^5.0.0", + "is-unicode-supported": "^1.1.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/longest-streak": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/magic-string": { + "version": "0.30.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.7.tgz", + "integrity": "sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/markdown-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-2.0.0.tgz", + "integrity": "sha512-o5vL7aDWatOTX8LzaS1WMoaoxIiLRQJuIKKe2wAw6IeULDHaqbiqiggmx+pKvZDb1Sj+pE46Sn1T7lCqfFtg1Q==", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/markdown-table": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.3.tgz", + "integrity": "sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-definitions": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-6.0.0.tgz", + "integrity": "sha512-scTllyX6pnYNZH/AIp/0ePz6s4cZtARxImwoPJ7kS42n+MnVsI4XbnG6d4ibehRIldYMWM2LD7ImQblVhUejVQ==", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "unist-util-visit": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-directive": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-directive/-/mdast-util-directive-3.0.0.tgz", + "integrity": "sha512-JUpYOqKI4mM3sZcNxmF/ox04XYFFkNwr0CFlrQIkCwbvH0xzMCqkMqAde9wRd80VAhaUrwFwKm2nxretdT1h7Q==", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-find-and-replace": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.1.tgz", + "integrity": "sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA==", + "dependencies": { + "@types/mdast": "^4.0.0", + "escape-string-regexp": "^5.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mdast-util-from-markdown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.0.tgz", + "integrity": "sha512-n7MTOr/z+8NAX/wmhhDji8O3bRvPTV/U0oTCaZJkjhPSKTPhS3xufVhKGF8s1pJ7Ox4QgoIU7KHseh09S+9rTA==", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vue/compiler-dom": { - "version": "3.4.3", - "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.4.3.tgz", - "integrity": "sha512-oGF1E9/htI6JWj/lTJgr6UgxNCtNHbM6xKVreBWeZL9QhRGABRVoWGAzxmtBfSOd+w0Zi5BY0Es/tlJrN6WgEg==", - "dev": true, + "node_modules/mdast-util-gfm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.0.0.tgz", + "integrity": "sha512-dgQEX5Amaq+DuUqf26jJqSK9qgixgd6rYDHAv4aTBuA92cTknZlKpPfa86Z/s8Dj8xsAQpFfBmPUHWJBWqS4Bw==", "dependencies": { - "@vue/compiler-core": "3.4.3", - "@vue/shared": "3.4.3" + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-gfm-autolink-literal": "^2.0.0", + "mdast-util-gfm-footnote": "^2.0.0", + "mdast-util-gfm-strikethrough": "^2.0.0", + "mdast-util-gfm-table": "^2.0.0", + "mdast-util-gfm-task-list-item": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vue/compiler-sfc": { - "version": "3.4.3", - "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.4.3.tgz", - "integrity": "sha512-NuJqb5is9I4uzv316VRUDYgIlPZCG8D+ARt5P4t5UDShIHKL25J3TGZAUryY/Aiy0DsY7srJnZL5ryB6DD63Zw==", - "dev": true, + "node_modules/mdast-util-gfm-autolink-literal": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.0.tgz", + "integrity": "sha512-FyzMsduZZHSc3i0Px3PQcBT4WJY/X/RCtEJKuybiC6sjPqLv7h1yqAkmILZtuxMSsUyaLUWNp71+vQH2zqp5cg==", "dependencies": { - "@babel/parser": "^7.23.6", - "@vue/compiler-core": "3.4.3", - "@vue/compiler-dom": "3.4.3", - "@vue/compiler-ssr": "3.4.3", - "@vue/shared": "3.4.3", - "estree-walker": "^2.0.2", - "magic-string": "^0.30.5", - "postcss": "^8.4.32", - "source-map-js": "^1.0.2" + "@types/mdast": "^4.0.0", + "ccount": "^2.0.0", + "devlop": "^1.0.0", + "mdast-util-find-and-replace": "^3.0.0", + "micromark-util-character": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vue/compiler-ssr": { - "version": "3.4.3", - "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.4.3.tgz", - "integrity": "sha512-wnYQtMBkeFSxgSSQbYGQeXPhQacQiog2c6AlvMldQH6DB+gSXK/0F6DVXAJfEiuBSgBhUc8dwrrG5JQcqwalsA==", - "dev": true, + "node_modules/mdast-util-gfm-footnote": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.0.0.tgz", + "integrity": "sha512-5jOT2boTSVkMnQ7LTrd6n/18kqwjmuYqo7JUPe+tRCY6O7dAuTFMtTPauYYrMPpox9hlN0uOx/FL8XvEfG9/mQ==", "dependencies": { - "@vue/compiler-dom": "3.4.3", - "@vue/shared": "3.4.3" + "@types/mdast": "^4.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vue/devtools-api": { - "version": "6.5.1", - "resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.5.1.tgz", - "integrity": "sha512-+KpckaAQyfbvshdDW5xQylLni1asvNSGme1JFs8I1+/H5pHEhqUKMEQD/qn3Nx5+/nycBq11qAEi8lk+LXI2dA==", - "dev": true - }, - "node_modules/@vue/reactivity": { - "version": "3.4.3", - "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.4.3.tgz", - "integrity": "sha512-q5f9HLDU+5aBKizXHAx0w4whkIANs1Muiq9R5YXm0HtorSlflqv9u/ohaMxuuhHWCji4xqpQ1eL04WvmAmGnFg==", - "dev": true, + "node_modules/mdast-util-gfm-strikethrough": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz", + "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==", "dependencies": { - "@vue/shared": "3.4.3" + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vue/runtime-core": { - "version": "3.4.3", - "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.4.3.tgz", - "integrity": "sha512-C1r6QhB1qY7D591RCSFhMULyzL9CuyrGc+3PpB0h7dU4Qqw6GNyo4BNFjHZVvsWncrUlKX3DIKg0Y7rNNr06NQ==", - "dev": true, + "node_modules/mdast-util-gfm-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz", + "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==", "dependencies": { - "@vue/reactivity": "3.4.3", - "@vue/shared": "3.4.3" + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "markdown-table": "^3.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vue/runtime-dom": { - "version": "3.4.3", - "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.4.3.tgz", - "integrity": "sha512-wrsprg7An5Ec+EhPngWdPuzkp0BEUxAKaQtN9dPU/iZctPyD9aaXmVtehPJerdQxQale6gEnhpnfywNw3zOv2A==", - "dev": true, + "node_modules/mdast-util-gfm-task-list-item": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz", + "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==", "dependencies": { - "@vue/runtime-core": "3.4.3", - "@vue/shared": "3.4.3", - "csstype": "^3.1.3" + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vue/server-renderer": { - "version": "3.4.3", - "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.4.3.tgz", - "integrity": "sha512-BUxt8oVGMKKsqSkM1uU3d3Houyfy4WAc2SpSQRebNd+XJGATVkW/rO129jkyL+kpB/2VRKzE63zwf5RtJ3XuZw==", - "dev": true, + "node_modules/mdast-util-mdx": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-3.0.0.tgz", + "integrity": "sha512-JfbYLAW7XnYTTbUsmpu0kdBUVe+yKVJZBItEjwyYJiDJuZ9w4eeaqks4HQO+R7objWgS2ymV60GYpI14Ug554w==", "dependencies": { - "@vue/compiler-ssr": "3.4.3", - "@vue/shared": "3.4.3" + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" }, - "peerDependencies": { - "vue": "3.4.3" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vue/shared": { - "version": "3.4.3", - "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.4.3.tgz", - "integrity": "sha512-rIwlkkP1n4uKrRzivAKPZIEkHiuwY5mmhMJ2nZKCBLz8lTUlE73rQh4n1OnnMurXt1vcUNyH4ZPfdh8QweTjpQ==", - "dev": true - }, - "node_modules/@vuepress/bundler-vite": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/bundler-vite/-/bundler-vite-2.0.0-rc.0.tgz", - "integrity": "sha512-rX8S8IYpqqlJfNPstS/joorpxXx/4WuE7+gDM31i2HUrxOKGZVzq8ZsRRRU2UdoTwHZSd3LpUS4sMtxE5xLK1A==", - "dev": true, - "dependencies": { - "@vitejs/plugin-vue": "^4.5.0", - "@vuepress/client": "2.0.0-rc.0", - "@vuepress/core": "2.0.0-rc.0", - "@vuepress/shared": "2.0.0-rc.0", - "@vuepress/utils": "2.0.0-rc.0", - "autoprefixer": "^10.4.16", - "connect-history-api-fallback": "^2.0.0", - "postcss": "^8.4.31", - "postcss-load-config": "^4.0.1", - "rollup": "^4.4.1", - "vite": "~5.0.0", - "vue": "^3.3.8", - "vue-router": "^4.2.5" - } - }, - "node_modules/@vuepress/cli": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/cli/-/cli-2.0.0-rc.0.tgz", - "integrity": "sha512-XWSIFO9iOR7N4O2lXIwS5vZuLjU9WU/aGAtmhMWEMxrdMx7TQaJbgrfpTUEbHMf+cPI1DXBbUbtmkqIvtfOV0w==", - "dev": true, + "node_modules/mdast-util-mdx-expression": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.0.tgz", + "integrity": "sha512-fGCu8eWdKUKNu5mohVGkhBXCXGnOTLuFqOvGMvdikr+J1w7lDJgxThOKpwRWzzbyXAU2hhSwsmssOY4yTokluw==", "dependencies": { - "@vuepress/core": "2.0.0-rc.0", - "@vuepress/shared": "2.0.0-rc.0", - "@vuepress/utils": "2.0.0-rc.0", - "cac": "^6.7.14", - "chokidar": "^3.5.3", - "envinfo": "^7.11.0", - "esbuild": "~0.19.5" + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" }, - "bin": { - "vuepress-cli": "bin/vuepress.js" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vuepress/client": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/client/-/client-2.0.0-rc.0.tgz", - "integrity": "sha512-TwQx8hJgYONYxX+QltZ2aw9O5Ym6SKelfiUduuIRb555B1gece/jSVap3H/ZwyBhpgJMtG4+/Mrmf8nlDSHjvw==", - "dev": true, - "dependencies": { - "@vue/devtools-api": "^6.5.1", - "@vuepress/shared": "2.0.0-rc.0", - "@vueuse/core": "^10.6.1", - "vue": "^3.3.8", - "vue-router": "^4.2.5" + "node_modules/mdast-util-mdx-jsx": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.0.0.tgz", + "integrity": "sha512-XZuPPzQNBPAlaqsTTgRrcJnyFbSOBovSadFgbFu8SnuNgm+6Bdx1K+IWoitsmj6Lq6MNtI+ytOqwN70n//NaBA==", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-remove-position": "^5.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vuepress/core": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/core/-/core-2.0.0-rc.0.tgz", - "integrity": "sha512-uoOaZP1MdxZYJIAJcRcmYKKeCIVnxZeOuLMOOB9CPuAKSalT1RvJ1lztw6RX3q9SPnlqtSZPQXDncPAZivw4pA==", - "dev": true, + "node_modules/mdast-util-mdxjs-esm": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz", + "integrity": "sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==", "dependencies": { - "@vuepress/client": "2.0.0-rc.0", - "@vuepress/markdown": "2.0.0-rc.0", - "@vuepress/shared": "2.0.0-rc.0", - "@vuepress/utils": "2.0.0-rc.0", - "vue": "^3.3.8" + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vuepress/markdown": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/markdown/-/markdown-2.0.0-rc.0.tgz", - "integrity": "sha512-USmqdKKMT6ZFHYRztTjKUlO8qgGfnEygMAAq4AzC/uYXiEfrbMBLAWJhteyGS56P3rGLj0OPAhksE681bX/wOg==", - "dev": true, - "dependencies": { - "@mdit-vue/plugin-component": "^1.0.0", - "@mdit-vue/plugin-frontmatter": "^1.0.0", - "@mdit-vue/plugin-headers": "^1.0.0", - "@mdit-vue/plugin-sfc": "^1.0.0", - "@mdit-vue/plugin-title": "^1.0.0", - "@mdit-vue/plugin-toc": "^1.0.0", - "@mdit-vue/shared": "^1.0.0", - "@mdit-vue/types": "^1.0.0", - "@types/markdown-it": "^13.0.6", - "@types/markdown-it-emoji": "^2.0.4", - "@vuepress/shared": "2.0.0-rc.0", - "@vuepress/utils": "2.0.0-rc.0", - "markdown-it": "^13.0.2", - "markdown-it-anchor": "^8.6.7", - "markdown-it-emoji": "^2.0.2", - "mdurl": "^1.0.1" - } - }, - "node_modules/@vuepress/plugin-active-header-links": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/plugin-active-header-links/-/plugin-active-header-links-2.0.0-rc.0.tgz", - "integrity": "sha512-UJdXLYNGL5Wjy5YGY8M2QgqT75bZ95EHebbqGi8twBdIJE9O+bM+dPJyYtAk2PIVqFORiw3Hj+PchsNSxdn9+g==", - "dev": true, + "node_modules/mdast-util-phrasing": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", "dependencies": { - "@vuepress/client": "2.0.0-rc.0", - "@vuepress/core": "2.0.0-rc.0", - "@vuepress/utils": "2.0.0-rc.0", - "ts-debounce": "^4.0.0", - "vue": "^3.3.8", - "vue-router": "^4.2.5" + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vuepress/plugin-back-to-top": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/plugin-back-to-top/-/plugin-back-to-top-2.0.0-rc.0.tgz", - "integrity": "sha512-6GPfuzV5lkAnR00BxRUhqMXwMWt741alkq2R6bln4N8BneSOwEpX/7vi19MGf232aKdS/Va4pF5p0/nJ8Sed/g==", - "dev": true, - "dependencies": { - "@vuepress/client": "2.0.0-rc.0", - "@vuepress/core": "2.0.0-rc.0", - "@vuepress/utils": "2.0.0-rc.0", - "ts-debounce": "^4.0.0", - "vue": "^3.3.8" + "node_modules/mdast-util-to-hast": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.0.2.tgz", + "integrity": "sha512-U5I+500EOOw9e3ZrclN3Is3fRpw8c19SMyNZlZ2IS+7vLsNzb2Om11VpIVOR+/0137GhZsFEF6YiKD5+0Hr2Og==", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vuepress/plugin-container": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/plugin-container/-/plugin-container-2.0.0-rc.0.tgz", - "integrity": "sha512-b7vrLN11YE7qiUDPfA3N9P7Z8fupe9Wbcr9KAE/bmfZ9VT4d6kzpVyoU7XHi99XngitsmnkaXP4aBvBF1c2AnA==", - "dev": true, - "dependencies": { - "@types/markdown-it": "^13.0.6", - "@vuepress/core": "2.0.0-rc.0", - "@vuepress/markdown": "2.0.0-rc.0", - "@vuepress/shared": "2.0.0-rc.0", - "@vuepress/utils": "2.0.0-rc.0", - "markdown-it": "^13.0.2", - "markdown-it-container": "^3.0.0" + "node_modules/mdast-util-to-markdown": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.0.tgz", + "integrity": "sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vuepress/plugin-docsearch": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/plugin-docsearch/-/plugin-docsearch-2.0.0-rc.0.tgz", - "integrity": "sha512-bFbb+RxNyoLVbojv3Fh3UNfMmx9tszdae5ni9nG2xa05giCRwGKT0wFG3Q6n0a9kIQ6V7z3PjCj9x1k4SALPEA==", - "dev": true, - "dependencies": { - "@docsearch/css": "^3.5.2", - "@docsearch/js": "^3.5.2", - "@docsearch/react": "^3.5.2", - "@vuepress/client": "2.0.0-rc.0", - "@vuepress/core": "2.0.0-rc.0", - "@vuepress/shared": "2.0.0-rc.0", - "@vuepress/utils": "2.0.0-rc.0", - "@vueuse/core": "^10.6.1", - "ts-debounce": "^4.0.0", - "vue": "^3.3.8", - "vue-router": "^4.2.5" - } - }, - "node_modules/@vuepress/plugin-external-link-icon": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/plugin-external-link-icon/-/plugin-external-link-icon-2.0.0-rc.0.tgz", - "integrity": "sha512-o8bk0oIlj/BkKc02mq91XLDloq1VOz/8iNcRwKAeqBE6svXzdYiyoTGet0J/4iPuAetsCn75S57W6RioDJHMnQ==", - "dev": true, + "node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", "dependencies": { - "@vuepress/client": "2.0.0-rc.0", - "@vuepress/core": "2.0.0-rc.0", - "@vuepress/markdown": "2.0.0-rc.0", - "@vuepress/shared": "2.0.0-rc.0", - "@vuepress/utils": "2.0.0-rc.0", - "vue": "^3.3.8" + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vuepress/plugin-git": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/plugin-git/-/plugin-git-2.0.0-rc.0.tgz", - "integrity": "sha512-r7UF77vZxaYeJQLygzodKv+15z3/dTLuGp4VcYO21W6BlJZvd4u9zqgiV7A//bZQvK4+3Hprylr0G3KgXqMewA==", - "dev": true, - "dependencies": { - "@vuepress/core": "2.0.0-rc.0", - "@vuepress/utils": "2.0.0-rc.0", - "execa": "^8.0.1" - } + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, - "node_modules/@vuepress/plugin-medium-zoom": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/plugin-medium-zoom/-/plugin-medium-zoom-2.0.0-rc.0.tgz", - "integrity": "sha512-peU1lYKsmKikIe/0pkJuHzD/k6xW2TuqdvKVhV4I//aOE1WxsREKJ4ACcldmoIsnysoDydAUqKT6xDPGyDsH2g==", - "dev": true, - "dependencies": { - "@vuepress/client": "2.0.0-rc.0", - "@vuepress/core": "2.0.0-rc.0", - "@vuepress/utils": "2.0.0-rc.0", - "medium-zoom": "^1.1.0", - "vue": "^3.3.8" + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "engines": { + "node": ">= 8" } }, - "node_modules/@vuepress/plugin-nprogress": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/plugin-nprogress/-/plugin-nprogress-2.0.0-rc.0.tgz", - "integrity": "sha512-rI+eK0Pg1KiZE+7hGmDUeSbgdWCid8Vnw0hFKNmjinDzGVmx4m03M6qfvclsI0SryH+lR7itZGLaR4gbTlrz/w==", - "dev": true, + "node_modules/micromark": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.0.tgz", + "integrity": "sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "dependencies": { - "@vuepress/client": "2.0.0-rc.0", - "@vuepress/core": "2.0.0-rc.0", - "@vuepress/utils": "2.0.0-rc.0", - "vue": "^3.3.8", - "vue-router": "^4.2.5" - } - }, - "node_modules/@vuepress/plugin-palette": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/plugin-palette/-/plugin-palette-2.0.0-rc.0.tgz", - "integrity": "sha512-wW70SCp3/K7s1lln5YQsBGTog2WXaQv5piva5zhXcQ47YGf4aAJpThDa5C/ot4HhkPOKn8Iz5s0ckxXZzW8DIg==", - "dev": true, + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-core-commonmark": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.0.tgz", + "integrity": "sha512-jThOz/pVmAYUtkroV3D5c1osFXAMv9e0ypGDOIZuCeAe91/sD6BoE2Sjzt30yuXtwOYUmySOhMas/PVyh02itA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "dependencies": { - "@vuepress/core": "2.0.0-rc.0", - "@vuepress/utils": "2.0.0-rc.0", - "chokidar": "^3.5.3" - } - }, - "node_modules/@vuepress/plugin-prismjs": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/plugin-prismjs/-/plugin-prismjs-2.0.0-rc.0.tgz", - "integrity": "sha512-c5WRI7+FhVjdbymOKQ8F2KY/Bnv7aQtWScVk8vCMUimNi7v7Wff/A/i3KSFNz/tge3LxiAeH/Dc2WS/OnQXwCg==", - "dev": true, + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-directive": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-directive/-/micromark-extension-directive-3.0.0.tgz", + "integrity": "sha512-61OI07qpQrERc+0wEysLHMvoiO3s2R56x5u7glHq2Yqq6EHbH4dW25G9GfDdGCDYqA21KE6DWgNSzxSwHc2hSg==", "dependencies": { - "@vuepress/core": "2.0.0-rc.0", - "prismjs": "^1.29.0" + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "parse-entities": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vuepress/plugin-shiki": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/plugin-shiki/-/plugin-shiki-2.0.0-rc.0.tgz", - "integrity": "sha512-K06icizhp0zVUtWa6rqL/SKWzzSP+XgYizRoqwdMsGlYNThLXAf4cIseRjF+I4VOFS5aj5hZs8MnxymKmRrwIQ==", - "dev": true, - "dependencies": { - "@vuepress/core": "2.0.0-rc.0", - "shiki": "^0.14.5" + "node_modules/micromark-extension-gfm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz", + "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==", + "dependencies": { + "micromark-extension-gfm-autolink-literal": "^2.0.0", + "micromark-extension-gfm-footnote": "^2.0.0", + "micromark-extension-gfm-strikethrough": "^2.0.0", + "micromark-extension-gfm-table": "^2.0.0", + "micromark-extension-gfm-tagfilter": "^2.0.0", + "micromark-extension-gfm-task-list-item": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vuepress/plugin-shiki/node_modules/shiki": { - "version": "0.14.7", - "resolved": "https://registry.npmmirror.com/shiki/-/shiki-0.14.7.tgz", - "integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==", - "dev": true, + "node_modules/micromark-extension-gfm-autolink-literal": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.0.0.tgz", + "integrity": "sha512-rTHfnpt/Q7dEAK1Y5ii0W8bhfJlVJFnJMHIPisfPK3gpVNuOP0VnRl96+YJ3RYWV/P4gFeQoGKNlT3RhuvpqAg==", "dependencies": { - "ansi-sequence-parser": "^1.1.0", - "jsonc-parser": "^3.2.0", - "vscode-oniguruma": "^1.7.0", - "vscode-textmate": "^8.0.0" + "micromark-util-character": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vuepress/plugin-theme-data": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/plugin-theme-data/-/plugin-theme-data-2.0.0-rc.0.tgz", - "integrity": "sha512-FXY3/Ml+rM6gNKvwdBF6vKAcwnSvtXCzKgQwJAw3ppQTKUkLcbOxqM+h4d8bzHWAAvdnEvQFug5uEZgWllBQbA==", - "dev": true, - "dependencies": { - "@vue/devtools-api": "^6.5.1", - "@vuepress/client": "2.0.0-rc.0", - "@vuepress/core": "2.0.0-rc.0", - "@vuepress/shared": "2.0.0-rc.0", - "@vuepress/utils": "2.0.0-rc.0", - "vue": "^3.3.8" + "node_modules/micromark-extension-gfm-footnote": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.0.0.tgz", + "integrity": "sha512-6Rzu0CYRKDv3BfLAUnZsSlzx3ak6HAoI85KTiijuKIz5UxZxbUI+pD6oHgw+6UtQuiRwnGRhzMmPRv4smcz0fg==", + "dependencies": { + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vuepress/shared": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/shared/-/shared-2.0.0-rc.0.tgz", - "integrity": "sha512-ikdSfjRv5LGM1iv4HHwF9P6gqTjaFCXKPK+hzlkHFHNZO1GLqk7/BPc4F51tAG1s8TcLhUZc+54LrfgS7PkXXA==", - "dev": true, + "node_modules/micromark-extension-gfm-strikethrough": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.0.0.tgz", + "integrity": "sha512-c3BR1ClMp5fxxmwP6AoOY2fXO9U8uFMKs4ADD66ahLTNcwzSCyRVU4k7LPV5Nxo/VJiR4TdzxRQY2v3qIUceCw==", "dependencies": { - "@mdit-vue/types": "^1.0.0", - "@vue/shared": "^3.3.8" + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vuepress/theme-default": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/theme-default/-/theme-default-2.0.0-rc.0.tgz", - "integrity": "sha512-I8Y08evDmMuD1jh3NftPpFFSlCWOizQDJLjN7EQwcg7jiAP4A7c2REo6nBN2EmP24Mi7UrRM+RnytHR5V+pElA==", - "dev": true, + "node_modules/micromark-extension-gfm-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.0.0.tgz", + "integrity": "sha512-PoHlhypg1ItIucOaHmKE8fbin3vTLpDOUg8KAr8gRCF1MOZI9Nquq2i/44wFvviM4WuxJzc3demT8Y3dkfvYrw==", "dependencies": { - "@vuepress/client": "2.0.0-rc.0", - "@vuepress/core": "2.0.0-rc.0", - "@vuepress/plugin-active-header-links": "2.0.0-rc.0", - "@vuepress/plugin-back-to-top": "2.0.0-rc.0", - "@vuepress/plugin-container": "2.0.0-rc.0", - "@vuepress/plugin-external-link-icon": "2.0.0-rc.0", - "@vuepress/plugin-git": "2.0.0-rc.0", - "@vuepress/plugin-medium-zoom": "2.0.0-rc.0", - "@vuepress/plugin-nprogress": "2.0.0-rc.0", - "@vuepress/plugin-palette": "2.0.0-rc.0", - "@vuepress/plugin-prismjs": "2.0.0-rc.0", - "@vuepress/plugin-theme-data": "2.0.0-rc.0", - "@vuepress/shared": "2.0.0-rc.0", - "@vuepress/utils": "2.0.0-rc.0", - "@vueuse/core": "^10.6.1", - "sass": "^1.69.5", - "vue": "^3.3.8", - "vue-router": "^4.2.5" + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" }, - "peerDependencies": { - "sass-loader": "^13.3.2" - }, - "peerDependenciesMeta": { - "sass-loader": { - "optional": true - } + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vuepress/utils": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/@vuepress/utils/-/utils-2.0.0-rc.0.tgz", - "integrity": "sha512-Q1ay/woClDHcW0Qe91KsnHoupdNN0tp/vhjvVLuAYxlv/1Obii7hz9WFcajyyGEhmsYxdvG2sGmcxFA02tuKkw==", - "dev": true, + "node_modules/micromark-extension-gfm-tagfilter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz", + "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==", "dependencies": { - "@types/debug": "^4.1.12", - "@types/fs-extra": "^11.0.4", - "@types/hash-sum": "^1.0.2", - "@vuepress/shared": "2.0.0-rc.0", - "debug": "^4.3.4", - "fs-extra": "^11.1.1", - "globby": "^14.0.0", - "hash-sum": "^2.0.0", - "ora": "^7.0.1", - "picocolors": "^1.0.0", - "upath": "^2.0.1" + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vueuse/core": { - "version": "10.7.1", - "resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-10.7.1.tgz", - "integrity": "sha512-74mWHlaesJSWGp1ihg76vAnfVq9NTv1YT0SYhAQ6zwFNdBkkP+CKKJmVOEHcdSnLXCXYiL5e7MaewblfiYLP7g==", - "dev": true, + "node_modules/micromark-extension-gfm-task-list-item": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.0.1.tgz", + "integrity": "sha512-cY5PzGcnULaN5O7T+cOzfMoHjBW7j+T9D2sucA5d/KbsBTPcYdebm9zUd9zzdgJGCwahV+/W78Z3nbulBYVbTw==", "dependencies": { - "@types/web-bluetooth": "^0.0.20", - "@vueuse/metadata": "10.7.1", - "@vueuse/shared": "10.7.1", - "vue-demi": ">=0.14.6" - } - }, - "node_modules/@vueuse/core/node_modules/vue-demi": { - "version": "0.14.6", - "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.6.tgz", - "integrity": "sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==", - "dev": true, - "hasInstallScript": true, - "bin": { - "vue-demi-fix": "bin/vue-demi-fix.js", - "vue-demi-switch": "bin/vue-demi-switch.js" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "@vue/composition-api": "^1.0.0-rc.1", - "vue": "^3.0.0-0 || ^2.6.0" + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" }, - "peerDependenciesMeta": { - "@vue/composition-api": { - "optional": true - } + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@vueuse/metadata": { - "version": "10.7.1", - "resolved": "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-10.7.1.tgz", - "integrity": "sha512-jX8MbX5UX067DYVsbtrmKn6eG6KMcXxLRLlurGkZku5ZYT3vxgBjui2zajvUZ18QLIjrgBkFRsu7CqTAg18QFw==", - "dev": true - }, - "node_modules/@vueuse/shared": { - "version": "10.7.1", - "resolved": "https://registry.npmmirror.com/@vueuse/shared/-/shared-10.7.1.tgz", - "integrity": "sha512-v0jbRR31LSgRY/C5i5X279A/WQjD6/JsMzGa+eqt658oJ75IvQXAeONmwvEMrvJQKnRElq/frzBR7fhmWY5uLw==", - "dev": true, + "node_modules/micromark-extension-mdx-expression": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-3.0.0.tgz", + "integrity": "sha512-sI0nwhUDz97xyzqJAbHQhp5TfaxEvZZZ2JDqUo+7NvyIYG6BZ5CPPqj2ogUoPJlmXHBnyZUzISg9+oUmU6tUjQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "dependencies": { - "vue-demi": ">=0.14.6" + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-mdx-expression": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/@vueuse/shared/node_modules/vue-demi": { - "version": "0.14.6", - "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.6.tgz", - "integrity": "sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==", - "dev": true, - "hasInstallScript": true, - "bin": { - "vue-demi-fix": "bin/vue-demi-fix.js", - "vue-demi-switch": "bin/vue-demi-switch.js" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "@vue/composition-api": "^1.0.0-rc.1", - "vue": "^3.0.0-0 || ^2.6.0" + "node_modules/micromark-extension-mdx-jsx": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-jsx/-/micromark-extension-mdx-jsx-3.0.0.tgz", + "integrity": "sha512-uvhhss8OGuzR4/N17L1JwvmJIpPhAd8oByMawEKx6NVdBCbesjH4t+vjEp3ZXft9DwvlKSD07fCeI44/N0Vf2w==", + "dependencies": { + "@types/acorn": "^4.0.0", + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "micromark-factory-mdx-expression": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "vfile-message": "^4.0.0" }, - "peerDependenciesMeta": { - "@vue/composition-api": { - "optional": true - } + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@yarnpkg/lockfile": { - "version": "1.1.0", - "resolved": "https://registry.npmmirror.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", - "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", - "dev": true - }, - "node_modules/algoliasearch": { - "version": "4.22.0", - "resolved": "https://registry.npmmirror.com/algoliasearch/-/algoliasearch-4.22.0.tgz", - "integrity": "sha512-gfceltjkwh7PxXwtkS8KVvdfK+TSNQAWUeNSxf4dA29qW5tf2EGwa8jkJujlT9jLm17cixMVoGNc+GJFO1Mxhg==", - "dev": true, + "node_modules/micromark-extension-mdx-md": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-md/-/micromark-extension-mdx-md-2.0.0.tgz", + "integrity": "sha512-EpAiszsB3blw4Rpba7xTOUptcFeBFi+6PY8VnJ2hhimH+vCQDirWgsMpz7w1XcZE7LVrSAUGb9VJpG9ghlYvYQ==", "dependencies": { - "@algolia/cache-browser-local-storage": "4.22.0", - "@algolia/cache-common": "4.22.0", - "@algolia/cache-in-memory": "4.22.0", - "@algolia/client-account": "4.22.0", - "@algolia/client-analytics": "4.22.0", - "@algolia/client-common": "4.22.0", - "@algolia/client-personalization": "4.22.0", - "@algolia/client-search": "4.22.0", - "@algolia/logger-common": "4.22.0", - "@algolia/logger-console": "4.22.0", - "@algolia/requester-browser-xhr": "4.22.0", - "@algolia/requester-common": "4.22.0", - "@algolia/requester-node-http": "4.22.0", - "@algolia/transporter": "4.22.0" + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" + "node_modules/micromark-extension-mdxjs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs/-/micromark-extension-mdxjs-3.0.0.tgz", + "integrity": "sha512-A873fJfhnJ2siZyUrJ31l34Uqwy4xIFmvPY1oj+Ean5PHcPBYzEsvqvWGaWcfEIr11O5Dlw3p2y0tZWpKHDejQ==", + "dependencies": { + "acorn": "^8.0.0", + "acorn-jsx": "^5.0.0", + "micromark-extension-mdx-expression": "^3.0.0", + "micromark-extension-mdx-jsx": "^3.0.0", + "micromark-extension-mdx-md": "^2.0.0", + "micromark-extension-mdxjs-esm": "^3.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/ansi-sequence-parser": { - "version": "1.1.1", - "resolved": "https://registry.npmmirror.com/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz", - "integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==", - "dev": true - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" + "node_modules/micromark-extension-mdxjs-esm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs-esm/-/micromark-extension-mdxjs-esm-3.0.0.tgz", + "integrity": "sha512-DJFl4ZqkErRpq/dAPyeWp15tGrcrrJho1hKK5uBS70BCtfrIFg81sqcTVu3Ta+KD1Tk5vAtBNElWxtAa+m8K9A==", + "dependencies": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-position-from-estree": "^2.0.0", + "vfile-message": "^4.0.0" }, - "engines": { - "node": ">=8" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmmirror.com/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, + "node_modules/micromark-factory-destination": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.0.tgz", + "integrity": "sha512-j9DGrQLm/Uhl2tCzcbLhy5kXsgkHUrjJHg4fFAeoMRwJmJerT9aw4FEhIbZStWN8A3qMwOp1uzHr4UL8AInxtA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/arg": { - "version": "5.0.2", - "resolved": "https://registry.npmmirror.com/arg/-/arg-5.0.2.tgz", - "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", - "dev": true - }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmmirror.com/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, + "node_modules/micromark-factory-label": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.0.tgz", + "integrity": "sha512-RR3i96ohZGde//4WSe/dJsxOX6vxIg9TimLAS3i4EhBAFx8Sm5SmqVfR8E87DPSR31nEAjZfbt91OMZWcNgdZw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "dependencies": { - "sprintf-js": "~1.0.2" + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "dev": true, - "engines": { - "node": ">= 4.0.0" + "node_modules/micromark-factory-mdx-expression": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-mdx-expression/-/micromark-factory-mdx-expression-2.0.1.tgz", + "integrity": "sha512-F0ccWIUHRLRrYp5TC9ZYXmZo+p2AM13ggbsW4T0b5CRKP8KHVRB8t4pwtBgTxtjRmwrK0Irwm7vs2JOZabHZfg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-position-from-estree": "^2.0.0", + "vfile-message": "^4.0.0" } }, - "node_modules/autoprefixer": { - "version": "10.4.16", - "resolved": "https://registry.npmmirror.com/autoprefixer/-/autoprefixer-10.4.16.tgz", - "integrity": "sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==", - "dev": true, + "node_modules/micromark-factory-space": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz", + "integrity": "sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "dependencies": { - "browserslist": "^4.21.10", - "caniuse-lite": "^1.0.30001538", - "fraction.js": "^4.3.6", - "normalize-range": "^0.1.2", - "picocolors": "^1.0.0", - "postcss-value-parser": "^4.2.0" - }, - "bin": { - "autoprefixer": "bin/autoprefixer" - }, - "engines": { - "node": "^10 || ^12 || >=14" - }, - "peerDependencies": { - "postcss": "^8.1.0" + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmmirror.com/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true - }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmmirror.com/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, - "engines": { - "node": ">=8" + "node_modules/micromark-factory-title": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.0.tgz", + "integrity": "sha512-jY8CSxmpWLOxS+t8W+FG3Xigc0RDQA9bKMY/EwILvsesiRniiVMejYTE4wumNc2f4UbAa4WsHqe3J1QS1sli+A==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/bl": { - "version": "5.1.0", - "resolved": "https://registry.npmmirror.com/bl/-/bl-5.1.0.tgz", - "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", - "dev": true, + "node_modules/micromark-factory-whitespace": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.0.tgz", + "integrity": "sha512-28kbwaBjc5yAI1XadbdPYHX/eDnqaUFVikLwrO7FDnKG7lpgxnvk/XGRhX/PN0mOZ+dBSZ+LgunHS+6tYQAzhA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "dependencies": { - "buffer": "^6.0.3", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, + "node_modules/micromark-util-character": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmmirror.com/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, + "node_modules/micromark-util-chunked": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.0.tgz", + "integrity": "sha512-anK8SWmNphkXdaKgz5hJvGa7l00qmcaUQoMYsBwDlSKFKjc6gjGXPDw3FNL3Nbwq5L8gE+RCbGqTw49FK5Qyvg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/browserslist": { - "version": "4.22.2", - "resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.22.2.tgz", - "integrity": "sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==", - "dev": true, + "node_modules/micromark-util-classify-character": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.0.tgz", + "integrity": "sha512-S0ze2R9GH+fu41FA7pbSqNWObo/kzwf8rN/+IGlW/4tC6oACOs8B++bh+i9bVyNnwCcuksbFwsBme5OCKXCwIw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "dependencies": { - "caniuse-lite": "^1.0.30001565", - "electron-to-chromium": "^1.4.601", - "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.13" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmmirror.com/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, + "node_modules/micromark-util-combine-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.0.tgz", + "integrity": "sha512-vZZio48k7ON0fVS3CUgFatWHoKbbLTK/rT7pzpJ4Bjp5JjkZeasRfrS9wsBdDJK2cJLHMckXZdzPSSr1B8a4oQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/cac": { - "version": "6.7.14", - "resolved": "https://registry.npmmirror.com/cac/-/cac-6.7.14.tgz", - "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", - "dev": true, - "engines": { - "node": ">=8" + "node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz", + "integrity": "sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/call-bind": { - "version": "1.0.5", - "resolved": "https://registry.npmmirror.com/call-bind/-/call-bind-1.0.5.tgz", - "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", - "dev": true, + "node_modules/micromark-util-decode-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.0.tgz", + "integrity": "sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "dependencies": { - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.1", - "set-function-length": "^1.1.1" + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/caniuse-lite": { - "version": "1.0.30001572", - "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001572.tgz", - "integrity": "sha512-1Pbh5FLmn5y4+QhNyJE9j3/7dK44dGB83/ZMjv/qJk86TvDbjk0LosiZo0i0WB0Vx607qMX9jYrn1VLHCkN4rw==", - "dev": true + "node_modules/micromark-util-encode": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz", + "integrity": "sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] }, - "node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmmirror.com/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "dev": true, - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" + "node_modules/micromark-util-events-to-acorn": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-events-to-acorn/-/micromark-util-events-to-acorn-2.0.2.tgz", + "integrity": "sha512-Fk+xmBrOv9QZnEDguL9OI9/NQQp6Hz4FuQ4YmCb/5V7+9eAh1s6AYSvL20kHkD67YIg7EpE54TiSlcsf3vyZgA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "@types/acorn": "^4.0.0", + "@types/estree": "^1.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "estree-util-visit": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "vfile-message": "^4.0.0" } }, - "node_modules/cheerio": { - "version": "1.0.0-rc.12", - "resolved": "https://registry.npmmirror.com/cheerio/-/cheerio-1.0.0-rc.12.tgz", - "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", - "dev": true, + "node_modules/micromark-util-html-tag-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.0.tgz", + "integrity": "sha512-xNn4Pqkj2puRhKdKTm8t1YHC/BAjx6CEwRFXntTaRf/x16aqka6ouVoutm+QdkISTlT7e2zU7U4ZdlDLJd2Mcw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromark-util-normalize-identifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.0.tgz", + "integrity": "sha512-2xhYT0sfo85FMrUPtHcPo2rrp1lwbDEEzpx7jiH2xXJLqBuy4H0GgXk5ToU8IEwoROtXuL8ND0ttVa4rNqYK3w==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "dependencies": { - "cheerio-select": "^2.1.0", - "dom-serializer": "^2.0.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "htmlparser2": "^8.0.1", - "parse5": "^7.0.0", - "parse5-htmlparser2-tree-adapter": "^7.0.0" - }, - "engines": { - "node": ">= 6" + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/cheerio-select": { - "version": "2.1.0", - "resolved": "https://registry.npmmirror.com/cheerio-select/-/cheerio-select-2.1.0.tgz", - "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", - "dev": true, + "node_modules/micromark-util-resolve-all": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.0.tgz", + "integrity": "sha512-6KU6qO7DZ7GJkaCgwBNtplXCvGkJToU86ybBAUdavvgsCiG8lSSvYxr9MhwmQ+udpzywHsl4RpGJsYWG1pDOcA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "dependencies": { - "boolbase": "^1.0.0", - "css-select": "^5.1.0", - "css-what": "^6.1.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1" + "micromark-util-types": "^2.0.0" } }, - "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmmirror.com/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, + "node_modules/micromark-util-sanitize-uri": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz", + "integrity": "sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" } }, - "node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmmirror.com/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "dev": true, - "engines": { - "node": ">=8" + "node_modules/micromark-util-subtokenize": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.0.tgz", + "integrity": "sha512-vc93L1t+gpR3p8jxeVdaYlbV2jTYteDje19rNSS/H5dlhxUYll5Fy6vJ2cDwP8RnsXi818yGty1ayP55y3W6fg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" } }, - "node_modules/cli-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/cli-cursor/-/cli-cursor-4.0.0.tgz", - "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", - "dev": true, + "node_modules/micromark-util-symbol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromark-util-types": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.0.tgz", + "integrity": "sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dependencies": { - "restore-cursor": "^4.0.0" + "braces": "^3.0.2", + "picomatch": "^2.3.1" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=8.6" } }, - "node_modules/cli-spinners": { - "version": "2.9.2", - "resolved": "https://registry.npmmirror.com/cli-spinners/-/cli-spinners-2.9.2.tgz", - "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", - "dev": true, + "node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "bin": { + "mime": "cli.js" + }, "engines": { - "node": ">=6" + "node": ">=10.0.0" } }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "engines": { + "node": ">=12" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "optional": true, "engines": { - "node": ">=7.0.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmmirror.com/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "optional": true }, - "node_modules/connect-history-api-fallback": { - "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz", - "integrity": "sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA==", - "dev": true, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/muggle-string": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.4.1.tgz", + "integrity": "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==" + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, "engines": { - "node": ">=0.8" + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, + "node_modules/napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", + "optional": true + }, + "node_modules/nlcst-to-string": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-3.1.1.tgz", + "integrity": "sha512-63mVyqaqt0cmn2VcI2aH6kxe1rLAmSROqHMA0i4qqg1tidkfExgpb0FGMikMCn86mw5dFtBtEANfmSSK7TjNHw==", "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "@types/nlcst": "^1.0.0" }, - "engines": { - "node": ">= 8" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/css-select": { - "version": "5.1.0", - "resolved": "https://registry.npmmirror.com/css-select/-/css-select-5.1.0.tgz", - "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", - "dev": true, + "node_modules/node-abi": { + "version": "3.54.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.54.0.tgz", + "integrity": "sha512-p7eGEiQil0YUV3ItH4/tBb781L5impVmmx2E9FRKF7d18XXzp4PGT2tdYMFY6wQqgxD0IwNZOiSJ0/K0fSi/OA==", + "optional": true, "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.1.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "nth-check": "^2.0.1" + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" } }, - "node_modules/css-what": { + "node_modules/node-addon-api": { "version": "6.1.0", - "resolved": "https://registry.npmmirror.com/css-what/-/css-what-6.1.0.tgz", - "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", - "dev": true, + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", + "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==", + "optional": true + }, + "node_modules/node-releases": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==" + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "engines": { - "node": ">= 6" + "node": ">=0.10.0" } }, - "node_modules/csstype": { - "version": "3.1.3", - "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz", - "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", - "dev": true - }, - "node_modules/dayjs": { - "version": "1.11.10", - "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.10.tgz", - "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==", - "dev": true + "node_modules/not": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/not/-/not-0.1.0.tgz", + "integrity": "sha512-5PDmaAsVfnWUgTUbJ3ERwn7u79Z0dYxN9ErxCpVJJqe2RK0PJ3z+iFUxuqjwtlDDegXvtWoxD/3Fzxox7tFGWA==" }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmmirror.com/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, + "node_modules/npm-run-path": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", + "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", "dependencies": { - "ms": "2.1.2" + "path-key": "^4.0.0" }, "engines": { - "node": ">=6.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "engines": { + "node": ">=12" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/define-data-property": { - "version": "1.1.1", - "resolved": "https://registry.npmmirror.com/define-data-property/-/define-data-property-1.1.1.tgz", - "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", - "dev": true, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", "dependencies": { - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "boolbase": "^1.0.0" }, - "engines": { - "node": ">= 0.4" + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" } }, - "node_modules/dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "dev": true, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "optional": true, "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" - } - }, - "node_modules/dom-serializer/node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, - "engines": { - "node": ">=0.12" + "wrappy": "1" } }, - "node_modules/domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmmirror.com/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", - "dev": true - }, - "node_modules/domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmmirror.com/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "dev": true, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dependencies": { - "domelementtype": "^2.3.0" + "mimic-fn": "^4.0.0" }, "engines": { - "node": ">= 4" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/domutils": { - "version": "3.1.0", - "resolved": "https://registry.npmmirror.com/domutils/-/domutils-3.1.0.tgz", - "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", - "dev": true, + "node_modules/ora": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-7.0.1.tgz", + "integrity": "sha512-0TUxTiFJWv+JnjWm4o9yvuskpEJLXTcng8MJuKd+SzAzp2o+OP3HWqNhB4OdJRt1Vsd9/mR0oyaEYlOnL7XIRw==", "dependencies": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3" + "chalk": "^5.3.0", + "cli-cursor": "^4.0.0", + "cli-spinners": "^2.9.0", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^1.3.0", + "log-symbols": "^5.1.0", + "stdin-discarder": "^0.1.0", + "string-width": "^6.1.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmmirror.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, - "node_modules/electron-to-chromium": { - "version": "1.4.617", - "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.617.tgz", - "integrity": "sha512-sYNE3QxcDS4ANW1k4S/wWYMXjCVcFSOX3Bg8jpuMFaXt/x8JCmp0R1Xe1ZXDX4WXnSRBf+GJ/3eGWicUuQq5cg==", - "dev": true - }, - "node_modules/emoji-regex": { - "version": "10.3.0", - "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-10.3.0.tgz", - "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==", - "dev": true - }, - "node_modules/entities": { - "version": "3.0.1", - "resolved": "https://registry.npmmirror.com/entities/-/entities-3.0.1.tgz", - "integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==", - "dev": true, + "node_modules/ora/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "engines": { - "node": ">=0.12" + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/envinfo": { - "version": "7.11.0", - "resolved": "https://registry.npmmirror.com/envinfo/-/envinfo-7.11.0.tgz", - "integrity": "sha512-G9/6xF1FPbIw0TtalAMaVPpiq2aDEuKLXM314jPVAO9r2fo2a4BLqMNkmRS7O/xPPZ+COAhGIz3ETvHEV3eUcg==", - "dev": true, - "bin": { - "envinfo": "dist/cli.js" + "node_modules/ora/node_modules/string-width": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-6.1.0.tgz", + "integrity": "sha512-k01swCJAgQmuADB0YIc+7TuatfNvTBVOoaUWJjTB9R4VJzR5vNWzf5t42ESVZFPS8xTySF7CAdV4t/aaIm3UnQ==", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^10.2.1", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=4" + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/esbuild": { - "version": "0.19.11", - "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.19.11.tgz", - "integrity": "sha512-HJ96Hev2hX/6i5cDVwcqiJBBtuo9+FeIJOtZ9W1kA5M6AMJRHUZlpYZ1/SbEwtO0ioNAW8rUooVpC/WehY2SfA==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" + "node_modules/p-limit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "dependencies": { + "yocto-queue": "^1.0.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.19.11", - "@esbuild/android-arm": "0.19.11", - "@esbuild/android-arm64": "0.19.11", - "@esbuild/android-x64": "0.19.11", - "@esbuild/darwin-arm64": "0.19.11", - "@esbuild/darwin-x64": "0.19.11", - "@esbuild/freebsd-arm64": "0.19.11", - "@esbuild/freebsd-x64": "0.19.11", - "@esbuild/linux-arm": "0.19.11", - "@esbuild/linux-arm64": "0.19.11", - "@esbuild/linux-ia32": "0.19.11", - "@esbuild/linux-loong64": "0.19.11", - "@esbuild/linux-mips64el": "0.19.11", - "@esbuild/linux-ppc64": "0.19.11", - "@esbuild/linux-riscv64": "0.19.11", - "@esbuild/linux-s390x": "0.19.11", - "@esbuild/linux-x64": "0.19.11", - "@esbuild/netbsd-x64": "0.19.11", - "@esbuild/openbsd-x64": "0.19.11", - "@esbuild/sunos-x64": "0.19.11", - "@esbuild/win32-arm64": "0.19.11", - "@esbuild/win32-ia32": "0.19.11", - "@esbuild/win32-x64": "0.19.11" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmmirror.com/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dependencies": { + "p-limit": "^3.0.2" + }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmmirror.com/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" + "node_modules/p-locate/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dependencies": { + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true + "node_modules/p-locate/node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "node_modules/execa": { + "node_modules/p-queue": { "version": "8.0.1", - "resolved": "https://registry.npmmirror.com/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dev": true, + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-8.0.1.tgz", + "integrity": "sha512-NXzu9aQJTAzbBqOt2hwsR63ea7yvxJc0PwN/zobNAudYfb1B7R08SzB4TsLeSbUCuG467NhnoT0oO6w1qRO+BA==", "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" + "eventemitter3": "^5.0.1", + "p-timeout": "^6.1.2" }, "engines": { - "node": ">=16.17" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" + "node_modules/p-timeout": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", + "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", + "engines": { + "node": ">=14.16" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, - "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmmirror.com/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "node_modules/pagefind": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/pagefind/-/pagefind-1.0.4.tgz", + "integrity": "sha512-oRIizYe+zSI2Jw4zcMU0ebDZm27751hRFiSOBLwc1OIYMrsZKk+3m8p9EVaOmc6zZdtqwwdilNUNxXvBeHcP9w==", + "bin": { + "pagefind": "lib/runner/bin.cjs" }, - "engines": { - "node": ">=8.6.0" + "optionalDependencies": { + "@pagefind/darwin-arm64": "1.0.4", + "@pagefind/darwin-x64": "1.0.4", + "@pagefind/linux-arm64": "1.0.4", + "@pagefind/linux-x64": "1.0.4", + "@pagefind/windows-x64": "1.0.4" } }, - "node_modules/fastq": { - "version": "1.16.0", - "resolved": "https://registry.npmmirror.com/fastq/-/fastq-1.16.0.tgz", - "integrity": "sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" + "node_modules/parse-entities": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.1.tgz", + "integrity": "sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w==", + "dependencies": { + "@types/unist": "^2.0.0", + "character-entities": "^2.0.0", + "character-entities-legacy": "^3.0.0", + "character-reference-invalid": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0", + "is-hexadecimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/fflate": { - "version": "0.8.1", - "resolved": "https://registry.npmmirror.com/fflate/-/fflate-0.8.1.tgz", - "integrity": "sha512-/exOvEuc+/iaUm105QIiOt4LpBdMTWsXxqR0HDF35vx3fmaKzw7354gTilCh5rkzEt8WYyG//ku3h3nRmd7CHQ==", - "dev": true + "node_modules/parse-entities/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmmirror.com/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, + "node_modules/parse-latin": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/parse-latin/-/parse-latin-5.0.1.tgz", + "integrity": "sha512-b/K8ExXaWC9t34kKeDV8kGXBkXZ1HCSAZRYE7HR14eA1GlXX5L8iWhs8USJNhQU9q5ci413jCKF0gOyovvyRBg==", "dependencies": { - "to-regex-range": "^5.0.1" + "nlcst-to-string": "^3.0.0", + "unist-util-modify-children": "^3.0.0", + "unist-util-visit-children": "^2.0.0" }, - "engines": { - "node": ">=8" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/find-yarn-workspace-root": { - "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", - "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", - "dev": true, + "node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", "dependencies": { - "micromatch": "^4.0.2" + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/fraction.js": { - "version": "4.3.7", - "resolved": "https://registry.npmmirror.com/fraction.js/-/fraction.js-4.3.7.tgz", - "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==", - "dev": true, - "engines": { - "node": "*" - } + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" }, - "node_modules/fs-extra": { - "version": "11.2.0", - "resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-11.2.0.tgz", - "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "engines": { - "node": ">=14.14" + "node": ">=8" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + "node": ">=8" } }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, - "node_modules/get-intrinsic": { - "version": "1.2.2", - "resolved": "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.2.2.tgz", - "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", - "dev": true, + "node_modules/path-to-regexp": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", + "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==" + }, + "node_modules/periscopic": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz", + "integrity": "sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==", "dependencies": { - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "@types/estree": "^1.0.0", + "estree-walker": "^3.0.0", + "is-reference": "^3.0.0" } }, - "node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmmirror.com/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "engines": { - "node": ">=16" + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmmirror.com/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "engines": { - "node": "*" + "node": ">=6" } }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmmirror.com/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dependencies": { - "is-glob": "^4.0.1" + "find-up": "^4.0.0" }, "engines": { - "node": ">= 6" + "node": ">=8" } }, - "node_modules/globby": { - "version": "14.0.0", - "resolved": "https://registry.npmmirror.com/globby/-/globby-14.0.0.tgz", - "integrity": "sha512-/1WM/LNHRAOH9lZta77uGbq0dAEQM+XjNesWwhlERDVenqothRbnzTrL3/LrIoEPPjeUHC3vrS6TwoyxeHs7MQ==", - "dev": true, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dependencies": { - "@sindresorhus/merge-streams": "^1.0.0", - "fast-glob": "^3.3.2", - "ignore": "^5.2.4", - "path-type": "^5.0.0", - "slash": "^5.1.0", - "unicorn-magic": "^0.1.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=18" + "node": ">=8" } }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dependencies": { - "get-intrinsic": "^1.1.3" + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true - }, - "node_modules/gray-matter": { - "version": "4.0.3", - "resolved": "https://registry.npmmirror.com/gray-matter/-/gray-matter-4.0.3.tgz", - "integrity": "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==", - "dev": true, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dependencies": { - "js-yaml": "^3.13.1", - "kind-of": "^6.0.2", - "section-matter": "^1.0.0", - "strip-bom-string": "^1.0.0" + "p-try": "^2.0.0" }, "engines": { - "node": ">=6.0" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dependencies": { + "p-limit": "^2.2.0" + }, "engines": { "node": ">=8" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", - "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", - "dev": true, + "node_modules/postcss": { + "version": "8.4.35", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", + "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "dependencies": { - "get-intrinsic": "^1.2.2" + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" } }, - "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true, + "node_modules/postcss-nested": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.0.1.tgz", + "integrity": "sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==", + "dependencies": { + "postcss-selector-parser": "^6.0.11" + }, "engines": { - "node": ">= 0.4" + "node": ">=12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.2.14" } }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, + "node_modules/postcss-selector-parser": { + "version": "6.0.15", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.15.tgz", + "integrity": "sha512-rEYkQOMUCEMhsKbK66tbEU9QVIxbhN18YiniAwA7XQYTVBqrBy+P2p5JcdqsHgKM2zWylp8d7J6eszocfds5Sw==", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, "engines": { - "node": ">= 0.4" + "node": ">=4" } }, - "node_modules/hash-sum": { - "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-2.0.0.tgz", - "integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==", - "dev": true - }, - "node_modules/hasown": { - "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/hasown/-/hasown-2.0.0.tgz", - "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", - "dev": true, + "node_modules/prebuild-install": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", + "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", + "optional": true, "dependencies": { - "function-bind": "^1.1.2" + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" }, "engines": { - "node": ">= 0.4" + "node": ">=10" } }, - "node_modules/htmlparser2": { - "version": "8.0.2", - "resolved": "https://registry.npmmirror.com/htmlparser2/-/htmlparser2-8.0.2.tgz", - "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", - "dev": true, + "node_modules/prebuild-install/node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "optional": true, "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "entities": "^4.4.0" + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" } }, - "node_modules/htmlparser2/node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, - "engines": { - "node": ">=0.12" + "node_modules/prebuild-install/node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "optional": true, + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" } }, - "node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmmirror.com/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "dev": true, - "engines": { - "node": ">=16.17.0" + "node_modules/prebuild-install/node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "optional": true, + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" } }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true - }, - "node_modules/ignore": { - "version": "5.3.0", - "resolved": "https://registry.npmmirror.com/ignore/-/ignore-5.3.0.tgz", - "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", - "dev": true, + "node_modules/prebuild-install/node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "optional": true, + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, "engines": { - "node": ">= 4" + "node": ">=6" } }, - "node_modules/immutable": { - "version": "4.3.4", - "resolved": "https://registry.npmmirror.com/immutable/-/immutable-4.3.4.tgz", - "integrity": "sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA==", - "dev": true - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmmirror.com/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, + "node_modules/preferred-pm": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/preferred-pm/-/preferred-pm-3.1.2.tgz", + "integrity": "sha512-nk7dKrcW8hfCZ4H6klWcdRknBOXWzNQByJ0oJyX97BOupsYD+FzLS4hflgEu/uPUEHZCuRfMxzCBsuWd7OzT8Q==", "dependencies": { - "once": "^1.3.0", - "wrappy": "1" + "find-up": "^5.0.0", + "find-yarn-workspace-root2": "1.2.16", + "path-exists": "^4.0.0", + "which-pm": "2.0.0" + }, + "engines": { + "node": ">=10" } }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmmirror.com/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, + "node_modules/preferred-pm/node_modules/which-pm": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-2.0.0.tgz", + "integrity": "sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==", "dependencies": { - "binary-extensions": "^2.0.0" + "load-yaml-file": "^0.2.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=8.15" } }, - "node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmmirror.com/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "dev": true, + "node_modules/prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "devOptional": true, "bin": { - "is-docker": "cli.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=8" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmmirror.com/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "dev": true, + "node_modules/prettier-plugin-astro": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-astro/-/prettier-plugin-astro-0.13.0.tgz", + "integrity": "sha512-5HrJNnPmZqTUNoA97zn4gNQv9BgVhv+et03314WpQ9H9N8m2L9OSV798olwmG2YLXPl1iSstlJCR1zB3x5xG4g==", + "devOptional": true, + "dependencies": { + "@astrojs/compiler": "^1.5.5", + "prettier": "^3.0.0", + "sass-formatter": "^0.7.6" + }, "engines": { - "node": ">=0.10.0" + "node": "^14.15.0 || >=16.0.0" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmmirror.com/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, + "node_modules/prettier-plugin-astro/node_modules/@astrojs/compiler": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-1.8.2.tgz", + "integrity": "sha512-o/ObKgtMzl8SlpIdzaxFnt7SATKPxu4oIP/1NL+HDJRzxfJcAkOTAb/ZKMRyULbz4q+1t2/DAebs2Z1QairkZw==", + "devOptional": true + }, + "node_modules/prismjs": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", + "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmmirror.com/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", "dependencies": { - "is-extglob": "^2.1.1" + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" }, "engines": { - "node": ">=0.10.0" + "node": ">= 6" } }, - "node_modules/is-interactive": { - "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/is-interactive/-/is-interactive-2.0.0.tgz", - "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", - "dev": true, + "node_modules/prompts/node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "engines": { - "node": ">=12" + "node": ">=6" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmmirror.com/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" + "node_modules/property-information": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.4.1.tgz", + "integrity": "sha512-OHYtXfu5aI2sS2LWFSN5rgJjrQ4pCy8i1jubJLe2QvMF8JJ++HXTUIVWFLfXJoaOfvYYjk2SN8J2wFUWIGXT4w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/is-stream": { + "node_modules/pump": { "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "optional": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" } }, - "node_modules/is-unicode-supported": { - "version": "1.3.0", - "resolved": "https://registry.npmmirror.com/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", - "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", - "dev": true, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/queue-tick": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", + "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", + "optional": true + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "optional": true, + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, "engines": { - "node": ">=12" + "node": ">= 6" } }, - "node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmmirror.com/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dev": true, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dependencies": { - "is-docker": "^2.0.0" + "picomatch": "^2.2.1" }, "engines": { - "node": ">=8" + "node": ">=8.10.0" } }, - "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmmirror.com/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true + "node_modules/rehype": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/rehype/-/rehype-13.0.1.tgz", + "integrity": "sha512-AcSLS2mItY+0fYu9xKxOu1LhUZeBZZBx8//5HKzF+0XP+eP8+6a5MXn2+DW2kfXR6Dtp1FEXMVrjyKAcvcU8vg==", + "dependencies": { + "@types/hast": "^3.0.0", + "rehype-parse": "^9.0.0", + "rehype-stringify": "^10.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "node_modules/rehype-parse": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-9.0.0.tgz", + "integrity": "sha512-WG7nfvmWWkCR++KEkZevZb/uw41E8TsH4DsY9UxsTbIXCVGbAs4S+r8FrQ+OtH5EEQAs+5UxKC42VinkmpA1Yw==", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-from-html": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmmirror.com/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, + "node_modules/rehype-raw": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-7.0.0.tgz", + "integrity": "sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==", "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "@types/hast": "^3.0.0", + "hast-util-raw": "^9.0.0", + "vfile": "^6.0.0" }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/json-stable-stringify": { - "version": "1.1.0", - "resolved": "https://registry.npmmirror.com/json-stable-stringify/-/json-stable-stringify-1.1.0.tgz", - "integrity": "sha512-zfA+5SuwYN2VWqN1/5HZaDzQKLJHaBVMZIIM+wuYjdptkaQsqzDdqjqf+lZZJUuJq1aanHiY8LhH8LmH+qBYJA==", - "dev": true, + "node_modules/rehype-stringify": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-10.0.0.tgz", + "integrity": "sha512-1TX1i048LooI9QoecrXy7nGFFbFSufxVRAfc6Y9YMRAi56l+oB0zP51mLSV312uRuvVLPV1opSlJmslozR1XHQ==", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-to-html": "^9.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-directive": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/remark-directive/-/remark-directive-3.0.0.tgz", + "integrity": "sha512-l1UyWJ6Eg1VPU7Hm/9tt0zKtReJQNOA4+iDMAxTyZNWnJnFlbS/7zhiel/rogTLQ2vMYwDzSJa4BiVNqGlqIMA==", "dependencies": { - "call-bind": "^1.0.5", - "isarray": "^2.0.5", - "jsonify": "^0.0.1", - "object-keys": "^1.1.1" + "@types/mdast": "^4.0.0", + "mdast-util-directive": "^3.0.0", + "micromark-extension-directive": "^3.0.0", + "unified": "^11.0.0" }, - "engines": { - "node": ">= 0.4" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmmirror.com/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", - "dev": true + "node_modules/remark-expressive-code": { + "version": "0.33.4", + "resolved": "https://registry.npmjs.org/remark-expressive-code/-/remark-expressive-code-0.33.4.tgz", + "integrity": "sha512-ucGzDknAY6LJKkcNSaYh9N0SEr1LDA0shageM1xa+4fu/o+7g6R1/ApF7d2c+cj1ERLvaF4OaUa87n5baY+MDA==", + "dependencies": { + "expressive-code": "^0.33.4", + "hast-util-to-html": "^8.0.4", + "unist-util-visit": "^4.1.2" + } }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmmirror.com/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, + "node_modules/remark-expressive-code/node_modules/@types/hast": { + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.10.tgz", + "integrity": "sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==", "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" + "@types/unist": "^2" } }, - "node_modules/jsonify": { - "version": "0.0.1", - "resolved": "https://registry.npmmirror.com/jsonify/-/jsonify-0.0.1.tgz", - "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", - "dev": true + "node_modules/remark-expressive-code/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmmirror.com/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node_modules/remark-expressive-code/node_modules/hast-util-from-parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-7.1.2.tgz", + "integrity": "sha512-Nz7FfPBuljzsN3tCQ4kCBKqdNhQE2l0Tn+X1ubgKBPRoiDIu1mL08Cfw4k7q71+Duyaw7DXDN+VTAp4Vh3oCOw==", + "dependencies": { + "@types/hast": "^2.0.0", + "@types/unist": "^2.0.0", + "hastscript": "^7.0.0", + "property-information": "^6.0.0", + "vfile": "^5.0.0", + "vfile-location": "^4.0.0", + "web-namespaces": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/klaw-sync": { - "version": "6.0.0", - "resolved": "https://registry.npmmirror.com/klaw-sync/-/klaw-sync-6.0.0.tgz", - "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", - "dev": true, + "node_modules/remark-expressive-code/node_modules/hast-util-parse-selector": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-3.1.1.tgz", + "integrity": "sha512-jdlwBjEexy1oGz0aJ2f4GKMaVKkA9jwjr4MjAAI22E5fM/TXVZHuS5OpONtdeIkRKqAaryQ2E9xNQxijoThSZA==", "dependencies": { - "graceful-fs": "^4.1.11" + "@types/hast": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/lefthook": { - "version": "1.6.1", - "resolved": "https://registry.npmmirror.com/lefthook/-/lefthook-1.6.1.tgz", - "integrity": "sha512-1T+tk0V6ubZgiZJGi39QlLMAcgEw+lhoDeSpT3L8Y/f8nUpJW9ntcMOmt+uvMfQ3TVjNcR1r/Lhtm7gTqgdcPg==", - "dev": true, - "hasInstallScript": true, - "bin": { - "lefthook": "bin/index.js" + "node_modules/remark-expressive-code/node_modules/hast-util-raw": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-7.2.3.tgz", + "integrity": "sha512-RujVQfVsOrxzPOPSzZFiwofMArbQke6DJjnFfceiEbFh7S05CbPt0cYN+A5YeD3pso0JQk6O1aHBnx9+Pm2uqg==", + "dependencies": { + "@types/hast": "^2.0.0", + "@types/parse5": "^6.0.0", + "hast-util-from-parse5": "^7.0.0", + "hast-util-to-parse5": "^7.0.0", + "html-void-elements": "^2.0.0", + "parse5": "^6.0.0", + "unist-util-position": "^4.0.0", + "unist-util-visit": "^4.0.0", + "vfile": "^5.0.0", + "web-namespaces": "^2.0.0", + "zwitch": "^2.0.0" }, - "optionalDependencies": { - "lefthook-darwin-arm64": "1.6.1", - "lefthook-darwin-x64": "1.6.1", - "lefthook-freebsd-arm64": "1.6.1", - "lefthook-freebsd-x64": "1.6.1", - "lefthook-linux-arm64": "1.6.1", - "lefthook-linux-x64": "1.6.1", - "lefthook-windows-arm64": "1.6.1", - "lefthook-windows-x64": "1.6.1" - } - }, - "node_modules/lefthook-darwin-arm64": { - "version": "1.6.1", - "resolved": "https://registry.npmmirror.com/lefthook-darwin-arm64/-/lefthook-darwin-arm64-1.6.1.tgz", - "integrity": "sha512-q6+sYr2Dpt6YnBGXRjMFcXZUnVB97nH+s7EP/tX8m9ewvQxLPqIiUPyAumfyJ2Siomkc5WgAinG+kT63VjUN3A==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-expressive-code/node_modules/hast-util-to-html": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-8.0.4.tgz", + "integrity": "sha512-4tpQTUOr9BMjtYyNlt0P50mH7xj0Ks2xpo8M943Vykljf99HW6EzulIoJP1N3eKOSScEHzyzi9dm7/cn0RfGwA==", + "dependencies": { + "@types/hast": "^2.0.0", + "@types/unist": "^2.0.0", + "ccount": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-raw": "^7.0.0", + "hast-util-whitespace": "^2.0.0", + "html-void-elements": "^2.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "stringify-entities": "^4.0.0", + "zwitch": "^2.0.4" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "node_modules/lefthook-darwin-x64": { - "version": "1.6.1", - "resolved": "https://registry.npmmirror.com/lefthook-darwin-x64/-/lefthook-darwin-x64-1.6.1.tgz", - "integrity": "sha512-utm7FwtbW8SxGMALIw5/iG4loYS2FI0crDKp/YIamrZgQr6M4pS2C3rxGj5OwiHFIm3arVU+3VZywdvRLJAw0w==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] + "node_modules/remark-expressive-code/node_modules/hast-util-to-parse5": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-7.1.0.tgz", + "integrity": "sha512-YNRgAJkH2Jky5ySkIqFXTQiaqcAtJyVE+D5lkN6CdtOqrnkLfGYYrEcKuHOJZlp+MwjSwuD3fZuawI+sic/RBw==", + "dependencies": { + "@types/hast": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "web-namespaces": "^2.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "node_modules/lefthook-freebsd-arm64": { - "version": "1.6.1", - "resolved": "https://registry.npmmirror.com/lefthook-freebsd-arm64/-/lefthook-freebsd-arm64-1.6.1.tgz", - "integrity": "sha512-F2BoDnGznkJyn6lyhmXpu62yq7SMCeHAl3Bl8c+P6mXfmatjjxEpVmrzRuzKMPd/MRGpy2B/glkuyO4wZZazow==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ] + "node_modules/remark-expressive-code/node_modules/hast-util-whitespace": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz", + "integrity": "sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "node_modules/lefthook-freebsd-x64": { - "version": "1.6.1", - "resolved": "https://registry.npmmirror.com/lefthook-freebsd-x64/-/lefthook-freebsd-x64-1.6.1.tgz", - "integrity": "sha512-/NBjMUtnwvdc/p821sfPnZCbWZ6FQkAvnvjoaQu6tkajKZbZYSKsl7UtAicO0nT+79BQFt7TbaZjpua2T9tM5w==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ] + "node_modules/remark-expressive-code/node_modules/hastscript": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-7.2.0.tgz", + "integrity": "sha512-TtYPq24IldU8iKoJQqvZOuhi5CyCQRAbvDOX0x1eW6rsHSxa/1i2CCiptNTotGHJ3VoHRGmqiv6/D3q113ikkw==", + "dependencies": { + "@types/hast": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-parse-selector": "^3.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "node_modules/lefthook-linux-arm64": { - "version": "1.6.1", - "resolved": "https://registry.npmmirror.com/lefthook-linux-arm64/-/lefthook-linux-arm64-1.6.1.tgz", - "integrity": "sha512-ke+2ni/bmxgYJSRsH+uIYYfTLj2It7WP+mcF4rfJHRbzn5yDYIjFgylUMC2CgW5urS4DSbxcRIbAqLY3OXAHnw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] + "node_modules/remark-expressive-code/node_modules/html-void-elements": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-2.0.1.tgz", + "integrity": "sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } }, - "node_modules/lefthook-linux-x64": { - "version": "1.6.1", - "resolved": "https://registry.npmmirror.com/lefthook-linux-x64/-/lefthook-linux-x64-1.6.1.tgz", - "integrity": "sha512-/HLkl9jt3XRjT0RPaLpAgUQmvp4zV/KKZ/8x6xslPl89krv3ZkHKKrqeaHdhiengq3hzx3N+KbOfFcxBRzdT6A==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] + "node_modules/remark-expressive-code/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" }, - "node_modules/lefthook-windows-arm64": { - "version": "1.6.1", - "resolved": "https://registry.npmmirror.com/lefthook-windows-arm64/-/lefthook-windows-arm64-1.6.1.tgz", - "integrity": "sha512-RyQ8S4/45BpJpRPy7KsOuJeXQ5FOa7MASoPtOYvrXt4A8kayCv1jlGs7MTv3XJbUosCJhfNpw3ReeHVGfw1KIw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] + "node_modules/remark-expressive-code/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "node_modules/lefthook-windows-x64": { - "version": "1.6.1", - "resolved": "https://registry.npmmirror.com/lefthook-windows-x64/-/lefthook-windows-x64-1.6.1.tgz", - "integrity": "sha512-poYLk2tfg1Ncr4aZeFuhHjv1qH6f9hX3tV1FOK2MfWkXkRTYPl6MF5h/ONMIv71BsLjGbAA7LNXM5Mj4/B//lQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] + "node_modules/remark-expressive-code/node_modules/unist-util-position": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.4.tgz", + "integrity": "sha512-kUBE91efOWfIVBo8xzh/uZQ7p9ffYRtUbMRZBNFYwf0RK8koUMx6dGUfwylLOKmaT2cs4wSW96QoYUSXAyEtpg==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, - "node_modules/lilconfig": { - "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/lilconfig/-/lilconfig-3.0.0.tgz", - "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", - "dev": true, - "engines": { - "node": ">=14" + "node_modules/remark-expressive-code/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/linkify-it": { - "version": "4.0.1", - "resolved": "https://registry.npmmirror.com/linkify-it/-/linkify-it-4.0.1.tgz", - "integrity": "sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw==", - "dev": true, + "node_modules/remark-expressive-code/node_modules/unist-util-visit": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", + "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", "dependencies": { - "uc.micro": "^1.0.1" + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.1.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/log-symbols": { - "version": "5.1.0", - "resolved": "https://registry.npmmirror.com/log-symbols/-/log-symbols-5.1.0.tgz", - "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", - "dev": true, + "node_modules/remark-expressive-code/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", "dependencies": { - "chalk": "^5.0.0", - "is-unicode-supported": "^1.1.0" + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" }, - "engines": { - "node": ">=12" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, + "node_modules/remark-expressive-code/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", "dependencies": { - "yallist": "^4.0.0" + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" }, - "engines": { - "node": ">=10" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/magic-string": { - "version": "0.30.5", - "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.5.tgz", - "integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==", - "dev": true, + "node_modules/remark-expressive-code/node_modules/vfile-location": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.1.0.tgz", + "integrity": "sha512-YF23YMyASIIJXpktBa4vIGLJ5Gs88UB/XePgqPmTa7cDA+JeO3yclbpheQYCHjVHBn/yePzrXuygIL+xbvRYHw==", "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" + "@types/unist": "^2.0.0", + "vfile": "^5.0.0" }, - "engines": { - "node": ">=12" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/markdown-it": { - "version": "13.0.2", - "resolved": "https://registry.npmmirror.com/markdown-it/-/markdown-it-13.0.2.tgz", - "integrity": "sha512-FtwnEuuK+2yVU7goGn/MJ0WBZMM9ZPgU9spqlFs7/A/pDIUNSOQZhUgOqYCficIuR2QaFnrt8LHqBWsbTAoI5w==", - "dev": true, + "node_modules/remark-expressive-code/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", "dependencies": { - "argparse": "^2.0.1", - "entities": "~3.0.1", - "linkify-it": "^4.0.1", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" }, - "bin": { - "markdown-it": "bin/markdown-it.js" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/markdown-it-anchor": { - "version": "8.6.7", - "resolved": "https://registry.npmmirror.com/markdown-it-anchor/-/markdown-it-anchor-8.6.7.tgz", - "integrity": "sha512-FlCHFwNnutLgVTflOYHPW2pPcl2AACqVzExlkGQNsi4CJgqOHN7YTgDd4LuhgN1BFO3TS0vLAruV1Td6dwWPJA==", - "dev": true, - "peerDependencies": { - "@types/markdown-it": "*", - "markdown-it": "*" + "node_modules/remark-gfm": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.0.tgz", + "integrity": "sha512-U92vJgBPkbw4Zfu/IiW2oTZLSL3Zpv+uI7My2eq8JxKgqraFdU8YUGicEJCEgSbeaG+QDFqIcwwfMTOEelPxuA==", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-gfm": "^3.0.0", + "micromark-extension-gfm": "^3.0.0", + "remark-parse": "^11.0.0", + "remark-stringify": "^11.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/markdown-it-container": { + "node_modules/remark-mdx": { "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/markdown-it-container/-/markdown-it-container-3.0.0.tgz", - "integrity": "sha512-y6oKTq4BB9OQuY/KLfk/O3ysFhB3IMYoIWhGJEidXt1NQFocFK2sA2t0NYZAMyMShAGL6x5OPIbrmXPIqaN9rw==", - "dev": true - }, - "node_modules/markdown-it-emoji": { - "version": "2.0.2", - "resolved": "https://registry.npmmirror.com/markdown-it-emoji/-/markdown-it-emoji-2.0.2.tgz", - "integrity": "sha512-zLftSaNrKuYl0kR5zm4gxXjHaOI3FAOEaloKmRA5hijmJZvSjmxcokOLlzycb/HXlUFWzXqpIEoyEMCE4i9MvQ==", - "dev": true - }, - "node_modules/markdown-it/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", - "dev": true - }, - "node_modules/medium-zoom": { - "version": "1.1.0", - "resolved": "https://registry.npmmirror.com/medium-zoom/-/medium-zoom-1.1.0.tgz", - "integrity": "sha512-ewyDsp7k4InCUp3jRmwHBRFGyjBimKps/AJLjRSox+2q/2H4p/PNpQf+pwONWlJiOudkBXtbdmVbFjqyybfTmQ==", - "dev": true - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmmirror.com/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" + "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-3.0.0.tgz", + "integrity": "sha512-O7yfjuC6ra3NHPbRVxfflafAj3LTwx3b73aBvkEFU5z4PsD6FD4vrqJAkE5iNGLz71GdjXfgRqm3SQ0h0VuE7g==", + "dependencies": { + "mdast-util-mdx": "^3.0.0", + "micromark-extension-mdxjs": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmmirror.com/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, + "node_modules/remark-parse": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", + "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unified": "^11.0.0" }, - "engines": { - "node": ">=8.6" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true, - "engines": { - "node": ">=12" + "node_modules/remark-rehype": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.0.tgz", + "integrity": "sha512-z3tJrAs2kIs1AqIIy6pzHmAHlF1hWQ+OdY4/hv+Wxe35EhyLKcajL33iUEn3ScxtFox9nUvRufR/Zre8Q08H/g==", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "mdast-util-to-hast": "^13.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, + "node_modules/remark-smartypants": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/remark-smartypants/-/remark-smartypants-2.1.0.tgz", + "integrity": "sha512-qoF6Vz3BjU2tP6OfZqHOvCU0ACmu/6jhGaINSQRI9mM7wCxNQTKB3JUAN4SVoN2ybElEDTxBIABRep7e569iJw==", "dependencies": { - "brace-expansion": "^1.1.7" + "retext": "^8.1.0", + "retext-smartypants": "^5.2.0", + "unist-util-visit": "^5.0.0" }, "engines": { - "node": "*" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmmirror.com/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", - "dev": true, - "bin": { - "nanoid": "bin/nanoid.cjs" + "node_modules/remark-stringify": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-11.0.0.tgz", + "integrity": "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-to-markdown": "^2.0.0", + "unified": "^11.0.0" }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/node-releases": { - "version": "2.0.14", - "resolved": "https://registry.npmmirror.com/node-releases/-/node-releases-2.0.14.tgz", - "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", - "dev": true + "node_modules/request-light": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/request-light/-/request-light-0.7.0.tgz", + "integrity": "sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q==" }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "engines": { "node": ">=0.10.0" } }, - "node_modules/normalize-range": { - "version": "0.1.2", - "resolved": "https://registry.npmmirror.com/normalize-range/-/normalize-range-0.1.2.tgz", - "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/npm-run-path": { - "version": "5.2.0", - "resolved": "https://registry.npmmirror.com/npm-run-path/-/npm-run-path-5.2.0.tgz", - "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", - "dev": true, + "node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", "dependencies": { - "path-key": "^4.0.0" + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/npm-run-path/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "dev": true, + "node_modules/restore-cursor/node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "engines": { - "node": ">=12" + "node": ">=6" } }, - "node_modules/nth-check": { - "version": "2.1.1", - "resolved": "https://registry.npmmirror.com/nth-check/-/nth-check-2.1.1.tgz", - "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", - "dev": true, + "node_modules/restore-cursor/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dependencies": { - "boolbase": "^1.0.0" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmmirror.com/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, + "mimic-fn": "^2.1.0" + }, "engines": { - "node": ">= 0.4" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmmirror.com/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, + "node_modules/restore-cursor/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "node_modules/retext": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/retext/-/retext-8.1.0.tgz", + "integrity": "sha512-N9/Kq7YTn6ZpzfiGW45WfEGJqFf1IM1q8OsRa1CGzIebCJBNCANDRmOrholiDRGKo/We7ofKR4SEvcGAWEMD3Q==", "dependencies": { - "wrappy": "1" + "@types/nlcst": "^1.0.0", + "retext-latin": "^3.0.0", + "retext-stringify": "^3.0.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmmirror.com/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, + "node_modules/retext-latin": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/retext-latin/-/retext-latin-3.1.0.tgz", + "integrity": "sha512-5MrD1tuebzO8ppsja5eEu+ZbBeUNCjoEarn70tkXOS7Bdsdf6tNahsv2bY0Z8VooFF6cw7/6S+d3yI/TMlMVVQ==", "dependencies": { - "mimic-fn": "^4.0.0" + "@types/nlcst": "^1.0.0", + "parse-latin": "^5.0.0", + "unherit": "^3.0.0", + "unified": "^10.0.0" }, - "engines": { - "node": ">=12" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/open": { - "version": "7.4.2", - "resolved": "https://registry.npmmirror.com/open/-/open-7.4.2.tgz", - "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", - "dev": true, + "node_modules/retext-latin/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/retext-latin/node_modules/unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", "dependencies": { - "is-docker": "^2.0.0", - "is-wsl": "^2.1.1" + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, - "engines": { - "node": ">=8" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/ora": { - "version": "7.0.1", - "resolved": "https://registry.npmmirror.com/ora/-/ora-7.0.1.tgz", - "integrity": "sha512-0TUxTiFJWv+JnjWm4o9yvuskpEJLXTcng8MJuKd+SzAzp2o+OP3HWqNhB4OdJRt1Vsd9/mR0oyaEYlOnL7XIRw==", - "dev": true, + "node_modules/retext-latin/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", "dependencies": { - "chalk": "^5.3.0", - "cli-cursor": "^4.0.0", - "cli-spinners": "^2.9.0", - "is-interactive": "^2.0.0", - "is-unicode-supported": "^1.3.0", - "log-symbols": "^5.1.0", - "stdin-discarder": "^0.1.0", - "string-width": "^6.1.0", - "strip-ansi": "^7.1.0" + "@types/unist": "^2.0.0" }, - "engines": { - "node": ">=16" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node_modules/retext-latin/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmmirror.com/parse5/-/parse5-7.1.2.tgz", - "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", - "dev": true, + "node_modules/retext-latin/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", "dependencies": { - "entities": "^4.4.0" + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "7.0.0", - "resolved": "https://registry.npmmirror.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", - "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", - "dev": true, + "node_modules/retext-smartypants": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/retext-smartypants/-/retext-smartypants-5.2.0.tgz", + "integrity": "sha512-Do8oM+SsjrbzT2UNIKgheP0hgUQTDDQYyZaIY3kfq0pdFzoPk+ZClYJ+OERNXveog4xf1pZL4PfRxNoVL7a/jw==", "dependencies": { - "domhandler": "^5.0.2", - "parse5": "^7.0.0" + "@types/nlcst": "^1.0.0", + "nlcst-to-string": "^3.0.0", + "unified": "^10.0.0", + "unist-util-visit": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/parse5/node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, - "engines": { - "node": ">=0.12" - } + "node_modules/retext-smartypants/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, - "node_modules/patch-package": { - "version": "8.0.0", - "resolved": "https://registry.npmmirror.com/patch-package/-/patch-package-8.0.0.tgz", - "integrity": "sha512-da8BVIhzjtgScwDJ2TtKsfT5JFWz1hYoBl9rUQ1f38MC2HwnEIkK8VN3dKMKcP7P7bvvgzNDbfNHtx3MsQb5vA==", - "dev": true, + "node_modules/retext-smartypants/node_modules/unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", "dependencies": { - "@yarnpkg/lockfile": "^1.1.0", - "chalk": "^4.1.2", - "ci-info": "^3.7.0", - "cross-spawn": "^7.0.3", - "find-yarn-workspace-root": "^2.0.0", - "fs-extra": "^9.0.0", - "json-stable-stringify": "^1.0.2", - "klaw-sync": "^6.0.0", - "minimist": "^1.2.6", - "open": "^7.4.2", - "rimraf": "^2.6.3", - "semver": "^7.5.3", - "slash": "^2.0.0", - "tmp": "^0.0.33", - "yaml": "^2.2.2" - }, - "bin": { - "patch-package": "index.js" + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, - "engines": { - "node": ">=14", - "npm": ">5" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/patch-package/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, + "node_modules/retext-smartypants/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "@types/unist": "^2.0.0" }, - "engines": { - "node": ">=10" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/patch-package/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, + "node_modules/retext-smartypants/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "@types/unist": "^2.0.0" }, - "engines": { - "node": ">=10" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/patch-package/node_modules/slash": { - "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", - "dev": true, - "engines": { - "node": ">=6" + "node_modules/retext-smartypants/node_modules/unist-util-visit": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", + "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.1.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node_modules/retext-smartypants/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" + "node_modules/retext-smartypants/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/path-type": { - "version": "5.0.0", - "resolved": "https://registry.npmmirror.com/path-type/-/path-type-5.0.0.tgz", - "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", - "dev": true, - "engines": { - "node": ">=12" + "node_modules/retext-smartypants/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmmirror.com/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" + "node_modules/retext-stringify": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/retext-stringify/-/retext-stringify-3.1.0.tgz", + "integrity": "sha512-767TLOaoXFXyOnjx/EggXlb37ZD2u4P1n0GJqVdpipqACsQP+20W+BNpMYrlJkq7hxffnFk+jc6mAK9qrbuB8w==", + "dependencies": { + "@types/nlcst": "^1.0.0", + "nlcst-to-string": "^3.0.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/postcss": { - "version": "8.4.32", - "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.32.tgz", - "integrity": "sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==", - "dev": true, + "node_modules/retext-stringify/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/retext-stringify/node_modules/unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, - "engines": { - "node": "^10 || ^12 || >=14" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/postcss-load-config": { - "version": "4.0.2", - "resolved": "https://registry.npmmirror.com/postcss-load-config/-/postcss-load-config-4.0.2.tgz", - "integrity": "sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==", - "dev": true, + "node_modules/retext-stringify/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", "dependencies": { - "lilconfig": "^3.0.0", - "yaml": "^2.3.4" + "@types/unist": "^2.0.0" }, - "engines": { - "node": ">= 14" - }, - "peerDependencies": { - "postcss": ">=8.0.9", - "ts-node": ">=9.0.0" - }, - "peerDependenciesMeta": { - "postcss": { - "optional": true - }, - "ts-node": { - "optional": true - } + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/postcss-value-parser": { - "version": "4.2.0", - "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", - "dev": true - }, - "node_modules/preact": { - "version": "10.19.3", - "resolved": "https://registry.npmmirror.com/preact/-/preact-10.19.3.tgz", - "integrity": "sha512-nHHTeFVBTHRGxJXKkKu5hT8C/YWBkPso4/Gad6xuj5dbptt9iF9NZr9pHbPhBrnT2klheu7mHTxTZ/LjwJiEiQ==", - "dev": true - }, - "node_modules/prettier": { - "version": "3.2.4", - "resolved": "https://registry.npmmirror.com/prettier/-/prettier-3.2.4.tgz", - "integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==", - "dev": true, - "bin": { - "prettier": "bin/prettier.cjs" + "node_modules/retext-stringify/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" }, - "engines": { - "node": ">=14" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/prismjs": { - "version": "1.29.0", - "resolved": "https://registry.npmmirror.com/prismjs/-/prismjs-1.29.0.tgz", - "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", - "dev": true, - "engines": { - "node": ">=6" + "node_modules/retext-stringify/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmmirror.com/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true + "node_modules/retext/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, + "node_modules/retext/node_modules/unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, - "engines": { - "node": ">= 6" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmmirror.com/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, + "node_modules/retext/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", "dependencies": { - "picomatch": "^2.2.1" + "@types/unist": "^2.0.0" }, - "engines": { - "node": ">=8.10.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/restore-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/restore-cursor/-/restore-cursor-4.0.0.tgz", - "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", - "dev": true, + "node_modules/retext/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/restore-cursor/node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmmirror.com/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "engines": { - "node": ">=6" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/restore-cursor/node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmmirror.com/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, + "node_modules/retext/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", "dependencies": { - "mimic-fn": "^2.1.0" + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" }, - "engines": { - "node": ">=6" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/restore-cursor/node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmmirror.com/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true - }, "node_modules/reusify": { "version": "1.0.4", - "resolved": "https://registry.npmmirror.com/reusify/-/reusify-1.0.4.tgz", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" } }, - "node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmmirror.com/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, + "node_modules/rollup": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.9.6.tgz", + "integrity": "sha512-05lzkCS2uASX0CiLFybYfVkwNbKZG5NFQ6Go0VWyogFTXXbR039UVsegViTntkk4OglHBdF54ccApXRRuXRbsg==", "dependencies": { - "glob": "^7.1.3" + "@types/estree": "1.0.5" }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/rollup": { - "version": "4.9.2", - "resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.9.2.tgz", - "integrity": "sha512-66RB8OtFKUTozmVEh3qyNfH+b+z2RXBVloqO2KCC/pjFaGaHtxP9fVfOQKPSGXg2mElmjmxjW/fZ7iKrEpMH5Q==", - "dev": true, "bin": { "rollup": "dist/bin/rollup" }, @@ -3430,72 +7720,87 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.9.2", - "@rollup/rollup-android-arm64": "4.9.2", - "@rollup/rollup-darwin-arm64": "4.9.2", - "@rollup/rollup-darwin-x64": "4.9.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.9.2", - "@rollup/rollup-linux-arm64-gnu": "4.9.2", - "@rollup/rollup-linux-arm64-musl": "4.9.2", - "@rollup/rollup-linux-riscv64-gnu": "4.9.2", - "@rollup/rollup-linux-x64-gnu": "4.9.2", - "@rollup/rollup-linux-x64-musl": "4.9.2", - "@rollup/rollup-win32-arm64-msvc": "4.9.2", - "@rollup/rollup-win32-ia32-msvc": "4.9.2", - "@rollup/rollup-win32-x64-msvc": "4.9.2", + "@rollup/rollup-android-arm-eabi": "4.9.6", + "@rollup/rollup-android-arm64": "4.9.6", + "@rollup/rollup-darwin-arm64": "4.9.6", + "@rollup/rollup-darwin-x64": "4.9.6", + "@rollup/rollup-linux-arm-gnueabihf": "4.9.6", + "@rollup/rollup-linux-arm64-gnu": "4.9.6", + "@rollup/rollup-linux-arm64-musl": "4.9.6", + "@rollup/rollup-linux-riscv64-gnu": "4.9.6", + "@rollup/rollup-linux-x64-gnu": "4.9.6", + "@rollup/rollup-linux-x64-musl": "4.9.6", + "@rollup/rollup-win32-arm64-msvc": "4.9.6", + "@rollup/rollup-win32-ia32-msvc": "4.9.6", + "@rollup/rollup-win32-x64-msvc": "4.9.6", "fsevents": "~2.3.2" } }, "node_modules/run-parallel": { "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/run-parallel/-/run-parallel-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "dependencies": { "queue-microtask": "^1.2.2" } }, + "node_modules/s.color": { + "version": "0.0.15", + "resolved": "https://registry.npmjs.org/s.color/-/s.color-0.0.15.tgz", + "integrity": "sha512-AUNrbEUHeKY8XsYr/DYpl+qk5+aM+DChopnWOPEzn8YKzOhv4l2zH6LzZms3tOZP3wwdOyc0RmTciyi46HLIuA==", + "devOptional": true + }, "node_modules/safe-buffer": { "version": "5.2.1", - "resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "node_modules/sass": { - "version": "1.69.7", - "resolved": "https://registry.npmmirror.com/sass/-/sass-1.69.7.tgz", - "integrity": "sha512-rzj2soDeZ8wtE2egyLXgOOHQvaC2iosZrkF6v3EUG+tBwEvhqUCzm0VP3k9gHF9LXbSrRhT5SksoI56Iw8NPnQ==", - "dev": true, + "node_modules/sass-formatter": { + "version": "0.7.9", + "resolved": "https://registry.npmjs.org/sass-formatter/-/sass-formatter-0.7.9.tgz", + "integrity": "sha512-CWZ8XiSim+fJVG0cFLStwDvft1VI7uvXdCNJYXhDvowiv+DsbD1nXLiQ4zrE5UBvj5DWZJ93cwN0NX5PMsr1Pw==", + "devOptional": true, "dependencies": { - "chokidar": ">=3.0.0 <4.0.0", - "immutable": "^4.0.0", - "source-map-js": ">=0.6.2 <2.0.0" - }, - "bin": { - "sass": "sass.js" - }, - "engines": { - "node": ">=14.0.0" + "suf-log": "^2.5.3" } }, "node_modules/sax": { "version": "1.3.0", - "resolved": "https://registry.npmmirror.com/sax/-/sax-1.3.0.tgz", - "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==", - "dev": true - }, - "node_modules/search-insights": { - "version": "2.13.0", - "resolved": "https://registry.npmmirror.com/search-insights/-/search-insights-2.13.0.tgz", - "integrity": "sha512-Orrsjf9trHHxFRuo9/rzm0KIWmgzE8RMlZMzuhZOJ01Rnz3D0YBAe+V6473t6/H6c7irs6Lt48brULAiRWb3Vw==", - "dev": true, - "peer": true + "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", + "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==" }, "node_modules/section-matter": { "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/section-matter/-/section-matter-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", "integrity": "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==", - "dev": true, "dependencies": { "extend-shallow": "^2.0.1", "kind-of": "^6.0.0" @@ -3505,10 +7810,9 @@ } }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmmirror.com/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -3519,26 +7823,65 @@ "node": ">=10" } }, - "node_modules/set-function-length": { - "version": "1.1.1", - "resolved": "https://registry.npmmirror.com/set-function-length/-/set-function-length-1.1.1.tgz", - "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", - "dev": true, + "node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dependencies": { - "define-data-property": "^1.1.1", - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "yallist": "^4.0.0" }, "engines": { - "node": ">= 0.4" + "node": ">=10" + } + }, + "node_modules/semver/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/sharp": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.2.tgz", + "integrity": "sha512-WlYOPyyPDiiM07j/UO+E720ju6gtNtHjEGg5vovUk1Lgxyjm2LFO+37Nt/UI3MMh2l6hxTWQWi7qk3cXJTutcQ==", + "hasInstallScript": true, + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.2", + "semver": "^7.5.4" + }, + "engines": { + "libvips": ">=8.15.1", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.33.2", + "@img/sharp-darwin-x64": "0.33.2", + "@img/sharp-libvips-darwin-arm64": "1.0.1", + "@img/sharp-libvips-darwin-x64": "1.0.1", + "@img/sharp-libvips-linux-arm": "1.0.1", + "@img/sharp-libvips-linux-arm64": "1.0.1", + "@img/sharp-libvips-linux-s390x": "1.0.1", + "@img/sharp-libvips-linux-x64": "1.0.1", + "@img/sharp-libvips-linuxmusl-arm64": "1.0.1", + "@img/sharp-libvips-linuxmusl-x64": "1.0.1", + "@img/sharp-linux-arm": "0.33.2", + "@img/sharp-linux-arm64": "0.33.2", + "@img/sharp-linux-s390x": "0.33.2", + "@img/sharp-linux-x64": "0.33.2", + "@img/sharp-linuxmusl-arm64": "0.33.2", + "@img/sharp-linuxmusl-x64": "0.33.2", + "@img/sharp-wasm32": "0.33.2", + "@img/sharp-win32-ia32": "0.33.2", + "@img/sharp-win32-x64": "0.33.2" } }, "node_modules/shebang-command": { "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -3548,36 +7891,106 @@ }, "node_modules/shebang-regex": { "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "engines": { "node": ">=8" } }, "node_modules/shiki": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmmirror.com/shiki/-/shiki-1.0.0-beta.2.tgz", - "integrity": "sha512-hPJcD6F5BRp2yfeBcERqQIVeEPjE2g+r5MVq/tonz2SxT6o79e84Y9iW+a5TyGXWtXAKiW5jd4lGevJ4yIUixA==", - "dev": true, + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.1.7.tgz", + "integrity": "sha512-9kUTMjZtcPH3i7vHunA6EraTPpPOITYTdA5uMrvsJRexktqP0s7P3s9HVK80b4pP42FRVe03D7fT3NmJv2yYhw==", "dependencies": { - "@shikijs/core": "1.0.0-beta.2" + "@shikijs/core": "1.1.7" } }, + "node_modules/shikiji": { + "version": "0.9.19", + "resolved": "https://registry.npmjs.org/shikiji/-/shikiji-0.9.19.tgz", + "integrity": "sha512-Kw2NHWktdcdypCj1GkKpXH4o6Vxz8B8TykPlPuLHOGSV8VkhoCLcFOH4k19K4LXAQYRQmxg+0X/eM+m2sLhAkg==", + "dependencies": { + "shikiji-core": "0.9.19" + } + }, + "node_modules/shikiji-core": { + "version": "0.9.19", + "resolved": "https://registry.npmjs.org/shikiji-core/-/shikiji-core-0.9.19.tgz", + "integrity": "sha512-AFJu/vcNT21t0e6YrfadZ+9q86gvPum6iywRyt1OtIPjPFe25RQnYJyxHQPMLKCCWA992TPxmEmbNcOZCAJclw==" + }, "node_modules/signal-exit": { "version": "4.1.0", - "resolved": "https://registry.npmmirror.com/signal-exit/-/signal-exit-4.1.0.tgz", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, "engines": { "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "optional": true + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "optional": true, + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "dependencies": { + "is-arrayish": "^0.3.1" } }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" + }, "node_modules/sitemap": { "version": "7.1.1", - "resolved": "https://registry.npmmirror.com/sitemap/-/sitemap-7.1.1.tgz", + "resolved": "https://registry.npmjs.org/sitemap/-/sitemap-7.1.1.tgz", "integrity": "sha512-mK3aFtjz4VdJN0igpIJrinf3EO8U8mxOPsTBzSsy06UtjZQJ3YY3o3Xa7zSc5nMqcMrRwlChHZ18Kxg0caiPBg==", - "dev": true, "dependencies": { "@types/node": "^17.0.5", "@types/sax": "^1.2.1", @@ -3594,192 +8007,514 @@ }, "node_modules/sitemap/node_modules/@types/node": { "version": "17.0.45", - "resolved": "https://registry.npmmirror.com/@types/node/-/node-17.0.45.tgz", - "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==", - "dev": true + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", + "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==" }, - "node_modules/slash": { - "version": "5.1.0", - "resolved": "https://registry.npmmirror.com/slash/-/slash-5.1.0.tgz", - "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", - "dev": true, + "node_modules/source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", "engines": { - "node": ">=14.16" + "node": ">= 8" } }, "node_modules/source-map-js": { "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", - "dev": true, "engines": { "node": ">=0.10.0" } }, + "node_modules/space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/sprintf-js": { "version": "1.0.3", - "resolved": "https://registry.npmmirror.com/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" }, "node_modules/stdin-discarder": { "version": "0.1.0", - "resolved": "https://registry.npmmirror.com/stdin-discarder/-/stdin-discarder-0.1.0.tgz", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", - "dev": true, "dependencies": { "bl": "^5.0.0" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/streamx": { + "version": "2.15.8", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.8.tgz", + "integrity": "sha512-6pwMeMY/SuISiRsuS8TeIrAzyFbG5gGPHFQsYjUr/pbBadaL1PCWmzKw+CHZSwainfvcF6Si6cVLq4XTEwswFQ==", + "optional": true, + "dependencies": { + "fast-fifo": "^1.1.0", + "queue-tick": "^1.0.1" + }, + "optionalDependencies": { + "bare-events": "^2.2.0" } }, "node_modules/string_decoder": { "version": "1.3.0", - "resolved": "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.3.0.tgz", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, "dependencies": { "safe-buffer": "~5.2.0" } }, "node_modules/string-width": { - "version": "6.1.0", - "resolved": "https://registry.npmmirror.com/string-width/-/string-width-6.1.0.tgz", - "integrity": "sha512-k01swCJAgQmuADB0YIc+7TuatfNvTBVOoaUWJjTB9R4VJzR5vNWzf5t42ESVZFPS8xTySF7CAdV4t/aaIm3UnQ==", - "dev": true, + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", + "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^10.2.1", - "strip-ansi": "^7.0.1" + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=16" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/stringify-entities": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.3.tgz", + "integrity": "sha512-BP9nNHMhhfcMbiuQKCqMjhDP5yBCAxsPu4pHFFzJ6Alo9dZgY4VLDPutXqIjpRiMoKdp7Av85Gr73Q5uH9k7+g==", + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, "node_modules/strip-ansi": { "version": "7.1.0", - "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-7.1.0.tgz", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, "dependencies": { "ansi-regex": "^6.0.1" }, "engines": { "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "engines": { + "node": ">=4" } }, "node_modules/strip-bom-string": { "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/strip-bom-string/-/strip-bom-string-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", "integrity": "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==", - "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/strip-final-newline": { "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, "engines": { "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/style-to-object": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-0.4.4.tgz", + "integrity": "sha512-HYNoHZa2GorYNyqiCaBgsxvcJIn7OHq6inEga+E6Ke3m5JkoqpQbnFssk4jwe+K7AhGa2fcha4wSOf1Kn01dMg==", + "dependencies": { + "inline-style-parser": "0.1.1" + } + }, + "node_modules/suf-log": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/suf-log/-/suf-log-2.5.3.tgz", + "integrity": "sha512-KvC8OPjzdNOe+xQ4XWJV2whQA0aM1kGVczMQ8+dStAO6KfEB140JEVQ9dE76ONZ0/Ylf67ni4tILPJB41U0eow==", + "devOptional": true, + "dependencies": { + "s.color": "0.0.15" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tar-fs": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.5.tgz", + "integrity": "sha512-JOgGAmZyMgbqpLwct7ZV8VzkEB6pxXFBVErLtb+XCOqzc6w1xiWKI9GVd6bwk68EX7eJ4DWmfXVmq8K2ziZTGg==", + "optional": true, + "dependencies": { + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + }, + "optionalDependencies": { + "bare-fs": "^2.1.1", + "bare-path": "^2.1.0" + } + }, + "node_modules/tar-stream": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", + "optional": true, + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/trim-lines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/trough": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", + "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/tsconfck": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.0.2.tgz", + "integrity": "sha512-6lWtFjwuhS3XI4HsX4Zg0izOI3FU/AI9EGVlPEUMDIhvLPMD4wkiof0WCoDgW7qY+Dy198g4d9miAqUHWHFH6Q==", + "bin": { + "tsconfck": "bin/tsconfck.js" + }, + "engines": { + "node": "^18 || >=20" + }, + "peerDependencies": { + "typescript": "^5.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "optional": true + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "optional": true, + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typesafe-path": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/typesafe-path/-/typesafe-path-0.2.2.tgz", + "integrity": "sha512-OJabfkAg1WLZSqJAJ0Z6Sdt3utnbzr/jh+NAHoyWHJe8CMSy79Gm085094M9nvTPy22KzTVn5Zq5mbapCI/hPA==" + }, + "node_modules/typescript": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typescript-auto-import-cache": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/typescript-auto-import-cache/-/typescript-auto-import-cache-0.3.2.tgz", + "integrity": "sha512-+laqe5SFL1vN62FPOOJSUDTZxtgsoOXjneYOXIpx5rQ4UMiN89NAtJLpqLqyebv9fgQ/IMeeTX+mQyRnwvJzvg==", + "dependencies": { + "semver": "^7.3.8" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, + "node_modules/unherit": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/unherit/-/unherit-3.0.1.tgz", + "integrity": "sha512-akOOQ/Yln8a2sgcLj4U0Jmx0R5jpIg2IUyRrWOzmEbjBtGzBdHtSeFKgoEcoH4KYIG/Pb8GQ/BwtYm0GCq1Sqg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-is": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", + "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-modify-children": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/unist-util-modify-children/-/unist-util-modify-children-3.1.1.tgz", + "integrity": "sha512-yXi4Lm+TG5VG+qvokP6tpnk+r1EPwyYL04JWDxLvgvPV40jANh7nm3udk65OOWquvbMDe+PL9+LmkxDpTv/7BA==", + "dependencies": { + "@types/unist": "^2.0.0", + "array-iterate": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-modify-children/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-position-from-estree": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position-from-estree/-/unist-util-position-from-estree-2.0.0.tgz", + "integrity": "sha512-KaFVRjoqLyF6YXCbVLNad/eS4+OfPQQn2yOd7zF/h5T/CSL2v8NpN6a5TPvtbXthAGw5nG+PuTtq+DdIZr+cRQ==", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-remove": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-remove/-/unist-util-remove-4.0.0.tgz", + "integrity": "sha512-b4gokeGId57UVRX/eVKej5gXqGlc9+trkORhFJpu9raqZkZhU0zm8Doi05+HaiBsMEIJowL+2WtQ5ItjsngPXg==", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/striptags": { - "version": "3.2.0", - "resolved": "https://registry.npmmirror.com/striptags/-/striptags-3.2.0.tgz", - "integrity": "sha512-g45ZOGzHDMe2bdYMdIvdAfCQkCTDMGBazSw1ypMowwGIee7ZQ5dU0rBJ8Jqgl+jAKIv4dbeE1jscZq9wid1Tkw==", - "dev": true - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, + "node_modules/unist-util-remove-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-5.0.0.tgz", + "integrity": "sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==", "dependencies": { - "has-flag": "^4.0.0" + "@types/unist": "^3.0.0", + "unist-util-visit": "^5.0.0" }, - "engines": { - "node": ">=8" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmmirror.com/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, + "node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dependencies": { - "os-tmpdir": "~1.0.2" + "@types/unist": "^3.0.0" }, - "engines": { - "node": ">=0.6.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmmirror.com/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, + "node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", "dependencies": { - "is-number": "^7.0.0" + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" }, - "engines": { - "node": ">=8.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/ts-debounce": { - "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/ts-debounce/-/ts-debounce-4.0.0.tgz", - "integrity": "sha512-+1iDGY6NmOGidq7i7xZGA4cm8DAa6fqdYcvO5Z6yBevH++Bdo9Qt/mN0TzHUgcCcKv1gmh9+W5dHqz8pMWbCbg==", - "dev": true - }, - "node_modules/uc.micro": { - "version": "1.0.6", - "resolved": "https://registry.npmmirror.com/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", - "dev": true - }, - "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true - }, - "node_modules/unicorn-magic": { - "version": "0.1.0", - "resolved": "https://registry.npmmirror.com/unicorn-magic/-/unicorn-magic-0.1.0.tgz", - "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", - "dev": true, - "engines": { - "node": ">=18" + "node_modules/unist-util-visit-children": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-children/-/unist-util-visit-children-2.0.2.tgz", + "integrity": "sha512-+LWpMFqyUwLGpsQxpumsQ9o9DG2VGLFrpz+rpVXYIEdPy57GSy5HioC0g3bg/8WP9oCLlapQtklOzQ8uLS496Q==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "engines": { - "node": ">= 10.0.0" - } + "node_modules/unist-util-visit-children/node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" }, - "node_modules/upath": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/upath/-/upath-2.0.1.tgz", - "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==", - "dev": true, - "engines": { - "node": ">=4", - "yarn": "*" + "node_modules/unist-util-visit-parents": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", + "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, "node_modules/update-browserslist-db": { "version": "1.0.13", - "resolved": "https://registry.npmmirror.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", - "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "dependencies": { "escalade": "^3.1.1", "picocolors": "^1.0.0" @@ -3793,18 +8528,56 @@ }, "node_modules/util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-location": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.2.tgz", + "integrity": "sha512-NXPYyxyBSH7zB5U6+3uDdd6Nybz6o6/od9rk8bp9H8GR3L+cm/fC0uUTbqBmUTnMCUDslAGBOIKNfvvb+gGlDg==", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, "node_modules/vite": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.12.tgz", - "integrity": "sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==", - "dev": true, + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.5.tgz", + "integrity": "sha512-BdN1xh0Of/oQafhU+FvopafUp6WaYenLU/NFoL5WyJL++GxkNfieKzBhM24H3HVsPQrlAqB7iJYTHabzaRed5Q==", "dependencies": { "esbuild": "^0.19.3", - "postcss": "^8.4.32", + "postcss": "^8.4.35", "rollup": "^4.2.0" }, "bin": { @@ -3852,207 +8625,218 @@ } } }, - "node_modules/vscode-oniguruma": { - "version": "1.7.0", - "resolved": "https://registry.npmmirror.com/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", - "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", - "dev": true - }, - "node_modules/vscode-textmate": { - "version": "8.0.0", - "resolved": "https://registry.npmmirror.com/vscode-textmate/-/vscode-textmate-8.0.0.tgz", - "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", - "dev": true - }, - "node_modules/vue": { - "version": "3.4.3", - "resolved": "https://registry.npmmirror.com/vue/-/vue-3.4.3.tgz", - "integrity": "sha512-GjN+culMAGv/mUbkIv8zMKItno8npcj5gWlXkSxf1SPTQf8eJ4A+YfHIvQFyL1IfuJcMl3soA7SmN1fRxbf/wA==", - "dev": true, - "dependencies": { - "@vue/compiler-dom": "3.4.3", - "@vue/compiler-sfc": "3.4.3", - "@vue/runtime-dom": "3.4.3", - "@vue/server-renderer": "3.4.3", - "@vue/shared": "3.4.3" - }, + "node_modules/vitefu": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz", + "integrity": "sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==", "peerDependencies": { - "typescript": "*" + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" }, "peerDependenciesMeta": { - "typescript": { + "vite": { "optional": true } } }, - "node_modules/vue-router": { - "version": "4.2.5", - "resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-4.2.5.tgz", - "integrity": "sha512-DIUpKcyg4+PTQKfFPX88UWhlagBEBEfJ5A8XDXRJLUnZOvcpMF8o/dnL90vpVkGaPbjvXazV/rC1qBKrZlFugw==", - "dev": true, + "node_modules/volar-service-css": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/volar-service-css/-/volar-service-css-0.0.30.tgz", + "integrity": "sha512-jui+1N0HBfjW43tRfhyZp0axhBee4997BRyX4os8xQm/7cjD2KjAuyz92nMIPRt1QDoG4/7uQT28xNhy0TPJTA==", "dependencies": { - "@vue/devtools-api": "^6.5.0" + "vscode-css-languageservice": "^6.2.10", + "vscode-uri": "^3.0.8" }, "peerDependencies": { - "vue": "^3.2.0" + "@volar/language-service": "~2.0.1" + }, + "peerDependenciesMeta": { + "@volar/language-service": { + "optional": true + } } }, - "node_modules/vuepress": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/vuepress/-/vuepress-2.0.0-rc.0.tgz", - "integrity": "sha512-sydt/B7+pIw926G5PntYmptLkC5o2buXKh+WR1+P2KnsvkXU+UGnQrJJ0FBvu/4RNuY99tkUZd59nyPhEmRrCg==", - "dev": true, + "node_modules/volar-service-emmet": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/volar-service-emmet/-/volar-service-emmet-0.0.30.tgz", + "integrity": "sha512-HEeIrmqQ/DTfuQDI9ER5+YReXXjE9f7W6MlBmn5biUuPyizVTGfuILN8pJhmYvmPHCA7qHhU7CJqwE9DAh9AJg==", "dependencies": { - "vuepress-vite": "2.0.0-rc.0" + "@vscode/emmet-helper": "^2.9.2", + "volar-service-html": "0.0.30" }, - "bin": { - "vuepress": "bin/vuepress.js" + "peerDependencies": { + "@volar/language-service": "~2.0.1" }, - "engines": { - "node": ">=18.16.0" + "peerDependenciesMeta": { + "@volar/language-service": { + "optional": true + } } }, - "node_modules/vuepress-plugin-feed2": { - "version": "2.0.0-rc.10", - "resolved": "https://registry.npmmirror.com/vuepress-plugin-feed2/-/vuepress-plugin-feed2-2.0.0-rc.10.tgz", - "integrity": "sha512-4PN5RaxuOzZMVouh8D8LajRSTPPzvA4m4m8UgVTXlexmrJmMsbwSOhtnTzQooB4iBhb6NyqURcJZk/LGRDQwJg==", - "dev": true, + "node_modules/volar-service-html": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/volar-service-html/-/volar-service-html-0.0.30.tgz", + "integrity": "sha512-wW3TEeRTeHv/3mC8Ik6T62SwewMWFungb8ydyEK/2GDHEntBEG/J9wtuh01/J0kYqPerhlT9zhdGB6PGYHAGuA==", "dependencies": { - "@vuepress/shared": "2.0.0-rc.0", - "@vuepress/utils": "2.0.0-rc.0", - "cheerio": "1.0.0-rc.12", - "vuepress-shared": "2.0.0-rc.10", - "xml-js": "^1.6.11" - }, - "engines": { - "node": ">=18.16.0", - "npm": ">=8", - "pnpm": ">=7", - "yarn": ">=2" + "vscode-html-languageservice": "^5.1.0", + "vscode-uri": "^3.0.8" }, "peerDependencies": { - "vuepress": "2.0.0-rc.0", - "vuepress-vite": "2.0.0-rc.0", - "vuepress-webpack": "2.0.0-rc.0" + "@volar/language-service": "~2.0.1" }, "peerDependenciesMeta": { - "vuepress": { - "optional": true - }, - "vuepress-vite": { - "optional": true - }, - "vuepress-webpack": { + "@volar/language-service": { "optional": true } } }, - "node_modules/vuepress-plugin-sitemap2": { - "version": "2.0.0-rc.10", - "resolved": "https://registry.npmmirror.com/vuepress-plugin-sitemap2/-/vuepress-plugin-sitemap2-2.0.0-rc.10.tgz", - "integrity": "sha512-HW9ck76DKpSp40a8jHm+OPQ6+PfJERj+RobuhAgLCEhm7Dx9uz/5ie4gl45A1rJ4ZP7NjteVNFYRzCBwNOejVg==", - "dev": true, + "node_modules/volar-service-prettier": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/volar-service-prettier/-/volar-service-prettier-0.0.30.tgz", + "integrity": "sha512-Qdc5Zc0y4hJmJbpIQ52cSDjs0uvVug/e2nuL/XZWPJM6Cr5/3RjjoRVKtDQbKItFYlGk+JH+LSXvwQeD5TXZqg==", "dependencies": { - "@vuepress/shared": "2.0.0-rc.0", - "@vuepress/utils": "2.0.0-rc.0", - "sitemap": "^7.1.1", - "vuepress-shared": "2.0.0-rc.10" - }, - "engines": { - "node": ">=18.16.0", - "npm": ">=8", - "pnpm": ">=7", - "yarn": ">=2" + "vscode-uri": "^3.0.8" }, "peerDependencies": { - "vuepress": "2.0.0-rc.0", - "vuepress-vite": "2.0.0-rc.0", - "vuepress-webpack": "2.0.0-rc.0" + "@volar/language-service": "~2.0.1", + "prettier": "^2.2 || ^3.0" }, "peerDependenciesMeta": { - "vuepress": { + "@volar/language-service": { "optional": true }, - "vuepress-vite": { - "optional": true - }, - "vuepress-webpack": { + "prettier": { "optional": true } } }, - "node_modules/vuepress-shared": { - "version": "2.0.0-rc.10", - "resolved": "https://registry.npmmirror.com/vuepress-shared/-/vuepress-shared-2.0.0-rc.10.tgz", - "integrity": "sha512-cBm3r0LkMGySwVdPLs69z4pWLKeLZNMm7H5nOx166Isv1y5A8vgvhU1z4ud9AJBeUz+SoL8+Q0IlN8PmBVAOjQ==", - "dev": true, + "node_modules/volar-service-typescript": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/volar-service-typescript/-/volar-service-typescript-0.0.30.tgz", + "integrity": "sha512-jA8c0Mhy9rgAsrgtwocK95Smws1M2E0MxlQ/SVo/rmOGH32cX9UGgI0IENWKa3yagp/khfoemOIQDz/KNhI3zg==", "dependencies": { - "@vuepress/client": "2.0.0-rc.0", - "@vuepress/shared": "2.0.0-rc.0", - "@vuepress/utils": "2.0.0-rc.0", - "@vueuse/core": "^10.7.1", - "cheerio": "1.0.0-rc.12", - "dayjs": "^1.11.10", - "execa": "^8.0.1", - "fflate": "^0.8.1", - "gray-matter": "^4.0.3", + "path-browserify": "^1.0.1", "semver": "^7.5.4", - "striptags": "^3.2.0", - "vue": "^3.4.1", - "vue-router": "^4.2.5" - }, - "engines": { - "node": ">=18.16.0", - "npm": ">=8", - "pnpm": ">=7", - "yarn": ">=2" + "typescript-auto-import-cache": "^0.3.1", + "vscode-languageserver-textdocument": "^1.0.11", + "vscode-nls": "^5.2.0", + "vscode-uri": "^3.0.8" }, "peerDependencies": { - "vuepress": "2.0.0-rc.0", - "vuepress-vite": "2.0.0-rc.0", - "vuepress-webpack": "2.0.0-rc.0" + "@volar/language-service": "~2.0.1", + "@volar/typescript": "~2.0.1" }, "peerDependenciesMeta": { - "vuepress": { - "optional": true - }, - "vuepress-vite": { + "@volar/language-service": { "optional": true - }, - "vuepress-webpack": { + } + } + }, + "node_modules/volar-service-typescript-twoslash-queries": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/volar-service-typescript-twoslash-queries/-/volar-service-typescript-twoslash-queries-0.0.30.tgz", + "integrity": "sha512-ahj6woBxhkZu7icQR58x5TnUaS8ZRKn7a+UvY+andmiTWsOaSu85zj36+LPZgZQi1MG+BtjNwUjKoxtZiN51PA==", + "peerDependencies": { + "@volar/language-service": "~2.0.1" + }, + "peerDependenciesMeta": { + "@volar/language-service": { "optional": true } } }, - "node_modules/vuepress-vite": { - "version": "2.0.0-rc.0", - "resolved": "https://registry.npmmirror.com/vuepress-vite/-/vuepress-vite-2.0.0-rc.0.tgz", - "integrity": "sha512-+2XBejeiskPyr2raBeA2o4uDFDsjtadpUVmtio3qqFtQpOhidz/ORuiTLr2UfLtFn1ASIHP6Vy2YjQ0e/TeUVw==", - "dev": true, + "node_modules/vscode-css-languageservice": { + "version": "6.2.12", + "resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-6.2.12.tgz", + "integrity": "sha512-PS9r7HgNjqzRl3v91sXpCyZPc8UDotNo6gntFNtGCKPhGA9Frk7g/VjX1Mbv3F00pn56D+rxrFzR9ep4cawOgA==", "dependencies": { - "@vuepress/bundler-vite": "2.0.0-rc.0", - "@vuepress/cli": "2.0.0-rc.0", - "@vuepress/core": "2.0.0-rc.0", - "@vuepress/theme-default": "2.0.0-rc.0", - "vue": "^3.3.8" - }, - "bin": { - "vuepress": "bin/vuepress.js", - "vuepress-vite": "bin/vuepress.js" - }, + "@vscode/l10n": "^0.0.18", + "vscode-languageserver-textdocument": "^1.0.11", + "vscode-languageserver-types": "3.17.5", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/vscode-css-languageservice/node_modules/@vscode/l10n": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.18.tgz", + "integrity": "sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ==" + }, + "node_modules/vscode-html-languageservice": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-5.1.2.tgz", + "integrity": "sha512-wkWfEx/IIR3s2P5yD4aTGHiOb8IAzFxgkSt1uSC3itJ4oDAm23yG7o0L29JljUdnXDDgLafPAvhv8A2I/8riHw==", + "dependencies": { + "@vscode/l10n": "^0.0.18", + "vscode-languageserver-textdocument": "^1.0.11", + "vscode-languageserver-types": "^3.17.5", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/vscode-html-languageservice/node_modules/@vscode/l10n": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/@vscode/l10n/-/l10n-0.0.18.tgz", + "integrity": "sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ==" + }, + "node_modules/vscode-jsonrpc": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", + "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", "engines": { - "node": ">=18.16.0" + "node": ">=14.0.0" + } + }, + "node_modules/vscode-languageserver": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", + "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==", + "dependencies": { + "vscode-languageserver-protocol": "3.17.5" }, - "peerDependencies": { - "@vuepress/client": "2.0.0-rc.0", - "vue": "^3.3.4" + "bin": { + "installServerIntoExtension": "bin/installServerIntoExtension" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", + "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", + "dependencies": { + "vscode-jsonrpc": "8.2.0", + "vscode-languageserver-types": "3.17.5" + } + }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz", + "integrity": "sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==" + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" + }, + "node_modules/vscode-nls": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.2.0.tgz", + "integrity": "sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng==" + }, + "node_modules/vscode-uri": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==" + }, + "node_modules/web-namespaces": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz", + "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, "node_modules/which": { "version": "2.0.2", - "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -4063,37 +8847,216 @@ "node": ">= 8" } }, + "node_modules/which-pm": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-2.1.1.tgz", + "integrity": "sha512-xzzxNw2wMaoCWXiGE8IJ9wuPMU+EYhFksjHxrRT8kMT5SnocBPRg69YAMtyV4D12fP582RA+k3P8H9J5EMdIxQ==", + "dependencies": { + "load-yaml-file": "^0.2.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8.15" + } + }, + "node_modules/which-pm-runs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", + "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/widest-line": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-4.0.1.tgz", + "integrity": "sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==", + "dependencies": { + "string-width": "^5.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/widest-line/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "node_modules/widest-line/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "optional": true }, - "node_modules/xml-js": { - "version": "1.6.11", - "resolved": "https://registry.npmmirror.com/xml-js/-/xml-js-1.6.11.tgz", - "integrity": "sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==", - "dev": true, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dependencies": { - "sax": "^1.2.4" + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" }, - "bin": { - "xml-js": "bin/cli.js" + "engines": { + "node": ">=12" } }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/yaml": { - "version": "2.3.4", - "resolved": "https://registry.npmmirror.com/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", - "dev": true, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", "engines": { - "node": ">= 14" + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "3.22.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", + "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } } } diff --git a/package.json b/package.json old mode 100755 new mode 100644 index 38d3fdea3a4..fa35fb74d0a --- a/package.json +++ b/package.json @@ -1,35 +1,37 @@ { "name": "nushell.github.io", + "type": "module", "version": "0.0.0", "description": "The Nushell website (nushell.sh)", "repository": "github:nushell/nushell.github.io", - "type": "module", - "scripts": { - "update": "nu make_docs.nu", - "dev": "vuepress dev", - "build": "vuepress build", - "postinstall": "patch-package", - "prepare": "git config --unset core.hooksPath && rm -rf .husky || true; npx lefthook install", - "pretty": "prettier --write ." - }, "license": "MIT", - "devDependencies": { - "@vuepress/plugin-back-to-top": "2.0.0-rc.0", - "@vuepress/plugin-docsearch": "2.0.0-rc.0", - "@vuepress/plugin-git": "2.0.0-rc.0", - "@vuepress/plugin-medium-zoom": "2.0.0-rc.0", - "@vuepress/plugin-shiki": "^2.0.0-rc.0", - "@vuepress/theme-default": "2.0.0-rc.0", - "lefthook": "^1.6.1", - "patch-package": "^8.0.0", - "prettier": "^3.2.4", - "shiki": "^1.0.0-beta.2", - "vuepress": "2.0.0-rc.0", - "vuepress-plugin-feed2": "2.0.0-rc.10", - "vuepress-plugin-sitemap2": "2.0.0-rc.10" - }, "engines": { "npm": ">=9.0.0", "node": ">=18.12.0" + }, + "scripts": { + "dev": "astro dev", + "start": "astro dev", + "build": "astro build", + "preview": "astro preview", + "astro": "astro", + "format": "prettier -w . --plugin=prettier-plugin-astro && biome format --write .", + "lint": "biome lint . && astro check", + "lint:fix": "biome lint --apply .", + "check-format": "prettier --check . && biome check .", + "check-format:fix": "biome check --apply .", + "precommit": "npm run check-format && npm run lint" + }, + "dependencies": { + "@astrojs/check": "^0.5.6", + "@astrojs/starlight": "^0.21.1", + "astro": "^4.4.11", + "sharp": "^0.33.2", + "typescript": "^5.3.3" + }, + "devDependencies": { + "@biomejs/biome": "1.5.3", + "prettier": "^3.2.5", + "prettier-plugin-astro": "^0.13.0" } } diff --git a/pt-BR/README.md b/pt-BR/README.md deleted file mode 100755 index 9554c0e4522..00000000000 --- a/pt-BR/README.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -home: true -heroImage: null -heroText: Nushell -tagline: Um novo tipo de shell. -actionText: Começar → -actionLink: /pt-BR/book/ -features: - - title: Controle seu sistema com pipelines poderosos - details: Pipelines permitem que você comande seu sistema como nunca antes. Seu sistema pertence a você, e ele aguarda seu comando. - - title: Tudo é dado - details: Em vez de ter que lembrar todos os parâmetros de todos os comandos, nós podemos usar apenas os mesmos, independentemente de onde ele veio. - - title: Plugins Poderosos - details: Nu pode não vir com tudo que você possa querer fazer com ele. Por isso, você pode extendê-lo com seu poderoso sistema de plugins. -footer: Se você tem sugestões ou deseja mudar algo, por favor nos dê feedback ---- - -### Instalação Rápida - -#### Instalar a Última Versão - -Instale a última versão a partir da [página de _releases_](https://github.com/nushell/nushell/releases). - -Alternativamente, você pode instalar a partir do código fonte com o [crates.io](https://crates.io): - -```sh -$ cargo install nu -``` - -#### Instale com Gerenciador de Pacotes - -Com [Homebrew](https://brew.sh/): - -```sh -$ brew install nushell -``` - -Com [Scoop](https://scoop.sh): - -```powershell -$ scoop install nu -``` - -#### Inicializar o shell - -``` -$ nu -``` diff --git a/pt-BR/book/README.md b/pt-BR/book/README.md deleted file mode 100644 index 36ae32528f2..00000000000 --- a/pt-BR/book/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Índice - -- [Instalação](instalacao.md) - Instalando o nushell -- [Introdução](introducao.md) - Começando a usar o nushell -- [Explorando](explorando.md) - Explorando o nushell -- [Tipos de dados](tipos_de_dados.md) - Tipos de dados no nushell -- [Carregando dados](carregando_dados.md) - Carregando e usando dados -- [Trabalhando com tabelas](trabalhando_com_tabelas.md) - Trabalhando com as tabelas do nushell -- [Pipeline](pipeline.md) - Como o pipeline funciona -- [Metadados](metadados.md) - Uma explicação sobre o sistema de metadados do nushell -- [Shells](shells_em_shells.md) - Trabalhando com múltiplos locais -- [Escapando comandos](escapando.md) - Escapando para comandos nativos com o mesmo nome -- [Plugins](plugins.md) - Melhorando o nushell com mais funcionalidades usando plugins -- [Command Reference](command_reference.md) - A list of all Nushell's commands. diff --git a/CNAME b/public/CNAME similarity index 100% rename from CNAME rename to public/CNAME diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 00000000000..b7631b2a5c3 --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1,15 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" + "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> +<svg version="1.0" xmlns="http://www.w3.org/2000/svg" + width="240.000000pt" height="240.000000pt" viewBox="0 0 240.000000 240.000000" + preserveAspectRatio="xMidYMid meet"> + +<g transform="translate(0.000000,240.000000) scale(0.100000,-0.100000)" +fill="#000000" stroke="none"> +<path d="M544 2108 c-37 -57 -69 -110 -71 -118 -3 -12 163 -119 611 -394 339 +-209 616 -382 616 -385 0 -3 -277 -177 -615 -385 -338 -208 -615 -383 -615 +-387 0 -15 151 -219 161 -219 6 0 311 188 680 418 l669 417 -2 158 -3 159 +-675 419 c-371 230 -678 419 -682 419 -4 0 -38 -46 -74 -102z"/> +</g> +</svg> diff --git a/public/nushell_minimal_dark_theme.json b/public/nushell_minimal_dark_theme.json new file mode 100644 index 00000000000..0dd16c58708 --- /dev/null +++ b/public/nushell_minimal_dark_theme.json @@ -0,0 +1,718 @@ +{ + "$schema": "vscode://schemas/color-theme", + "type": "dark", + // "include": "./dark_vs.json", + "tokenColors": [ + // "FlatShape__InternalCommand": "#61d6d6", //"Cyan.bold" + { + "scope": ["keyword.control.nushell"], + "settings": { + "foreground": "#61d6d6" + } + }, + + // I used this for things like + // alias <this_word> = blah + { + "scope": ["source.nushell"], + "settings": { + "foreground": "#06989a" //#61d6d6 + // "fontStyle": "bold" + } + }, + + { + "scope": "keyword.control.other.nushell", + "settings": { + "foreground": "#FF0000", + "fontStyle": "bold" + } + }, + + // these are the sub commands + { + "scope": ["keyword.other"], + "settings": { + "foreground": "#00b7ff" + } + }, + + // "FlatShape__String": "#12820e", //"Green" + { + // "scope": ["string", "meta.embedded.assembly"], + "scope": ["string.quoted"], + "settings": { + "foreground": "#12820e" + } + }, + + // "FlatShape__Operator": "#AAAA00", //"Yellow" #c19c00 + { + "scope": ["punctuation.nushell"], + "settings": { + "foreground": "#c19c00" + // "fontStyle": "bold" + } + }, + + // "FlatShape__Comment": "#55FF55", //"Green.bold", #16c60c + { + "scope": ["comment"], + "settings": { + "foreground": "#16c60c" + // "fontStyle": "bold" + } + }, + + // for range 0..10 + { + "scope": ["constant", "constant.numeric"], + "settings": { + "foreground": "#b4009e" + // "fontStyle": "bold" + } + }, + + // "FlatShape__Flag": "#3878ff", //"Blue.bold" + // "FlatShape__ShorthandFlag": "#3878ff", //"Blue.bold" + // for --flag + { + "scope": ["variable.parameter.function"], + "settings": { + "foreground": "#3878ff" + // "fontStyle": "bold" + } + }, + + // "FlatShape__Variable_or_FlatShape__Identifier": "#821791", //"Purple" + { + "scope": ["variable.name", "variable.name.nushell"], + "settings": { + "foreground": "#aa44dd" + } + }, + + { + "scope": ["variable.other"], + "settings": { + "foreground": "#61d6d6" + } + }, + + // { + // "scope": ["variable.language"], + // "settings": { + // "foreground": "#aa44dd" + // } + // }, + + // "FlatShape__Int": "#b4009e", //"Purple.bold" + // "FlatShape__Decimal": "#b4009e", //"Purple.bold" + { + "scope": [ + "constant.numeric", + "variable.other.enummember", + "keyword.operator.plus.exponent", + "keyword.operator.minus.exponent" + ], + "settings": { + "foreground": "#b4009e" + } + }, + + // for def + { + "scope": ["entity.name.function"], + "settings": { + "foreground": "#61d6d6" + } + }, + + { + "scope": ["entity.name.type"], + "settings": { + "foreground": "#f9f1a5" + } + }, + + // for var:storage_type + { + "scope": ["storage.type"], + "settings": { + "foreground": "#a538ff" + } + }, + + { + "scope": ["storage.modifier"], + "settings": { + "foreground": "#5555FF" + } + } + + // { + // "scope": [ + // "meta.embedded", + // "source.groovy.embedded" + // ], + // "settings": { + // "foreground": "#D4D4D4" + // } + // }, + // { + // "scope": "emphasis", + // "settings": { + // "fontStyle": "italic" + // } + // }, + // { + // "scope": "strong", + // "settings": { + // "fontStyle": "bold" + // } + // }, + // { + // "scope": "header", + // "settings": { + // "foreground": "#000080" + // } + // }, + // { + // "scope": "comment", + // "settings": { + // "foreground": "#6A9955" + // } + // }, + // { + // "scope": "constant.language", + // "settings": { + // "foreground": "#569CD6" + // } + // }, + // { + // "scope": [ + // "constant.numeric", + // "variable.other.enummember", + // "keyword.operator.plus.exponent", + // "keyword.operator.minus.exponent" + // ], + // "settings": { + // "foreground": "#FF55FF" + // } + // }, + // { + // "scope": "constant.regexp", + // "settings": { + // "foreground": "#646695" + // } + // }, + // { + // "scope": "entity.name.tag", + // "settings": { + // "foreground": "#569CD6" + // } + // }, + // { + // "scope": "entity.name.tag.css", + // "settings": { + // "foreground": "#D7BA7D" + // } + // }, + // { + // "scope": "entity.other.attribute-name", + // "settings": { + // "foreground": "#9CDCFE" + // } + // }, + // { + // "scope": [ + // "entity.other.attribute-name.class.css", + // "entity.other.attribute-name.class.mixin.css", + // "entity.other.attribute-name.id.css", + // "entity.other.attribute-name.parent-selector.css", + // "entity.other.attribute-name.pseudo-class.css", + // "entity.other.attribute-name.pseudo-element.css", + // "source.css.less entity.other.attribute-name.id", + // "entity.other.attribute-name.scss" + // ], + // "settings": { + // "foreground": "#D7BA7D" + // } + // }, + // { + // "scope": "invalid", + // "settings": { + // "foreground": "#F44747" + // } + // }, + // { + // "scope": "markup.underline", + // "settings": { + // "fontStyle": "underline" + // } + // }, + // { + // "scope": "markup.bold", + // "settings": { + // "foreground": "#569CD6", + // "fontStyle": "bold" + // } + // }, + // { + // "scope": "markup.heading", + // "settings": { + // "foreground": "#569CD6", + // "fontStyle": "bold" + // } + // }, + // { + // "scope": "markup.italic", + // "settings": { + // "fontStyle": "italic" + // } + // }, + // { + // "scope": "markup.inserted", + // "settings": { + // "foreground": "#B5CEA8" + // } + // }, + // { + // "scope": "markup.deleted", + // "settings": { + // "foreground": "#CE9178" + // } + // }, + // { + // "scope": "markup.changed", + // "settings": { + // "foreground": "#569CD6" + // } + // }, + // { + // "scope": "punctuation.definition.quote.begin.markdown", + // "settings": { + // "foreground": "#6A9955" + // } + // }, + // { + // "scope": "punctuation.definition.list.begin.markdown", + // "settings": { + // "foreground": "#6796E6" + // } + // }, + // { + // "scope": "markup.inline.raw", + // "settings": { + // "foreground": "#CE9178" + // } + // }, + // { + // "scope": "punctuation.definition.tag", + // "settings": { + // "foreground": "#808080" + // } + // }, + // { + // "scope": [ + // "meta.preprocessor", + // "entity.name.function.preprocessor" + // ], + // "settings": { + // "foreground": "#569CD6" + // } + // }, + // { + // "scope": "meta.preprocessor.string", + // "settings": { + // "foreground": "#CE9178" + // } + // }, + // { + // "scope": "meta.preprocessor.numeric", + // "settings": { + // "foreground": "#B5CEA8" + // } + // }, + // { + // "scope": "meta.structure.dictionary.key.python", + // "settings": { + // "foreground": "#9CDCFE" + // } + // }, + // { + // "scope": "meta.diff.header", + // "settings": { + // "foreground": "#569CD6" + // } + // }, + // { + // "scope": "storage", + // "settings": { + // "foreground": "#569CD6" + // } + // }, + // { + // "scope": "storage.type", + // "settings": { + // "foreground": "#569CD6" + // } + // }, + // { + // "scope": [ + // "storage.modifier", + // "keyword.operator.noexcept" + // ], + // "settings": { + // "foreground": "#569CD6" + // } + // }, + // { + // "scope": [ + // "string", + // "meta.embedded.assembly" + // ], + // "settings": { + // "foreground": "#00AA00" + // } + // }, + // { + // "scope": "string.tag", + // "settings": { + // "foreground": "#CE9178" + // } + // }, + // { + // "scope": "string.value", + // "settings": { + // "foreground": "#CE9178" + // } + // }, + // { + // "scope": "string.regexp", + // "settings": { + // "foreground": "#D16969" + // } + // }, + // { + // "scope": [ + // "punctuation.definition.template-expression.begin", + // "punctuation.definition.template-expression.end", + // "punctuation.section.embedded" + // ], + // "settings": { + // "foreground": "#569CD6" + // } + // }, + // { + // "scope": [ + // "meta.template.expression" + // ], + // "settings": { + // "foreground": "#D4D4D4" + // } + // }, + // { + // "scope": [ + // "support.type.vendored.property-name", + // "support.type.property-name", + // "variable.css", + // "variable.scss", + // "variable.other.less", + // "source.coffee.embedded" + // ], + // "settings": { + // "foreground": "#9CDCFE" + // } + // }, + // { + // "scope": "keyword", + // "settings": { + // "foreground": "#569CD6" + // } + // }, + // { + // "scope": "keyword.control", + // "settings": { + // "foreground": "#0ff" + // } + // }, + // { + // "scope": "keyword.operator", + // "settings": { + // "foreground": "#D4D4D4" + // } + // }, + // { + // "scope": [ + // "keyword.operator.new", + // "keyword.operator.expression", + // "keyword.operator.cast", + // "keyword.operator.sizeof", + // "keyword.operator.alignof", + // "keyword.operator.typeid", + // "keyword.operator.alignas", + // "keyword.operator.instanceof", + // "keyword.operator.logical.python", + // "keyword.operator.wordlike" + // ], + // "settings": { + // "foreground": "#569CD6" + // } + // }, + // { + // "scope": "keyword.other.unit", + // "settings": { + // "foreground": "#B5CEA8" + // } + // }, + // { + // "scope": [ + // "punctuation.section.embedded.begin.php", + // "punctuation.section.embedded.end.php" + // ], + // "settings": { + // "foreground": "#569CD6" + // } + // }, + // { + // "scope": "support.function.git-rebase", + // "settings": { + // "foreground": "#9CDCFE" + // } + // }, + // { + // "scope": "constant.sha.git-rebase", + // "settings": { + // "foreground": "#B5CEA8" + // } + // }, + // { + // "scope": [ + // "storage.modifier.import.java", + // "variable.language.wildcard.java", + // "storage.modifier.package.java" + // ], + // "settings": { + // "foreground": "#D4D4D4" + // } + // }, + // { + // "scope": "variable.language", + // "settings": { + // "foreground": "#569CD6" + // } + // }, + // { + // "scope": [ + // "entity.name.function", + // "support.function", + // "support.constant.handlebars", + // "source.powershell variable.other.member", + // "entity.name.operator.custom-literal" + // ], + // "settings": { + // "foreground": "#DCDCAA" + // } + // }, + // { + // "scope": [ + // "meta.return-type", + // "support.class", + // "support.type", + // "entity.name.type", + // "entity.name.namespace", + // "entity.other.attribute", + // "entity.name.scope-resolution", + // "entity.name.class", + // "storage.type.numeric.go", + // "storage.type.byte.go", + // "storage.type.boolean.go", + // "storage.type.string.go", + // "storage.type.uintptr.go", + // "storage.type.error.go", + // "storage.type.rune.go", + // "storage.type.cs", + // "storage.type.generic.cs", + // "storage.type.modifier.cs", + // "storage.type.variable.cs", + // "storage.type.annotation.java", + // "storage.type.generic.java", + // "storage.type.java", + // "storage.type.object.array.java", + // "storage.type.primitive.array.java", + // "storage.type.primitive.java", + // "storage.type.token.java", + // "storage.type.groovy", + // "storage.type.annotation.groovy", + // "storage.type.parameters.groovy", + // "storage.type.generic.groovy", + // "storage.type.object.array.groovy", + // "storage.type.primitive.array.groovy", + // "storage.type.primitive.groovy" + // ], + // "settings": { + // "foreground": "#4EC9B0" + // } + // }, + // { + // "scope": [ + // "meta.type.cast.expr", + // "meta.type.new.expr", + // "support.constant.math", + // "support.constant.dom", + // "support.constant.json", + // "entity.other.inherited-class" + // ], + // "settings": { + // "foreground": "#4EC9B0" + // } + // }, + // { + // "scope": [ + // "keyword.control", + // "source.cpp keyword.operator.new", + // "keyword.operator.delete", + // "keyword.other.using", + // "keyword.other.operator", + // "entity.name.operator" + // ], + // "settings": { + // "foreground": "#55FFFF" + // } + // }, + // { + // "scope": [ + // "variable", + // "meta.definition.variable.name", + // "support.variable", + // "entity.name.variable" + // ], + // "settings": { + // "foreground": "#AA00AA" + // } + // }, + // { + // "scope": [ + // "variable.parameter.function.nushell" + // ], + // "settings": { + // "foreground": "#5555FF", + // // "fontStyle": "bold" + // } + // }, + // { + // "scope": [ + // "variable.other.constant", + // "variable.other.enummember" + // ], + // "settings": { + // "foreground": "#4FC1FF" + // } + // }, + // { + // "scope": [ + // "meta.object-literal.key" + // ], + // "settings": { + // "foreground": "#9CDCFE" + // } + // }, + // { + // "scope": [ + // "support.constant.property-value", + // "support.constant.font-name", + // "support.constant.media-type", + // "support.constant.media", + // "constant.other.color.rgb-value", + // "constant.other.rgb-value", + // "support.constant.color" + // ], + // "settings": { + // "foreground": "#CE9178" + // } + // }, + // { + // "scope": [ + // "punctuation.definition.group.regexp", + // "punctuation.definition.group.assertion.regexp", + // "punctuation.definition.character-class.regexp", + // "punctuation.character.set.begin.regexp", + // "punctuation.character.set.end.regexp", + // "keyword.operator.negation.regexp", + // "support.other.parenthesis.regexp" + // ], + // "settings": { + // "foreground": "#CE9178" + // } + // }, + // { + // "scope": [ + // "constant.character.character-class.regexp", + // "constant.other.character-class.set.regexp", + // "constant.other.character-class.regexp", + // "constant.character.set.regexp" + // ], + // "settings": { + // "foreground": "#D16969" + // } + // }, + // { + // "scope": [ + // "keyword.operator.or.regexp", + // "keyword.control.anchor.regexp" + // ], + // "settings": { + // "foreground": "#DCDCAA" + // } + // }, + // { + // "scope": "keyword.operator.quantifier.regexp", + // "settings": { + // "foreground": "#D7BA7D" + // } + // }, + // { + // "scope": "constant.character", + // "settings": { + // "foreground": "#569CD6" + // } + // }, + // { + // "scope": "constant.character.escape", + // "settings": { + // "foreground": "#D7BA7D" + // } + // }, + // { + // "scope": "entity.name.label", + // "settings": { + // "foreground": "#C8C8C8" + // } + // }, + // { + // "scope": "token.info-token", + // "settings": { + // "foreground": "#6796E6" + // } + // }, + // { + // "scope": "token.warn-token", + // "settings": { + // "foreground": "#CD9731" + // } + // }, + // { + // "scope": "token.error-token", + // "settings": { + // "foreground": "#F44747" + // } + // }, + // { + // "scope": "token.debug-token", + // "settings": { + // "foreground": "#B267E6" + // } + // } + ] +} diff --git a/ru/README.md b/ru/README.md deleted file mode 100644 index 365c4917103..00000000000 --- a/ru/README.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -home: true -heroImage: null -heroText: Nushell -tagline: Новый тип оболочки -actionText: Начать → -actionLink: /book/ -features: - - title: Конвейеры для управления любой ОС - details: Nu работает на Linux, macOS, BSD и Windows. Выучите его один раз, а затем используйте везде. - - title: Все есть данные - details: Конвейеры Nu используют структурированные данные, поэтому вы можете спокойно выбирать, фильтровать и сортировать их каждый раз одним и тем же способом. Перестаньте парсить строки и начните решать проблемы. - - title: Мощные плагины - details: Nu легко расширяется с помощью мощной системы плагинов. ---- - -<img src="https://www.nushell.sh/frontpage/ls-example.png" alt="Снимок экрана, показывающий использование команды ls" class="hero"/> - -### Nu работает с существующими данными - -Nu говорит на языках [JSON, YAML, SQLite, Excel, и других](/book/loading_data.html) из коробки. В конвейер Nu легко внести данные, будь они в файле, базе данных или веб-API: - -<img src="https://www.nushell.sh/frontpage/fetch-example.png" alt="Снимок экрана, показывающий выборку с помощью веб-API" class="hero"/> - -### Nu имеет отличные сообщения об ошибках - -Nu оперирует типизированными данными, поэтому отлавливает ошибки, которые другие оболочки не могут. А когда что-то ломается, Nu точно сообщает, где и почему: - -<img src="https://www.nushell.sh/frontpage/miette-example.png" alt="Снимок экрана, показывающий, как Nu ловит ошибку типа" class="hero"/> - -## Получить Nu - -Nushell доступен в виде [загружаемых двоичных файлов](https://github.com/nushell/nushell/releases), [через ваш любимый менеджер пакетов](https://repology.org/project/nushell/versions), в [Действие GitHub](https://github.com/marketplace/actions/setup-nu), а также в виде [исходного кода](https://github.com/nushell/nushell). Прочитайте [подробные инструкции по установке](/book/installation.html) или сразу приступайте к работе: - -#### macOS / Linux: - -```shell -$ brew install nushell -``` - -#### Windows: - -```shell -$ winget install nushell -``` - -После установки запустите Nu, набрав `nu`. - -## Сообщество - -Присоединяйтесь к нам [в Discord](https://discord.gg/NtAbbGn), если у вас есть вопросы о Nu! - -Вы можете помочь улучшить этот сайт, [оставив отзыв](https://github.com/nushell/nushell.github.io/issues) или [отправив PR](https://github.com/nushell/nushell.github.io/pulls). diff --git a/assets/images/0_12_0_jupyter.png b/src/assets/images/0_12_0_jupyter.png similarity index 100% rename from assets/images/0_12_0_jupyter.png rename to src/assets/images/0_12_0_jupyter.png diff --git a/assets/images/0_14_0_help_examples.png b/src/assets/images/0_14_0_help_examples.png similarity index 100% rename from assets/images/0_14_0_help_examples.png rename to src/assets/images/0_14_0_help_examples.png diff --git a/assets/images/0_15_0_prettier_errors.png b/src/assets/images/0_15_0_prettier_errors.png similarity index 100% rename from assets/images/0_15_0_prettier_errors.png rename to src/assets/images/0_15_0_prettier_errors.png diff --git a/assets/images/0_16_0_after_table.png b/src/assets/images/0_16_0_after_table.png similarity index 100% rename from assets/images/0_16_0_after_table.png rename to src/assets/images/0_16_0_after_table.png diff --git a/assets/images/0_16_0_before_table.png b/src/assets/images/0_16_0_before_table.png similarity index 100% rename from assets/images/0_16_0_before_table.png rename to src/assets/images/0_16_0_before_table.png diff --git a/assets/images/0_16_0_prompt_3.png b/src/assets/images/0_16_0_prompt_3.png similarity index 100% rename from assets/images/0_16_0_prompt_3.png rename to src/assets/images/0_16_0_prompt_3.png diff --git a/assets/images/0_16_0_prompt_4.png b/src/assets/images/0_16_0_prompt_4.png similarity index 100% rename from assets/images/0_16_0_prompt_4.png rename to src/assets/images/0_16_0_prompt_4.png diff --git a/assets/images/0_16_0_rendering_time.png b/src/assets/images/0_16_0_rendering_time.png similarity index 100% rename from assets/images/0_16_0_rendering_time.png rename to src/assets/images/0_16_0_rendering_time.png diff --git a/assets/images/0_17_0_playground.png b/src/assets/images/0_17_0_playground.png similarity index 100% rename from assets/images/0_17_0_playground.png rename to src/assets/images/0_17_0_playground.png diff --git a/assets/images/0_19_autocomplete.gif b/src/assets/images/0_19_autocomplete.gif similarity index 100% rename from assets/images/0_19_autocomplete.gif rename to src/assets/images/0_19_autocomplete.gif diff --git a/assets/images/0_19_heart_theme.png b/src/assets/images/0_19_heart_theme.png similarity index 100% rename from assets/images/0_19_heart_theme.png rename to src/assets/images/0_19_heart_theme.png diff --git a/assets/images/0_19_table_colors.png b/src/assets/images/0_19_table_colors.png similarity index 100% rename from assets/images/0_19_table_colors.png rename to src/assets/images/0_19_table_colors.png diff --git a/assets/images/0_21_bar_charts.gif b/src/assets/images/0_21_bar_charts.gif similarity index 100% rename from assets/images/0_21_bar_charts.gif rename to src/assets/images/0_21_bar_charts.gif diff --git a/assets/images/0_21_line_chart.png b/src/assets/images/0_21_line_chart.png similarity index 100% rename from assets/images/0_21_line_chart.png rename to src/assets/images/0_21_line_chart.png diff --git a/assets/images/0_22_flatten.gif b/src/assets/images/0_22_flatten.gif similarity index 100% rename from assets/images/0_22_flatten.gif rename to src/assets/images/0_22_flatten.gif diff --git a/assets/images/0_23_website.png b/src/assets/images/0_23_website.png similarity index 100% rename from assets/images/0_23_website.png rename to src/assets/images/0_23_website.png diff --git a/assets/images/0_30_0_speed.png b/src/assets/images/0_30_0_speed.png similarity index 100% rename from assets/images/0_30_0_speed.png rename to src/assets/images/0_30_0_speed.png diff --git a/assets/images/0_32_themes.png b/src/assets/images/0_32_themes.png similarity index 100% rename from assets/images/0_32_themes.png rename to src/assets/images/0_32_themes.png diff --git a/assets/images/0_36_tutor.png b/src/assets/images/0_36_tutor.png similarity index 100% rename from assets/images/0_36_tutor.png rename to src/assets/images/0_36_tutor.png diff --git a/assets/images/0_37_find.png b/src/assets/images/0_37_find.png similarity index 100% rename from assets/images/0_37_find.png rename to src/assets/images/0_37_find.png diff --git a/assets/images/0_4_0_new_colors.png b/src/assets/images/0_4_0_new_colors.png similarity index 100% rename from assets/images/0_4_0_new_colors.png rename to src/assets/images/0_4_0_new_colors.png diff --git a/assets/images/0_4_0_streaming_table.gif b/src/assets/images/0_4_0_streaming_table.gif similarity index 100% rename from assets/images/0_4_0_streaming_table.gif rename to src/assets/images/0_4_0_streaming_table.gif diff --git a/assets/images/0_59_1_for_multiline_indicator.png b/src/assets/images/0_59_1_for_multiline_indicator.png similarity index 100% rename from assets/images/0_59_1_for_multiline_indicator.png rename to src/assets/images/0_59_1_for_multiline_indicator.png diff --git a/assets/images/0_59_1_ls_gridc.png b/src/assets/images/0_59_1_ls_gridc.png similarity index 100% rename from assets/images/0_59_1_ls_gridc.png rename to src/assets/images/0_59_1_ls_gridc.png diff --git a/assets/images/0_59_1_ls_sort.png b/src/assets/images/0_59_1_ls_sort.png similarity index 100% rename from assets/images/0_59_1_ls_sort.png rename to src/assets/images/0_59_1_ls_sort.png diff --git a/assets/images/0_60_0_completions_external.gif b/src/assets/images/0_60_0_completions_external.gif similarity index 100% rename from assets/images/0_60_0_completions_external.gif rename to src/assets/images/0_60_0_completions_external.gif diff --git a/assets/images/0_60_0_completions_internal.gif b/src/assets/images/0_60_0_completions_internal.gif similarity index 100% rename from assets/images/0_60_0_completions_internal.gif rename to src/assets/images/0_60_0_completions_internal.gif diff --git a/assets/images/0_60_0_history.gif b/src/assets/images/0_60_0_history.gif similarity index 100% rename from assets/images/0_60_0_history.gif rename to src/assets/images/0_60_0_history.gif diff --git a/assets/images/0_60_0_history_complete.gif b/src/assets/images/0_60_0_history_complete.gif similarity index 100% rename from assets/images/0_60_0_history_complete.gif rename to src/assets/images/0_60_0_history_complete.gif diff --git a/assets/images/0_60_completions.gif b/src/assets/images/0_60_completions.gif similarity index 100% rename from assets/images/0_60_completions.gif rename to src/assets/images/0_60_completions.gif diff --git a/assets/images/0_60_ls_colors.png b/src/assets/images/0_60_ls_colors.png similarity index 100% rename from assets/images/0_60_ls_colors.png rename to src/assets/images/0_60_ls_colors.png diff --git a/assets/images/0_60_miette.png b/src/assets/images/0_60_miette.png similarity index 100% rename from assets/images/0_60_miette.png rename to src/assets/images/0_60_miette.png diff --git a/assets/images/0_61_completion_descriptions.png b/src/assets/images/0_61_completion_descriptions.png similarity index 100% rename from assets/images/0_61_completion_descriptions.png rename to src/assets/images/0_61_completion_descriptions.png diff --git a/assets/images/0_61_help_menu.png b/src/assets/images/0_61_help_menu.png similarity index 100% rename from assets/images/0_61_help_menu.png rename to src/assets/images/0_61_help_menu.png diff --git a/assets/images/0_67_error_message.png b/src/assets/images/0_67_error_message.png similarity index 100% rename from assets/images/0_67_error_message.png rename to src/assets/images/0_67_error_message.png diff --git a/assets/images/0_67_header.png b/src/assets/images/0_67_header.png similarity index 100% rename from assets/images/0_67_header.png rename to src/assets/images/0_67_header.png diff --git a/assets/images/0_67_vs_code.png b/src/assets/images/0_67_vs_code.png similarity index 100% rename from assets/images/0_67_vs_code.png rename to src/assets/images/0_67_vs_code.png diff --git a/assets/images/0_6_0_starship_prompt.png b/src/assets/images/0_6_0_starship_prompt.png similarity index 100% rename from assets/images/0_6_0_starship_prompt.png rename to src/assets/images/0_6_0_starship_prompt.png diff --git a/assets/images/0_70_table_expand.png b/src/assets/images/0_70_table_expand.png similarity index 100% rename from assets/images/0_70_table_expand.png rename to src/assets/images/0_70_table_expand.png diff --git a/assets/images/0_72_auto_expand.png b/src/assets/images/0_72_auto_expand.png similarity index 100% rename from assets/images/0_72_auto_expand.png rename to src/assets/images/0_72_auto_expand.png diff --git a/assets/images/0_73_explore_try_mode.png b/src/assets/images/0_73_explore_try_mode.png similarity index 100% rename from assets/images/0_73_explore_try_mode.png rename to src/assets/images/0_73_explore_try_mode.png diff --git a/assets/images/0_74_io_signatures.png b/src/assets/images/0_74_io_signatures.png similarity index 100% rename from assets/images/0_74_io_signatures.png rename to src/assets/images/0_74_io_signatures.png diff --git a/assets/images/0_74_new_help.png b/src/assets/images/0_74_new_help.png similarity index 100% rename from assets/images/0_74_new_help.png rename to src/assets/images/0_74_new_help.png diff --git a/assets/images/0_75_save_progress.png b/src/assets/images/0_75_save_progress.png similarity index 100% rename from assets/images/0_75_save_progress.png rename to src/assets/images/0_75_save_progress.png diff --git a/assets/images/0_76_explain_cmd.png b/src/assets/images/0_76_explain_cmd.png similarity index 100% rename from assets/images/0_76_explain_cmd.png rename to src/assets/images/0_76_explain_cmd.png diff --git a/assets/images/0_76_inspect_cmd.png b/src/assets/images/0_76_inspect_cmd.png similarity index 100% rename from assets/images/0_76_inspect_cmd.png rename to src/assets/images/0_76_inspect_cmd.png diff --git a/assets/images/0_76_plugin_with_example.png b/src/assets/images/0_76_plugin_with_example.png similarity index 100% rename from assets/images/0_76_plugin_with_example.png rename to src/assets/images/0_76_plugin_with_example.png diff --git a/assets/images/0_76_profile_prompt.png b/src/assets/images/0_76_profile_prompt.png similarity index 100% rename from assets/images/0_76_profile_prompt.png rename to src/assets/images/0_76_profile_prompt.png diff --git a/assets/images/0_76_view_files.png b/src/assets/images/0_76_view_files.png similarity index 100% rename from assets/images/0_76_view_files.png rename to src/assets/images/0_76_view_files.png diff --git a/assets/images/0_79_ide.png b/src/assets/images/0_79_ide.png similarity index 100% rename from assets/images/0_79_ide.png rename to src/assets/images/0_79_ide.png diff --git a/assets/images/0_79_std_log.png b/src/assets/images/0_79_std_log.png similarity index 100% rename from assets/images/0_79_std_log.png rename to src/assets/images/0_79_std_log.png diff --git a/assets/images/0_84_table_compact.png b/src/assets/images/0_84_table_compact.png similarity index 100% rename from assets/images/0_84_table_compact.png rename to src/assets/images/0_84_table_compact.png diff --git a/assets/images/0_84_table_padding.png b/src/assets/images/0_84_table_padding.png similarity index 100% rename from assets/images/0_84_table_padding.png rename to src/assets/images/0_84_table_padding.png diff --git a/assets/images/0_86_completions.gif b/src/assets/images/0_86_completions.gif similarity index 100% rename from assets/images/0_86_completions.gif rename to src/assets/images/0_86_completions.gif diff --git a/assets/images/0_9_0_error_highlight.png b/src/assets/images/0_9_0_error_highlight.png similarity index 100% rename from assets/images/0_9_0_error_highlight.png rename to src/assets/images/0_9_0_error_highlight.png diff --git a/assets/images/bday_4_bulk_convert.jpeg b/src/assets/images/bday_4_bulk_convert.jpeg similarity index 100% rename from assets/images/bday_4_bulk_convert.jpeg rename to src/assets/images/bday_4_bulk_convert.jpeg diff --git a/assets/images/bday_4_grid.png b/src/assets/images/bday_4_grid.png similarity index 100% rename from assets/images/bday_4_grid.png rename to src/assets/images/bday_4_grid.png diff --git a/assets/images/bday_4_hex_colours.png b/src/assets/images/bday_4_hex_colours.png similarity index 100% rename from assets/images/bday_4_hex_colours.png rename to src/assets/images/bday_4_hex_colours.png diff --git a/assets/images/bday_4_subcommand_help.png b/src/assets/images/bday_4_subcommand_help.png similarity index 100% rename from assets/images/bday_4_subcommand_help.png rename to src/assets/images/bday_4_subcommand_help.png diff --git a/assets/images/default.png b/src/assets/images/default.png similarity index 100% rename from assets/images/default.png rename to src/assets/images/default.png diff --git a/assets/images/did_you_mean.png b/src/assets/images/did_you_mean.png similarity index 100% rename from assets/images/did_you_mean.png rename to src/assets/images/did_you_mean.png diff --git a/assets/images/eq_git_branch_completion.gif b/src/assets/images/eq_git_branch_completion.gif similarity index 100% rename from assets/images/eq_git_branch_completion.gif rename to src/assets/images/eq_git_branch_completion.gif diff --git a/.vuepress/public/frontpage/fetch-example.png b/src/assets/images/fetch-example.png similarity index 100% rename from .vuepress/public/frontpage/fetch-example.png rename to src/assets/images/fetch-example.png diff --git a/assets/images/happy_nu_year_2020.png b/src/assets/images/happy_nu_year_2020.png similarity index 100% rename from assets/images/happy_nu_year_2020.png rename to src/assets/images/happy_nu_year_2020.png diff --git a/assets/images/jonathandturner.jpg b/src/assets/images/jonathandturner.jpg similarity index 100% rename from assets/images/jonathandturner.jpg rename to src/assets/images/jonathandturner.jpg diff --git a/assets/images/logo-contest/ellie-mascot.png b/src/assets/images/logo-contest/ellie-mascot.png similarity index 100% rename from assets/images/logo-contest/ellie-mascot.png rename to src/assets/images/logo-contest/ellie-mascot.png diff --git a/assets/images/logo-contest/font-logo.png b/src/assets/images/logo-contest/font-logo.png similarity index 100% rename from assets/images/logo-contest/font-logo.png rename to src/assets/images/logo-contest/font-logo.png diff --git a/assets/images/logo-contest/shell-mascot.png b/src/assets/images/logo-contest/shell-mascot.png similarity index 100% rename from assets/images/logo-contest/shell-mascot.png rename to src/assets/images/logo-contest/shell-mascot.png diff --git a/.vuepress/public/frontpage/ls-example.png b/src/assets/images/ls-example.png similarity index 100% rename from .vuepress/public/frontpage/ls-example.png rename to src/assets/images/ls-example.png diff --git a/.vuepress/public/frontpage/miette-example.png b/src/assets/images/miette-example.png similarity index 100% rename from .vuepress/public/frontpage/miette-example.png rename to src/assets/images/miette-example.png diff --git a/assets/images/nu_error.png b/src/assets/images/nu_error.png similarity index 100% rename from assets/images/nu_error.png rename to src/assets/images/nu_error.png diff --git a/assets/images/nu_error2.png b/src/assets/images/nu_error2.png similarity index 100% rename from assets/images/nu_error2.png rename to src/assets/images/nu_error2.png diff --git a/assets/images/nu_error_metadata.png b/src/assets/images/nu_error_metadata.png similarity index 100% rename from assets/images/nu_error_metadata.png rename to src/assets/images/nu_error_metadata.png diff --git a/assets/images/link.png b/src/assets/images/nu_icon.png similarity index 100% rename from assets/images/link.png rename to src/assets/images/nu_icon.png diff --git a/assets/images/nu_logo.png b/src/assets/images/nu_logo.png similarity index 100% rename from assets/images/nu_logo.png rename to src/assets/images/nu_logo.png diff --git a/assets/images/nu_ls.png b/src/assets/images/nu_ls.png similarity index 100% rename from assets/images/nu_ls.png rename to src/assets/images/nu_ls.png diff --git a/assets/images/nu_ls_filter.png b/src/assets/images/nu_ls_filter.png similarity index 100% rename from assets/images/nu_ls_filter.png rename to src/assets/images/nu_ls_filter.png diff --git a/assets/images/nu_ps_filter.png b/src/assets/images/nu_ps_filter.png similarity index 100% rename from assets/images/nu_ps_filter.png rename to src/assets/images/nu_ps_filter.png diff --git a/assets/images/nushell-autocomplete4.gif b/src/assets/images/nushell-autocomplete4.gif similarity index 100% rename from assets/images/nushell-autocomplete4.gif rename to src/assets/images/nushell-autocomplete4.gif diff --git a/assets/images/nushell_survey_2019_anything_else.png b/src/assets/images/nushell_survey_2019_anything_else.png similarity index 100% rename from assets/images/nushell_survey_2019_anything_else.png rename to src/assets/images/nushell_survey_2019_anything_else.png diff --git a/assets/images/nushell_survey_2019_blockers.png b/src/assets/images/nushell_survey_2019_blockers.png similarity index 100% rename from assets/images/nushell_survey_2019_blockers.png rename to src/assets/images/nushell_survey_2019_blockers.png diff --git a/assets/images/nushell_survey_2019_fave_features.png b/src/assets/images/nushell_survey_2019_fave_features.png similarity index 100% rename from assets/images/nushell_survey_2019_fave_features.png rename to src/assets/images/nushell_survey_2019_fave_features.png diff --git a/assets/images/nushell_survey_2019_needs_work.png b/src/assets/images/nushell_survey_2019_needs_work.png similarity index 100% rename from assets/images/nushell_survey_2019_needs_work.png rename to src/assets/images/nushell_survey_2019_needs_work.png diff --git a/assets/images/nushell_survey_2019_percent.png b/src/assets/images/nushell_survey_2019_percent.png similarity index 100% rename from assets/images/nushell_survey_2019_percent.png rename to src/assets/images/nushell_survey_2019_percent.png diff --git a/assets/images/nushell_survey_2019_stoppers.png b/src/assets/images/nushell_survey_2019_stoppers.png similarity index 100% rename from assets/images/nushell_survey_2019_stoppers.png rename to src/assets/images/nushell_survey_2019_stoppers.png diff --git a/assets/images/nushell_survey_2023_how_install.png b/src/assets/images/nushell_survey_2023_how_install.png similarity index 100% rename from assets/images/nushell_survey_2023_how_install.png rename to src/assets/images/nushell_survey_2023_how_install.png diff --git a/assets/images/nushell_survey_2023_platforms.png b/src/assets/images/nushell_survey_2023_platforms.png similarity index 100% rename from assets/images/nushell_survey_2023_platforms.png rename to src/assets/images/nushell_survey_2023_platforms.png diff --git a/assets/images/nushell_survey_2023_priorities.png b/src/assets/images/nushell_survey_2023_priorities.png similarity index 100% rename from assets/images/nushell_survey_2023_priorities.png rename to src/assets/images/nushell_survey_2023_priorities.png diff --git a/assets/images/nushell_survey_2023_running_nushell.png b/src/assets/images/nushell_survey_2023_running_nushell.png similarity index 100% rename from assets/images/nushell_survey_2023_running_nushell.png rename to src/assets/images/nushell_survey_2023_running_nushell.png diff --git a/assets/images/nushell_survey_2023_use_nushell.png b/src/assets/images/nushell_survey_2023_use_nushell.png similarity index 100% rename from assets/images/nushell_survey_2023_use_nushell.png rename to src/assets/images/nushell_survey_2023_use_nushell.png diff --git a/assets/images/open_cargo.png b/src/assets/images/open_cargo.png similarity index 100% rename from assets/images/open_cargo.png rename to src/assets/images/open_cargo.png diff --git a/assets/images/right_prompt.png b/src/assets/images/right_prompt.png similarity index 100% rename from assets/images/right_prompt.png rename to src/assets/images/right_prompt.png diff --git a/assets/images/right_prompt_default.png b/src/assets/images/right_prompt_default.png similarity index 100% rename from assets/images/right_prompt_default.png rename to src/assets/images/right_prompt_default.png diff --git a/assets/images/two_year_cake.png b/src/assets/images/two_year_cake.png similarity index 100% rename from assets/images/two_year_cake.png rename to src/assets/images/two_year_cake.png diff --git a/assets/images/two_year_stars.png b/src/assets/images/two_year_stars.png similarity index 100% rename from assets/images/two_year_stars.png rename to src/assets/images/two_year_stars.png diff --git a/assets/images/two_year_tweet1.png b/src/assets/images/two_year_tweet1.png similarity index 100% rename from assets/images/two_year_tweet1.png rename to src/assets/images/two_year_tweet1.png diff --git a/assets/images/two_year_tweet2.png b/src/assets/images/two_year_tweet2.png similarity index 100% rename from assets/images/two_year_tweet2.png rename to src/assets/images/two_year_tweet2.png diff --git a/assets/images/two_year_tweet3.png b/src/assets/images/two_year_tweet3.png similarity index 100% rename from assets/images/two_year_tweet3.png rename to src/assets/images/two_year_tweet3.png diff --git a/assets/images/two_year_tweet4.png b/src/assets/images/two_year_tweet4.png similarity index 100% rename from assets/images/two_year_tweet4.png rename to src/assets/images/two_year_tweet4.png diff --git a/assets/images/two_year_tweet5.png b/src/assets/images/two_year_tweet5.png similarity index 100% rename from assets/images/two_year_tweet5.png rename to src/assets/images/two_year_tweet5.png diff --git a/assets/images/two_year_vscode.png b/src/assets/images/two_year_vscode.png similarity index 100% rename from assets/images/two_year_vscode.png rename to src/assets/images/two_year_vscode.png diff --git a/assets/images/utf8_light_table.png b/src/assets/images/utf8_light_table.png similarity index 100% rename from assets/images/utf8_light_table.png rename to src/assets/images/utf8_light_table.png diff --git a/assets/images/utf8_table.png b/src/assets/images/utf8_table.png similarity index 100% rename from assets/images/utf8_table.png rename to src/assets/images/utf8_table.png diff --git a/assets/images/view_source.png b/src/assets/images/view_source.png similarity index 100% rename from assets/images/view_source.png rename to src/assets/images/view_source.png diff --git a/assets/images/year_1_kloc.png b/src/assets/images/year_1_kloc.png similarity index 100% rename from assets/images/year_1_kloc.png rename to src/assets/images/year_1_kloc.png diff --git a/src/components/GetBlogPosts.astro b/src/components/GetBlogPosts.astro new file mode 100644 index 00000000000..a6cc5403bb3 --- /dev/null +++ b/src/components/GetBlogPosts.astro @@ -0,0 +1,13 @@ +--- +const posts = await Astro.glob("../content/docs/blog/*.md"); // returns an array of posts that live at ./src/pages/post/*.md +--- + +<ul> + { + posts.map((post) => ( + <li> + <a href={post.url}>{post.frontmatter.title}</a> + </li> + )) + } +</ul> diff --git a/src/components/GetCommands.astro b/src/components/GetCommands.astro new file mode 100644 index 00000000000..b9383c7a1a9 --- /dev/null +++ b/src/components/GetCommands.astro @@ -0,0 +1,24 @@ +--- +const posts = await Astro.glob("../content/docs/commands/docs/*.md"); // returns an array of posts that live at ./src/pages/post/*.md +--- + +<table> + <tr> + <th>Command</th> + <th>Categories</th> + <th>Description</th> + <th>Feature</th> + </tr> + { + posts.map((post) => ( + <tr> + <td> + <a href={post.url}>{post.frontmatter.title}</a> + </td> + <td>{post.frontmatter.categories}</td> + <td>{post.frontmatter.usage}</td> + <td>{post.frontmatter.feature}</td> + </tr> + )) + } +</table> diff --git a/src/content/config.ts b/src/content/config.ts new file mode 100644 index 00000000000..e0233b30397 --- /dev/null +++ b/src/content/config.ts @@ -0,0 +1,7 @@ +import { docsSchema, i18nSchema } from "@astrojs/starlight/schema"; +import { defineCollection } from "astro:content"; + +export const collections = { + docs: defineCollection({ schema: docsSchema() }), + i18n: defineCollection({ type: "data", schema: i18nSchema() }), +}; diff --git a/blog/2019-08-23-introducing-nushell.md b/src/content/docs/blog/2019-08-23-introducing-nushell.md similarity index 93% rename from blog/2019-08-23-introducing-nushell.md rename to src/content/docs/blog/2019-08-23-introducing-nushell.md index c9741169e00..5fa5869ef9d 100644 --- a/blog/2019-08-23-introducing-nushell.md +++ b/src/content/docs/blog/2019-08-23-introducing-nushell.md @@ -3,20 +3,18 @@ title: Introducing nushell author: Jonathan Turner author_site: https://twitter.com/jntrnr author_image: https://www.nushell.sh/blog/images/jonathandturner.jpg -excerpt: Today, we're introducing a new shell, written in Rust. It draws inspiration from the classic Unix philosophy of pipelines, the structured data approach of PowerShell, functional programming, systems programming, and more. +description: Today, we're introducing a new shell, written in Rust. It draws inspiration from the classic Unix philosophy of pipelines, the structured data approach of PowerShell, functional programming, systems programming, and more. --- -# Introducing nushell - Today, we're introducing a new shell, written in Rust. It draws inspiration from the classic Unix philosophy of pipelines, the structured data approach of PowerShell, functional programming, systems programming, and more. It's called Nushell, or just Nu for short. We have a [book](https://book.nushell.sh/en) (¡también se habla [Español](https://book.nushell.sh/es)!). We have a [repo](https://github.com/nushell/nushell). This release was made by Jonathan Turner (me), Yehuda Katz, and Andrés Robalino, with contributions from Odin Dutton. - + -# But why? +## But why? Many of us have gotten used to bash (or zsh/fish/etc), and don't understand why you would need another kind of shell. That was me, too, a few months ago before I started working on this. My friend Yehuda had discovered PowerShell and was going on and on about how amazing it was to do more with the shell, but until he actually gave me a demo, I didn't really believe him. @@ -24,33 +22,33 @@ Then he talked me into joining him on an idea he had. What if we could take the In this post, I'll talk about how a few simple ideas drive how Nu works, what Nu can do with them, and where we hope to go in the future. -# Simple ideas +## Simple ideas To Nu, everything is data. When you type `ls`, you're given a table of information about the directory you're listing: - + Rather than having to remember different flags to `ls`, we can just work with the data it gives back. We can find the files greater than a certain size: - + Or we could choose to sort it by a column, or only show directories, or more. That by itself is fun but perhaps not compelling enough. - + Where this simple concept - that everything in Nu is data - starts to shine when we try other commands and realize that we're using the same commands to filter, to sort, etc. Rather than having the need to remember all the parameters to all the commands, we can just use the same verbs to act over our data, regardless of where the data came from. Nu pushes this idea even further. - + Nu also understands structured text files like JSON, TOML, YAML, and more. Opening these files gives us the same tables we saw with `ls` and `ps`. Again, this lets us use the same commands to filter our data, explore it, and use it. -# Working with the outside world +## Working with the outside world The above approach could be fun, but if we're not careful, it could become a walled garden. What happens outside of the commands Nu comes with? First, let's take a look at working with a file that Nu doesn't understand. -``` +```nu > open people.psv Octavia | Butler | Writer Bob | Ross | Painter @@ -59,7 +57,7 @@ Antonio | Vivaldi | Composer To work with this in Nu, we need to do two steps: figure out where the rows are, and then figure out what the columns are. The rows are pretty easy, we just have one record per row: -``` +```nu > open people.psv | lines ---+------------------------------ # | value @@ -72,7 +70,7 @@ To work with this in Nu, we need to do two steps: figure out where the rows are, Next, we can create our columns by splitting each row at the pipe (`|`) symbol: -``` +```nu > open people.psv | lines | split-column "|" ---+----------+-----------+----------- # | Column1 | Column2 | Column3 @@ -85,7 +83,7 @@ Next, we can create our columns by splitting each row at the pipe (`|`) symbol: That's already good enough that we can work with the data. We can go a step further and name the columns if we want: -``` +```nu > open people.psv | lines | split-column " | " firstname lastname job ---+-----------+----------+---------- # | firstname | lastname | job @@ -98,7 +96,7 @@ That's already good enough that we can work with the data. We can go a step furt But what about working with commands outside of Nu? Let's first call the native version of `ls` instead of the Nu version: -``` +```nu > ^ls assets Cargo.lock docs images Makefile.toml README.md rustfmt2.toml src tests Cargo2.toml Cargo.toml extra LICENSE open readonly.txt rustfmt.toml target @@ -106,7 +104,7 @@ Cargo2.toml Cargo.toml extra LICENSE open readonly.txt rustfmt.toml targe We'll use the same commands we used on data to bring it into Nu: -``` +```nu ^ls | split-row " " file ----+--------------- # | value @@ -133,7 +131,7 @@ We'll use the same commands we used on data to bring it into Nu: Or maybe we want to work with the native `ls -la`: -``` +```nu ^ls -la | lines | split-column " " ----+------------+---------+----------+----------+---------+---------+---------+---------+--------------- # | Column1 | Column2 | Column3 | Column4 | Column5 | Column6 | Column7 | Column8 | Column9 @@ -169,7 +167,7 @@ Or maybe we want to work with the native `ls -la`: After a bit of experimenting, we might come up with a command like this: -``` +```nu > ^ls -la | lines | skip 1 | split-column " " perms files group user size month day time name ----+------------+-------+----------+----------+--------+-------+-----+-------+--------------- # | perms | files | group | user | size | month | day | time | name @@ -206,33 +204,33 @@ Because Nu let's you manipulate your data until it's how you want it, there's a Oh, before I forget - I wanted to quickly show how to get data from Nu back out into the outside world. Here's an example of calling `echo` on each filename in a directory: -``` +```nu > ls | get name | echo $it ``` You can see that we can mix-and-match commands that are inside of Nu with those that are outside, and data will still flow between them as expected. But Nu is more than just a pipeline. -# More than a pipeline +## More than a pipeline As we built Nu, we realized we could experiment with other parts of how a shell works. The first of these experiments lead us to an observation: if everything is data in Nu, we should be able to view this data. - + We've seen the tables. Nu also supports opening and looking at text and binary data. If we open a source file, we can scroll around in a syntax-highlighted file. If we open an xml, we can look at its data. We can even open a binary file and look at what's inside (hint: there's even a fun easter egg if you open certain kinds binary files, especially if you've installed Nu with the optional `rawkey` feature). Being able to view data is helpful, and this kind of polish extends to other aspects, like error messages: - + -Nu takes heavy inspiration from the [error messages in Rust](https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html). As much as possible, draw your eyes to the problem. +Nu takes heavy inspiration from the [error messages in Rust](https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come). As much as possible, draw your eyes to the problem. Combined with the pipeline, some pretty interesting errors are possible: - + You might wonder how does that even work. Nu has a metadata system (still early!) that you can read about in the [Metadata chapter](https://book.nushell.sh/en/metadata) of the [Nu book](https://book.nushell.sh). Let's just take a quick peek at it: -``` +```nu > open Cargo.toml ------------+--------------+------------------+----------+---------- bin | dependencies | dev-dependencies | lib | package @@ -249,13 +247,13 @@ You might wonder how does that even work. Nu has a metadata system (still early! Data that flows through the pipeline gets a set of additional metadata tagged to it. We can use this later to figure out how to display the contents, show a better error message, and more. -# Shells, plural +## Shells, plural Let's say you're in a directory, but you'd really like to flip back and forth between it and one or two others. You could open up multiple tabs, multiple terminals, if you're on a Unix system you could use "screen", and probably even more than that. What if the shells were just built in? In Nu, we can `enter` a directory, which adds it to a ring of shells we can bounce between: -``` +```nu > enter ../rhai/ /home/jonathan/Source/rhai(master)> shells ---+---+------------+------------------------------- @@ -270,7 +268,7 @@ Using `n` and `p` we can jump back and forth between the shells. `exit` gets us You might noticed that `name` column in the `shells` table. Why's that there? Oh no... oh yes. -``` +```nu > enter Cargo.toml /> shells ---+---+--------------------------------------------+------------------------------- @@ -284,7 +282,7 @@ You might noticed that `name` column in the `shells` table. Why's that there? Oh That's right, we're in the file. Can we `cd`? Oh yes, we can: -``` +```nu /> ls ------------+--------------+------------------+----------+---------- bin | dependencies | dev-dependencies | lib | package @@ -310,17 +308,17 @@ That's right, we're in the file. Can we `cd`? Oh yes, we can: ----+----------------------+--------------------------- ``` -# Plugins +## Plugins -Nu can't come with everything you might want to do with it, so we're releasing Nu with the ability to extend it with plugins. There's more information in the [plugins chapters](https://www.nushell.sh/book/plugins.html). Nu will look for these plugins in your path, and load them up on startup. +Nu can't come with everything you might want to do with it, so we're releasing Nu with the ability to extend it with plugins. There's more information in the [plugins chapters](https://www.nushell.sh/book/plugins). Nu will look for these plugins in your path, and load them up on startup. -# All because of Rust +## All because of Rust Nu would not have been possible without Rust. Internally, it uses async/await, async streams, and liberal use of "serde" to manage serializing and deserializing into the common data format and to communicate with plugins. We also heavily leveraged [crates.io](https://crates.io). The ability to load numerous file formats, display messages, draw tables, and more all came from the hundreds (thousands?) of generous developers who wrote the crates we use in Nu. A **huge** thank you to everyone who contributed to Nu without ever knowing it. -# What's next? +## What's next? Nu is just getting started. In this release, we have a foundation to build on. Next, we'll work towards stability, the ability to use Nu as your main shell, the ability to write functions and scripts in Nu, and much more. diff --git a/blog/2019-09-24-nushell_0_3_0.md b/src/content/docs/blog/2019-09-24-nushell_0_3_0.md similarity index 90% rename from blog/2019-09-24-nushell_0_3_0.md rename to src/content/docs/blog/2019-09-24-nushell_0_3_0.md index 514771411ad..121533cb104 100644 --- a/blog/2019-09-24-nushell_0_3_0.md +++ b/src/content/docs/blog/2019-09-24-nushell_0_3_0.md @@ -3,32 +3,30 @@ title: Nushell 0.3.0 author: Jonathan Turner author_site: https://twitter.com/jntrnr author_image: https://www.nushell.sh/blog/images/jonathandturner.jpg -excerpt: We're happy to announce that today we're releasing Nushell 0.3.0. Nu has seen numerous bugfixes, performance improvements, and features added since its initial public release (which was only a few weeks ago!) +description: We're happy to announce that today we're releasing Nushell 0.3.0. Nu has seen numerous bugfixes, performance improvements, and features added since its initial public release (which was only a few weeks ago!) --- -# Nushell 0.3.0 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. We're happy to announce that today we're releasing Nushell 0.3.0. Nu has seen numerous bugfixes, performance improvements, and features added since its initial public release (which was only a few weeks ago!) -# Where to get it +## Where to get it Nu 0.3.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.3.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo +nightly install nu` (or if you want all the features `cargo +nightly install nu --all-features`). -# What's new +## What's new ## New table design (Porges, jonathandturner) - + One of the most striking differences is that Nu now uses UTF-8 box drawing to draw its tables. - + The table is also configurable. If you feel like the table is a bit too heavy, you can also configure it to work in light mode using this command: -``` +```nu > config --set [table_mode light] ``` @@ -53,7 +51,7 @@ Since the 0.2.0 release, Nu has gained a set of additional commands, including: ## Error improvements (jonathandturner) - + We've made steady progress on improving error messages. Recently, we added "did you mean?" errors to help when you mistype the name of columns. Nu 0.3.0 also has gone through a few passes to generally polish the errors to include more information when an error occurs. diff --git a/blog/2019-10-15-nushell-0_4_0.md b/src/content/docs/blog/2019-10-15-nushell-0_4_0.md similarity index 86% rename from blog/2019-10-15-nushell-0_4_0.md rename to src/content/docs/blog/2019-10-15-nushell-0_4_0.md index 34ad388faf1..431f5f5f73b 100644 --- a/blog/2019-10-15-nushell-0_4_0.md +++ b/src/content/docs/blog/2019-10-15-nushell-0_4_0.md @@ -3,50 +3,48 @@ title: Nushell 0.4.0 author: Jonathan Turner author_site: https://twitter.com/jntrnr author_image: https://www.nushell.sh/blog/images/jonathandturner.jpg -excerpt: Today we're happy to announce the 0.4.0 release of Nushell. The 0.4.0 marks a continually maturing shell that is now starting to show signs of stability. And, of course, a few fun features along the way. +description: Today we're happy to announce the 0.4.0 release of Nushell. The 0.4.0 marks a continually maturing shell that is now starting to show signs of stability. And, of course, a few fun features along the way. --- -# Nushell 0.4.0 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today we're happy to announce the 0.4.0 release of Nushell. The [0.4.0 release](https://github.com/nushell/nushell/releases/tag/0.4.0) marks a continually maturing shell that is now starting to show signs of stability. And, of course, a few fun features along the way. -# Where to get it +## Where to get it Nu 0.4.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.4.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo +beta install nu` (or if you want all the features `cargo +beta install nu --all-features`). -# What's new +## What's new -## New Colors (wycats) +### New Colors (wycats) - + New colors! With 0.4.0, we're adding some new colors to show off different types of the command, where errors might be happening, and if the command is internal or external. The coloring is just the tip of the iceberg, as it were, and builds from a reworking of the parser to make it more accurate, more stable, and more feature-complete. -## Streaming table (jonathandturner) +### Streaming table (jonathandturner) - + Streaming tables Up to this point, we've taken a few shortcuts with how streams worked in Nushell. We knew that a table, in theory, was a stream of rows. In practice, though, this wasn't the case as the code has lots of assumptions about how tables worked. With the 0.4.0, we're taking a big step in the direction of full support for streams. You'll see that now data will start being printed as it becomes available, with tables printing pages of 50 rows at a time (by default). This allows you to get deep listings of files (eg using `ls **`), work with streams from external sources, and more. -## Better ctrl-c support (jonathandturner, landaire) +### Better ctrl-c support (jonathandturner, landaire) As part of having streams of tables, it's always helpful to be able to say "stop!" when you need to. With 0.4.0, using ctrl-c to stop the output should be a lot more responsive and will take you back to the prompt. -## Textview gets VI keys (JonnyWalker81) +### Textview gets VI keys (JonnyWalker81) The built-in text viewer now lets you use vi keys for navigation thanks to JonnyWalker81's work. -## Onto the Beta compiler (est31) +### Onto the Beta compiler (est31) For those of you wondering if and when Nu was going to be usable on stable Rust, you need but wait just a little longer. Contributor est31 has been hard at work at moving Nu onto stable Rust and has now successfully moved Nu off of nightly and onto beta. As beta matures and becomes the next release of Rust, we'll be able to move Nu onto stable. This should help people who are working to distribute Nu on various distributions. -## Brazilian Portuguese book (marcelocg) +### Brazilian Portuguese book (marcelocg) Contributor marcelocg surprised us with a translation of the Nu book into Brazillian Portuguese. Obrigado, Marcelo! @@ -68,6 +66,6 @@ Happy hacktoberfest! Lots of people wanted to jump in and help document all of o As always, there were a bunch of stability and correctness both in Nu and in the CI that support Nu's development -# Looking ahead +## Looking ahead We'll continuing filling out the features that will let folks use Nu as their everyday shell. Coming up are better support for the environment, path, and for command aliases. diff --git a/blog/2019-11-05-nushell-0_5_0.md b/src/content/docs/blog/2019-11-05-nushell-0_5_0.md similarity index 93% rename from blog/2019-11-05-nushell-0_5_0.md rename to src/content/docs/blog/2019-11-05-nushell-0_5_0.md index e84feb1132d..8f4c56828d9 100644 --- a/blog/2019-11-05-nushell-0_5_0.md +++ b/src/content/docs/blog/2019-11-05-nushell-0_5_0.md @@ -3,33 +3,31 @@ title: Nushell 0.5.0 author: Jonathan Turner author_site: https://twitter.com/jntrnr author_image: https://www.nushell.sh/blog/images/jonathandturner.jpg -excerpt: Today, we're happy to announce the 0.5.0 release for Nu. We've got lots of new features, including some long-requested ones, in this release. +description: Today, we're happy to announce the 0.5.0 release for Nu. We've got lots of new features, including some long-requested ones, in this release. --- -# Nushell 0.5.0 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're happy to announce the 0.5.0 release for Nu. We've got lots of new features, including some long-requested ones, in this release. -# Where to get it +## Where to get it Nu 0.5.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0_5_0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo +beta install nu` (or if you want all the features `cargo +beta install nu --all-features`). -# Nu as a login shell (jonathandturner) +## Nu as a login shell (jonathandturner) One of the key features that landed in 0.5.0 is set of new capabilities that work together to allow you to use Nu as a login shell, completely independent of bash or other hosting shells. For this, we've built in support for querying and updating the environment variables and the path. To get started, you'll need to first copy the environment you're using into the config. Luckily, we've also made some improvements there: -```shell +```nu > config --set [path $nu:path] > config --set [env $nu:env] ``` Version 0.7.2 and later (added: Dec 24, 2019) : -```shell +```nu > config set [path $nu.path] > config set [env $nu.env] ``` @@ -40,7 +38,7 @@ Once these values are set, you'll be able to use Nu as your login shell. As you saw above, we've added a few new built-in variables. These will let you know what the current values that Nu can see are for your environment, path, and the config itself. -```shell +```nu > echo $nu:env > echo $nu:path > echo $nu:config @@ -48,7 +46,7 @@ As you saw above, we've added a few new built-in variables. These will let you k Version 0.7.2 and later: -```shell +```nu > echo $nu.env > echo $nu.path > echo $nu.config @@ -58,7 +56,7 @@ Version 0.7.2 and later: One of the first things you'll notice is that the new $nu:path is structured. If you run the echo above, you might see something like this: -```shell +```nu > echo $nu:path ━━━┯━━━━━━━━━━━━━━━━━━ # │ <value> @@ -77,7 +75,7 @@ One of the first things you'll notice is that the new $nu:path is structured. If Version 0.7.2 and later: -```shell +```nu > echo $nu.path ━━━┯━━━━━━━━━━━━━━━━━━ # │ <value> @@ -96,13 +94,13 @@ Version 0.7.2 and later: We've added two new commands: `prepend` for adding items to the start of a table and `append` for adding items to the end of a table. With these commands, we can now query out the path, update it, and save it back. -```shell +```nu > echo $nu:path | prepend "/my/new/directory" | config --set_into path ``` Version 0.7.2 and later: -```shell +```nu > echo $nu.path | prepend "/my/new/directory" | config set_into path ``` @@ -110,19 +108,19 @@ Version 0.7.2 and later: You can use a similar set of steps to add new variables, or change existing variables, in your environment. -```shell +```nu > echo $nu:env | insert GREETING hello_world | config --set_into env ``` Version 0.7.2 and later: -```shell +```nu > echo $nu.env | insert GREETING hello_world | config set_into env ``` _Note: the previous `add` command of previous releases has been renamed `insert` to remove confusion with mathematical functions._ -# On-going improvements +## On-going improvements We're continuing to improve the commands we currently ship as part of Nu. Here are a few you might find helpful: @@ -130,7 +128,7 @@ We're continuing to improve the commands we currently ship as part of Nu. Here a The `str` command now supports being able to retrieve a substring from the strings given, so you could return, for example, the first 5 characters and stop after that. -```shell +```nu > ls | get name ━━━━┯━━━━━━━━━━━━━━━━━━━━ # │ <value> @@ -143,7 +141,7 @@ The `str` command now supports being able to retrieve a substring from the strin 5 │ rustfmt.toml ``` -```shell +```nu > ls | get name | str --substring "0,3" ━━━━┯━━━━━━━━━ # │ <value> @@ -160,7 +158,7 @@ The `str` command now supports being able to retrieve a substring from the strin Ever wish you could `rm` things, but not forever? You can now tell `rm` to send items to your platform's recycle bin rather than deleting them forever. As with our other commands, this works across all the platforms that Nu supports. -```shell +```nu > rm myfile.txt --trash ``` @@ -168,7 +166,7 @@ Ever wish you could `rm` things, but not forever? You can now tell `rm` to send We're also continuing to improve the built-in help system. New in this release are descriptions for the flags and parameters that the command uses. For example, here's a look at what the help for `rm` now looks like: -```shell +```nu > help rm Remove a file @@ -183,7 +181,7 @@ flags: --recursive: delete subdirectories recursively ``` -# New commands +## New commands In addition to the new `append` and `prepend` we mentioned earlier, we've added a few new commands to Nu. @@ -191,7 +189,7 @@ In addition to the new `append` and `prepend` we mentioned earlier, we've added Growing our set of mathematics functions for working with numbers, we now have an `average` command which will take the average of values given to it. -```shell +```nu > ls | get size | average ``` @@ -199,7 +197,7 @@ Growing our set of mathematics functions for working with numbers, we now have a We've also introduced a new command to load in strings as tables. This new `read` command will take a pattern that describes the columns, their names, and where they are in each row of the string. -```shell +```nu > open .editorconfig root = true @@ -212,7 +210,7 @@ insert_final_newline = false end_of_line = lf ``` -```shell +```nu > open .editorconfig | read "{variable} = {value}" ━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━ # │ variable │ value @@ -226,15 +224,15 @@ end_of_line = lf 6 │ end_of_line │ lf ``` -# Bugfixes (jonathandturner, JesterOrNot, thegedge, andrasio, wycats, notryanb, Detegr, t-hart) +## Bugfixes (jonathandturner, JesterOrNot, thegedge, andrasio, wycats, notryanb, Detegr, t-hart) As always, we've had lots of bugfixes. A _huge_ "thank you!" to folks who reported issues, fixed issues, and just generally shared their experience with the shell. It's much appreciated and helps to continue making Nu that much better. -# Survey +## Survey If you haven't already taken it, we'd love to hear your feedback in a quick (roughly 3 question) [survey](https://t.co/nujSjnI0dr?amp=1). -# Looking forward +## Looking forward There are a bunch of areas we're currently working on to make Nu more stable and feature complete. Until this work is finished, please consider Nu to be somewhere in the _pre-alpha_ to _alpha_ quality level. diff --git a/blog/2019-11-23-nushell-survey-results.md b/src/content/docs/blog/2019-11-23-nushell-survey-results.md similarity index 88% rename from blog/2019-11-23-nushell-survey-results.md rename to src/content/docs/blog/2019-11-23-nushell-survey-results.md index 088c4df97cf..6b83a2ca950 100644 --- a/blog/2019-11-23-nushell-survey-results.md +++ b/src/content/docs/blog/2019-11-23-nushell-survey-results.md @@ -3,28 +3,26 @@ title: Nushell 2019 Survey Results author: Jonathan Turner author_site: https://twitter.com/jntrnr author_image: https://www.nushell.sh/blog/images/jonathandturner.jpg -excerpt: Recently, we ran a short survey to see how you were feeling about nushell. Here are the results. +description: Recently, we ran a short survey to see how you were feeling about nushell. Here are the results. --- -# Nushell 2019 Survey Results - Recently, we ran a short survey to see how you were feeling about [Nushell](https://github.com/nushell/nushell). We wanted to give a very hearty "thank you!" to everyone who participated. These surveys are a great way to gather information about how people are feeling, where they're happy, and where they feel there are pain points. In total, **160** people responded. An impressive amount for a project still in its first few months in the public. -# Do you use Nu? +## Do you use Nu? - + The survey welcomed both users and non-users of Nu. In our first question, we wanted to see how many folks are using Nu already. Perhaps unsurprising for a project still missing major functionality, most respondents aren't users, yet. As we'll see, there are themes around what people are waiting for before they jump in. But first, let's take a look at the responses from folks how are currently using Nu. -# Nu users +## Nu users -## What do you like? (20 responses) +### What do you like? (20 responses) - + Overwhelmingly, Nu users love tables! People currently using Nushell felt that tables and Nu's structured approach were their favorite features. @@ -40,7 +38,7 @@ Other topics mentioned: syntax highlighting, good plugins, shells feature, tags ## Where should Nushell improve? (20 responses) - + Nu users also pointed out a few areas where they hoped Nu would improve over time. Top of mind were improvements around auto-completion, improving the keyboard shortcuts, and better integration with existing shells and tools. @@ -53,11 +51,11 @@ There were also a batch of additional improvements people wished for: full scrip - _"Compatibility with other shells. It's annoying that I often have to add quotes when copying a command from a website."_ - _"Honestly, I wish I knew enough about Nu that I could add a bunch of documentation to show others what it could do."_ -# Nu non-users +## Nu non-users -## What's stopping you from using Nu? (100 responses) +### What's stopping you from using Nu? (100 responses) - + We also asked for feedback from people not using Nu what their thoughts were. What are the kinds of things that block them from using Nu? @@ -74,7 +72,7 @@ We also heard from many people who were perfectly comfortable in their current s ## Used Nu but stopped (38 responses) - + For those folks who tried Nu, but decided it wasn't for them, we also gave them a chance to tell us why. Similarly to the previous question, "stability" and "time" were at the top of the list. @@ -88,9 +86,9 @@ Other topics that came up: needing better autocomplete, needing aliases, better - _"Also the lack of documentation around the different commands is a major impediment."_ - _"Lack of middle-of-the-word completion, mostly. Also all the aliases I have defined that I’d need to port over."_ -# Anything else we should know? (68 responses) +## Anything else we should know? (68 responses) - + As our final question, we gave responders a chance to give us any last thoughts they felt we should know. @@ -107,7 +105,7 @@ Overwhelming, people sent us love and encouragement. Lots of it. We wanted to ta And thank _you_ for responding to our survey! -# Conclusions +## Conclusions The astute reader may already see some of the changes we've done recently were directly inspired by comments in this survey, and more are planned. This has been a great help, and we're looking forward to growing Nu with you in the coming months. diff --git a/blog/2019-11-26-nushell-0_6_0.md b/src/content/docs/blog/2019-11-26-nushell-0_6_0.md similarity index 92% rename from blog/2019-11-26-nushell-0_6_0.md rename to src/content/docs/blog/2019-11-26-nushell-0_6_0.md index 710b6743931..7d3446b141d 100644 --- a/blog/2019-11-26-nushell-0_6_0.md +++ b/src/content/docs/blog/2019-11-26-nushell-0_6_0.md @@ -3,22 +3,20 @@ title: Nushell 0.6.0 author: Jonathan Turner author_site: https://twitter.com/jntrnr author_image: https://www.nushell.sh/blog/images/jonathandturner.jpg -excerpt: We're happy to announce the 0.6.0 release of Nu. This release has a bunch of new features, bugfixes, and general improvements. +description: We're happy to announce the 0.6.0 release of Nu. This release has a bunch of new features, bugfixes, and general improvements. --- -# Nushell 0.6.0 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. We're happy to announce the 0.6.0 release of Nu. This release has a bunch of new features, bugfixes, and general improvements. -# Where to get it +## Where to get it Nu 0.6.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.6.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu` (or if you want all the features `cargo install nu --all-features`). -# Starship support (Southclaws, jonathandturner) +## Starship support (Southclaws, jonathandturner) - + _Welcome to the starship!_ Having a configurable prompt has been a regularly requested feature, dating back to our first release of Nu. With 0.6.0, we're excited to show off the ability to integrate with [starship](https://starship.rs/). Starship is a powerful prompt being built in Rust, and it includes tons of fun features. @@ -27,7 +25,7 @@ To use the Starship support, enable the starship feature (the binary releases wi Here's the config I use in the screenshot above: -``` +```nu ❯ cat ~/.config/starship.toml add_newline = false @@ -40,35 +38,35 @@ disabled = true To enable Starship support, make sure to enable the `starship` feature, or to use the all-features build: -``` +```nu > cargo install nu --features starship-prompt ``` or -``` +```nu > cargo install nu --all-features ``` -# Stable Rust (est31) +## Stable Rust (est31) Nu now works on stable Rust! Contributor est31 did a ton of work soon after our first Nu release, but it wasn't until just recently that it fully paid off. With the Rust 1.39 release, Nu now fully works on stable Rust! We're excited for what this means for package authors, as they will now have a stable dependency they can use to build Nu from, rather than tracking nightly. -# New website! New blog! (sebastian-xyz) +## New website! New blog! (sebastian-xyz) We're starting to work on an actual website, complete with a blog. In fact, where you're seeing this now is on our new site. We're excited to finally have something more official, and looking forward to growing the website in the weeks to come. If you're a web developer or designer and you want to help out, please join us! You can find us on the [website repo](https://github.com/nushell/nushell.github.io) and [blog repo](https://github.com/nushell/blog). -# New features +## New features -## histogram (andrasio) +### histogram (andrasio) As we extend Nu's ability to function as a shell, we also wanted to include some features that help with doing some data analysis on structured data you're working with. In this release is a new `histogram` feature which gives a quick histogram of the data you're looking at: -```shell +```nu > open tests/fixtures/formats/caco3_plastics.csv | histogram origin ━━━┯━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ # │ origin │ frequency @@ -80,13 +78,13 @@ As we extend Nu's ability to function as a shell, we also wanted to include some ━━━┷━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ``` -## split-by (andrasio) +### split-by (andrasio) When working with tables inside of tables, it's sometimes helpful to be able to group and regroup data so that the end result can be easily processed or charted. With this release, we've add a new command: `split-by`. Split-by is similar to `group-by`, in a way you can think of it as a re-group as it will create new groups to wrap your existing groups. To see how this works, let's say we have some shipping data, and we want to group these by the region: -```shell +```nu > open tests/fixtures/formats/caco3_plastics.csv | group-by origin ━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━ @@ -98,7 +96,7 @@ To see how this works, let's say we have some shipping data, and we want to grou Next, let's say we know that inside of these new columns is a table that has a column called `shipped_at`. What we want to do is to `group-by` again, but this time use that new column to create new groups: -```shell +```nu /home/jonathan/Source/nushell(better_duration)> open tests/fixtures/formats/caco3_plastics.csv | group-by origin | split-by shipped_at ━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━ 18/03/2016 │ 27/07/2016 │ 24/06/2016 │ 07/07/2016 │ 01/01/1900 │ 01/11/2016 │ 04/10/2016 @@ -109,7 +107,7 @@ Next, let's say we know that inside of these new columns is a table that has a c What we have as a result is a kind of (row, column) grouping of the table data, which would allow you to graph for each date on one axis, and for each origin on the other. -## default and compact (andrasio) +### default and compact (andrasio) One of the sticky issues working with tables is that sometimes you'll have gaps in the data. Perhaps there just isn't a value for that row. @@ -119,7 +117,7 @@ Default, as the name implies, will allow you to give blank spots a default value Here's an example of default: -```shell +```nu > open amigos.json | get amigos ━━━┯━━━━━━━━━━━┯━━━━━━━━━━━━ # │ name │ rusty_luck @@ -133,7 +131,7 @@ Here's an example of default: We can default the missing column from the table like this: -```shell +```nu > open amigos.json | get amigos | default rusty_luck 1 giving: ━━━┯━━━━━━━━━━┯━━━━━━━━━━━━ @@ -146,11 +144,11 @@ We can default the missing column from the table like this: ━━━┷━━━━━━━━━━┷━━━━━━━━━━━━ ``` -## format (jonathandturner) +### format (jonathandturner) To add to the abilities of outputting tables of various into readable strings, we've recently added the `format` command. This allows you to convert table data into a string by following a formatting pattern: -```shell +```nu > ls | format "name is {name}" ━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━ # │ <value> @@ -164,21 +162,21 @@ To add to the abilities of outputting tables of various into readable strings, w 6 │ name is tests ``` -## from-xlsx (jonathandturner) +### from-xlsx (jonathandturner) We now have an early start at Excel support. With it, you can now import Excel files as tables. -# On-going improvements +## On-going improvements Lots of improvements to existing commands this time around. -## Simple and full `ls` (jonathandturner) +### Simple and full `ls` (jonathandturner) To make `ls` work better on smaller terminals (including the bog standard 80x24 login size), we've shrunk `ls` a tiny bit by default. Have no worry, though, the original columns and more are available in the new `ls --full`. -## Fuzzy matching (bndbsh) +### Fuzzy matching (bndbsh) -```shell +```nu ❯ ls | where name =~ "yml" ━━━━━━━━━━━━━┯━━━━━━┯━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━ name │ type │ size │ accessed │ modified @@ -189,11 +187,11 @@ To make `ls` work better on smaller terminals (including the bog standard 80x24 A long-requested feature is the ability to match strings a bit more fuzzily. With 0.6.0, you'll be able to do just that with the new `=~` (fuzzy match to include) and `!~` (fuzzy match to exclude) commands. -## `from-csv`, now with separator (drmason13) +### `from-csv`, now with separator (drmason13) Sometimes you might find a .csv file in the wild that uses a different separator than comma. You can now configure `from-csv` to use a different character as the separator using, for example, `from-csv --separator ";"`. -## nth can take multiple row numbers (andrasio) +### nth can take multiple row numbers (andrasio) You can now pass multiple row numbers to `nth`. For example `nth 1 3 5` will return those three separate rows as a new table. @@ -201,9 +199,9 @@ You can now pass multiple row numbers to `nth`. For example `nth 1 3 5` will ret Sometimes when you're trying to get to data inside an inner table, you want to describe travelling through a particular row to get there. With recent improvements, you can now include the row number in the column path (assuming it is not the first part of the path). -## Duration support (jonathandturner, Aloso) +### Duration support (jonathandturner, Aloso) -```shell +```nu ❯ ls | where accessed < 1w ━━━┯━━━━━━━━━━━━━━━┯━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━ # │ name │ type │ size │ accessed │ modified @@ -219,18 +217,18 @@ Sometimes when you're trying to get to data inside an inner table, you want to d It's now possible to use duration values in Nu. This allows us to check for files accessed less than a week ago, as you see in the example above. -## Renamed `read` to `parse` (jonathandturner) +### Renamed `read` to `parse` (jonathandturner) To help with at-a-glance readability, we've renamed `read` to `parse`. While `read` felt more friendly, it could easily be confused for reading input, reading a file, etc. -# General improvements (wycats, thegedge, drmason13, jonathandturner, uma1317, JesterOrNot, andrasio, BurNiinTRee) +## General improvements (wycats, thegedge, drmason13, jonathandturner, uma1317, JesterOrNot, andrasio, BurNiinTRee) There has been a ton of work behind the scenes on Nu itself. We now have a much-improved internal debugging system and better module separation courtesy of wycats. There are also a number of general cleanups and bugfixes that have gone into the release. -# Survey results +## Survey results -We recently ran a survey to ask Nu users/non-users what they thought of Nu. If you're interested, definitely check out the [results of the survey](https://www.nushell.sh/blog/2019-11-23-nushell-survey-results.html) +We recently ran a survey to ask Nu users/non-users what they thought of Nu. If you're interested, definitely check out the [results of the survey](https://www.nushell.sh/blog/2019-11-23-nushell-survey-results) -# Looking ahead +## Looking ahead We're still hard at work on "MVP #2". It will be the next milestone on our way to the eventual 1.0. If you'd like to help with code, docs, translation, testing, or just want to come chat and throw ideas around, we'd love to have you! You can find us on [discord](), [twitter](https://twitter.com/nu_shell), and [github](https://github.com/nushell/nushell). diff --git a/blog/2019-12-18-nushell-0_7_0.md b/src/content/docs/blog/2019-12-18-nushell-0_7_0.md similarity index 88% rename from blog/2019-12-18-nushell-0_7_0.md rename to src/content/docs/blog/2019-12-18-nushell-0_7_0.md index db074694e3f..12969c39521 100644 --- a/blog/2019-12-18-nushell-0_7_0.md +++ b/src/content/docs/blog/2019-12-18-nushell-0_7_0.md @@ -3,36 +3,34 @@ title: Nushell 0.7.0 author: Jonathan Turner author_site: https://twitter.com/jntrnr author_image: https://www.nushell.sh/blog/images/jonathandturner.jpg -excerpt: We're happy to announce the 0.7.0 release of Nu. This release has a couple new features, bugfixes, and lots of internal improvements on the way to upcoming features. +description: We're happy to announce the 0.7.0 release of Nu. This release has a couple new features, bugfixes, and lots of internal improvements on the way to upcoming features. --- -# Nushell 0.7.0 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. We're happy to announce the 0.7.0 release of Nu. This release has a couple new features, bugfixes, and lots of internal improvements on the way to upcoming features. -# Where to get it +## Where to get it Nu 0.7.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.7.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu` (or if you want all stable features `cargo install nu --features=stable`). -# Ranges (wycats, sebastian-xyz) +## Ranges (wycats, sebastian-xyz) We've added ranges as new fundamental type in Nu. To use it, use `<number>..<number>`. Currently, you can use it with the new `range` command, which lets you do commands like: -``` +```nu ls | range 3..5 ``` And return rows 3 through 5 of the table that `ls` gives you. -# Autocomplete improvements (jonathandturner) +## Autocomplete improvements (jonathandturner) As we improve the parser, we are getting more opportunities to do more with the results. One feature we added recently is the ability to autocomplete flags for internal commands. For example, if you want to see what's available for the `config` command, you can now type `config --` and then immediately use the `<tab>` key to cycle through possible options. -# Nu becomes multiple crates (wycats, jonathandturner) +## Nu becomes multiple crates (wycats, jonathandturner) Part of a big effort to get Nu ready for script support is to refactor the current codebase to make it cleaner and easier to work with. @@ -42,13 +40,13 @@ One side effect of this work is that we've now separated out the plugins from th From cargo, you can install the main crate with: -``` +```sh cargo install nu ``` Then, you can install the plugins the same way. You can find them because they have a name starting with `nu_plugin_`. For example, to install the textview plugin: -``` +```nu cargo install nu_plugin_textview ``` @@ -69,29 +67,29 @@ The current set of plugins includes: By default, Nu will install a small set of these plugins ("sys", "ps", "textview", "inc", "str"). You can optionally turn this off using: -``` +```sh cargo install nu --no-default-features ``` -# Introducing: stable and unstable features +## Introducing: stable and unstable features Another part of the current refactor work is that we're splitting the "stable" and "unstable" features up. This lets us experiment a bit easier before a command becomes a stable part of the releases. Now, to install all the stable features, you can use: -``` +```sh cargo install nu --features=stable ``` If you want to get both stable _and_ unstable features, use: -``` +```sh cargo install nu --all-features ``` Warning: unless you're working on Nu itself you may not want to install all features currently, as you'll see that we're working on an internal tracing tool. -# Moving the book(s) (sebastian-xyz) +## Moving the book(s) (sebastian-xyz) We've been hard at working building up the websites. In the previous release, we talked about "nushell.sh" and the new website there. Since then, we've consolidated the books into the new website. Please update your book links to point to the new site: @@ -99,15 +97,15 @@ We've been hard at working building up the websites. In the previous release, we - Contributor book - [nushell.sh/contributor-book](https://www.nushell.sh/contributor-book/) - Cookbook (in-progress) - [nushell.sh/cookbook](https://www.nushell.sh/cookbook/) -# Command improvements +## Command improvements -## Embed -> Wrap (jonathandturner, andrasio) +### Embed -> Wrap (jonathandturner, andrasio) For better readability, we've renamed the `embed` command to `wrap`. As the name implies, you can now `wrap` one table with another. You can also use `wrap` to create a table from a stream of values. For example, you may have a list of strings you want to turn into a table: -``` +```nu > ls | get name ────┬──────────────────── # │ <value> @@ -122,7 +120,7 @@ For example, you may have a list of strings you want to turn into a table: We can now name this table using `wrap`: -``` +```nu > ls | get name | wrap filename ────┬──────────────────── # │ filename @@ -135,21 +133,21 @@ We can now name this table using `wrap`: 5 │ TODO.md ``` -# Internal improvements (wycats, jonathandturner, thibran, thegedge) +## Internal improvements (wycats, jonathandturner, thibran, thegedge) Though not visible as additional new features, a group of us has been at work refactoring and cleaning up Nu's internals. This should help us both fix some long-standing bugs as well as make way for new features in the future. We've also internally introduced a new "line" type, which represents strings that carry a line ending with them. This helps us more easily traffic string data through the system and know how best to output it at the end of the pipeline. -# Bugfixes +## Bugfixes Of course, with each release, there are the usual bugfixes. We've improved tilde expansion (naufraghi), how internal pipelines are handled (thegedge), and more. -# Improved docs (tchak, coolshaurya, sebastian-xyz) +## Improved docs (tchak, coolshaurya, sebastian-xyz) -A big "thank you!" for folks continuing to work on the on-going command documentation efforts. Already, we're seeing people [read about the commands](/book/command_reference.html) on the new website to help them learn Nu, which is great! +A big "thank you!" for folks continuing to work on the on-going command documentation efforts. Already, we're seeing people [read about the commands](/book/command_reference) on the new website to help them learn Nu, which is great! -# What's next? +## What's next? You might have noticed that with 0.7.0, we're seemingly getting close to 1.0. What happens after 0.9.0? Are we going to take the leap? diff --git a/blog/2019-12-31-happy-nu-year-2020.md b/src/content/docs/blog/2019-12-31-happy-nu-year-2020.md similarity index 87% rename from blog/2019-12-31-happy-nu-year-2020.md rename to src/content/docs/blog/2019-12-31-happy-nu-year-2020.md index fd5b32b004b..e06afee42f6 100644 --- a/blog/2019-12-31-happy-nu-year-2020.md +++ b/src/content/docs/blog/2019-12-31-happy-nu-year-2020.md @@ -3,16 +3,14 @@ title: Happy Nu Year 2020 author: Jonathan Turner author_site: https://twitter.com/jntrnr author_image: https://www.nushell.sh/blog/images/jonathandturner.jpg -excerpt: 2019 was quite the year for Nushell. We landed the initial commit on May 10th, and 1881 commits later we find ourselves at the end of 2019. What all happened this year? +description: 2019 was quite the year for Nushell. We landed the initial commit on May 10th, and 1881 commits later we find ourselves at the end of 2019. What all happened this year? --- -# Happy Nu Year 2020 - - + 2019 was quite the year for Nushell. We landed the initial commit on May 10th, and 1881 commits later we find ourselves at the end of 2019. What all happened this year? -We started off with quite the bang! After quietly working on Nu for a few months, we wrote up a [blog post](https://www.nushell.sh/blog/2019-08-23-introducing-nushell.html) to explain what Nu was. To our surprise, the post got a surprisingly warm reception! Soon, we were recording a podcast with the Changelog to [talk about Nu](https://changelog.com/podcast/363). +We started off with quite the bang! After quietly working on Nu for a few months, we wrote up a [blog post](https://www.nushell.sh/blog/2019-08-23-introducing-nushell) to explain what Nu was. To our surprise, the post got a surprisingly warm reception! Soon, we were recording a podcast with the Changelog to [talk about Nu](https://changelog.com/podcast/363). As the excitement calmed back to everyday levels, we got to the work of turning this minimum-viable product into the real thing. More than 65 people joined us to help fix bugs, test code, write docs, and explore new directions. @@ -20,8 +18,8 @@ As the excitement calmed back to everyday levels, we got to the work of turning At the end of 2019, where are we? -- We now have a [website](https://nushell.sh), a [blog](https://www.nushell.sh/blog), [three](https://www.nushell.sh/book/) [different](https://www.nushell.sh/contributor-book/) [books](https://www.nushell.sh/cookbook/), and the results of our [first survey](https://www.nushell.sh/blog/2019-11-23-nushell-survey-results.html) -- We released 6 different releases: [0.2](https://www.nushell.sh/blog/2019-08-23-introducing-nushell.html), [0.3](https://www.nushell.sh/blog/2019-09-24-nushell_0_3_0.html), [0.4](https://www.nushell.sh/blog/2019-10-15-nushell-0_4_0.html), [0.5](https://www.nushell.sh/blog/2019-11-05-nushell-0_5_0.html), [0.6](https://www.nushell.sh/blog/2019-11-26-nushell-0_6_0.html), and [0.7](https://www.nushell.sh/blog/2019-12-18-nushell-0_7_0.html). +- We now have a [website](https://nushell.sh), a [blog](https://www.nushell.sh/blog), [three](https://www.nushell.sh/book/) [different](https://www.nushell.sh/contributor-book/) [books](https://www.nushell.sh/cookbook/), and the results of our [first survey](https://www.nushell.sh/blog/2019-11-23-nushell-survey-results) +- We released 6 different releases: [0.2](https://www.nushell.sh/blog/2019-08-23-introducing-nushell), [0.3](https://www.nushell.sh/blog/2019-09-24-nushell_0_3_0), [0.4](https://www.nushell.sh/blog/2019-10-15-nushell-0_4_0), [0.5](https://www.nushell.sh/blog/2019-11-05-nushell-0_5_0), [0.6](https://www.nushell.sh/blog/2019-11-26-nushell-0_6_0), and [0.7](https://www.nushell.sh/blog/2019-12-18-nushell-0_7_0). - Nu gained features. Lots of them. New table designs, new file formats, lots of new commands, improvements to error reporting, plugins (in [C++](https://github.com/lefticus/nu_plugin_calc), [Go](https://vsoch.github.io/2019/nushell-plugin-golang/), [Python](https://github.com/vsoch/nushell-plugin-python), and [Ruby](https://github.com/andrasio/nu-plugin/tree/master/examples)), new colors, support for streaming tables, vi mode, moved to the stable Rust compiler, login shell support, recycle bin support, starship.rs support, fuzzy matching, duration and date comparison, ranges, improved autocomplete, and a bunch of internal improvements to make way for 2020. - Thanks to all the reports, PRs, and help debugging we've made a ton of progress in making Nu more stable and complete @@ -39,7 +37,7 @@ In short, it's been a lot of fun, a lot of work, and we met some new friends alo ## Nushell repo -```shell +```nu > fetch https://api.github.com/repos/nushell/nushell/stats/contributors | get author | sort-by login | get login ────┬─────────────────── # │ <value> @@ -122,7 +120,7 @@ In short, it's been a lot of fun, a lot of work, and we met some new friends alo ## Nushell book repo -```shell +```nu > fetch https://api.github.com/repos/nushell/book/stats/contributors | get author | sort-by login | get login ────┬───────────────── # │ <value> @@ -148,7 +146,7 @@ In short, it's been a lot of fun, a lot of work, and we met some new friends alo ## Contributor book -```shell +```nu > fetch https://api.github.com/repos/nushell/contributor-book/stats/contributors | get author | sort-by login | get login ───┬───────────────── # │ <value> @@ -163,7 +161,7 @@ In short, it's been a lot of fun, a lot of work, and we met some new friends alo ## Cookbook -```shell +```nu > fetch https://api.github.com/repos/nushell/cookbook/stats/contributors | get author | sort-by login | get login ───┬───────────────── # │ <value> @@ -176,7 +174,7 @@ In short, it's been a lot of fun, a lot of work, and we met some new friends alo ## Blog -```shell +```nu > fetch https://api.github.com/repos/nushell/blog/stats/contributors | get author | sort-by login | get login ───┬───────────────── # │ <value> diff --git a/blog/2020-01-07-nushell-0_8_0.md b/src/content/docs/blog/2020-01-07-nushell-0_8_0.md similarity index 91% rename from blog/2020-01-07-nushell-0_8_0.md rename to src/content/docs/blog/2020-01-07-nushell-0_8_0.md index cfcac15ce0e..2aee61c4f58 100644 --- a/blog/2020-01-07-nushell-0_8_0.md +++ b/src/content/docs/blog/2020-01-07-nushell-0_8_0.md @@ -3,16 +3,14 @@ title: Nushell 0.8.0 author: Jonathan Turner author_site: https://twitter.com/jntrnr author_image: https://www.nushell.sh/blog/images/jonathandturner.jpg -excerpt: We're happy to announce the 0.8.0 release of Nu. This continues a series of internal improvements, with better stability and correctness, and, of course, new features. +description: We're happy to announce the 0.8.0 release of Nu. This continues a series of internal improvements, with better stability and correctness, and, of course, new features. --- -# Nushell 0.8.0 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. We're happy to announce the 0.8.0 release of Nu. This continues a series of internal improvements, with better stability and correctness, and, of course, new features. -# Where to get it +## Where to get it Nu 0.8.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.8.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -20,7 +18,7 @@ If you want more goodies, you can install `cargo install nu --features=stable`. As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -``` +```nu ❯ ls nu_plugin_* | sort-by name | get name ────┬────────────────────── # │ <value> @@ -40,7 +38,7 @@ As part of this release, we also publish a set of plugins you can install and us ────┴────────────────────── ``` -# Unwrapping your presents (jonathandturner, andrasio, with help from ubsan) +## Unwrapping your presents (jonathandturner, andrasio, with help from ubsan) A classic trick when writing Rust is to use the `.unwrap()` method. This method gives you a quick way to say "panic if you see this happen". When prototyping, it's easy to use this as a way to develop code more quickly, but as a codebase matures you move away from it. @@ -48,17 +46,17 @@ It was time for Nu to move away from using this shortcut. Fixing the unwraps is We're happy to say there are now no more unwraps in the Nu codebase. We have more improvements in mind, but this already is a big upgrade from where we were a few weeks ago. -# Clippy cleanliness (thibran, vorot93, jonathandturner) +## Clippy cleanliness (thibran, vorot93, jonathandturner) Along the same theme of making code as clean as we can, we recently adopted using the `clippy` tool. Clippy is a tool to help point out common mistakes or inefficiencies in your Rust code. The end result of working through its warnings is often a cleaner looking codebase that's also a bit more efficient as a result. The Nu codebase is now clippy-clean, and we're enforcing this on every new checkin to the codebase. -# Improved +## Improved -## `which` gets better (avandesa) +### `which` gets better (avandesa) -```shell +```nu > which which ───────┬──────────────────────────┬───────── arg │ path │ builtin @@ -69,9 +67,9 @@ The Nu codebase is now clippy-clean, and we're enforcing this on every new check We're in the process of improving some of our existing built-in commands to make them more Nu-like. In this release, the `which` command has a bit more of a Nu-feel. It will tell you the path and if the command is an internal builtin command or an external command. -## `ps` gets better (jonathandturner) +### `ps` gets better (jonathandturner) -``` +```nu ─────┬───────┬──────────────────────────────────────┬──────────┬─────────┬──────────┬────────── # │ pid │ name │ status │ cpu │ mem │ virtual ─────┼───────┼──────────────────────────────────────┼──────────┼─────────┼──────────┼────────── @@ -83,21 +81,21 @@ We're in the process of improving some of our existing built-in commands to make The `ps` command has gained a few new columns: "mem" and "virtual" for helping you track memory usage. -## OpenOffice .ods support (coolshaurya) +### OpenOffice .ods support (coolshaurya) Fresh off the presses is initial support for opening .ods files. Similarly to our xlsx support, this will allow you to open .ods files and read in their data, separated by the sheets. -## Improved keyboard navigation (Aloso) +### Improved keyboard navigation (Aloso) We now support moving left by-word using the ctrl+left and ctrl+right keyboard shortcuts. -# New commands +## New commands -## uniq (notryanb) +### uniq (notryanb) With 0.8.0, you'll also be able to remove duplicate rows from your tables with the `uniq` command: -``` +```nu > open test.csv ───┬────────────┬───────────┬────────────┬────── # │ first_name │ last_name │ rusty_at │ type @@ -109,7 +107,7 @@ With 0.8.0, you'll also be able to remove duplicate rows from your tables with t ───┴────────────┴───────────┴────────────┴────── ``` -``` +```nu > open test.csv | uniq ───┬────────────┬───────────┬────────────┬────── # │ first_name │ last_name │ rusty_at │ type @@ -120,14 +118,14 @@ With 0.8.0, you'll also be able to remove duplicate rows from your tables with t ───┴────────────┴───────────┴────────────┴────── ``` -# New built-in variable (jonathandturner) +## New built-in variable (jonathandturner) With 0.8.0, we've moved away from the `$nu:path` built-ins. Now, there's just one built-in for internal values: `$nu`. Using `echo $nu` will show you the table of current values. -# Fixing bugs (jonathandturner, sandorex, miller-time, quebin31, thegedge) +## Fixing bugs (jonathandturner, sandorex, miller-time, quebin31, thegedge) As always, we also fixed bugs. In 0.8.0, you'll see improvements with UTF-8, the `pick` command, correctly handling required positional arguments, CTRL+L clear screen, and faster response times for external commands. -# What's coming +## What's coming We're well on our way to 0.10.0. That's right, we're not close to our 1.0 release just yet. After 0.9, we'll continue with a release every three weeks. Expect to see Nu continue to mature and stabilize. diff --git a/blog/2020-01-28-nushell-0_9_0.md b/src/content/docs/blog/2020-01-28-nushell-0_9_0.md similarity index 94% rename from blog/2020-01-28-nushell-0_9_0.md rename to src/content/docs/blog/2020-01-28-nushell-0_9_0.md index 2aeb30dd0e3..4a4afa98a3b 100644 --- a/blog/2020-01-28-nushell-0_9_0.md +++ b/src/content/docs/blog/2020-01-28-nushell-0_9_0.md @@ -3,16 +3,14 @@ title: Nushell 0.9.0 author: Jonathan Turner author_site: https://twitter.com/jntrnr author_image: https://www.nushell.sh/blog/images/jonathandturner.jpg -excerpt: We're happy to announce the 0.9.0 release of Nu. This release offers better help and error feedback, better support for the native shell, new commands, lots of command improvements, and bugfixes. +description: We're happy to announce the 0.9.0 release of Nu. This release offers better help and error feedback, better support for the native shell, new commands, lots of command improvements, and bugfixes. --- -# Nushell 0.9.0 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. We're happy to announce the 0.9.0 release of Nu. This release offers better help and error feedback, better support for the native shell, new commands, lots of command improvements, and bugfixes. -# Where to get it +## Where to get it Nu 0.9.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.9.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -20,19 +18,19 @@ If you want more goodies, you can install `cargo install nu --features=stable`. As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's new +## What's new -## `--help` available on all commands (Amanita-muscaria) +### `--help` available on all commands (Amanita-muscaria) One of the first things a user might do in a new shell is to type a familiar command and pass it `--help`. A perfectly reasonable thing to do, and with 0.9.0 it does exactly you'd expect. It will now print out the help information for the given command for all internal commands (much in the same way as using `help <command name>`) -## Better error feedback (wycats, andrasio) +### Better error feedback (wycats, andrasio) - + Our improvements to the parser as part of 0.9.0 also come with some fun perks. One of these is that unknown flags, and similar errors, will now get highlighted red to let you know that this isn't a valid input to the command. -## Shelling out (jonathandturner) +### Shelling out (jonathandturner) An early feature of Nu that people that has been a popular request to bring back is "shelling out". When Nu doesn't recognize a command, it will try to find it as an external command. In the last few versions, this was limited as Nu was not able to execute shell scripts, .cmd scripts... basically anything that wasn't an executable. The problem is that lots of apps use scripts as a way to configure what to execute (commands like `code`, `npm`, and others are common scripts behind the scenes). @@ -44,7 +42,7 @@ With 0.9.0, we're returning to our earlier behavior and executing both binaries Nu now has its own `du` command to show the disk usage of a part of the file system. This is a handy way of quickly looking for where all your free space went. -``` +```nu ❯ du ───┬───────────────┬─────────┬──────────────── # │ name │ size │ contents @@ -67,7 +65,7 @@ Short, sweet, and to the point, you can now `clear` your screen with the new `cl ## New welcome message (jonathandturner) -``` +```nu Welcome to Nushell 0.9.0 (type 'help' for more info) nushell on 📙 bump_to_0_9_0 is 📦 v0.9.0 via 🦀 v1.40.0 ❯ @@ -119,7 +117,7 @@ When working on Nu itself, there's a handy `debug` command which gives you all t Autocompletion at the Nu prompt can now be changed between circular (the default) and list. -``` +```nu > config --set [completion_mode list] ``` @@ -141,7 +139,7 @@ We're continuing to document the commands that are available and continue fillin Contributors to Nu will also appreciate that we're working our way through the code and source repositories and documenting how each part works. This should help developers get used to Nu from the inside and find a much easier path to jump in. -# Looking ahead +## Looking ahead With 0.9.0, we've added a lot of "quality of life" improvements that we hope you enjoy. We'd love to hear from you how 0.9.0 works for you. diff --git a/blog/2020-02-18-nushell-0_10_0.md b/src/content/docs/blog/2020-02-18-nushell-0_10_0.md similarity index 89% rename from blog/2020-02-18-nushell-0_10_0.md rename to src/content/docs/blog/2020-02-18-nushell-0_10_0.md index 7e358355534..cb5cab8c6f2 100644 --- a/blog/2020-02-18-nushell-0_10_0.md +++ b/src/content/docs/blog/2020-02-18-nushell-0_10_0.md @@ -3,16 +3,14 @@ title: Nushell 0.10.0 author: Jonathan Turner author_site: https://twitter.com/jntrnr author_image: https://www.nushell.sh/blog/images/jonathandturner.jpg -excerpt: Greetings and welcome to the 10th release of Nushell! Yes, that's right this is the tenth release of Nu we've put out in the wild, and oh is this release wild. So let's stop dilly-dallying and get right to it, shall we? +description: Greetings and welcome to the 10th release of Nushell! Yes, that's right this is the tenth release of Nu we've put out in the wild, and oh is this release wild. So let's stop dilly-dallying and get right to it, shall we? --- -# Nushell 0.10.0 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Greetings and welcome to the 10th release of Nushell! Yes, that's right this is the tenth release of Nu we've put out in the wild, and oh is this release wild. So let's stop dilly-dallying and get right to it, shall we? -# Where to get it +## Where to get it Nu 0.10.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.10.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -20,15 +18,15 @@ If you want more goodies, you can install `cargo install nu --features=stable`. As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's new +## What's new -## Scripts! (thegedge, jonathandturner) +### Scripts! (thegedge, jonathandturner) Yes, you read that right, we're just beginning to add support for running Nu scripts. So far, these scripts are simple things. Nu will go line by line and run each line. But we're looking forward to building up support with more features as we go. To run a script, you just call `nu` and pass in it the script file: -```sh +```nu > cat hello_world.nu echo hello echo world @@ -38,11 +36,11 @@ hello world ``` -## Running commands from outside Nu (jonathandturner) +### Running commands from outside Nu (jonathandturner) Another fun features in this release is the ability to run a Nu command from outside of Nu. Just like shells like Bash and Windows CMD, you can now pass the `-c` flag and give the pipeline you want to run: -```sh +```nu > ./nu -c "ls | get name" ─────┬─────────────────────────────── # │ <value> @@ -53,54 +51,54 @@ Another fun features in this release is the ability to run a Nu command from out 3 │ deps ``` -## Shorthand flags (Amanita-muscaria) +### Shorthand flags (Amanita-muscaria) Tired of typing those long flags that every Nu command seems to have? Worry no more! You can now use short flags in many common Nu commands. For example: Instead of: -```sh +```nu > ls --full ``` You can now use: -```sh +```nu > ls -f ``` The shorthand flags are listed as part of the updated help section -## Did someone say flags? (andrasio) +### Did someone say flags? (andrasio) If you're coming to Nu from other CLIs, you might have wondered why you always had to put flags at the end. A little annoying, right? We fixed it. -```sh +```nu > ls *.sh --full ``` and now: -``` +```nu > ls --full *.sh ``` Use whichever you like best. -## More plugins by default (andrasio) +### More plugins by default (andrasio) We've extended the set of plugins installed with `cargo install nu --features=stable` to the whole set of stable plugins. This cuts down on the amount of extra plugins to install if you want the full set. It should also help cut down on the confusion when users expected a command to be available but wasn't installed by default. You can still install without these additional commands, if you like, and pick and choose the ones you want. -## `calc` command (coolshaurya) +### `calc` command (coolshaurya) There's a new `calc` command in development that can calculate the result of math expressions in a string. -```sh +```nu > echo "2+3" | calc 5.000000000000000 ``` -## `kill` command (sandorex) +### `kill` command (sandorex) Nu now also has a cross-platform `kill` command, for killing processes. @@ -126,7 +124,7 @@ By default, the `help` command now prints a little more information by default t Better errors for incorrect `mv` and incorrect flags, better performance running external commands, better code documentation, plugins can now have numbers in their names, test directories can now have spaces in their names, fixed some issues with `cp`, moved off of the "futures-preview" crate to "futures" official, fixes to working with external commands that don't send line endings, improvements to `textview` and more. -# Looking ahead +## Looking ahead Adding the ability to run scripts gives Nu a lot more potential when used in larger tasks, and we're excited to continue to grow this support. This work comes out of the work to add aliases, which we're currently working on. It also opens up the possibility of running Nu from other hosts in the future. diff --git a/blog/2020-03-10-nushell_0_11_0.md b/src/content/docs/blog/2020-03-10-nushell_0_11_0.md similarity index 89% rename from blog/2020-03-10-nushell_0_11_0.md rename to src/content/docs/blog/2020-03-10-nushell_0_11_0.md index 0f5af38afff..10c1d637950 100644 --- a/blog/2020-03-10-nushell_0_11_0.md +++ b/src/content/docs/blog/2020-03-10-nushell_0_11_0.md @@ -3,16 +3,14 @@ title: Nushell 0.11.0 author: Jonathan Turner author_site: https://twitter.com/jntrnr author_image: https://www.nushell.sh/blog/images/jonathandturner.jpg -excerpt: We're excited to release the 0.11.0 release of Nu. This release continues to push us forward with new commands, improved engine internals, bugfixes, and more. +description: We're excited to release the 0.11.0 release of Nu. This release continues to push us forward with new commands, improved engine internals, bugfixes, and more. --- -# Nushell 0.11.0 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. We're excited to release the 0.11.0 release of Nu. This release continues to push us forward with new commands, improved engine internals, bugfixes, and more. -# Where to get it +## Where to get it Nu 0.11.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.11.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -20,31 +18,31 @@ If you want more goodies, you can install `cargo install nu --features=stable`. As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's new +## What's new -## Compound shorthand flags (Amanita-muscaria) +### Compound shorthand flags (Amanita-muscaria) Over the last few releases, we've seen the ability for flags to have shorthand version. You no longer needed to use `--full` if the flag supported the shorter `-f` version. In this release, we've taken it one step further and allowed you to combine multiple shorthand flags into one group. For example, `ls --full --short-names` can now be written as `ls -fs` -## Improvements and cleanup for `ls` (Bocom, quebin31, lincis, equal-l2) +### Improvements and cleanup for `ls` (Bocom, quebin31, lincis, equal-l2) A lot of improvements went into `ls` for this release. The updated `ls` command is now more forgiving of coming across directories the user can't access and will simply show what it can and continue, it can work with named pipes on systems with them, it shows a more reasonable display for zero-length files, and the internals of `ls` have been cleaned a bit to make way for future improvements. -## External command output no longer blocks (thegedge) +### External command output no longer blocks (thegedge) Continuing our series of improvements to working with external commands, we have a few updates in this release. The first of these updates is an improvement to how content streams out of externals. With 0.11.0, this content will no longer block, which allows content to flow more easily between external and internal commands. As a result, some corner cases that came up with a series of commands in a pipeline not working because one blocks no longer is an issue. -## Allow externals to output texts or binary (jonathandturner, thegedge) +### Allow externals to output texts or binary (jonathandturner, thegedge) The second update to externals now allows externals to freely output either text or strings, and for this content to be read in a block at a time into Nu. This allows externals to stream any content they wish, and for this stream to continue for as long as needed. -## New `shuffle` command (hirschenberger) +### New `shuffle` command (hirschenberger) With 0.11.0, we introduce a new `shuffle` command that will let you shuffle the rows of a table. This allows you to choose to not always process data the same way, or to search through data more stochastically. -``` +```nu ❯ help commands | shuffle ─────┬──────────────┬─────────────────────────────────────────────────────────────────────────────────────────────── # │ name │ description @@ -57,11 +55,11 @@ With 0.11.0, we introduce a new `shuffle` command that will let you shuffle the 5 │ table │ View the contents of the pipeline as a table. ``` -## New column `rename` command (andrasio) +### New column `rename` command (andrasio) You can also now use the new `rename` command to rename a column to a new name. -``` +```nu ❯ help commands | rename action description ─────┬──────────────┬─────────────────────────────────────────────────────────────────────────────────────────────── # │ action │ description @@ -72,11 +70,11 @@ You can also now use the new `rename` command to rename a column to a new name. 3 │ binaryview │ Autoview of binary data. ``` -## Merge the `env` command into the `$nu` variable (jonathandturner) +### Merge the `env` command into the `$nu` variable (jonathandturner) The `$nu` variable has grown to include values that were previously part of `env`, effectively merging the two into the `$nu` variable. This allows you to easily find out where the history file is stored, where config is stored, and where a good temp directory are all in one place: -``` +```nu ❯ echo $nu.home-dir $nu.temp-dir $nu.config-path $nu.history-path ───┬────────────────────────────────────────────────────────────────────── # │ <value> @@ -88,23 +86,23 @@ The `$nu` variable has grown to include values that were previously part of `env ───┴────────────────────────────────────────────────────────────────────── ``` -## The `format` command can now use column paths (andrasio) +### The `format` command can now use column paths (andrasio) The `format` command is a handy way of putting column data into a string for displaying, but it previously had the restriction that you couldn't use it to print out information that was deeper in the table. With 0.11.0, we've removed that restriction. -``` +```nu ❯ open Cargo.toml | format "The edition is {package.edition}" The edition is 2018 ``` -## Allow help to be printed with `-h` in more cases (rabisg0) +### Allow help to be printed with `-h` in more cases (rabisg0) You should now be able to use `-h` to reach the help of a command in more cases than was previously allowed, making it a universal way to get to the help text. -## Improved documentation (coolshaurya, Amanita-muscaria, notryanb) +### Improved documentation (coolshaurya, Amanita-muscaria, notryanb) Documentation for `du`, `uniq`, `debug`, and plugin docs have all been improved in this release. -# Looking ahead +## Looking ahead We're excited to continue to polish how Nu works to make it more reliable and more efficient. Of course, we're also working on adding new much-requested features like aliases in upcoming releases. If you'd like to help with aliases or with Nu in general -- even if you want to help with a part of the project outside of just coding -- we'd love to have you. Come visit us on [github](https://github.com/nushell/nushell) or the [discord](https://discord.gg/NtAbbGn). diff --git a/blog/2020-03-31-nushell_0_12_0.md b/src/content/docs/blog/2020-03-31-nushell_0_12_0.md similarity index 91% rename from blog/2020-03-31-nushell_0_12_0.md rename to src/content/docs/blog/2020-03-31-nushell_0_12_0.md index d3e2ccb0b96..d71c3cd8e86 100644 --- a/blog/2020-03-31-nushell_0_12_0.md +++ b/src/content/docs/blog/2020-03-31-nushell_0_12_0.md @@ -3,16 +3,14 @@ title: Nushell 0.12.0 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: We're excited to release version 0.12.0 of Nu! +description: We're excited to release version 0.12.0 of Nu! --- -# Nushell 0.12.0 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. We're excited to release version 0.12.0 of Nu! -# Where to get it +## Where to get it Nu 0.12.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.12.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -20,11 +18,11 @@ If you want more goodies, you can install `cargo install nu --features=stable`. As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's new +## What's new -## Automatic `cd` (jonathandturner) +### Automatic `cd` (jonathandturner) -``` +```nu nushell on 📙 master is 📦 v0.12.0 via 🦀 v1.42.0 ❯ docs nushell/docs on 📙 master @@ -34,9 +32,9 @@ nushell on 📙 master is 📦 v0.12.0 via 🦀 v1.42.0 Fish and Windows users rejoice, you can now `cd` to a directory or drive by typing its name in the shell. This also allows Windows users to change drives by giving just the drive name. Now, when you use the drive letter, we'll switch drives and return you to your previous working directory on that drive (eg `D:` will change to the D: drive and `cd` to the path you had been at previousy). -## Type inference (andrasio) +### Type inference (andrasio) -``` +```nu ❯ open tests/fixtures/formats//caco3_plastics.csv | get cif_per_net_weight ───┬───────── # │ <value> @@ -58,15 +56,15 @@ nushell on 📙 master is 📦 v0.12.0 via 🦀 v1.42.0 We've been hard at work at improving how we read in unstructured data. In this release, you'll see the beginning of type inference as data is read in. In the above example, you can see how we now autodetect decimal numbers and then can later sum them together. -## Jupyter notebook support (jonathandturner) +### Jupyter notebook support (jonathandturner) - + Nu's core design goal is that it should be easier to work with your system and your data. In this release, we take a step beyond being just a shell with [Jupyter notebook support](https://github.com/nushell/nu_jupyter). -## `ls --all` (quebin31) +### `ls --all` (quebin31) -``` +```nu ❯ ls ────┬─────────────────────────────────────────────────────┬──────┬──────────┬────────────── # │ name │ type │ size │ modified @@ -88,13 +86,13 @@ Nu's core design goal is that it should be easier to work with your system and y With 0.12.0, you can now show hidden files when listing directory contents with `ls`. -## `from-ics` and `from-vcf` (pulpdrew) +### `from-ics` and `from-vcf` (pulpdrew) The file support continues to improve, as we add support for vCard and iCal file formats. -## `to-md` and `to-html` (jonathandturner) +### `to-md` and `to-html` (jonathandturner) -``` +```nu ❯ ls | to-md |name|type|size|modified| |-|-|-|-| @@ -104,9 +102,9 @@ The file support continues to improve, as we add support for vCard and iCal file You can now output to markdown and html using the new converters. -## `headers` (samhedin) +### `headers` (samhedin) -``` +```nu ❯ open tests/fixtures/formats/sample_data.ods | get SalesOrders ────┬────────────┬─────────┬──────────┬─────────┬─────────┬───────────┬─────────── # │ Column0 │ Column1 │ Column2 │ Column3 │ Column4 │ Column5 │ Column6 @@ -124,17 +122,17 @@ You can now output to markdown and html using the new converters. Sometimes when working with data, you've managed to read in columns of data and notice that the first row is the headers you want. Previously, this required a lot of twiddling to lift the row into being the header. With 0.12.0, this has become much simpler with the `header` command. -## `ps --full` mode (jonathandturner) +### `ps --full` mode (jonathandturner) We're extending the information you can get back from `ps`. You are now able to get the original commandline and more for each process using the new `ps --full`. -## `rm` can now take multiple arguments to remove multiple files at once (pulpdrew) +### `rm` can now take multiple arguments to remove multiple files at once (pulpdrew) Sometimes we're missing a feature and you wonder how we made it that long :D. In this release, you can now pass multiple files to `rm` for deletion. -## Row rotation (jonathandturner) +### Row rotation (jonathandturner) -``` +```nu ❯ sys ─────────┬───────────────────────────────────────── host │ [row 7 columns] @@ -149,7 +147,7 @@ Sometimes we're missing a feature and you wonder how we made it that long :D. In When working with data with lots of columns, it can sometimes be a pain to watch it print to the screen only to see that the data is missing columns because they won't fit. In this version, we're experimenting with a way to help this by auto-rotating a row when it is printed by itself. This will allow more of the row to fit into the screen. -## Configurable table headers (Amanita-muscaria) +### Configurable table headers (Amanita-muscaria) You may have noticed that the headers in the above examples were centered. How's that for sneaking a feature in? @@ -159,15 +157,15 @@ With 0.12.0, you can configure your table look a bit more by changing how the he - header_align: Sets header alignment center/left/right - header_style: Sets style bold, underlined, italic. More than one can be used -## Lots of bugfixes/improvements (Sosthene-Guedon, quebin31, neuronull, andrasio, thegedge, vsoch, jonathandturner, jonstodle) +### Lots of bugfixes/improvements (Sosthene-Guedon, quebin31, neuronull, andrasio, thegedge, vsoch, jonathandturner, jonstodle) Open no longer fails silently, improved CSV opening, improve canonicalize of filenames, `sys` now properly says user sessions, moved `shuffle` to being an internal command, relaxed file modes, cleaned up `which` implementation, fix Docker build matrix, streams can now be interrupted, improvements to `du`, `get` now will remove blank values for easier processing, respect CARGO_TARGET_DIR when set, allow `..` and `/` to be mv targets, -## Documentation improvements (pulpdrew, nickgerace, waldyrious, kloun) +### Documentation improvements (pulpdrew, nickgerace, waldyrious, kloun) Docs for `from-ics` and `from-vcf`, quickstart section for Docker users, docs for `skip` and `skip-while`, typos and whitespace fixes, typo in `calc` docs -# Looking ahead +## Looking ahead "Just keep going!" as Yehuda Katz would say, and we intend to. Lots of internal improvements are coming, and of course aliases which has become a daily request. diff --git a/blog/2020-04-21-nushell_0_13_0.md b/src/content/docs/blog/2020-04-21-nushell_0_13_0.md similarity index 93% rename from blog/2020-04-21-nushell_0_13_0.md rename to src/content/docs/blog/2020-04-21-nushell_0_13_0.md index 7596be31d61..1af4b4eb46d 100644 --- a/blog/2020-04-21-nushell_0_13_0.md +++ b/src/content/docs/blog/2020-04-21-nushell_0_13_0.md @@ -3,16 +3,14 @@ title: Nushell 0.13.0 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: We're excited to release version 0.13.0 of Nu! This is by *far* one the the biggest releases, yet. Let's dive in! +description: We're excited to release version 0.13.0 of Nu! This is by *far* one the the biggest releases, yet. Let's dive in! --- -# Nushell 0.13.0 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. We're excited to release version 0.13.0 of Nu! This is by _far_ one the the biggest releases, yet. Let's dive in! -# Where to get it +## Where to get it Nu 0.13.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.13.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -20,13 +18,13 @@ If you want more goodies, you can install `cargo install nu --features=stable`. As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## Aliases (jonathandturner) +### Aliases (jonathandturner) Yes, it's true. Nu now supports aliases so that those long pipelines now have new life as concise, reusable commands. -``` +```nu > alias myecho [msg] { echo $msg } > myecho "hello world!" hello world! @@ -34,54 +32,54 @@ hello world! The alias has a name, a list of optional parameters, and the block that will execute. This block can refer to the parameters using their variable names. -## Startup commands (jonathandturner) +### Startup commands (jonathandturner) With aliases, it's helpful to be able to start up Nu with your favorite aliases ready to go. To this end, we've now added the `startup` config variable. Adding a table of strings to this config variable enables you to run all of these commands as Nu starts up. -``` +```nu > config --set [startup ["alias myecho [msg] { echo $msg }"]] ``` -You can read more about setting `config` variables in [the book](https://www.nushell.sh/book/configuration.html) +You can read more about setting `config` variables in [the book](https://www.nushell.sh/book/configuration) -## Multi-dot paths (quebin31) +### Multi-dot paths (quebin31) In some shells, you can use multiple dots to mean go back even more directories. In addition to the common `..`, to go back to the previous directory, you can now also use `...` to go back two directories, `....` to go back three, and so on. -## Semicolon support (jonathandturner) +### Semicolon support (jonathandturner) A long standing annoyance when using Nu day in and day out is that you can't compose two different pipelines together. Sometimes you want to run a build, and then run the output of the build if it succeeds. In Bash, you might do something like this: -``` +```nu > make && ./run/my/app ``` If make succeeds, then your app runs. We're introducing the ';' separator which does this (beware bash users that this ';' will stop if the left-hand fails). You can write the above bash line as this in Nu 0.13.0: -``` +```nu > make; ./run/my/app ``` Note that commands that you may be used to printing to the terminal when you run them directly may not print anything when used on the left-hand side of the `;`. This is because the data comes out and, being structured, it just gets consumed before it's viewed. If you prefer to see the output of a command on the left of the `;`, you can pass it through `autoview` to do this for you: -``` +```nu > ls | autoview ; echo "done" ``` -## Math operations (jonathandturner) +### Math operations (jonathandturner) Wish you had a calculator or want to do a quick computation on something in your table? With 0.13.0, you can now switch into "math mode" and do a quick calculation. To switch into math mode, use the `=` operator as the command name. -``` +```nu > = 3 + 4 7 ``` You can use this in pipelines as well, do something like: -``` +```nu ls | get size | = $it + 1mb ``` @@ -89,7 +87,7 @@ It doesn't end there. Not only are the basic +, -, \*, and / available, but you ### checking if a value is in a member of the given table with `in:` -``` +```nu > = a in: [a b c] true > = d in: [a b c] @@ -98,13 +96,13 @@ false ### `&&` and `||` to create compound comparisons -``` +```nu > ls | where name > 'f' && size > 1kb ``` ### Parens to allow grouping -``` +```nu = (1 + 2) * (3 + 4) 21 ``` @@ -134,7 +132,7 @@ With 0.13.0, we're taking a big step to making externals work in a way much more Starting with 0.13.0, blocks can now contain pipelines (including `;`-separated multiple pipeline blocks). This allowed us to create the first command to take advantage of this: `each`. The new `each` command will run over each row in a table and do something for each. For example, let's say you wanted to convert each row of a table to separate JSON, rather than converting the whole table: -``` +```nu > ls | each { to-json } ``` @@ -144,13 +142,13 @@ With the math operations above, we're now changing the default type of syntax in (0.12.0) -``` +```nu > ls | where { $it.size > 10kb } ``` (0.13.0) -``` +```nu > ls | where { = $it.size > 10kb } ``` @@ -158,11 +156,11 @@ This is because blocks are now pipelines by default, so you need the extra `=` t You can also still use the shorthand versions of these comparisons: -``` +```nu > ls | where size > 10kb > ls | where $it.size > 10kb ``` -# Looking forward +## Looking forward With 0.13.0, we've landed some important features that fill in gaps for using Nu as your daily driver, and we're excited to hear from our users. Looking forward, there's a lot of polish we'd like to put on these new features, including updating the book, cleaning up the code, writing more test cases, and fixing some of our bug backlog. This will also give us time to "kick the tires" on these new features as well, using them in our day-to-day work. We're currently planning for the following release to be more focused on "polish". After this, of course, there are many more features to come! diff --git a/blog/2020-05-12-nushell_0_14_0.md b/src/content/docs/blog/2020-05-12-nushell_0_14_0.md similarity index 89% rename from blog/2020-05-12-nushell_0_14_0.md rename to src/content/docs/blog/2020-05-12-nushell_0_14_0.md index 60eb86f1400..8382b5c6fa9 100644 --- a/blog/2020-05-12-nushell_0_14_0.md +++ b/src/content/docs/blog/2020-05-12-nushell_0_14_0.md @@ -3,16 +3,14 @@ title: Nushell 0.14.0 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: We're excited to release version 0.14.0 of Nu! +description: We're excited to release version 0.14.0 of Nu! --- -# Nushell 0.14.0 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. We're excited to release version 0.14.0 of Nu! -# Where to get it +## Where to get it Nu 0.14.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.14.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -20,35 +18,35 @@ If you want more goodies, you can install `cargo install nu --features=stable`. As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## Temporary environment variables (jonathandturner) +### Temporary environment variables (jonathandturner) A feature requested by many, many folks is finally here. Up until now, to change an environment variable, you had to update the `config` settings, and then these changes would be permanent. This makes working with certain kinds of commands, which need some additional environment information, annoying to use. With 0.14.0, you'll now be able to temporarily set an environment variable. To do so, you can use the new `with-env` command. This command takes the variable/value pair and the block to run once the environment is set: -``` +```nu > with-env [DEBUG true] { command arg1 arg2 } ``` Bash, as well as many other shells, use a handy shorthand form, which we also now support. You can write the above as: -``` +```nu > DEBUG=true command arg1 arg2 ``` -## Starting things off right (1ntEgr8) +### Starting things off right (1ntEgr8) Modern desktops have a way to associate file types with applications and often have a way to run that application automatically when you open a file of that type. In macOS, you can use the `open` command, `start` on Windows, and a variety of related `start` command in Linux. In 0.14.0, we've added a unified `start` command that works across platforms that will run the associated application for a file type. For example, if you've associated your .py files with VSCode, you can edit them now using `start myfile.py`. -## Nu gets a calendar (JosephTLyons) +### Nu gets a calendar (JosephTLyons) A fun surprise for this release is the recently-added `cal` command, which will give you a calendar in table form. -``` +```nu > cal ───┬────────┬────────┬─────────┬───────────┬──────────┬────────┬────────── # │ sunday │ monday │ tuesday │ wednesday │ thursday │ friday │ saturday @@ -64,25 +62,25 @@ A fun surprise for this release is the recently-added `cal` command, which will You can pass in flags to give you additional columns for the year, month, and even get calendars from the past or future. -## Commands get some helpful examples (elichai) +### Commands get some helpful examples (elichai) A last minute update also gave us a big improvement in our built-in help. Starting with 0.14, we'll now have examples as part of the help commands can use: - + We're working to add examples to all commands. If that's something you're interested in helping with, come join us on [discord](https://discord.gg/NtAbbGn). -## Subcommands (jonathandturner) +### Subcommands (jonathandturner) As we fill out more forms of commands that Nu can represent, one type that we weren't able to do was subcommands. This meant all of our commands were at the top level, making it more difficult to find what you needed. Additionally, many external commands use subcommands, which meant we had no way to effectively wrap them in Nu. With 0.14, you can now define subcommands. Subcommands each get a unique signature which has its own coloring, autocomplete, etc. -``` +```nu > open myfile.txt | from csv --headerless ``` -## Breaking changes: renaming some commands (jonathandturner, andrasio) +### Breaking changes: renaming some commands (jonathandturner, andrasio) You may have noticed above that the `from-csv` is now `from csv`, that is, the `csv` part is now a subcommand of the `from` command. We've moved all `from-*` and `to-*` commands to be subcommands. This change was requested by users as part of an effort to streamline how conversion commands work. @@ -93,19 +91,19 @@ Another set of changes requested by users was to update the names of some of the While we are cautious to take breaking changes, we're confident - judging from user feedback - that these changes make Nu more ergonomic and easier to learn. -## `ls` learns read directory sizes (JosephTLyons) +### `ls` learns read directory sizes (JosephTLyons) A few users have wondered why Nu doesn't print the full directory size as part of `ls`. With 0.14, you'll now be able to get just that with the new `--du` argument to `ls`. Note: this isn't enabled by default as calculating the directory size can take quite a lot of processing. -## Startup speedups (fdncred) +### Startup speedups (fdncred) It's important to make a good first impression, and with this release Nu gets a speed boost for the initial startup. It will now load plugins in parallel rather than one after another. In some cases, this can lead to startups 3x-4x faster than previous versions. -## Auto-cd speedups (quebin31) +### Auto-cd speedups (quebin31) We've also gotten a boost when using the automatic change directory. You'll notice that 0.14 is a lot snappier when you type a directory to automatically jump to. -## Lots of new commands +### Lots of new commands - `from eml` (aeshirey) - have lots of saved emails lying around and want to process them? With 0.14, you can now easily load them into Nu - `empty?` (andrasio) - you can now check multiple columns for emptiness, and if empty, give them a value @@ -113,35 +111,35 @@ We've also gotten a boost when using the automatic change directory. You'll noti - `merge` (andrasio) - ever have two related tables and wish you could merge them into one? The new `merge` command can help you do that - `not-in:` operator (jonathandturner) - going along with the `in:` operator is the new `not-in:`, which checks that a value isn't in the given list -## It-expansion (jonathandturner, thegedge) +### It-expansion (jonathandturner, thegedge) We've streamlined how `$it` is handled. The `$it` variable has always implied iteration (`$it` gets the name from iteration, item, and being "it"). In 0.14, we've made this more explicit with an expansion that happens inside of Nu. Now, with Nu sees an `$it`, it expands it to a full `each` call. -``` +```nu > ls | echo $it.name ``` Internally, now expands to: -``` +```nu > ls | each { echo $it.name } ``` This helps us be more uniform about when iteration will happen. We've also updated how externals are handled so they can take advantage of this, making them work a lot more closely with how internals work. -## Doc and book updates (nespera, jonathandturner, fdncred, jzaefferer, siedentop) +### Doc and book updates (nespera, jonathandturner, fdncred, jzaefferer, siedentop) We're continuing to fill out help information on each of the commands. This release adds a few more to the list of documented commands. The [book](https://www.nushell.sh/book/) has also gone through a big revision to bring it up-to-date with the 0.14 release. We've also added tables to help you transition from Bash, PowerShell, SQL, and LINQ. A big thanks to our contributors to help find and fix issues. There's more work to do here. If you're writing-inclined, come join us! -## Bugfixes and polish (quebin31, BurNiinTree, avandesa, pka, homburg, rimathia, thegedge, jonathandturner, mhmdanas, JesterOrNot) +### Bugfixes and polish (quebin31, BurNiinTree, avandesa, pka, homburg, rimathia, thegedge, jonathandturner, mhmdanas, JesterOrNot) Lots of bugfixes and polish for this release. A big "thanks!" to everyone that joined in and filed bugs, fixed bugs, and gave feedback on discord, github, and twitter. -# Looking forward +## Looking forward We've got lots of fun things planned for upcoming releases: more intelligent autocomplete, autocomplete for popular external commands, and more streamlining of the engine itself. diff --git a/blog/2020-06-09-nushell_0_15_0.md b/src/content/docs/blog/2020-06-09-nushell_0_15_0.md similarity index 93% rename from blog/2020-06-09-nushell_0_15_0.md rename to src/content/docs/blog/2020-06-09-nushell_0_15_0.md index 25f7a83b36a..69eca618e2f 100644 --- a/blog/2020-06-09-nushell_0_15_0.md +++ b/src/content/docs/blog/2020-06-09-nushell_0_15_0.md @@ -3,18 +3,16 @@ title: Nushell 0.15.0 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.15 of Nu - and it has a few last-minute surprises we hope you'll find as much fun as we do. +description: Today, we're releasing 0.15 of Nu - and it has a few last-minute surprises we hope you'll find as much fun as we do. --- -# Nushell 0.15.0 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.15 of Nu - and it has a few last-minute surprises we hope you'll find as much fun as we do. As many of you know, this release was delayed as part of a wide-spread effort to elevate Black voices and raise awareness of police violence, a movement which has now grown worldwide. We encourage you to take time to understand what this movement stands for, why it's happening, and to get involved where you can. -# Where to get it +## Where to get it Nu 0.15.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.15.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,9 +20,9 @@ If you want more goodies, you can install `cargo install nu --features=stable`. As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## Per-directory environment variables (samhedin) +### Per-directory environment variables (samhedin) Right before the announcement of 0.15, we had a surprise feature land - per-directory environment variables. This allows you to configure some environment variables specific to the directory (including subdirectories) that you're currently in, and Nu will set these environment variables as you `cd` into the directory and unset them as you `cd` out. @@ -32,7 +30,7 @@ How it works: In your config, create a new config setting called `nu_env_dirs` and set it to a list of directories you want to allow to control their own environments: -``` +```nu > config --set [nu_env_dirs ["/home/sam", "/home/sam/github", "/home/sam/github/test"] ``` @@ -40,7 +38,7 @@ Note: after setting the above config settings, restart Nu so that they can be pi Once set, you can now create a `.nu-env` file in the directory that you want to control the environment in: -``` +```nu > open .nu-env [env] var = "value" @@ -49,41 +47,41 @@ anothervar = "anothervalue" With this file in place, you can `cd` into one of the directories you've configured and see the new environment variables now available. -## Improvements to auto-complete (AaronC81) +### Improvements to auto-complete (AaronC81) Starting with 0.15, you can now get autocompletions for external commands in your PATH. Additionally, auto-completing a filepath with a space now is handled with cleaner logic than in previous versions. -## Argument invocation (jonathandturner, cjpearce) +### Argument invocation (jonathandturner, cjpearce) You're now able to run a pipeline inside of another command as an argument, and then use the results that come out. -``` +```nu > echo $(ls | where size > 10kb | count) 3 ``` -## String interpolation (jonathandturner) +### String interpolation (jonathandturner) We also support string interpolation, or building a string from text and running commands. For example, if we wanted to print out the current path to the history file with a message, we could do: {% raw %} -``` +```nu > echo `My current history path is {{$nu.history-path}}` My current history path is /home/jonathant/.local/share/nu/history.txt ``` {% endraw %} -## Prettier errors (jonathandturner, brendanzab) +### Prettier errors (jonathandturner, brendanzab) We've switched from language-reporting to codespan, giving us nicer looking errors: - + -## Big history by default (aeosynth, lightclient) +### Big history by default (aeosynth, lightclient) Let's start with 100k line history. You can also configure the history size using the new "history_size" config setting. @@ -111,7 +109,7 @@ In addition to using `average` on a column, you can now run it over a whole tabl You can now pass multiple values to `start` at one time using the new glob support. -``` +```nu > start file*.rs ``` @@ -123,7 +121,7 @@ With 0.15, by default we will only look in the directory of the `nu` application ### `echo` now will iterate over a range (jonathandturner) -``` +```nu > echo 1..3 ───┬─── 0 │ 1 @@ -144,7 +142,7 @@ For those long-running `du` runs that you want to stop short, you can now use `c Now support: passing a string as a value in environment shorthands: -``` +```nu > FOO="My Bar" command arg1 arg2 ``` @@ -172,7 +170,7 @@ Previously, `format` would only allow you to pass in column names. This meant th You can now get `to json` to give you pretty-printed output, using the new `--pretty <indent size>` flag. -``` +```nu > echo $nu | to json --pretty 2 ``` @@ -190,6 +188,6 @@ Also thanks to mhmdanas, andrasio, shiena, q-b, jzaefferer, Samboy218, ryepesg, There are _far_ too many improvements and bugfixes to list here, but another _huge_ thank you to everyone who has helped fix an issue, report an issue, chatted with us on twitter and discord, and just shared your love for Nu with others. -# Looking forward +## Looking forward With 0.15, we've closed another set of gaps in what people need in a shell. We're looking to continue improving completions, as well as growing the parser to support Nu scripts not just line-by-line, but as whole source files. We're also working on improving jupyter support, file encoding for better support across languages, and more. diff --git a/blog/2020-06-30-nushell_0_16_0.md b/src/content/docs/blog/2020-06-30-nushell_0_16_0.md similarity index 92% rename from blog/2020-06-30-nushell_0_16_0.md rename to src/content/docs/blog/2020-06-30-nushell_0_16_0.md index 4923911c349..a00f716222b 100644 --- a/blog/2020-06-30-nushell_0_16_0.md +++ b/src/content/docs/blog/2020-06-30-nushell_0_16_0.md @@ -3,16 +3,14 @@ title: Nushell 0.16.0 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.16 of Nu. What's new? +description: Today, we're releasing 0.16 of Nu. What's new? --- -# Nushell 0.16.0 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.16 of Nu -# Where to get it +## Where to get it Nu 0.16.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.16.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -20,15 +18,15 @@ If you want more goodies, you can install `cargo install nu --features=stable`. As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## New automated release binaries (charlespierce, fdncred, jonathandturner) +### New automated release binaries (charlespierce, fdncred, jonathandturner) Up to this point, we've hand-rolled all the binary releases. The process has been time-consuming and error-prone. Starting with 0.16.0, we'll be releasing using the GitHub release automation. The first benefits you'll see is that we've also added a wix-based installer for Windows users. The second, perhaps harder to see, benefit is a more relaxed release process that's easier on the project maintainers :) Please note: as part of this, we took the opportunity to also align the directory structure across platforms. Apologies in advance for any inconvenience this might cause. -## New textview (fdncred) +### New textview (fdncred) We've had a few requests for an improved text viewing experience, so with 0.16.0 we're trying out a new viewer based on the [bat](https://crates.io/crates/bat) crate. We also support quite a lot of [configuration settings](https://github.com/nushell/nushell/pull/2010) for this new text viewer. @@ -66,35 +64,35 @@ You can now run a pipeline which returns a string, or list of strings, that is u A simple example: -``` +```nu > config --set [prompt "echo '> '"] ``` We've also added a new `ansi` command to let you change the color. Let's use it to change the prompt to blue: -``` +```nu > config --set [prompt "echo $(ansi blue) '> '"] ``` You can make the prompt even fancier. For example, this prompt prints the current directory, git branch, and current date and time: -``` +```nu > config --set [prompt 'echo [ $(ansi green) $(pwd) $(ansi reset) $(do -i {git rev-parse --abbrev-ref HEAD } | trim | echo [ "(" $(ansi blue) $it $(ansi reset) ")" ] | str join) $(char newline) $(ansi cyan) $(date --format "%d/%m/%Y %H:%M:%S").formatted $(ansi reset) "> " ]'] ``` - + _Example of full prompt_ Or update your prompt to show an abbreviated path: -``` +```nu > config --set [prompt 'echo [ $(ansi green) $(pwd | split row "/" | first $(pwd | split row "/" | count | = $it - 1 ) | each { str substring "0,1" | format "{$it}/" } | append $(pwd | split row "/" | last ) | str join) $(do -i { git rev-parse --abbrev-ref HEAD | trim | echo $(ansi reset) "(" $(ansi blue) $it $(ansi reset) ")" | str join }) $(ansi reset) "> "]'] ``` (note: the above assumes Unix-based systems, so on Windows use "\" as the path separator)) - + _Example of abbreviated prompt_ @@ -108,7 +106,7 @@ We've made enabling starship a configuration option, rather than always being on To enable starship, set the `use_starship` setting: -``` +```nu > config --set [use_starship $true] ``` @@ -116,17 +114,17 @@ To enable starship, set the `use_starship` setting: With 0.16.0, we now use a new table drawing algorithm. Here's the before and after for comparison: - + _Table drawn with 0.15.0_ - + _Table drawn with 0.16.0_ If you're struggling to see much difference, that's a good thing! Where you'll really see the difference is in the time it takes to draw these tables: - + _0.16.0 renders tables 40% faster than 0.15.0_ @@ -160,6 +158,6 @@ Over the past few weeks we've seen steady progress on the Simplified Chinese tra - Clean up and formatting of our docs (JosephTLyons) - Optimization work to not clone in some places (utam0k) -# Looking ahead +## Looking ahead We are looking into a few areas for the next release: further improving our per-directory environments, improving compile times, continuing to do code cleanup and pay down tech debt, and possibly more. diff --git a/blog/2020-07-21-nushell_0_17_0.md b/src/content/docs/blog/2020-07-21-nushell_0_17_0.md similarity index 95% rename from blog/2020-07-21-nushell_0_17_0.md rename to src/content/docs/blog/2020-07-21-nushell_0_17_0.md index 191c8de4c2b..e82b4bfee2c 100644 --- a/blog/2020-07-21-nushell_0_17_0.md +++ b/src/content/docs/blog/2020-07-21-nushell_0_17_0.md @@ -3,16 +3,14 @@ title: Nushell 0.17.0 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.17 of Nu, the first Nu to include WebAssembly, custom keybindings, and much more. +description: Today, we're releasing 0.17 of Nu, the first Nu to include WebAssembly, custom keybindings, and much more. --- -# Nushell 0.17.0 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.17 of Nu, the first Nu to include WebAssembly, custom keybindings, and much more. -# Where to get it +## Where to get it Nu 0.17.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.17.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -20,11 +18,11 @@ If you want more goodies, you can install `cargo install nu --features=stable`. As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## WebAssembly support (jonathandturner) and upcoming wasm-based playground (jzaefferer, jonathandturner) +### WebAssembly support (jonathandturner) and upcoming wasm-based playground (jzaefferer, jonathandturner) - + _Nu, now in your browser_ @@ -32,11 +30,11 @@ As part of on-going cleanup and portability work, with 0.17 it's now possible to If you'd like to see what we're building, [check it out](https://www.nushell.sh/demo/). -## Custom keybindings (jonathandturner) +### Custom keybindings (jonathandturner) Nushell now also supports custom keybindings. To configure your keybindings, you can add a keybindings.yml file beside your config file. You can find out the location for your system using: -``` +```nu > echo $nu.keybinding-path /home/jonathan/.config/nu/keybindings.yml ``` @@ -49,7 +47,7 @@ You can base your custom file off this [example keybindings file](https://github The new `benchmark` command will time a block and output the length of time it took to run: -``` +```nu > benchmark { echo "hello" } 363us 528ns ``` @@ -58,7 +56,7 @@ The new `benchmark` command will time a block and output the length of time it t The `str reverse` command will reverse the characters of a string: -``` +```nu > echo "hello world" | str reverse dlrow olleh ``` @@ -67,7 +65,7 @@ dlrow olleh On a related note, you can now also get the length of a string. -``` +```nu > echo "hello world" | str length 11 ``` @@ -76,7 +74,7 @@ On a related note, you can now also get the length of a string. In previous versions of Nu, it was difficult to format numbers for precision and digit grouping. Starting with 0.17, there's now a new `str from` subcommand to help with this. -``` +```nu > echo 1.456123 | str from --decimals 2 1.46 @@ -88,7 +86,7 @@ In previous versions of Nu, it was difficult to format numbers for precision and You can now calculate standard deviation and variance in your numeric datasets: -``` +```nu > echo [ 1 2 3 4 5 ] | math stddev 1.414213562373095048801688724209698078569671875376948073176679737990732478462107038850387534327641573 @@ -100,7 +98,7 @@ You can now calculate standard deviation and variance in your numeric datasets: Ever want to run one block if a condition was true and another if the condition was false? Now you can! -``` +```nu > echo 0..5 | if $it > 3 { echo big } { echo small } ───┬─────── 0 │ small @@ -118,7 +116,7 @@ The keen observer might notice we're stealthy sneaking in more commands you migh To more easily work with the characters in a string, you can now split the characters into separate items: -``` +```nu > echo "hello" | split chars ───┬─── 0 │ h @@ -133,7 +131,7 @@ To more easily work with the characters in a string, you can now split the chara Finally, you can now move columns in your table: -``` +```nu > ls ───┬──────────────────────────────────┬──────┬─────────┬──────────── # │ name │ type │ size │ modified diff --git a/blog/2020-08-11-nushell_0_18.md b/src/content/docs/blog/2020-08-11-nushell_0_18.md similarity index 89% rename from blog/2020-08-11-nushell_0_18.md rename to src/content/docs/blog/2020-08-11-nushell_0_18.md index aeb28e34590..bbc9db3dc16 100644 --- a/blog/2020-08-11-nushell_0_18.md +++ b/src/content/docs/blog/2020-08-11-nushell_0_18.md @@ -3,16 +3,14 @@ title: Nushell 0.18 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.18 of Nu. The focus of this release was largely to polish what is already there, ensuring that internally parts work together better, are more consistent, and are easier to maintain. We've also added new commands for working with paths, URLs, strings, and lists. +description: Today, we're releasing 0.18 of Nu. The focus of this release was largely to polish what is already there, ensuring that internally parts work together better, are more consistent, and are easier to maintain. We've also added new commands for working with paths, URLs, strings, and lists. --- -# Nushell 0.18 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.18 of Nu. The focus of this release was largely to polish what is already there, ensuring that internally parts work together better, are more consistent, and are easier to maintain. We've also added new commands for working with paths, URLs, strings, and lists. -# Where to get it +## Where to get it Nu 0.18 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.18.1) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,9 +20,9 @@ As part of this release, we also publish a set of plugins you can install and us _Please note:_ as part of last minute changes, we had to bump the first release version of 0.18 to 0.18.1 instead of 0.18.0. -# What's New +## What's New -## Command improvements +### Command improvements - **New:** [`reduce` command](https://github.com/nushell/nushell/pull/2292) to reduce a list of values into a value (bailey-layzer) - **New:** [`path basename`, `path extension`, `path expand`](https://github.com/nushell/nushell/pull/2255) for working with path values (mattyhall) @@ -46,20 +44,20 @@ _Please note:_ as part of last minute changes, we had to bump the first release - `ls -al` (and `ps -l`) are now the preferred way of getting a full listing (JosephTLyons) - `insert` now [takes a block](https://github.com/nushell/nushell/pull/2265) to do the work of inserting values (coolshaurya) -## Breaking changes +### Breaking changes The flags for --full in `ls` and `ps` has been changed to --long (-l) to better align with habits from other shells. Line editor config settings have [moved to their own section](https://github.com/nushell/nushell/pull/2238). -## Demo site (jzaefferer, jonathandturner) +### Demo site (jzaefferer, jonathandturner) There have been a number of improvements to the new wasm-based demo site, including new colors, command improvements, pivoting of long tables, and more. -## Bugfixes (fdncred, kornelski, JosephTLyons, andrasio, thegedge, jonathandturner, jzaefferer, warrenseine, coolshaurya) +### Bugfixes (fdncred, kornelski, JosephTLyons, andrasio, thegedge, jonathandturner, jzaefferer, warrenseine, coolshaurya) Fixed issues with different types of symlinks on Windows, Nu will now used the support app_dirs crate, lots of internal match logic cleanup, internal representation of data summaries got a cleanup, getting ready to add a winget package, the first wave of parser cleanups ahead of future completion work, cleaned up unnecessary extra build steps, new command examples, improvements to the new `path` command errors, fixed histogram example, and consistency improvements. -# Looking forward +## Looking forward We're nearly to the first birthday for Nu! In the near future, we'll continue to improve completions, work on a possible new [data frames](https://github.com/nushell/rfcs/pull/3) implementation, continuing to push the wasm implementation further, and more. diff --git a/blog/2020-08-23-year_of_nushell.md b/src/content/docs/blog/2020-08-23-year_of_nushell.md similarity index 96% rename from blog/2020-08-23-year_of_nushell.md rename to src/content/docs/blog/2020-08-23-year_of_nushell.md index 156b0d3621a..86a8adec224 100644 --- a/blog/2020-08-23-year_of_nushell.md +++ b/src/content/docs/blog/2020-08-23-year_of_nushell.md @@ -3,32 +3,30 @@ title: One year of Nushell author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Hard to imagine that it's already been a year since Nu first went public. A year later and we've learned a lot, and made a few mistakes along the way. In this post, we look back over the year and see how we did and where we might be going in the future. +description: Hard to imagine that it's already been a year since Nu first went public. A year later and we've learned a lot, and made a few mistakes along the way. In this post, we look back over the year and see how we did and where we might be going in the future. --- -# One year of Nushell - Hard to imagine that it's already been a year since Nu first went public. At the time, it was largely a demo of what could be possible, but still needed quite a bit of work to make it ready for everyday use. A year later and we've learned a lot, and made a few mistakes along the way. In this post, we look back over the year and see how we did and where we might be going in the future. -# History +## History When Nu first started, it started with a simple idea: the output of `ls`, `ps`, and `sysinfo` should all output the same thing. Taking a page from PowerShell, we explored outputting structured data and quickly settled on a table design that would support the output of each of the three commands, with the added ability of streaming the output as it became available. Around this idea, we then built a set of "filters", like the `where` clause, borrowed from SQL, and a growing set of data types we would support natively. Soon, we were able to write more complex statements like `ls | where size > 10kb`. This became the crux of the idea - commands that output values from a core set of data types into a stream, composed together with the traditional UNIX pipe (`|`), so that you could build up a complex set of commands that work over the data as it streams through. -# Nushell today +## Nushell today -## Contributors +### Contributors Before we got started talking about Nushell today, we wanted to give a _big_ "thank you!" to everyone who has contributed to Nu to get us to this point. Nu is what it is because of your help. 1ntEgr8, AaronC81, AdminXVII, aeosynth, aeshirey, aidanharris, almindor, Aloso, Amanita-muscaria, amousa11, andrasio, Andrew-Webb, arashout, arnaldo2792, avandesa, avranju, bailey-layzer, BatmanAoD, bndbsh, Bocom, boisgera, Borimino, BradyBromley, BurNiinTRee, Byron, candostdagdeviren, casidiablo, charlespierce, chhetripradeep, cjpearce, coolshaurya, cristicismas, DangerFunPants, daschl, daveremy, davidrobertmason, Delapouite, dependabot[bot], Detegr, devnought, Dimagog, djc, drmason13, DrSensor, elichai, eltonlaw, EmNudge, eoinkelly, equal-l2, est31, fdncred, filalex77, Flare576, gilesv, gorogoroumaru, GuillaumeGomez, hdhoang, he4d, hilias, HiranmayaGundu, hirschenberger, homburg, iamcodemaker, incrop, ineol, Jacobious52, jankoprowski, JCavallo, jdvr, jerodsanto, JesterOrNot, johnae, johnterickson, jonathandturner, JonnyWalker81, jonstodle, JosephTLyons, jzaefferer, k-brk, Kelli314, klnusbaum, kloun, kornelski, kubouch, kvrhdn, landaire, lesichkovm, LhKipp, lightclient, lincis, lord, luccasmmg, marcelocg, matsuu, mattclarke, mattyhall, max-sixty, mfarberbrodsky, mhmdanas, mike-morr, miller-time, mistydemeo, mlbright, mlh758, morrme, nalshihabi, naufraghi, nespera, neuronull, nickgerace, nmandery, notryanb, oknozor, orf, orientnab, oskarskog, oylenshpeegul, pag4k, Paradiesstaub, philip-peterson, piotrek-szczygiel, pizzafox, pka, pmeredit, pontaoski, Porges, pulpdrew, q-b, quebin31, rabisg0, ramonsnir, rimathia, ritobanrc, rnxpyke, romanlevin, routrohan, rrichardson, rtlechow, rutrum, ryuichi1208, Samboy218, samhedin, sandorex, sdfnz, sebastian-xyz, shaaraddalvi, shiena, siedentop, Sosthene-Guedon, Southclaws, svartalf, taiki-e, Tauheed-Elahee, tchak, thegedge, tim77, Tiwalun, twe4ked, twitu, u5surf, UltraWelfare, uma0317, utam0k, vsoch, vthriller, waldyrious, warrenseine, wycats, yaahc, yahsinhuangtw, yanganto, ymgyt, zombie110year -# What is Nushell? +## What is Nushell? Nushell is an interactive programming language for working with your files, your system, and your data as a shell, a notebook, and more. -## Nu is more than a shell +### Nu is more than a shell It's easy to think of Nushell as just a shell. It's even got 'shell' in the name. It's the first and probably main way you'll interact with it. So why say it's "more than a shell"? @@ -42,17 +40,17 @@ When we say that "Nu is more than a shell", does that imply that Nu can be used The idea of Nu runs deeper than just the shell, to being a language that's relatively easy to learn, yet powerful enough to do real work with your system, to process large amounts of data, to interactively let you iterate quickly on an idea, to invite exploration by building up a pipeline one piece at a time. There's really no shortage of ambition for where we hope to go. -# The design of Nu +## The design of Nu Nu's original design has proven surprisingly robust thus far. Some of its core ideas are continuing to pay dividends a year later. Let's look at the designs that still feel right. -## Pipelines are infinite +### Pipelines are infinite When we first started writing Nu, we took a few shortcuts that had us processing all the data in a pipeline at once. Very quickly, we realize this wasn't going to work. External commands (think `cat /dev/random`) can output an infinite stream of data, and the system needs to be able to handle it. Understanding this, we transitioned to a different model: data flows between command as infinite streams of structured data. As the data is processed, we avoid collecting the data whenever possible to allow this streaming to happen. Because the streams can be infinite, even the printing out of tables is done a batch at a time. -## Separating viewing data from the data itself +### Separating viewing data from the data itself Coming from other shells, the idea of running `echo` or `ls` goes hand-in-hand with printing something to the terminal. It's difficult to see that there two steps going on behind the scenes: creating the information and then displaying it to the screen. @@ -62,7 +60,7 @@ That's because both `echo` and `ls` are lazy commands. They'll only do the work Behind the scenes, Nu converts a standalone `ls` to be the pipeline `ls | autoview`. The work of viewing comes from `autoview` and it handles working with the data and calling the proper viewer. In this way, we're able to keep things as structured data for as long as possible, and only convert it to be displayed as the final step before being shown to the user. (note: the wasm-based demo and jupyter do a similar step, but instead of adding `autoview`, they add `to html`) -## Rich data types +### Rich data types In a similar way to working with structured data, rather than only plain text, Nu takes a different approach to data types as well. Nu takes the traditional set of basic types, like strings and numbers, and extends them into a richer set of basic data primitives. @@ -74,7 +72,7 @@ For example, in Nu it's possible to write `= 1min + 1sec` to create a duration t Nu also can help if you try to mix types that shouldn't. For example, if you had written: `= 1min + 1kb` it seems you didn't mean to add time and file sizes together, and Nu gives you an error if you do: -``` +```nu error: Coercion error ┌─ shell:1:3 │ @@ -88,7 +86,7 @@ _note: we'll be making this error better in the future_ Data in Nu also isn't just the value, but it's also a set of metadata that comes with the value. For example, if you load data from a file using the `open` command, we track the place that it's loaded along with the data that's loaded. We can see this metadata using the `tags` command: -``` +```nu open package.json | tags ───┬─────────────────┬────────────────────────────────────────────────────────────────────────────── # │ span │ anchor @@ -106,7 +104,7 @@ Something we attached to early on was the idea that Nu should be fun. It should Nu is really about play. You play with your data, you play with the structures that make up your files and filesystem, you play with what web services give back to you. Everything about Nu is made to invite you to explore how things work and how data is put together. As you play, you learn more about Nu works and how to better use it. We firmly believe that learning doesn't have to hurt. At its best, the pleasure of exploration over time yields expertise without punishing you along the way. Humans just get better at something when we love to pick it up day after day, experimenting as we go. With Nu, we can ask questions like "what if I do this?" because the system is built to let us ask the question and answer it ourselves. -Nu takes this one step further. The error reporting system comes from the design of [Rust's error messages](https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html), with clear messages to help guide you to success. +Nu takes this one step further. The error reporting system comes from the design of [Rust's error messages](https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come), with clear messages to help guide you to success. The goal for Nu is that it won't require you to be a wiz with the commandline or with complex programming practices. Instead, you start where you feel comfortable, and grow a line at a time. With Nu, as your comfort grows, single lines easily grow to multiple lines, and (eventually) to larger programs. You don't need separate styles of thinking when experimenting and another for building your application. In Nu, these are (or will be) one and the same. @@ -122,19 +120,19 @@ Early on, when we were first brainstorming how something like Nushell might work The simplest version is: -``` +```nu ls | echo $it ``` To `echo $it` doesn't really do anything interesting, it just passes along the value it was handed. It's when we combine this with variable paths that things get a little more interesting: -``` +```nu ls | echo $it.name ``` Now, in 4 words we've asked Nu to list all the files in the current directory and output only the names. This pipeline, if there are 100s of thousands of files, will happily stream out its results as it finds new files. As in this case: -``` +```nu ls **/* | echo $it.name ``` @@ -144,13 +142,13 @@ A note for those wondering how this works under the hood: if an `$it` is found a This turns: -``` +```nu ls | echo $it.name ``` Into: -``` +```nu ls | each { echo $it.name } ``` @@ -162,7 +160,7 @@ In Nu, a command has the form `<cmd> <arg1> <arg2>`. To the lisp-lovers among yo You may be wondering - if you choose a cmd-arg-arg form, how do you write something like: -``` +```nu where size > 10kb ``` @@ -180,7 +178,7 @@ That is, the `where` command takes a single parameter, a `condition`, which has In math mode, we can now parse an expression using operator precedence. The `where` command tells the parser to treat all of the free parameters as a single expression, to parse that expression, and to pass it as the single argument. The canonical form is more precise, though a bit more cumbersome: -``` +```nu where { = $it.size > 10kb } ``` @@ -196,21 +194,21 @@ In addition to kebab case, you can use `?` as part of the identifier, allowing n Nushell currently sits at just over 55k lines of code, built from almost 1300 merged pull requests. - + _Growth in code size with each version_ -# Surprises? +## Surprises? It's funny, when you start working on a shell it's easy to think "it'll be like a REPL". In fact, it's closer to creating an interactive IDE for the terminal. As people came to Nu from other shells, including shells like fish, there was a strong assumption that completions would be stellar, that it will integrate well with existing workflows, and it will support configuring the prompt, the keybindings, and more. It also turns out that getting a shell correct is a lot more experimentation and a lot less following what the textbooks say. In practice, things like 'stdout' and 'stderr' are used in a variety of ways, as are the exit codes output by programs. Our initial designs started with a stricter view of these ideas, and softened over time as we saw that the real world is a much fuzzier place than we realized. -# Quirks +## Quirks Nu hasn't been without a few quirks. Like any awkward growth spurt, we've had our awkward times and still have a few "curious" areas. -## No variables, yet +### No variables, yet Had you a time machine and told us a year ago that we still wouldn't have variables today, we probably wouldn't have believed you. Isn't that an important part of a language? @@ -223,7 +221,7 @@ That, of course, has its limits. At some point you want to take the result of on There are other questions we still need to answer as well, like how do variables and function definitions play together? How do variables shadow each other (or even if they're allowed)? -## To view or not to view +### To view or not to view Nushell, being a language focused on working on structured data, has a few quirks with how and when the data is viewed. For one, Nushell has multiple types of data, and different types of data may have different viewing needs. To help with this, we created `autoview`, a command that will look at the data and detect a variety of different cases. Once it's identified the shape of the data, it will call out to the viewing command that handles viewing that particular kind of data. @@ -235,7 +233,7 @@ In the current version of Nu, we don't. We treat anything to the left of `;` as This seems reasonable until you see something like `echo "hello"; echo "world"` and only see the output "world" and then have to stop and think through all the steps that led to that output. -## Getting turned around +### Getting turned around As it turns out, the terminal is small. Want to view a few columns? Generally not a problem. Want to open that random CSV file from work with 30 columns? Well, now we might have a problem. How does that 30 column file actually look when you print it out in the terminal, with a nicely drawn table? @@ -243,27 +241,27 @@ For some cases, we found we could be helpful by rotating the table so that the c That being said, it's not without its trade-offs. To some folks, rotating the table when they aren't expecting it can be very disorienting. We're still working to figure out the best defaults and heuristics. -# Future work +## Future work -## Focus +### Focus Nushell is in the stage of the project where we're still experimenting with what the language should be, how it works in practice, and finding out what its most important core values are. Rust, the language Nushell is written in, went through a similar stage. As it found its most important values, it tried on others. Once people started to create real projects in Rust, and show what was possible with this core part of the language, the design began to gel and then solidify as it arrived at 1.0. As part of that, early ideas were modified or discarded altogether. Nushell will go through a similar stage. As it grows, it will find its sweet spot, its niche that it naturally fills. The design will come from features built to solve real problems, and we'll polish these features, improving their utility, error messages, documentation, and overall flow. The end result will be a sharper, more focused Nushell that feels like the tool you want in your toolbox. Some early adopters are already giving us feedback that Nushell is well on its way of meeting this role, and we're excited to continue to explore and refine as we go. -## Exploring the data model +### Exploring the data model There are some really juicy open questions that we'll work on in the coming year. We already have a fairly rich set of data primitives, like strings, dates, file sizes, durations, and more. Figuring out what makes sense to be built-in vs what should be added from outside of the core Nu data model will take a bit of time and finesse as we get more experience working with Nu in the real world. -## Shifting to being a full language +### Shifting to being a full language Looking at Nu today, you can see some common parts of languages like `if` or `open`, but it doesn't yet feel like there's enough syntax to build up full programs. You can't define your own commands, your own variables, and you can't build out a project across multiple files. We're working to address all of these limitations so that Nu can function not only for one-liners, but also for much more. -## Getting completions _really_ good +### Getting completions _really_ good A regular point of feedback is that people want completions where possible. We've got some ideas here that will allow us to have completions in far more places, including external commands (think `git checkout <TAB>`). We're laying the groundwork for this now, and looking forward to rolling out more functionality as we go. -# Conclusion +## Conclusion We had far more support and made far more progress than we could have ever predicted a year ago. Today's Nu is something many people use as their daily driver, and it gets stronger with each release. We're excited to bring Nu to a broader audience as we continue to improve usability, grow its feature set, and refine its internals. diff --git a/blog/2020-09-01-nushell_0_19.md b/src/content/docs/blog/2020-09-01-nushell_0_19.md similarity index 89% rename from blog/2020-09-01-nushell_0_19.md rename to src/content/docs/blog/2020-09-01-nushell_0_19.md index 84a53c1cb79..3c0f97298c1 100644 --- a/blog/2020-09-01-nushell_0_19.md +++ b/src/content/docs/blog/2020-09-01-nushell_0_19.md @@ -3,16 +3,14 @@ title: Nushell 0.19 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.19 of Nu. In this version, we fill some long-lived gaps in Nu, improve completions, theming, and much more. +description: Today, we're releasing 0.19 of Nu. In this version, we fill some long-lived gaps in Nu, improve completions, theming, and much more. --- -# Nushell 0.19 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.19 of Nu. In this version, we fill some long-lived gaps in Nu, improve completions, theming, and much more. -# Where to get it +## Where to get it Nu 0.19 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.19.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -20,33 +18,33 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## New completion engine (thegedge) +### New completion engine (thegedge) - + Nushell's completion suggestions are now built around the nushell parser. This means completers can now use a much richer context to provide relevant suggestions. This is still a work in progress, but one immediate improvement is that we can now complete commands, flags, and arguments in most nested structures. For example, `echo $(l<TAB>` will show you all commands that start with l. The completion work is still very "new", with parts landing in the hours before the release, so please give it a spin and let us know where we can keep improving it. -## Improved theming (fdncred) +### Improved theming (fdncred) - + _Nu, with love_ We're continuing to expand what's possible with Nu's themes, allowing you to configure more areas of how your data is displayed. - + You can also configure how the various Nu data types are displayed. You can learn about the [new custom data colors](https://github.com/nushell/nushell/pull/2449) if you're interested in configuring them for yourself. There's also and example `config.toml` [here](https://github.com/nushell/nushell/blob/main/docs/sample_config/config.toml) with an example of how to set the colors you like. -## Table literals (jonathandturner) +### Table literals (jonathandturner) Starting with 0.19, you can now write table values like you would other kinds of values. To do so, separate a row of header names from the data using a `;`. For example: -``` +```nu > echo [[name size]; [JT 185] [KJ 160]] ───┬──────┬────── # │ name │ size @@ -58,13 +56,13 @@ Starting with 0.19, you can now write table values like you would other kinds of To be a valid table, the number of columns needs to line up. -## Multiline edits (jonathandturner) +### Multiline edits (jonathandturner) In addition to the new table literals, we're opening up multiline commands. Initially, this will be for the line editor, but we'll extend this further as we improve parser support. You can now also write the above: -``` +```nu > echo [ [name, size]; [JT, 185] @@ -80,11 +78,11 @@ You can now also write the above: You might have noticed we now also allow commas to separate cells. These are intended to help readability and give a more familiar syntax for people coming from other languages. -## Nushell celebrates its first year in the public +### Nushell celebrates its first year in the public -We recently sat down and wrote about [where Nushell has come over the last year](http://www.nushell.sh/blog/2020/08/23/year_of_nushell.html) and some thoughts about where it's going. The blog post is a wealth of information about Nu's philosophy and direction. Well worth a read. +We recently sat down and wrote about [where Nushell has come over the last year](http://www.nushell.sh/blog/2020/08/23/year_of_nushell) and some thoughts about where it's going. The blog post is a wealth of information about Nu's philosophy and direction. Well worth a read. -## Command improvements +### Command improvements - `size` now gives back [simpler columns](https://github.com/nushell/nushell/pull/2473) (gillespiecd) - `uniqe` has [more examples](https://github.com/nushell/nushell/pull/2472) (gillespiecd) @@ -109,7 +107,7 @@ We recently sat down and wrote about [where Nushell has come over the last year] - We've also got a [Portuguese translation of the contributor book(!!)](https://github.com/nushell/contributor-book/pull/29) (vpperego) - Improved [RHEL installation instructions](https://github.com/nushell/book/pull/126) (arnaldo2792) -## More cleanup and improvements (gillespiecd, jonathandturner, Marcoleni, andrasio, dmeijboom, thegedge, jzaefferer, ryuichi1208, JosephTLyons) +### More cleanup and improvements (gillespiecd, jonathandturner, Marcoleni, andrasio, dmeijboom, thegedge, jzaefferer, ryuichi1208, JosephTLyons) Cleanups in math commands, extra bits of command help, reformatting of the command list, better email samples, cleaned up spans in pipelines, fix to `header` command with mismatched columns, cleanup of dependency usage, cleaned up display config, added crossreferences in command help, subcommands are now sorted before being listed, some dockerfile improvements, nu-cli now has nu-data split off from it, column count now won't break on empty tables, wasm is now tested on CI, improvements to `histogram` and `count`, @@ -119,13 +117,13 @@ Cleanups in math commands, extra bits of command help, reformatting of the comma To help Nu focus a bit more on the core capabilities, and to free up it to update separate from Nu, Starship is now external. Once you install Starship, you can set your prompt to use starship using: -``` +```nu > config set prompt `echo $(starship prompt)` ``` You can also set Nu to use other prompts as well. For example, if you like powerline, you can also use this: -``` +```nu > config set prompt `echo $(powerline shell left)` ``` @@ -133,7 +131,7 @@ You can also set Nu to use other prompts as well. For example, if you like power Based on feedback from users, we've now disabled any auto-pivoting of tables by default. You can still re-enable this behavior in your config, but we will no longer rotate any tables without being explicitly asked. -``` +```nu # To only rotate large tables: > config set pivot_mode auto @@ -155,7 +153,7 @@ With the new theming support, `header_color`, `header_bold`, and `header_align` While not technically a breaking change, it's worth a mention that starting with 0.19, you don't need to use `--features=stable` to get most of Nu's features. We've folded most of the common ones into the default install. For all the bells and whistles, now use `--features=extra`, which includes additional functionality not part of the original `stable` release. -# Looking forward +## Looking forward With 0.19, we see the first deeper changes to the completion engine since Nu was first released. These will grow to allow custom completions for commands, and we're looking forward to making these features available. diff --git a/blog/2020-09-22-nushell_0_20.md b/src/content/docs/blog/2020-09-22-nushell_0_20.md similarity index 92% rename from blog/2020-09-22-nushell_0_20.md rename to src/content/docs/blog/2020-09-22-nushell_0_20.md index 43fbcb0c35b..d6b6dacfe5f 100644 --- a/blog/2020-09-22-nushell_0_20.md +++ b/src/content/docs/blog/2020-09-22-nushell_0_20.md @@ -3,16 +3,14 @@ title: Nushell 0.20 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.20 of Nu. In this version, we're introducing some new features for working with rows, improvements to completions, and more. +description: Today, we're releasing 0.20 of Nu. In this version, we're introducing some new features for working with rows, improvements to completions, and more. --- -# Nushell 0.20 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.20 of Nu. In this version, we're introducing some new features for working with rows, improvements to completions, and more. -# Where to get it +## Where to get it Nu 0.20 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.20.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -20,17 +18,17 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## New functionality +### New functionality -### `each group` and `each window` (ritobanrc) +#### `each group` and `each window` (ritobanrc) With 0.20, you can now work with groups of rows at a time easier than ever before. For example, let's say you have a table like this: -``` +```nu ───┬───────┬───── # │ name │ age ───┼───────┼───── @@ -45,7 +43,7 @@ For example, let's say you have a table like this: And you wanted to take three rows at a time, and sum the ages. You can now do this using: -``` +```nu ... | each group 3 { get age | math sum } ───┬───── 0 │ 110 @@ -55,7 +53,7 @@ And you wanted to take three rows at a time, and sum the ages. You can now do th Or, you can slide a "window" over the data, looking at multiple rows at a time. Let's slide a window of two rows, so that we look at each pair. We can use this to average the adjacent rows: -``` +```nu ... | each window 2 { get age | math avg } ───┬───────── 0 │ 35.0000 @@ -66,7 +64,7 @@ Or, you can slide a "window" over the data, looking at multiple rows at a time. ───┴───────── ``` -### Completion improvements (thegedge, rezural) +#### Completion improvements (thegedge, rezural) The new completer received a [lot of bugfixes](https://github.com/nushell/nushell/pull/2497), [more fixes](https://github.com/nushell/nushell/pull/2503), and [yet more fixes](https://github.com/nushell/nushell/pull/2525) since its initial release with 0.19. We're continuing to improve this experience further. @@ -102,31 +100,31 @@ Completions can [now be case-insensitive](https://github.com/nushell/nushell/pul Removed unnused dependencies, cleanups to duration, some ARM incompatibilites were fixed, some Ctrl+C issues were fixed, optimized some config reading, cleanup code in `get` and `nu-value-ext`, rustyline was upgraded (fixing a common instability in Windows), `help command` get some improvements, `random integer` got some stability fixes. -# Breaking changes +## Breaking changes -## `in:` and `not-in:` are now `in` and `not-in` +### `in:` and `not-in:` are now `in` and `not-in` In working with operators, we've removed the colon from the `in` and `not-in` operators. -## `trim` and `str trim` are now just `str trim` +### `trim` and `str trim` are now just `str trim` We've merged the functionality and now just have the one `str trim` command. -## Locale-formatted numbers temporarily not supported +### Locale-formatted numbers temporarily not supported As part of updating dependencies, we've had to temporarily disable locale-formatting numbers. We hope to fix this as dependencies update to the latest versions. -## Change in config location +### Change in config location We've tried to use a supported 'directories' crate, which has meant having to change until we found a supported one. This, unfortunately, means that this release moves the config location again. On macOS, `config path` now points to: "$HOME/Library/Application Support/org.nushell.nu/config.toml", in 0.19.0 and earlier it was: "$HOME/Library/Preferences/org.nushell.nu/config.toml". -# Zulip chat +## Zulip chat We're experimenting with using Zulip for our community chat and design discussions. If you want, you can [try the server and tell us what you think](https://nushell.zulipchat.com/). If you'd rather we stick with [Discord](https://discord.gg/NtAbbGn), you can tell us that, too :) -# Looking forward +## Looking forward We've put a [survey to get feedback from you about Nushell](https://docs.google.com/forms/d/e/1FAIpQLScEFzDh7j3jfAuVMBCQtQE-qfKAhugLCiUaaGL583QtGwz5fw/viewform?usp=sf_link). This will help us focus our efforts in the coming releases to refactor, trim, and polish Nu. Working with a large codebase is always a challenge, and recently we've been thinking through what features really make up the "core" Nu experience and what parts can be moved outside of Nu itself. This may mean making more things plugins, cutting back on the dependencies we use, and more. Getting your feedback makes sure we have a clear picture for what the "core" of Nu is to most people. diff --git a/blog/2020-10-13-nushell_0_21.md b/src/content/docs/blog/2020-10-13-nushell_0_21.md similarity index 85% rename from blog/2020-10-13-nushell_0_21.md rename to src/content/docs/blog/2020-10-13-nushell_0_21.md index 27e0badbab5..f964f49a140 100644 --- a/blog/2020-10-13-nushell_0_21.md +++ b/src/content/docs/blog/2020-10-13-nushell_0_21.md @@ -3,16 +3,14 @@ title: Nushell 0.21 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.21 of Nu. In this version, we introduce a charting functionality for quickly exploring data, stability improvements, and some general command cleanups. +description: Today, we're releasing 0.21 of Nu. In this version, we introduce a charting functionality for quickly exploring data, stability improvements, and some general command cleanups. --- -# Nushell 0.21 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.21 of Nu. In this version, we introduce a charting functionality for quickly exploring data, stability improvements, and some general command cleanups. -# Where to get it +## Where to get it Nu 0.21 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.21.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -20,13 +18,13 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## New functionality +### New functionality -### Charting (andrasio) +#### Charting (andrasio) - + _New charting functionality_ @@ -34,15 +32,15 @@ Nushell now supports bar and line charts for when you want to quickly take a loo Here's an example of using `chart` to chart out contributions to a git repository: -``` +```nu > git log "--pretty=format:%h<nu>%aN<nu>%s<nu>%aD" | lines | split column "<nu>" sha1 author desc merged_at | where author == "Andrés N. Robalino" | update merged_at { get merged_at | str to-datetime } | reverse | chart line merged_at -f "%b-%Y" ``` - + _Line chart of GitHub contributions_ -### Improvements +#### Improvements - `rm -f` no longer complains if the path can't be found (luccasmg) - `benchmark` now randomizes the environment for more accurate results (tumdum) @@ -57,10 +55,10 @@ _Line chart of GitHub contributions_ - new `xpath` command that can search XML documents (fdncred, andrasio) - rustyline paste mode no longer assumes bracketed paste (wcarss) -### Internal improvements (fdncred, gillespiecd, jonathandturner, JosephTLyons, andrasio) +#### Internal improvements (fdncred, gillespiecd, jonathandturner, JosephTLyons, andrasio) Windows builds now use a bigger stack, suggestions have been cleaned up, cleaned up unused files in nu-data, some redundant dependencies were simplified, variable scope was improved to make way for variables, internal names for `describe` have been improved, nu-protocol got a tidy, added example to `update`, fix for panics in `str to-datetime`, internal name of `to md` corrected, `empty?` got a rewrite, integers are now parsed as BigInt, decimals are now parsed as BigDecimal, cleanup of old files in the root, more tests added, -# Looking forward +## Looking forward We recently finished the Nushell survey and will be working on processing the results, which will help us plan the next few months. Also, if you haven't heard, Nushell is part of the [new Couchbase CLI experience](http://couchbase.sh). There are also lots of big plans for improving core parts of the system, including line editing, completions, and more. If you're interested in helping out, come chat with us on [discord](https://discord.gg/NtAbbGn). diff --git a/blog/2020-11-03-nushell_0_22.md b/src/content/docs/blog/2020-11-03-nushell_0_22.md similarity index 89% rename from blog/2020-11-03-nushell_0_22.md rename to src/content/docs/blog/2020-11-03-nushell_0_22.md index ed31b7381d7..52427faa5e7 100644 --- a/blog/2020-11-03-nushell_0_22.md +++ b/src/content/docs/blog/2020-11-03-nushell_0_22.md @@ -3,18 +3,16 @@ title: Nushell 0.22 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.22 of Nu. In this version, we introduce a new flattening command, more math commands, we remove it-expansion, and add a lot of assorted improvements. +description: Today, we're releasing 0.22 of Nu. In this version, we introduce a new flattening command, more math commands, we remove it-expansion, and add a lot of assorted improvements. --- -# Nushell 0.22 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.22 of Nu. In this version, we introduce a new flattening command, more math commands, we remove it-expansion, and add a lot of assorted improvements. <!-- more --> -# Where to get it +## Where to get it Nu 0.22 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.22.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,23 +20,23 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## New functionality +### New functionality -### The `flatten` command (andrasio) +#### The `flatten` command (andrasio) - + _New flatten command_ There's now a flatten command that can take tables nested inside of the main table and flatten their contents into the main table. -### More `math` commands (morbatex, gillespiecd, fdncred) +#### More `math` commands (morbatex, gillespiecd, fdncred) You can now use rounding in math operations: -``` +```nu > echo [1.5 2.3 -3.1] | math ceil ───┬──── 0 │ 2 @@ -73,19 +71,19 @@ In this release, we're trying an experiment of removing it-expansion. Previously: -``` +```nu ls | echo $it.name ``` Now: -``` +```nu ls | each { echo $it.name } ``` Or, you can switch to other forms, like: -``` +```nu ls | get name ``` @@ -112,7 +110,7 @@ Please try it out and let us know what you think. It's now easier to create column-paths inside of the Nu source, `alias` got some bugfixes, the parser got some bugfixes, fixed typo in the build message, filesize labels for bytes wasn't showing up (now fixed), internally there are now more helpers for creating the core Value type, bumped the required Rust version, bugfix for `;` endings, and remove unneeded comments. -# Looking forward +## Looking forward We're continuing to work to simplify the internal representation, improve the parser, and work to add support for features like block parameters, variables, and, in the future, custom commands. diff --git a/blog/2020-11-24-nushell_0_23.md b/src/content/docs/blog/2020-11-24-nushell_0_23.md similarity index 87% rename from blog/2020-11-24-nushell_0_23.md rename to src/content/docs/blog/2020-11-24-nushell_0_23.md index f0a103a0026..838f51470c1 100644 --- a/blog/2020-11-24-nushell_0_23.md +++ b/src/content/docs/blog/2020-11-24-nushell_0_23.md @@ -3,18 +3,16 @@ title: Nushell 0.23 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.23 of Nu. In this version, we continue improving the commands, release a new website, and talk about some of the experiments that will be making their way into Nu in future versions. +description: Today, we're releasing 0.23 of Nu. In this version, we continue improving the commands, release a new website, and talk about some of the experiments that will be making their way into Nu in future versions. --- -# Nushell 0.23 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.23 of Nu. In this version, we continue improving the commands, release a new website, and talk about some of the experiments that will be making their way into Nu in future versions. <!-- more --> -# Where to get it +## Where to get it Nu 0.23 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.23.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,21 +20,21 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## New website (ibraheemdev) +### New website (ibraheemdev) - + _The new website_ We've just put up the first version of a new website that combines the front site with the books and docs all in one place. We're still continuing to polish this, so if you'd like to help out, come by the [discord](https://discord.gg/NtAbbGn) and say hello! -## Breaking changes +### Breaking changes The `from json` command used to preserve the order of fields. Unfortunately, unsafe behaviors in one of the dependencies we used for this were recently found and we've had to (perhaps temporarily) remove the order preservation. We'd happily accept PRs that re-enabled this functionality. -## Improvements +### Improvements - Better table alignments (fdncred) - `seq` now can do date ranges as well (fdncred) @@ -48,7 +46,7 @@ The `from json` command used to preserve the order of fields. Unfortunately, uns - A new `random decimal` command (smaydew) - Some `str substring` fixes (andrasio) -# Looking forward +## Looking forward We've been splitting our efforts between the website, Nushell, and two new side projects that will feed into Nushell in the future: [nunu](https://github.com/jonathandturner/nunu/) and [nunu2](https://github.com/jonathandturner/nunu2). The first is investigating some parser improvements we could do in Nushell to better support scripts and more in the future. The second experiments with variables, blocks, and evaluation. Combined, they should some signs of what we hope will be available in Nu in the weeks to come. diff --git a/blog/2020-12-15-nushell_0_24.md b/src/content/docs/blog/2020-12-15-nushell_0_24.md similarity index 90% rename from blog/2020-12-15-nushell_0_24.md rename to src/content/docs/blog/2020-12-15-nushell_0_24.md index 50294f324cf..a66347f9965 100644 --- a/blog/2020-12-15-nushell_0_24.md +++ b/src/content/docs/blog/2020-12-15-nushell_0_24.md @@ -3,18 +3,16 @@ title: Nushell 0.24 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.24 of Nu. We've added a few new utilities, improved the existing date functionality, and more. +description: Today, we're releasing 0.24 of Nu. We've added a few new utilities, improved the existing date functionality, and more. --- -# Nushell 0.24 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.24 of Nu. We've added a few new utilities, improved the existing date functionality, and more. <!-- more --> -# Where to get it +## Where to get it Nu 0.24 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.24.1) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -24,9 +22,9 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## Improvements +### Improvements - added a `hash` command for creating hashes (notryanb, andrasio) - improved the public API by making `run_block` public (max-sixty) @@ -37,7 +35,7 @@ As part of this release, we also publish a set of plugins you can install and us - gitpod setup got fixed (jankeronmes) - a new `math abs` command (xolve) -# Looking forward +## Looking forward Our work on the big update has continued, and we're looking forward to making it available soon. We're now down to the last three known outstanding issues that need to be resolved before the work can be merged into the main Nushell source code. diff --git a/blog/2021-01-05-nushell_0_25.md b/src/content/docs/blog/2021-01-05-nushell_0_25.md similarity index 94% rename from blog/2021-01-05-nushell_0_25.md rename to src/content/docs/blog/2021-01-05-nushell_0_25.md index acb2c564dd3..7c17c348cf6 100644 --- a/blog/2021-01-05-nushell_0_25.md +++ b/src/content/docs/blog/2021-01-05-nushell_0_25.md @@ -3,18 +3,16 @@ title: Nushell 0.25 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.25 of Nu. It's one of the largest releases we've ever done. +description: Today, we're releasing 0.25 of Nu. It's one of the largest releases we've ever done. --- -# Nushell 0.25 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.25 of Nu. It's one of the largest releases we've ever done. With it Nushell grows from being a shell to being a full scripting language as well. <!-- more --> -# Where to get it +## Where to get it Nu 0.25 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.25.1) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,17 +20,17 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New Lots of new features in this release. If you'd like to watch a demonstration, we can also watch a [video showing off the new features](https://www.youtube.com/watch?v=PO6EW7_a1tE). -## Custom commands +### Custom commands A long-requested feature for Nushell is to have scripting capability. A key piece of this story is the ability to make your own commands in addition to those built into Nu. With 0.25, you can now make your own custom commands: -``` +```nu def add [x, y] { = $x + $y } @@ -42,7 +40,7 @@ add 1 5 The definitions are created in the scope where you define them, and are visible before any of the script body runs. This allows you to have written the above like so: -``` +```nu add 1 5 def add [x, y] { @@ -52,7 +50,7 @@ def add [x, y] { There are a few other important features of custom commands. The first is that you can optionally add a type annotation to each parameter you take in. These type annotations tell the parser how to parse arguments given to the function and tell the type checker what is allowed to be passed in. -``` +```nu def add [x:int, y] { = $x + $y } @@ -62,7 +60,7 @@ add "bob" 4 Now if you run the example, you'll see a type error like this: -``` +```nu error: Type Error ┌─ shell:5:5 │ @@ -87,17 +85,17 @@ _Note: Nushell is whitespace-significant, so the variable + ':' + type need to b You can also create flags for your commands: -``` +```nu def create-item(name, --age:int) { ... } create-item "driver" --age 20 ``` -## Variables +### Variables You can now also define variables using `let`. -``` +```nu let name = "Nushell" echo $name ``` @@ -106,7 +104,7 @@ These variables are created in the scope they're defined in. If, for example, we had written this instead: -``` +```nu do { let $name = "Nu" echo $name # prints "Nu" @@ -120,7 +118,7 @@ These variables are **immutable** and need to be initialized as they are defined Along with variables, we also support "shadowing", so that you can create a variable inside of a scope, and have it "shadow" the variable of the same name outside of the scope: -``` +```nu let size = 10 do { let size = 5 @@ -129,11 +127,11 @@ do { echo $size # prints 10 ``` -## Environment variables +### Environment variables You can also use `let-env` to create environment variables. Just like variables, they are created in the scope they're defined. -``` +```nu let-env TRACE = on echo $nu.env.TRACE # prints 'on' ``` @@ -142,21 +140,20 @@ echo $nu.env.TRACE # prints 'on' With 0.25, we've also changed how aliases work to be more like a text expansion, in the spirit of how aliases work in shells like Bash. -``` +```nu alias ll = ls -l ll -a ``` This lets you alias a larger command to a smaller name, and then also pass additional arguments and flags to it. -## Source-ing +### Source-ing You can now also `source` a script, so that the definitions and code of that script runs in the current scope and context. Let's say we had a file called definitions.nu: -``` -# definitions.nu +```nu title="definitions.nu" def add [x, y] { = x + y } @@ -164,7 +161,7 @@ def add [x, y] { We can later use the definitions in this file using `source`: -``` +```nu source definitions.nu add 3 7 @@ -172,7 +169,7 @@ add 3 7 Like variables and definitions, the definitions we `source` are put into the current scope. -``` +```nu do { source definitions.nu echo $(add 3 7) # prints 10 @@ -180,25 +177,25 @@ do { echo $(add 1 11) # errors, `add` isn't in scope here ``` -## Breaking changes +### Breaking changes - Please note that the `alias` command no longer works the same way it did pre-0.25 Pre-0.25, aliases worked similarly to how `def` works now. We used multiple arguments, and each was optional: -``` +```nu alias mycmd [a b c d] { myverylongcommand $a $b $c $d } ``` With 0.25, we no longer pass parameters to alias this way. Instead, think of the aliased name being replaced by the right hand side. To update the previous alias to 0.25, we can write: -``` +```nu alias mycmd = myverylongcommand ``` Calling `mycmd 1 2` now expands to `myverylongcommand 1 2` and then runs the expanded command. -## Improvements +### Improvements - the `which` command now shows if the name points to an alias or custom command (LhKipp) - you can configure the [style that primities are shown](https://github.com/nushell/nushell/pull/2829) (fdncred) @@ -207,6 +204,6 @@ Calling `mycmd 1 2` now expands to `myverylongcommand 1 2` and then runs the exp - better information for debugging in `version` (gillespiecd) - Thanks to all those who landed general improvements too! (baoyachi, scrabsha, stormasm, max-sixty, ArturKovacs, JosephTLyons) -# Looking forward +## Looking forward This update opens a lot of doors to what's possible with Nushell. There are a few areas we'd like to explore with it: better autocompletions, describing external commands, and more. We'd also really like to hear your feedback on the release so we can continue to improve the overall experience of using Nu. diff --git a/blog/2021-01-26-nushell_0_26.md b/src/content/docs/blog/2021-01-26-nushell_0_26.md similarity index 93% rename from blog/2021-01-26-nushell_0_26.md rename to src/content/docs/blog/2021-01-26-nushell_0_26.md index 049e255b255..09cd73f816c 100644 --- a/blog/2021-01-26-nushell_0_26.md +++ b/src/content/docs/blog/2021-01-26-nushell_0_26.md @@ -3,18 +3,16 @@ title: Nushell 0.26 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.26 of Nu. It's a polish release with lots of improvements. +description: Today, we're releasing 0.26 of Nu. It's a polish release with lots of improvements. --- -# Nushell 0.26 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.26 of Nu. It's a polish release with lots of improvements. <!-- more --> -# Where to get it +## Where to get it Nu 0.26 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.26.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,13 +20,13 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## Rest support in custom commands (LhKipp, jonathandturner) +### Rest support in custom commands (LhKipp, jonathandturner) You can now refer to a rest argument in your custom command: -``` +```nu def my-cmd[...rest:int] { echo $rest | math sum } @@ -36,11 +34,11 @@ def my-cmd[...rest:int] { Elements of the rest are referred to with positions, like `$rest.1` for the 2nd position. -## Short flags in custom commands (LhKipp) +### Short flags in custom commands (LhKipp) You can now also added an optional shorthand flag to longhand flags: -``` +```nu def foo [--bar(-b): int] { echo $bar } @@ -49,11 +47,11 @@ foo -b 10 foo --bar 10 ``` -## Improved build times (jonathandturner, stormasm) +### Improved build times (jonathandturner, stormasm) When building from scratch, you may now notice that Nushell builds slightly faster. This comes from refactoring large crates into smaller crates and replacing some of our support crates with similar crates that compile faster. -## Improvements +### Improvements I hope you like improvements. We got a _lot_ of them this release. @@ -73,13 +71,13 @@ I hope you like improvements. We got a _lot_ of them this release. - stormasm refactored [nu-cli and split off commands into nu-command](https://github.com/nushell/nushell/pull/2910) - TrevorAC99 fixed a [rust-embed build breakage](https://github.com/nushell/nushell/pull/2880) -## Breaking changes +### Breaking changes - `ps` and `sys` are now served using a [different supporting crate](https://github.com/nushell/nushell/pull/2954). The functionality difference between the old crate and the new crate may mean a lack of fields that existed before, or different values than before (as it may be calculated differently). - We removed [`str set`](https://github.com/nushell/nushell/pull/2940). This command was one of the first of its style and has since been replaced by more general commands like `update`. - Internal architecture: the Primitive case for [lines has been removed](https://github.com/nushell/nushell/pull/2887). Instead, use strings. - Internal architecture: the Path and Pattern primitives are now called [FilePath and GlobPattern](https://github.com/nushell/nushell/pull/2889) respectively. -# Looking forward +## Looking forward We've been humbled by the feedback we got on the 0.25 release and appreciate the support. Looking forward, we'll be continuing to polish the features that landed in 0.25 as we prepare for using these features in larger scripts and in custom completion logic. diff --git a/blog/2021-02-16-nushell_0_27.md b/src/content/docs/blog/2021-02-16-nushell_0_27.md similarity index 87% rename from blog/2021-02-16-nushell_0_27.md rename to src/content/docs/blog/2021-02-16-nushell_0_27.md index 1ea177556a3..31acdcbb49d 100644 --- a/blog/2021-02-16-nushell_0_27.md +++ b/src/content/docs/blog/2021-02-16-nushell_0_27.md @@ -3,18 +3,16 @@ title: Nushell 0.27 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.27 of Nu. This release fixes some long-standing issues with Nushell. +description: Today, we're releasing 0.27 of Nu. This release fixes some long-standing issues with Nushell. --- -# Nushell 0.27 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.27 of Nu. This release fixes some long-standing issues with Nushell. <!-- more --> -# Where to get it +## Where to get it Nu 0.27 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.27.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,28 +20,28 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## Book updates (fdncred, jonathandturner) +### Book updates (fdncred, jonathandturner) The Nushell book received some much-needed updates. You'll notice new chapters and updated chapters to bring it more up-to-date with recent Nushell. -- [Thoroughly updated configuration section](https://www.nushell.sh/book/configuration.html) -- [Updated section on data types](https://www.nushell.sh/book/types_of_data.html) -- [A new section on creating your own commands](https://www.nushell.sh/book/custom_commands.html) -- [An updated section on aliases](https://www.nushell.sh/book/aliases.html) -- [A new section on working with variables and expressions](https://www.nushell.sh/book/variables_and_subexpressions.html) -- [The start of a new section on writing your own Nushell scripts](https://www.nushell.sh/book/scripts.html) +- [Thoroughly updated configuration section](https://www.nushell.sh/book/configuration) +- [Updated section on data types](https://www.nushell.sh/book/types_of_data) +- [A new section on creating your own commands](https://www.nushell.sh/book/custom_commands) +- [An updated section on aliases](https://www.nushell.sh/book/aliases) +- [A new section on working with variables and expressions](https://www.nushell.sh/book/variables_and_subexpressions) +- [The start of a new section on writing your own Nushell scripts](https://www.nushell.sh/book/scripts) -# Improvements +## Improvements -## New commands (fdncred) +### New commands (fdncred) - A new `term size` commands [lets you get the current size of the terminal](https://github.com/nushell/nushell/pull/3038) - New [`pow` operator](https://github.com/nushell/nushell/pull/2976) - New [modulus(`%`) operator](https://github.com/nushell/nushell/pull/2975) -## Functionality (jonathandturner, WatsonThink, ilius, andrasio, Qwanve, fdncred, ammkrn) +### Functionality (jonathandturner, WatsonThink, ilius, andrasio, Qwanve, fdncred, ammkrn) - Tables now [truncate instead of crashing when too large](https://github.com/nushell/nushell/pull/3061) - `source` command now can [use tilde in the path](https://github.com/nushell/nushell/pull/3059) @@ -61,7 +59,7 @@ The Nushell book received some much-needed updates. You'll notice new chapters a - `str from` can convert [more things to strings](https://github.com/nushell/nushell/pull/2977) - Booleans are now shown as [true/false instead of Yes/No](https://github.com/nushell/nushell/pull/3043) -## Internal (stormasm, ilius, fdncred, LhKipp, RReverser, jonathandturner) +### Internal (stormasm, ilius, fdncred, LhKipp, RReverser, jonathandturner) - Some [comment parsing improvements](https://github.com/nushell/nushell/pull/3053) - The `block` function is now [`parse_block`](https://github.com/nushell/nushell/pull/3047) @@ -70,17 +68,17 @@ The Nushell book received some much-needed updates. You'll notice new chapters a - The [WASI build should now be working again](https://github.com/nushell/nushell/pull/2983) - File size is [now a big int](https://github.com/nushell/nushell/pull/2984) -## Documentation (watzon, ahkrr, LhKipp, Andy-Python-Programmer, diogomafra) +### Documentation (watzon, ahkrr, LhKipp, Andy-Python-Programmer, diogomafra) - Sample config has [gotten an update](https://github.com/nushell/nushell/pull/3060) and [here](https://github.com/nushell/nushell/pull/3031) - Some [README links got updated](https://github.com/nushell/nushell/pull/3052) - More [README updates](https://github.com/nushell/nushell/pull/3013) and [here](https://github.com/nushell/nushell/pull/2996) - README now shows [contributor icons](https://github.com/nushell/nushell/pull/2993) -# Breaking changes +## Breaking changes - Booleans are now shown as [true/false instead of Yes/No](https://github.com/nushell/nushell/pull/3043) -# Looking ahead +## Looking ahead We're hard at work at putting together the proposed features for Nushell 1.0, which will help guide the work to get there. While there's still much work to do to achieve a 1.0 release, this proposal will let the community help refine and correct the direction. We're looking forward to kicking this off in the coming weeks. diff --git a/blog/2021-03-09-nushell_0_28.md b/src/content/docs/blog/2021-03-09-nushell_0_28.md similarity index 91% rename from blog/2021-03-09-nushell_0_28.md rename to src/content/docs/blog/2021-03-09-nushell_0_28.md index d1c733e54e6..f0f14ad6a9e 100644 --- a/blog/2021-03-09-nushell_0_28.md +++ b/src/content/docs/blog/2021-03-09-nushell_0_28.md @@ -3,18 +3,16 @@ title: Nushell 0.28 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.28 of Nu. In this release we've added new commands for working with tables, paths, and lots of general feature improvements. +description: Today, we're releasing 0.28 of Nu. In this release we've added new commands for working with tables, paths, and lots of general feature improvements. --- -# Nushell 0.28 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.28 of Nu. In this release we've added new commands for working with tables, paths, and lots of general feature improvements. <!-- more --> -# Where to get it +## Where to get it Nu 0.28 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.28.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -24,15 +22,15 @@ If you'd like to try the experimental paging feature in this release, you can in As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## New commands +### New commands -### Rotate (andrasio) +#### Rotate (andrasio) With the new `rotate` command, we have an easier way to turn rows to columns and columns to rows. -``` +```nu > echo [[col1, col2, col3]; [cell1, cell2, cell3] [cell4, cell5, cell6]] | rotate ───┬─────────┬─────────┬───────── # │ Column0 │ Column1 │ Column2 @@ -45,7 +43,7 @@ With the new `rotate` command, we have an easier way to turn rows to columns and You can also rotate counter-clockwise: -``` +```nu > echo [[col1, col2, col3]; [cell1, cell2, cell3] [cell4, cell5, cell6]] | rotate counter-clockwise ───┬─────────┬─────────┬───────── # │ Column0 │ Column1 │ Column2 @@ -56,11 +54,11 @@ You can also rotate counter-clockwise: ───┴─────────┴─────────┴───────── ``` -### Column rolling (andrasio) +#### Column rolling (andrasio) You are now able to move columns around in the same way you may do a bitwise-rotate. -``` +```nu > echo '00000100' | split chars | each { str to-int } @@ -76,11 +74,11 @@ You are now able to move columns around in the same way you may do a bitwise-rot ───┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴────── ``` -### Dropping columns (andrasio) +#### Dropping columns (andrasio) The new `drop column` subcommand also gives you the ability to remove the last column from a table. -``` +```nu > echo [[lib, extension]; [nu-core, rs] [rake, rb]] | drop column ───────── lib @@ -90,29 +88,29 @@ The new `drop column` subcommand also gives you the ability to remove the last c ───────── ``` -### ANSI strip (fdncred) +#### ANSI strip (fdncred) With the new [`ansi strip` command](https://github.com/nushell/nushell/pull/3095), you can remove ansi sequences from a string of text. -### Path joining (kubouch) +#### Path joining (kubouch) We now have a `path join` command which allows you to join part of a path to an existing path following the path conventions for your platform. For example, on Windows: -``` +```nu > echo 'C:\Users\viking' | path join spam.txt ``` Or Unix-based systems: -``` +```nu > echo '/home/viking' | path join spam.txt ``` -## Functionality +### Functionality -### (Experimental) Built-in table paging (rezural) +#### (Experimental) Built-in table paging (rezural) If you build Nushell with the optional `--features=table-pager` you'll see some new capabilities we're working on that will let you [view a table with a built-in pager](https://github.com/nushell/nushell/pull/3128). @@ -120,41 +118,41 @@ In the future, we'll likely move this to its own command so that you can enable Let us know how this works for you. -### Timing your pipelines (fdncred) +#### Timing your pipelines (fdncred) You can now see the time spent in the last set of commands you sent to Nushell by checking the new `$nu.env.CMD_DURATION` environment variable. This will let you, for example, add timings to your prompts for all your fancy prompt needs. -### Improved matches (ilius, kubouch) +#### Improved matches (ilius, kubouch) The `match` command has a [few new flags](https://github.com/nushell/nushell/pull/3111) to give you more control over how you'd like to match text. You're now also able to [invert the match](https://github.com/nushell/nushell/pull/3114). -### Fetch now uses the latest surf and rustls (fdncred) +#### Fetch now uses the latest surf and rustls (fdncred) We're experimenting with moving away from openssl for some commands. In this release, we've moved [`fetch` to use the latest surf](https://github.com/nushell/nushell/pull/3120), which gives us the ability to use rustls instead of openssl. Please try this out and let us know how it works for you. -### Cleaner help output (kubouch) +#### Cleaner help output (kubouch) We've cleaned up the help, so that there's now a difference between [the synopsis for a command and its full help text](https://github.com/nushell/nushell/pull/3124). This makes `help commands` output a table that's much easier to read. -### JSON order is now preserved, again (andrasio) +#### JSON order is now preserved, again (andrasio) We previously supported preserving the order of fields of JSON when serialized and deserialized, but as we changed and updated dependencies we lost this ability. In this release, it's been re-added so that [fields will preserve order](https://github.com/nushell/nushell/pull/3126) once again. -### Exit codes (tiffany352) +#### Exit codes (tiffany352) The `exit` command can now [optionally take an exit code](https://github.com/nushell/nushell/pull/3132), allowing you to quit a nushell with an exit code that can be detect outside of the shell. -### VSCode extension is now published (fdncred) +#### VSCode extension is now published (fdncred) VSCode users can now use the VSCode extension for Nushell [right from the VSCode marketplace](https://marketplace.visualstudio.com/items?itemName=TheNuProjectContributors.vscode-nushell-lang)! -## Internal +### Internal - Improved [tests for nu-env](https://github.com/nushell/nushell/pull/3078) (andrasio) - We now remove the [current directory (`.`) from paths](https://github.com/nushell/nushell/pull/3084) where possible (iCodeSometime) @@ -170,7 +168,7 @@ VSCode users can now use the VSCode extension for Nushell [right from the VSCode - [Trash functionality has been fixed](https://github.com/nushell/nushell/pull/3146) (tw4452852) - Today's crates.io release was also [fully automated, thanks to Nushell](https://github.com/nushell/nu_scripts/blob/main/nu_release.nu) (jonathandturner) -## Documentation +### Documentation - Instructions for building and [running the website locally](https://github.com/nushell/nushell.github.io/pull/109) (jakevossen5) - Updates to the [docker instructions](https://github.com/nushell/nushell.github.io/pull/108) (jakevossen5) @@ -179,7 +177,7 @@ VSCode users can now use the VSCode extension for Nushell [right from the VSCode - Corrected [Nushell version in excerpt](https://github.com/nushell/nushell.github.io/pull/104) (iCodeSometime) - Fixed a typo in the [PowerShell comparison](https://github.com/nushell/nushell.github.io/pull/103) (JTurtl3) -# Looking ahead +## Looking ahead We're continuing our 1.0 planning and hope to publish a proposal soon for your feedback. There are also some on-going experiments, including a new [line editor](https://github.com/jonathandturner/reedline) that are offering good insights into better ways of working with the terminal. diff --git a/blog/2021-03-30-nushell_0_29.md b/src/content/docs/blog/2021-03-30-nushell_0_29.md similarity index 93% rename from blog/2021-03-30-nushell_0_29.md rename to src/content/docs/blog/2021-03-30-nushell_0_29.md index bdb70690c04..575800c351b 100644 --- a/blog/2021-03-30-nushell_0_29.md +++ b/src/content/docs/blog/2021-03-30-nushell_0_29.md @@ -3,18 +3,16 @@ title: Nushell 0.29 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.29 of Nu. This release adds more polish for paths, streaming, and more. +description: Today, we're releasing 0.29 of Nu. This release adds more polish for paths, streaming, and more. --- -# Nushell 0.29 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.29 of Nu. This release adds more polish for paths, streaming, and more. <!-- more --> -# Where to get it +## Where to get it Nu 0.29 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.29.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -24,13 +22,13 @@ If you'd like to try the experimental paging feature in this release, you can in As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## New commands +### New commands - notryanb added the [`hash md5` command](https://github.com/nushell/nushell/pull/3197) -## Functionality +### Functionality - John-Goff [renamed the `count` command to `length`](https://github.com/nushell/nushell/pull/3166) - ahkrr bumped [rustyline to 8.0.0](https://github.com/nushell/nushell/pull/3167) @@ -40,7 +38,7 @@ As part of this release, we also publish a set of plugins you can install and us - stormasm added the [`$scope` variable to see into the current scope](https://github.com/nushell/nushell/pull/3203). The currently only supports seeing the aliases in scope. - DonnotPanic added [timezone support for time conversions](https://github.com/nushell/nushell/pull/3207) -## Internal +### Internal - jonathandturner fixed an issue with [input stream buffering for text](https://github.com/nushell/nushell/pull/3153) - fdncred updated the [`fetch` command for better portability](https://github.com/nushell/nushell/pull/3154) @@ -49,16 +47,16 @@ As part of this release, we also publish a set of plugins you can install and us - nibon7 fixed [running tests with `--release`](https://github.com/nushell/nushell/pull/3184) - ahkrr improved [prompt reliability](https://github.com/nushell/nushell/pull/3189) -## Documentation +### Documentation - suzanje fixed some broken [contributor book links](https://github.com/nushell/nushell/pull/3198) - mvolkmann fixed a [typo in the help text](https://github.com/nushell/nushell/pull/3216) -## Breaking changes +### Breaking changes - The [`count` command is now `length`](https://github.com/nushell/nushell/pull/3166) for better discoverability. -# Looking ahead +## Looking ahead There are a few different on-going projects to help Nushell. New this week is [engine-p](https://github.com/jonathandturner/enginep/tree/gradient_deep_dive_wip), an experimental engine that explores what an iterator+parallel approach would be like in contrast to Nu's current async stream approach. Early results are promising here, as the engine appears to perform better while also using a simpler set of patterns, which should help new contributors. diff --git a/blog/2021-04-20-nushell_0_30.md b/src/content/docs/blog/2021-04-20-nushell_0_30.md similarity index 90% rename from blog/2021-04-20-nushell_0_30.md rename to src/content/docs/blog/2021-04-20-nushell_0_30.md index 3f45a586cdf..d580adef2b6 100644 --- a/blog/2021-04-20-nushell_0_30.md +++ b/src/content/docs/blog/2021-04-20-nushell_0_30.md @@ -3,18 +3,16 @@ title: Nushell 0.30 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.30 of Nu. This release adds big improvements to performance and simplicity of the engine. +description: Today, we're releasing 0.30 of Nu. This release adds big improvements to performance and simplicity of the engine. --- -# Nushell 0.30 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.30 of Nu. This release adds big improvements to performance and simplicity of the engine. <!-- more --> -# Where to get it +## Where to get it Nu 0.30 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.30.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -24,11 +22,11 @@ If you'd like to try the experimental paging feature in this release, you can in As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## Performance improvements (jonathandturner) +### Performance improvements (jonathandturner) - + _Nu, now noticeably faster_ @@ -38,11 +36,11 @@ The end result is an engine that is both simpler and much faster. In the above e Though the performance numbers are still early, they're extremely promising. -## New built-in variable `$scope` (stevenbarragan, fdncred) +### New built-in variable `$scope` (stevenbarragan, fdncred) We're experimenting with a new built-in variable called `$scope`. This gives you access to definitions in scope, including variables. -## New Commands +### New Commands - [`math sqrt`](https://github.com/nushell/nushell/pull/3239) (luccasmmg) - [`any?` and `all?`](https://github.com/nushell/nushell/pull/3253) (andrasio) @@ -50,11 +48,11 @@ We're experimenting with a new built-in variable called `$scope`. This gives you - [`into int`](https://github.com/nushell/nushell/pull/3279) (efx) - [`query json`](https://github.com/nushell/nushell/pull/3327) (fdncred). This is a new experimental query function as we explore how we'd like to do data querying in nushell. -## Documentation (andrasio) +### Documentation (andrasio) We have a new [guide on how to create Nushell commands](https://github.com/nushell/nushell/pull/3326). -## Improvements (LhKipp, luccasmmg, waldyrious, ilius, fdncred, andrasio, DonnutPanic, ammrkn, jonathandturner, schrieveslaach, daschl, nightscape) +### Improvements (LhKipp, luccasmmg, waldyrious, ilius, fdncred, andrasio, DonnutPanic, ammrkn, jonathandturner, schrieveslaach, daschl, nightscape) - Lots of internal optimization updates: [1](https://github.com/nushell/nushell/pull/3289), [2](https://github.com/nushell/nushell/pull/3292), [3](https://github.com/nushell/nushell/pull/3300), [4](https://github.com/nushell/nushell/pull/3301), [5](https://github.com/nushell/nushell/pull/3306) - Now [appends to the history instead of replacing it](https://github.com/nushell/nushell/pull/3314) @@ -86,20 +84,20 @@ We have a new [guide on how to create Nushell commands](https://github.com/nushe - Fixed [capitalizations of Unicode](https://github.com/nushell/nushell/pull/3234) - Fixes to [path sync'ing](https://github.com/nushell/nushell/pull/3335), [more path fixes](https://github.com/nushell/nushell/pull/3336), and [improvements to dynamic blocks](https://github.com/nushell/nushell/pull/3339) -## Breaking changes +### Breaking changes -### Removed help shell +#### Removed help shell We have removed the [help shell](https://github.com/nushell/nushell/pull/3258) to simplify code. -### Removed ambiguous units +#### Removed ambiguous units We've also removed [`yr` and `mon` units](https://github.com/nushell/nushell/pull/3262) because their meaning was too confusing. -### New set of default features +#### New set of default features The [default feature list is now simpler](https://github.com/nushell/nushell/pull/3288). This means that doing a `cargo install` will give you fewer of the plugins than previously. We're still working to refine this list. Please do give feedback if these changes negatively impact you. -# Looking ahead +## Looking ahead The new engine and performance improvements should open the door for even more improvements in the future. These improvements also make it easier to explore adding more sophisticated completion logic in the future, as that logic could be written in Nushell itself. diff --git a/blog/2021-05-11-nushell_0_31.md b/src/content/docs/blog/2021-05-11-nushell_0_31.md similarity index 94% rename from blog/2021-05-11-nushell_0_31.md rename to src/content/docs/blog/2021-05-11-nushell_0_31.md index 2d6a8628520..6ba6fd26dfe 100644 --- a/blog/2021-05-11-nushell_0_31.md +++ b/src/content/docs/blog/2021-05-11-nushell_0_31.md @@ -3,18 +3,16 @@ title: Nushell 0.31 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.31 of Nu. This release includes continued polish of the engine and commands. +description: Today, we're releasing 0.31 of Nu. This release includes continued polish of the engine and commands. --- -# Nushell 0.31 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.31 of Nu. This release includes continued polish of the engine and commands. <!-- more --> -# Where to get it +## Where to get it Nu 0.31 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.31.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -24,18 +22,18 @@ If you'd like to try the experimental paging feature in this release, you can in As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New This release is largely around polish. We've continued to improve Nushell's engine to work in the more streamlined style, improved the performance of commands like `ps` and the appearance of commands like `binaryview`. -## New commands (fdncred) +### New commands (fdncred) - [`into string`](https://github.com/nushell/nushell/issues/3403) to convert values to strings - [`into binary`](https://github.com/nushell/nushell/issues/3370) to convert values to binary -## Improvements +### Improvements -### Nushell +#### Nushell - natemara fixed [a slowness in the `ps` command](https://github.com/nushell/nushell/pull/3407) - elferherrera, kubouch, stormasm, LhKipp ported commands to the new engine-p style @@ -48,23 +46,23 @@ This release is largely around polish. We've continued to improve Nushell's engi - ccde177b5fb9b8c55078417b4c9fee removed [ichwh](https://github.com/nushell/nushell/issues/3349) - LhKipp fixed an issue [in nu-env if `cd` with shortcuts](https://github.com/nushell/nushell/issues/3344) -### Extension +#### Extension - fdncred fixed [a bug in the syntax highlighting](https://github.com/nushell/vscode-nushell-lang/issues/32) -### Documentation +#### Documentation - nalpine fixed [dead links](https://github.com/nushell/nushell.github.io/issues/126) - ChristopherBiscardi updated [starship prompt integration](https://github.com/nushell/nushell.github.io/issues/125) - ammkrn updated [ls -f -> ls -la](https://github.com/nushell/nushell.github.io/issues/123) -### Nu Scripts +#### Nu Scripts - fdncred created [table grouping experiment, update twin to support single user per row](https://github.com/nushell/nu_scripts/issues/48), [twin weeknum guess](https://github.com/nushell/nu_scripts/issues/46), and a [prototype of TWiN automation script](https://github.com/nushell/nu_scripts/issues/44) - efx added [a one liner to parse aws s3 ls output](https://github.com/nushell/nu_scripts/issues/47) - jonathandturner fixed [TWiN range](https://github.com/nushell/nu_scripts/issues/45) -# Looking ahead +## Looking ahead Coming soon after the 0.31 release, we'll be landing [some improvements](https://github.com/nushell/nushell/pull/3389) to Nushell's syntax. These fixes will be breaking changes, but they're for a good reason. The simplification of the syntax will make Nushell both more consistent and more approachable for new users and experienced users alike. diff --git a/blog/2021-06-01-nushell_0_32.md b/src/content/docs/blog/2021-06-01-nushell_0_32.md similarity index 87% rename from blog/2021-06-01-nushell_0_32.md rename to src/content/docs/blog/2021-06-01-nushell_0_32.md index b117b23577b..f100c90cd26 100644 --- a/blog/2021-06-01-nushell_0_32.md +++ b/src/content/docs/blog/2021-06-01-nushell_0_32.md @@ -3,18 +3,16 @@ title: Nushell 0.32 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.32 of Nu. This release contains a large amount of usability improvements. +description: Today, we're releasing 0.32 of Nu. This release contains a large amount of usability improvements. --- -# Nushell 0.32 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.32 of Nu. This release contains a large amount of usability improvements. <!-- more --> -# Where to get it +## Where to get it Nu 0.32 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.32.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -24,50 +22,50 @@ If you'd like to try the experimental paging feature in this release, you can in As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New There are a _lot_ of new changes in this release of Nu. You can check these out by in this blog post, or, if you like, there is also an accompanying [YouTube video of 0.32 features](https://youtu.be/AqYxhJKblvY) as well as updated [Nushell samples](https://github.com/nushell/nu_scripts). -## New expression syntax (jt) +### New expression syntax (jt) We've simplified our expression/subexpression logic to make it much more predictable and universal. The parser will now automatically handle by command calls and expressions in the same way, so that you don't have to remember to use `=` to switch from one mode to the next. Before 0.32: -```shell +```nu > = 10 + 3 13 ``` With 0.32: -```shell +```nu > 10 + 3 13 ``` You can also use any value as an expression, including variables or strings: -```shell +```nu > "hello world" hello world ``` Subexpressions also follow a similar simplification. We've removed the previous `$()` style, replacing it with `()`. This allows you to put subexpressions anywhere that you want. -```shell +```nu > 10 * (3 + 2) 50 ``` -```shell +```nu > echo ((ls | length) / 2) 7 ``` This allows parens to mean "do this first" in both math expression and command calls. -## Subexpressions and column paths (jt) +### Subexpressions and column paths (jt) The new subexpressions can also use "column paths", or paths that start from the current value and travel to a subset of the structured data inside. @@ -82,14 +80,14 @@ For example, you could combine column paths with some subtraction to find when y We've also updated string interpolation to match the expression/subexpression simplification mentioned above. The same "parens mean do this first" pattern applies: -```shell +```nu > $"the result is (3 + 2)" the result is 5 ``` For interpolation that uses column paths, wrap the entire column path in a pair of parens: -```shell +```nu > $"uptime is (sys).host.uptime" uptime is [row host cpu mem temp].host.uptime @@ -99,7 +97,7 @@ uptime is 1day 19hr 57min 7sec As part of this change, we removed the previous backtick string interpolation form. -## Environment loading (lily-mara) +### Environment loading (lily-mara) In Nushell, we've worked hard to limit the amount of mutation that will happen in the system. This helps developers focus on the task at hand, and not have to think about non-local effects from the code they're running. @@ -111,7 +109,7 @@ We call it "environment loading". Here, rather than having commands mutate the g Let's try this by creating a table of three new environment variables we'll load: -```shell +```nu def activate [] { [[name, value]; [FOO, BAR] [DEBUG, TRUE] [CURRENTENV, NUSHELL]] } @@ -122,7 +120,7 @@ echo $nu.env.FOO The changes to the environment are still scoped to the block you're inside of. In the example above, because we're at the top level, we can safely shadow the previous environment values. -## Locale improvements (fdncred) +### Locale improvements (fdncred) When you have `filesize_format = "B"` set in your config.toml file you should be able to see the thousands separators based on your locale. i.e. some locales use `,` other locales use `.` and i'm not sure if there are others. @@ -132,42 +130,42 @@ This is with the `de_DE` locale on linux: (note the number separators) This is with `en-US` on windows:  -## Better line editing support (schrieveslaach, fdncred) +### Better line editing support (schrieveslaach, fdncred) -### Partial completions +#### Partial completions With 0.32, you can use ctrl+right arrow to do a partial completion from a completion hint. -### Delete word +#### Delete word You can also use alt+backspace to delete whole words. -### And more +#### And more For a full list of updated line editing capabilities, check out the update [sample keybinding file](https://github.com/nushell/nushell/blob/main/docs/sample_config/keybindings.yml). -## Explicit block parameters (jt) +### Explicit block parameters (jt) You can now name block parameters. You can use this to help make working with blocks easier to read. -```shell +```nu > ls | each { |row| echo $row.name } ``` -## `do` supports passing arguments (stepnivik) +### `do` supports passing arguments (stepnivik) You can now pass arguments to give the running block as part of a `do` call: -```shell +```nu > do { |x| $x + 100} 55 155 ``` -## New `for..in` command (jt) +### New `for..in` command (jt) With the new `for..in` command, you can write more natural iterating loops: -```shell +```nu > for $x in 1..3 { echo ($x + 10) } ───┬──── 0 │ 11 @@ -176,104 +174,104 @@ With the new `for..in` command, you can write more natural iterating loops: ───┴──── ``` -## Flags can now use equals (andrasio) +### Flags can now use equals (andrasio) You can now use `=` between a flag and its value. For example, in addition to: -```shell +```nu > seq --separator ':' 1 10 1:2:3:4:5:6:7:8:9:10 ``` You can also write: -```shell +```nu > seq --separator=':' 1 10 1:2:3:4:5:6:7:8:9:10 ``` -## Other improvements +### Other improvements -### Simple string concatenation (jt) +#### Simple string concatenation (jt) You can now create a new string by concatenating two strings `"hello " + "world"`. -### Path relative-to (kubouch) +#### Path relative-to (kubouch) Implements path relative-to subcommand. It converts the input path as a relative to the argument path, like this: -```shell +```nu > 'eggs/bacon/sausage/spam' | path relative-to 'eggs/bacon/sausage' spam ``` There are also additional [`path`-related fixes](https://github.com/nushell/nushell/pull/3441). -### Negative indexing for range (alexshadley) +#### Negative indexing for range (alexshadley) You can now pass negative ranges to the `range` command, and it will work from the back of the input. -``` +```nu > echo [1 2 3 4 5] | range (-3..) ``` Will return `[3, 4, 5]`. -### Default integer is now signed 64-bit (jt) +#### Default integer is now signed 64-bit (jt) In 0.32, adds a new primitive data type for i64 and makes it the default integer type. -### Improved filename support (ahkrr, fdncred) +#### Improved filename support (ahkrr, fdncred) Filename [quoting for #](https://github.com/nushell/nushell/pull/3524). Pipes are [also now escaped](https://github.com/nushell/nushell/pull/3489) -### sqlite improvements (Garfield96) +#### sqlite improvements (Garfield96) A panic in [sqlite support has been fixed](https://github.com/nushell/nushell/pull/3522) and the support rusqlite crate [has been updated](https://github.com/nushell/nushell/pull/3523). -### `seq` is now more nu-like (fdncred) +#### `seq` is now more nu-like (fdncred) The `seq` command is now more nushell friendly by returning numbers when it can and strings when it must. This will definitely break some scripts.  -### Case-insensitive completions are now the default on Windows (Sympatron) +#### Case-insensitive completions are now the default on Windows (Sympatron) Since Windows filenames are case-insensitive, This changes to case-insensitive completion matching by default. All other platforms still use case-sensitive matching by default. -### Porting commands to the new engine (efx, LhKipp, elferherrera) +#### Porting commands to the new engine (efx, LhKipp, elferherrera) More commands have been updated to use the new engine-p engine. -### `char` now has more characters (fdncred, kubouch) +#### `char` now has more characters (fdncred, kubouch) The `char` command now supports an [additional set of characters](https://github.com/nushell/nushell/pull/3457). It also supports the path separator character. You can use `char --list` to see the full list of available character and ansi values. -### Protect against bad config more defensively (fdncred) +#### Protect against bad config more defensively (fdncred) Nushell is now more resilient if it encounters [a bad config file](https://github.com/nushell/nushell/pull/3510). -### Better glob support for `rm` (lily-mara) +#### Better glob support for `rm` (lily-mara) The `*` wildcard should not attempt to delete files with a leading dot unless the more explicit `.*` is used. `rm *` should also not attempt to delete the current directory or its parent directory (. and ..), either. With this release, these should now be followed. -# Breaking changes +## Breaking changes - The previous math mode command `=` has been replaced by a smarter parser that can autodetect math mode based on the first token. Math mode calls like `= 10 / 2` are now simply `10 / 2`. - Invocations of the style `$()` have now been replaced by `()` subexpressions. `$(= 2 + 3)` is now `(2 + 3)` - String interpolation of the style: -```shell +```nu `the result is {{= 1 + 2}}` ``` Are now replaced with: -```shell +```nu $"the result is (1 + 2)" ``` @@ -281,7 +279,7 @@ $"the result is (1 + 2)" - The default integer is now signed 64-bit integer and not big integers. - The `unit` type has now been split into `filesize` and `duration` for better utility. -# Looking ahead +## Looking ahead Nushell 0.32 is the first version of Nushell that begins to show what the 1.0 Nushell language will feel like. The easier, and more uniform, expression and subexpression syntax will let us continue to evolve towards a language that's both easier to read and easier to write. diff --git a/blog/2021-06-22-nushell_0_33.md b/src/content/docs/blog/2021-06-22-nushell_0_33.md similarity index 92% rename from blog/2021-06-22-nushell_0_33.md rename to src/content/docs/blog/2021-06-22-nushell_0_33.md index bfc20324305..67066fa0322 100644 --- a/blog/2021-06-22-nushell_0_33.md +++ b/src/content/docs/blog/2021-06-22-nushell_0_33.md @@ -3,18 +3,16 @@ title: Nushell 0.33 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.33 of Nu. This release includes improved completions, support for pipeline variables, syntax theming and more. +description: Today, we're releasing 0.33 of Nu. This release includes improved completions, support for pipeline variables, syntax theming and more. --- -# Nushell 0.33 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.33 of Nu. This release includes improved completions, support for pipeline variables, syntax theming and more. <!-- more --> -# Where to get it +## Where to get it Nu 0.33 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.33.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -24,9 +22,9 @@ If you'd like to try the experimental paging feature in this release, you can in As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## Improved completions (fdncred, NiklasJonsson, kubouch, andrasio, jt) +### Improved completions (fdncred, NiklasJonsson, kubouch, andrasio, jt) We've begun the completion improvements that have been planned for some time. In this release, we've added completions for [alias definitions](https://github.com/nushell/nushell/pull/3594), [source imports](https://github.com/nushell/nushell/pull/3589), completions for [quoted paths](https://github.com/nushell/nushell/pull/3577), completions while [inside of a pipeline](https://github.com/nushell/nushell/pull/3575), completions in [incomplete expressions](https://github.com/nushell/nushell/pull/3564), [subcommand completions](https://github.com/nushell/nushell/pull/3571) and more. @@ -34,7 +32,7 @@ On Windows, we've [sped up path completions](https://github.com/nushell/nushell/ Behind the scenes, we've also refactored completions into their own crate, so that we can more easily grow the areas where completions are supported. -## Pipeline vars (jt) +### Pipeline vars (jt) Sometimes, when you're working on a pipeline, you want to refer to values coming in using an xargs style. With 0.33, we've introduced a new built-in variable called `$in`. The `$in` variable will collect the pipeline into a value for you, allowing you to access the whole stream as a parameter. @@ -43,31 +41,31 @@ Sometimes, when you're working on a pipeline, you want to refer to values coming 6 ``` -## New distributions (itsme-alan, zmedico) +### New distributions (itsme-alan, zmedico) You can now install Nushell from the [winget repo](https://github.com/microsoft/winget-pkgs/pull/17428) and from [gentoo](https://packages.gentoo.org/packages/app-shells/nushell). -## More natural pipeline output (jt) +### More natural pipeline output (jt) In this release, we've also relaxed some of the strictness in when output happens to always be at the end of a pipeline. In previous versions of Nushell, it was common for people to try an example like `echo "hello "; echo "world"` only to be confused why they only saw `world` in the output. Now, we treat `;` like carriage return, so that pipelines more naturally output their results just as they do at the end of lines. You can add back in the ignore ability using the new `ignore` command, which will ignore any stdout or data output from the previous command in the pipeline. For example, `ls | ignore`. -## Syntax highlighting themes (fdncred) +### Syntax highlighting themes (fdncred) - + _Nu, with configurable colors_ You can now configure the colors used in syntax highlighting. For the currently supported token types and examples, check out [the original PR](https://github.com/nushell/nushell/pull/3606). -## New commands +### New commands - nathom added [`unlet_env` to remove environment variables from the current scope](https://github.com/nushell/nushell/pull/3629) - jt added the [`ignore` command to ignore pipeline output](https://github.com/nushell/nushell/pull/3643) - fdncred added [`ansi gradient` command](https://github.com/nushell/nushell/pull/3570) -## Additional improvements +### Additional improvements - fdncred added [path and environment path separators to `char`](https://github.com/nushell/nushell/pull/3660) to allow for creating more portable scripts, fixed an issue with [error colors](https://github.com/nushell/nushell/pull/3634), added [single and double quote to char](https://github.com/nushell/nushell/pull/3601), [version now lists plugins](https://github.com/nushell/nushell/pull/3548) - efx updated [commands to engine-p style](https://github.com/nushell/nushell/pull/3649) @@ -86,6 +84,6 @@ You can now configure the colors used in syntax highlighting. For the currently - jt, LovecraftianHorror, apatrushev, sholderbach, elferherrera, inet56 added fixes to the website and docs - fdncred, efx, jt, and andrasio all added scripts and fixes to the scripts repo -# Looking ahead +## Looking ahead We're continuing to improve our dataframe support, and hope to be rolling it out a part of the default commands in the next release. Elfherrera has been [hard at work improving the dataframe support to get it ready](https://github.com/nushell/nushell/pull/3608). diff --git a/blog/2021-07-13-nushell_0_34.md b/src/content/docs/blog/2021-07-13-nushell_0_34.md similarity index 95% rename from blog/2021-07-13-nushell_0_34.md rename to src/content/docs/blog/2021-07-13-nushell_0_34.md index 6a7a7858a2a..115ac54a3f9 100644 --- a/blog/2021-07-13-nushell_0_34.md +++ b/src/content/docs/blog/2021-07-13-nushell_0_34.md @@ -3,18 +3,16 @@ title: Nushell 0.34 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.34 of Nu. This release is the first to support dataframes and also includes a set of usability improvements. +description: Today, we're releasing 0.34 of Nu. This release is the first to support dataframes and also includes a set of usability improvements. --- -# Nushell 0.34 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.34 of Nu. This release is the first to support dataframes and also includes a set of usability improvements. <!-- more --> -# Where to get it +## Where to get it Nu 0.34 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.34.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -24,21 +22,21 @@ If you'd like to try the experimental paging feature in this release, you can in As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## Dataframes (elferherrera) +### Dataframes (elferherrera) With 0.34, we've introduced a new family of commands to work with dataframes. Dataframes are an efficient way of working with large datasets by storing data as columns and offering a set of operations over them. To create a dataframe, you can use the `dataframe open` command and pass it a source file to load. This command currently supports CSV and parquet files. -``` +```nu > let df = (dataframe open .\Data7602DescendingYearOrder.csv) ``` Once loaded, there are a variety of commands you can use to interact with the dataframe (you can get the full list with `dataframe --help`). For example, to see the first few rows of the dataframe we just loaded, we can use `dataframe first`: -``` +```nu > $df | dataframe first ───┬──────────┬─────────┬──────┬───────────┬────────── @@ -56,14 +54,13 @@ Where dataframes really shine is their performance. For example, the above dataset is 5 columns and ~5.5 million rows of data. We're able to process group it by the year column, sum the results, and display it to the user in 557ms: -``` -# process.nu +```nu title="process.nu" let df = (dataframe open Data7602DescendingYearOrder.csv) let res = ($df | dataframe group-by year | dataframe aggregate sum | dataframe select geo_count) $res ``` -``` +```nu > benchmark {source process.nu} ───┬─────────────────── @@ -75,7 +72,7 @@ $res By comparison, here's the same example in pandas: -``` +```nu title="process.nu" import pandas as pd df = pd.read_csv("Data7602DescendingYearOrder.csv") @@ -83,7 +80,7 @@ res = df.groupby("year")["geo_count"].sum() print(res) ``` -``` +```nu > benchmark {python .\load.py} ───┬──────────────────────── @@ -97,15 +94,15 @@ print(res) While these results are still early, we're excited to see what can be possible using Nushell for processing large datasets. -You can learn more about dataframes, including many examples and a much more in-depth explanation, by reading the new [dataframes chapter of the Nushell book](https://www.nushell.sh/book/dataframes.html). +You can learn more about dataframes, including many examples and a much more in-depth explanation, by reading the new [dataframes chapter of the Nushell book](https://www.nushell.sh/book/dataframes). Note: while all the dataframe functionality is currently grouped behind the `dataframe` top-level command, we hope to extend support for dataframes to other common Nushell commands. -## Improved multiline support (jt) +### Improved multiline support (jt) We've extended multiline expression support to more areas. Now, you can span tables over multiple lines more naturally: -``` +```nu [ [name, value]; [foo, 2] @@ -115,28 +112,28 @@ We've extended multiline expression support to more areas. Now, you can span tab Subexpression now also span multiple lines. Everything inside of the parentheses are treated as if they were written together: -``` +```nu (echo foo | str length) ``` This also gives you a way to split up commands that have many arguments over multiple lines: -``` +```nu (echo foo bar) ``` -## Multiple shorthand environment vars (jt) +### Multiple shorthand environment vars (jt) A long-time shortcoming is now fixed in 0.34. You can now pass multiple environment shorthands to the same command: -``` +```nu > FOO=bar BAR=baz $nu.env.FOO + $nu.env.BAR barbaz ``` -## Variable completions (andrasio) +### Variable completions (andrasio) In addition to steadily improving the completion engine, we've started adding support for completions for built-in variables. @@ -144,13 +141,13 @@ You can now write `$nu.<TAB>` to complete into the built-in `$nu` variable, incl Other variables that are in scope can also have their names completed. -## New commands +### New commands - Added the [`pathvar` command for updating the PATH](https://github.com/nushell/nushell/pull/3670) (nathom) - Added a [`paste` command for pasting from clipboard](https://github.com/nushell/nushell/pull/3694) (1ntEgr8) - Added [`$nu.lang` to reflect on the current commands](https://github.com/nushell/nushell/pull/3720) (fdncred) -## Additional improvements +### Additional improvements - Updated [`into binary` to be more composable](https://github.com/nushell/nushell/pull/3758) (fdncred) - Added [unique option to `uniq`](https://github.com/nushell/nushell/pull/3754) (mcbattirola) @@ -181,7 +178,7 @@ Other variables that are in scope can also have their names completed. - Updated the Nu API surface to [expose more useful functionality](https://github.com/nushell/nushell/pull/3673) (stormasm) - Fixed a [panic during math with large durations](https://github.com/nushell/nushell/pull/3669) (luccasmmg) -# Looking ahead +## Looking ahead Work on [reedline](https://github.com/jntrnr/reedline) has steadily grown in the background, and is now nearing the time where we will explore integrating it into Nushell as Nushell's line editor. diff --git a/blog/2021-08-03-nushell_0_35.md b/src/content/docs/blog/2021-08-03-nushell_0_35.md similarity index 94% rename from blog/2021-08-03-nushell_0_35.md rename to src/content/docs/blog/2021-08-03-nushell_0_35.md index a8873185a84..ca93f3d5b80 100644 --- a/blog/2021-08-03-nushell_0_35.md +++ b/src/content/docs/blog/2021-08-03-nushell_0_35.md @@ -3,18 +3,16 @@ title: Nushell 0.35 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.35 of Nu. This release shows off a lot of dataframe progress and lots of command polish. +description: Today, we're releasing 0.35 of Nu. This release shows off a lot of dataframe progress and lots of command polish. --- -# Nushell 0.35 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.35 of Nu. This release shows off a lot of dataframe progress and lots of command polish. <!-- more --> -# Where to get it +## Where to get it Nu 0.35 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.35.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,15 +20,15 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## New commands +### New commands - [`into path`](https://github.com/nushell/nushell/pull/3811) (realcundo) - [`date humanize`](https://github.com/nushell/nushell/pull/3833) (zkat) - [`hash sha256`](https://github.com/nushell/nushell/pull/3836) (with [additional improvements](https://github.com/nushell/nushell/pull/3841)) (realcundo) -## Dataframe improvements (elferherrera) +### Dataframe improvements (elferherrera) - [Improved join operation](https://github.com/nushell/nushell/pull/3776) - [Faster CSV reading and encoding](https://github.com/nushell/nushell/pull/3781) @@ -41,7 +39,7 @@ As part of this release, we also publish a set of plugins you can install and us - [Simplified contains command](https://github.com/nushell/nushell/pull/3874) - [Pretty printing for nested dataframes](https://github.com/nushell/nushell/pull/3875) -## Additional improvements +### Additional improvements - Hinting is [now configurable](https://github.com/nushell/nushell/pull/3780) (fdncred) - [Improvements to our winget releases](https://github.com/nushell/nushell/pull/3767) and [publish workflows](https://github.com/nushell/nushell/pull/3819) (TechWatching) @@ -65,7 +63,7 @@ As part of this release, we also publish a set of plugins you can install and us - Added [support for multi-doc yaml files](https://github.com/nushell/nushell/pull/3870) (realcundo) - Added [a new crate to support Nu serialization more directly with serde](https://github.com/nushell/nushell/pull/3878) (lily-mara) -# Looking ahead +## Looking ahead We're hard at work at bringing more dataframe support into nushell itself, which will allow us to use it for more actions, and extend support to dataframes to existing commands. diff --git a/blog/2021-08-23-two-years-of-nushell.md b/src/content/docs/blog/2021-08-23-two-years-of-nushell.md similarity index 91% rename from blog/2021-08-23-two-years-of-nushell.md rename to src/content/docs/blog/2021-08-23-two-years-of-nushell.md index 1c1f9bc5569..285983d839c 100644 --- a/blog/2021-08-23-two-years-of-nushell.md +++ b/src/content/docs/blog/2021-08-23-two-years-of-nushell.md @@ -3,12 +3,10 @@ title: Two years of Nushell author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Happy birthday, Nushell! Today mark's the second year for Nushell. +description: Happy birthday, Nushell! Today mark's the second year for Nushell. --- -# Two years of Nushell - - + _Happy birthday, Nushell!_ @@ -26,7 +24,7 @@ Nushell (sometimes shortened to just Nu) is a language that allows you to easily We've started collecting examples to share with each other as Nushell grows and our skill with it grows with it. You can check them out in the [Nu Scripts repo](https://github.com/nushell/nu_scripts). - + To work with Nushell, we also published a [vscode extension](https://marketplace.visualstudio.com/items?itemName=TheNuProjectContributors.vscode-nushell-lang). @@ -38,7 +36,7 @@ We've spent a lot of time this year steadily improving areas that make Nushell - ### Nushell, the data analysis tool -A relatively new aspect of being an interactive tool for working with data is Nushell's recent adoption of supporting dataframes. Dataframes allow users to work with large datasets in an efficient way. Recent versions of Nushell, using dataframes, are able to process and aggregate data from [5 million line csv files in less than a second](https://www.nushell.sh/blog/2021-07-13-nushell_0_34.html#dataframes-elferherrera). Did we mention dataframes are fast? +A relatively new aspect of being an interactive tool for working with data is Nushell's recent adoption of supporting dataframes. Dataframes allow users to work with large datasets in an efficient way. Recent versions of Nushell, using dataframes, are able to process and aggregate data from [5 million line csv files in less than a second](https://www.nushell.sh/blog/2021-07-13-nushell_0_34#dataframes-elferherrera). Did we mention dataframes are fast? We'll be exploring how best to more-fully integrate dataframes with the rest of the Nushell features in the coming year. @@ -46,7 +44,7 @@ We'll be exploring how best to more-fully integrate dataframes with the rest of ### Seeing what Nushell will become -With 0.32, we first [got a glimpse of what the Nushell language will become](https://www.nushell.sh/blog/2021-06-01-nushell_0_32.html#new-expression-syntax-jt). With 0.34, we saw [what data processing could be](https://www.nushell.sh/blog/2021-07-13-nushell_0_34.html#dataframes-elferherrera). These recent releases help to sketch where Nushell will feel like when it hits 1.0. +With 0.32, we first [got a glimpse of what the Nushell language will become](https://www.nushell.sh/blog/2021-06-01-nushell_0_32#new-expression-syntax-jt). With 0.34, we saw [what data processing could be](https://www.nushell.sh/blog/2021-07-13-nushell_0_34#dataframes-elferherrera). These recent releases help to sketch where Nushell will feel like when it hits 1.0. One example that shows this off is the script we use every week to create the This Week in Nu newsletter. As you can see, [it's a full script](https://github.com/nushell/nu_scripts/blob/main/make_release/this_week_in_nu_release.nu) of the sort you might write in Python or Ruby. @@ -54,19 +52,19 @@ One example that shows this off is the script we use every week to create the Th We're seeing a growing amount of love for Nushell as more people try it and share their experiences. Here are some tweets from the last few weeks: - + - + - + - + - + The Nushell repo has also felt a recent surge of interest. Since this time last year, the number of stars has nearly doubled! - + _Growing interest in Nushell (shown: number of GitHub stars)_ diff --git a/blog/2021-08-24-nushell_0_36.md b/src/content/docs/blog/2021-08-24-nushell_0_36.md similarity index 91% rename from blog/2021-08-24-nushell_0_36.md rename to src/content/docs/blog/2021-08-24-nushell_0_36.md index 046b36b1466..4a37b53a62a 100644 --- a/blog/2021-08-24-nushell_0_36.md +++ b/src/content/docs/blog/2021-08-24-nushell_0_36.md @@ -3,18 +3,16 @@ title: Nushell 0.36 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.36 of Nu. This release fixes some long-standing issues with history, improves the help system, improves dataframes, and much more. +description: Today, we're releasing 0.36 of Nu. This release fixes some long-standing issues with history, improves the help system, improves dataframes, and much more. --- -# Nushell 0.36 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.36 of Nu. This release fixes some long-standing issues with history, improves the help system, improves dataframes, and much more. <!-- more --> -# Where to get it +## Where to get it Nu 0.36 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.36.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,13 +20,13 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## Help now has search (fdncred) +### Help now has search (fdncred) You can now use `help -f <term>` and search the help for text. This can come in handy if you know roughly what you want but can't remember the name of the command: -``` +```nu > help -f string ────┬──────────────────────────┬────────────────────────────────────────────────┬───────────── # │ name │ usage │ extra_usage @@ -43,31 +41,31 @@ You can now use `help -f <term>` and search the help for text. This can come in ... ``` -## Built-in tutor (jt) +### Built-in tutor (jt) In addition to the new help search, we've also started to build out a built-in Nushell tutorial. You can navigate by topic or search the help text for a string. - + We've only added a few topics so far, but we hope to grow these topics (with your help) over the coming releases. -## New commands and features +### New commands and features - [`drop nth`](https://github.com/nushell/nushell/pull/3917) - drops the given rows (andrasio) - [`PROMPT_STRING` environment variable](https://github.com/nushell/nushell/pull/3918) - configures the script to run to create the prompt directly from the environment (elferherrera) - [`zip`](https://github.com/nushell/nushell/pull/3919) - combine two lists into one list of pairs (andrasio) -## Dataframe improvements (elferherrera) +### Dataframe improvements (elferherrera) - [datetime commands](https://github.com/nushell/nushell/pull/3894) - [describe command](https://github.com/nushell/nushell/pull/3907) - [rolling and cumulative commands](https://github.com/nushell/nushell/pull/3960) -## Important bugfixes (lily-mara, gwenn, jt) +### Important bugfixes (lily-mara, gwenn, jt) A long-standing issue with history getting garbled when you have multiple shells open sending history updates is hopefully [now fixed](https://github.com/kkawakam/rustyline/pull/560). Thanks to the rustyline maintainers for helping find the root cause and creating a fix for it. -## Additional improvements +### Additional improvements - waldyrious fixed [a typo](https://github.com/nushell/nushell/pull/3890), and fixed [issue templates](https://github.com/nushell/nushell/pull/3891) - fdncred started a list of [projects that officially support Nushell](https://github.com/nushell/nushell/pull/3895) @@ -81,7 +79,7 @@ A long-standing issue with history getting garbled when you have multiple shells - filaretov fixed [unaliasing to only affect the current scope](https://github.com/nushell/nushell/pull/3936) - kubouch fixed [an issue where `source` couldn't handle paths with emojis](https://github.com/nushell/nushell/pull/3939) -# Looking ahead +## Looking ahead The ability to search help and improve a built-in tutorial gives us a lot of opportunities to make Nushell more user-friendly, especially to users who are just getting started learning what Nushell can do. If you're interested, these are some good places to [jump in and help](https://github.com/nushell/nushell/blob/main/crates/nu-command/src/commands/core_commands/tutor.rs) if you have specific topics or areas of interest. diff --git a/blog/2021-09-14-nushell_0_37.md b/src/content/docs/blog/2021-09-14-nushell_0_37.md similarity index 92% rename from blog/2021-09-14-nushell_0_37.md rename to src/content/docs/blog/2021-09-14-nushell_0_37.md index 4756777c9fe..a644ac7cbba 100644 --- a/blog/2021-09-14-nushell_0_37.md +++ b/src/content/docs/blog/2021-09-14-nushell_0_37.md @@ -3,18 +3,16 @@ title: Nushell 0.37 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.37 of Nu. This release adds a new find function, improvements to the current engine, and updates on the upcoming engine. +description: Today, we're releasing 0.37 of Nu. This release adds a new find function, improvements to the current engine, and updates on the upcoming engine. --- -# Nushell 0.37 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.37 of Nu. This release adds a new `find` function, improvements to the current engine, and updates on the upcoming engine. <!-- more --> -# Where to get it +## Where to get it Nu 0.37 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.37.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,17 +20,17 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## `find`ing data in tables +### `find`ing data in tables - + In 0.37, you now have access to a new `find` command, which can help you quickly look for data across all columns in a table. You can still reach your system's `find` command using `^` by typing `^find`. -## Additional improvements +### Additional improvements - fdncred added more [support for ansi art](https://github.com/nushell/nushell/pull/3973), and [more chars](https://github.com/nushell/nushell/pull/3975) - aminya removed shelling out in [some cases where it's not needed](https://github.com/nushell/nushell/pull/3974) @@ -45,19 +43,19 @@ You can still reach your system's `find` command using `^` by typing `^find`. - kubouch did some fixes to p[aths and the `source` command](https://github.com/nushell/nushell/pull/3998) - elferherrera updated the [prompt environment variable to PROMPT_COMMAND](https://github.com/nushell/nushell/pull/4003) to show that it is nushell code that gets run -## Engine-q +### Engine-q We've been hard at work on the upcoming set of engine updates for Nushell (codenamed 'engine-q'). These updates address some fundamental flaws in the current Nushell engine design and should help set us up for a strong engine in the future. In this section we'll talk a bit about the design of this engine and show some fun tricks it's able to do. -### Background +#### Background The current Nushell code uses a single concept for the scope that's shared between the parser and the evaluation engine. This is how definitions could be added by the parser into the scope that the engine could find them. This scope used locks to maintain thread safety. This meant that each variable lookup had the additional cost of unlocking the lock around the scope. The way this was set up also had subtle bugs with how the scope was handled, including corner cases where variables would be visible in scopes where they shouldn't be. In addition, there wasn't an easy way to do a speculative parse of content like you might with syntax highlighting or completions. -### New design +#### New design In the new design, both the parser and the engine have received a pretty thorough rework. The parser now uses an [interning system](https://en.wikipedia.org/wiki/String_interning) for its definitions, allowing the resulting parse tree to be simpler. It also has a change delta system where the parser can create a temporary working set to use, and this working set can optionally merge into the permanent state. We've also building in a lot of additional fun additions -- like typechecking! -- so you can get additional benefits from information the parser knows. @@ -67,12 +65,12 @@ As you can see, we're taking full advantage of the opportunity to fix long-stand Oh, there is one more thing. - + A big motivator for the rewrite was to make it easier to add dynamic custom completions, like the kind you use when completing a git branch while doing `git checkout`. The above gif shows a very early prototype of how we might implement this using the engine-q system. It works by running actually nushell code at completion time, getting the list of git branches as a list, and handing that list back to the completion system. The demo took less than two hours to implement using the capabilities of the new engine, and we're excited to see how we can make this more general and offer the ability for folks to create their own completions in nushell code. -# Looking ahead +## Looking ahead Engine-q offers some huge improvements to both the internals of Nushell as well as a way to finally check off tasks we know we've wanted for a long time (like git completions). If you're interested in helping out with the engine-q work, we'd love to have the help. The best place is to join us on the discord and on the engine-q repo. diff --git a/blog/2021-10-05-nushell_0_38.md b/src/content/docs/blog/2021-10-05-nushell_0_38.md similarity index 93% rename from blog/2021-10-05-nushell_0_38.md rename to src/content/docs/blog/2021-10-05-nushell_0_38.md index a0636b0d5af..78f33a3e7b8 100644 --- a/blog/2021-10-05-nushell_0_38.md +++ b/src/content/docs/blog/2021-10-05-nushell_0_38.md @@ -3,18 +3,16 @@ title: Nushell 0.38 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.38 of Nu. This release includes polish to the user interface, improvements to how columns are passed, lots of bug fixes, and updates on the upcoming engine. +description: Today, we're releasing 0.38 of Nu. This release includes polish to the user interface, improvements to how columns are passed, lots of bug fixes, and updates on the upcoming engine. --- -# Nushell 0.38 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.38 of Nu. This release includes polish to the user interface, improvements to how columns are passed, lots of bug fixes, and updates on the upcoming engine. <!-- more --> -# Where to get it +## Where to get it Nu 0.38 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.38.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,15 +20,15 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## Quickly jump to a shell (tw4452852) +### Quickly jump to a shell (tw4452852) If you've used shells, you've no doubt used the `n` and `p` commands to quickly jump between them. This can be a big time saver when you're working in multiple directories. In this release, we've added a `g` command that helps you quickly jump to a particular shell. This helps in the cases where you end up with more than two shells open and you already know what shell you want to jump to. -## Additional improvements +### Additional improvements - Improvements in [updated table cell values](https://github.com/nushell/nushell/pull/4027) (andrasio) - `update cells` command now [can take a list of columns](https://github.com/nushell/nushell/pull/4039) (ArtoLord) @@ -56,7 +54,7 @@ In this release, we've added a `g` command that helps you quickly jump to a part - Fixed [some typos in the tutor](https://github.com/nushell/nushell/pull/4051) (hojjatabdollahi) - Removed [the experimental scrolling support as it had broken](https://github.com/nushell/nushell/pull/4063) -## Engine-q +### Engine-q Engine-q continues to grow to become the upcoming engine for Nushell. Over the last three weeks, it gained basic filesystem support, improved completions, lots of new internal commands including `select`, `ps`, `sys`, and more. @@ -64,7 +62,7 @@ We've also added a full module system, a new error reporter using [miette](https It's grown to the stage that some of us are starting to dogfood using engine-q as our shell. -# Looking ahead +## Looking ahead For the next few months, as engine-q matures, we'll be contributing to both Nushell and engine-q. This will help Nushell continue to grow and help support users of Nushell. We'll also use the knowledge we get from support Nushell in how we design these last pieces of engine-q. diff --git a/blog/2021-10-26-nushell_0_39.md b/src/content/docs/blog/2021-10-26-nushell_0_39.md similarity index 91% rename from blog/2021-10-26-nushell_0_39.md rename to src/content/docs/blog/2021-10-26-nushell_0_39.md index 43b08c9afcd..0b580201a33 100644 --- a/blog/2021-10-26-nushell_0_39.md +++ b/src/content/docs/blog/2021-10-26-nushell_0_39.md @@ -3,18 +3,16 @@ title: Nushell 0.39 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.39 of Nu. This release is a bugfix release of 0.38. +description: Today, we're releasing 0.39 of Nu. This release is a bugfix release of 0.38. --- -# Nushell 0.39 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.39 of Nu. This release is a bugfix release of 0.38. <!-- more --> -# Where to get it +## Where to get it Nu 0.39 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.39.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,19 +20,19 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New - History file is now removed when the history is cleared (fdncred) - HTML selector has a regression fixed (lucassmmg) - Unused dependencies were removed (lucassmmg) - Updated clippy warnings were fixed (jt) -# Engine-q progress +## Engine-q progress You'll notice that this release is pretty light, only a set of fixes on 0.38. This is because our energy is now largely focused on engine-q. We're excited to get this in front of you. Just to tease a little of what will be possible, this week we added support for processing streams in parallel in engine-q using a new `par-each` command. We'll talk more about this as it develops. -# Looking forward +## Looking forward We're excited about what the new engine changes will bring in terms of performance, correctness, and new capabilities. If you're interested in helping out, come [join us on the discord](https://discord.gg/NtAbbGn)! diff --git a/blog/2021-11-16-nushell_0_40.md b/src/content/docs/blog/2021-11-16-nushell_0_40.md similarity index 97% rename from blog/2021-11-16-nushell_0_40.md rename to src/content/docs/blog/2021-11-16-nushell_0_40.md index 7851eab3c2c..00b987b023f 100644 --- a/blog/2021-11-16-nushell_0_40.md +++ b/src/content/docs/blog/2021-11-16-nushell_0_40.md @@ -3,18 +3,16 @@ title: Nushell 0.40 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.40 of Nu. This release is includes better table imports and much smaller release size. +description: Today, we're releasing 0.40 of Nu. This release is includes better table imports and much smaller release size. --- -# Nushell 0.40 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.40 of Nu. This release is includes better table imports and much smaller release size. <!-- more --> -# Where to get it +## Where to get it Nu 0.40 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.40.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,15 +20,15 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## Detecting columns (jt) +### Detecting columns (jt) Nushell now supports a new command: `detect columns`. This command is intended as an easy way to handle tabular data that's written as text. Commands like `ps`, `ls -l`, `netstat`, `df`, and others commonly output their output as text. With `detect columns`, you can run the external command, and convert them into Nushell's tabular data format. Let's look at an example: -``` +```nu > df Filesystem 1K-blocks Used Available Use% Mounted on udev 8108824 0 8108824 0% /dev @@ -46,7 +44,7 @@ tmpfs 1631280 128 1631152 1% /run/user/1000 The `df` command comes with most Unix-based systems and prints out a table of data for each of the devices on the system. Let's turn this into a table we can work with in Nushell: -``` +```nu > df | detect columns ───┬────────────────┬───────────┬───────────┬───────────┬──────┬────────────────┬──────────────── # │ Filesystem │ 1K-blocks │ Used │ Available │ Use% │ Mounted │ on @@ -65,7 +63,7 @@ The `df` command comes with most Unix-based systems and prints out a table of da Ahh, that's close to what we want in just one step. Let's go ahead and clean this up a little. First, let's drop that last column. "Mounted on" being two words confused the importer, but all the data is there, we just need to drop the last column. -``` +```nu > df | detect columns | drop column ───┬────────────────┬───────────┬───────────┬───────────┬──────┬──────────────── # │ Filesystem │ 1K-blocks │ Used │ Available │ Use% │ Mounted @@ -84,7 +82,7 @@ Ahh, that's close to what we want in just one step. Let's go ahead and clean thi Finally, it'd be nice to be able to have real file sizes for the middle columns, so let's convert the numbers into Nushell's filesize type: -``` +```nu > df | detect columns | drop column | into filesize 1K-blocks Used Available ───┬────────────────┬───────────┬──────────┬───────────┬──────┬──────────────── # │ Filesystem │ 1K-blocks │ Used │ Available │ Use% │ Mounted @@ -103,23 +101,23 @@ Finally, it'd be nice to be able to have real file sizes for the middle columns, In just a couple steps, we've converted the text-based table into tabular data we can use just like any other Nushell command. To make this easy to do in the future, we can alias `df` to do these steps: -``` +```nu > alias df = (^df | detect columns | drop column | into filesize 1K-blocks Used Available) ``` -## Smaller binaries (fdncred) +### Smaller binaries (fdncred) The size of the Nushell release binaries has come up as regular feedback from Nushell users. "Why does the shell have to be so big?" And we've heard you! Today's release now uses a combination of `strip` and `upx` to bring considerable savings in binary size. The Linux release (plugins incl.) has dropped from 475mb to 58mb(!!), making it **88% smaller**. We're seeing similar improvements in the sizes of the macOS and Windows releases. -## Additional fixes +### Additional fixes - Upgraded [polars dataframe support](https://github.com/nushell/nushell/pull/4122) (nmandery) - Fixed a [panic during parsing](https://github.com/nushell/nushell/pull/4107) (ahkrr) - File matching between `rm` and `ls` is now [more consistent](https://github.com/nushell/nushell/pull/4099) (yogi) -# Engine-q progress +## Engine-q progress We've also hit a milestone with engine-q: now over 100 commands have been ported to engine-q! Special thanks to onthebridgetonowhere, CBenoit, luccasmmg, stormasm, and aslynatilla for their work in these ports since the last Nushell release. @@ -127,7 +125,7 @@ We've also added support for [`$config`](https://github.com/nushell/engine-q/pul If you're interested in how some of the upcoming support for parallel processing in engine-q works, contributor JT [made a video explaining it](https://www.youtube.com/watch?v=3o8b_QcrFHc). -# Looking forward +## Looking forward We're excited to see Nushell continue to gain more ability to work with data in easier ways as well as doing so in as a much smaller binary. Progress on engine-q continues to grow, and covers a large amount of ground in the engine internals, porting commands, plugin support, modules, and more. diff --git a/blog/2021-12-07-nushell_0_41.md b/src/content/docs/blog/2021-12-07-nushell_0_41.md similarity index 93% rename from blog/2021-12-07-nushell_0_41.md rename to src/content/docs/blog/2021-12-07-nushell_0_41.md index f91fb0ab459..2c424065430 100644 --- a/blog/2021-12-07-nushell_0_41.md +++ b/src/content/docs/blog/2021-12-07-nushell_0_41.md @@ -3,18 +3,16 @@ title: Nushell 0.41 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.41 of Nu. This release is a bugfix release of 0.40. +description: Today, we're releasing 0.41 of Nu. This release is a bugfix release of 0.40. --- -# Nushell 0.41 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.41 of Nu. This release is a bugfix release of 0.41. <!-- more --> -# Where to get it +## Where to get it Nu 0.41 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.41.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,13 +20,13 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## Features +### Features - [Add -l/--login flag for compat with other shells](https://github.com/nushell/nushell/pull/4175) (ahouts) -## Fixes +### Fixes - [`save --append` will now create a file if missing](https://github.com/nushell/nushell/pull/4156) (BraulioVM) - [Upgraded dependencies](https://github.com/nushell/nushell/pull/4135) (ahkrr) @@ -39,10 +37,10 @@ As part of this release, we also publish a set of plugins you can install and us - [Clipboard capability via arboard removed](https://github.com/nushell/nushell/pull/4174) (jt) - [Removed some unnecessary allocation](https://github.com/nushell/nushell/pull/4178) (ahouts) -# Engine-q progress +## Engine-q progress As engine-q matures, our energy continues to be directed towards it. Over [80 PRs](https://github.com/nushell/engine-q/pulls?page=1&q=is%3Apr+is%3Aclosed) have been merged into engine-q since the last Nushell release. As engine-q nears readiness for early adopters to begin using it, we've begun concentrating on closing the remaining gaps in functionality so that it can be used as a daily shell. Once ready, Nushell will have its core functionality replaced by engine-q and from there on we'll be using the new engine. We're planning to change the version number significantly to reflect the jump in features. -# Looking forward +## Looking forward As we enter the holidays, the focus of the Nushell effort continues to be on engine-q. There are still [many commands left to port](https://github.com/nushell/engine-q/issues/242) and more places to jump in. If you'd like to help, come join us on the [discord](https://discord.gg/NtAbbGn). We'd be happy to show you around. diff --git a/blog/2021-12-28-nushell_0_42.md b/src/content/docs/blog/2021-12-28-nushell_0_42.md similarity index 92% rename from blog/2021-12-28-nushell_0_42.md rename to src/content/docs/blog/2021-12-28-nushell_0_42.md index bfe84db5e96..75dc3d50f31 100644 --- a/blog/2021-12-28-nushell_0_42.md +++ b/src/content/docs/blog/2021-12-28-nushell_0_42.md @@ -3,18 +3,16 @@ title: Nushell 0.42 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.42 of Nu. This release is a bugfix release of 0.41. +description: Today, we're releasing 0.42 of Nu. This release is a bugfix release of 0.41. --- -# Nushell 0.42 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.42 of Nu. This release is a bugfix release of 0.41. <!-- more --> -# Where to get it +## Where to get it Nu 0.42 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.42.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,24 +20,24 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New -## Fixes +### Fixes - Can optionally [use an insecure SSL cert](https://github.com/nushell/nushell/pull/4219) (nibon7) - Fixed a crash [when viewing text files](https://github.com/nushell/nushell/pull/4226) (nibon7) - Build fixed for [NetBSD](https://github.com/nushell/nushell/pull/4192) (0323pin) -## Breaking change +### Breaking change - For naming consistency, [`into column_path` is now `into column-path`](https://github.com/nushell/nushell/pull/4189) (hustcer) -# Engine-q progress +## Engine-q progress At this point, we're now 100% focused on getting engine-q done. Over [120 PRs](https://github.com/nushell/engine-q/pulls?page=1&q=is%3Apr+is%3Aclosed) have been merged into engine-q since the last Nushell release and another [20 PRs in reedline](https://github.com/nushell/reedline/pulls?q=is%3Apr+is%3Aclosed). Engine-q is now able to be used as a standalone shell. It includes the full set of dataframe functionality and most of the nushell commands. We aren't yet making nightly builds available, but you should be able to [clone and build engine-q](https://github.com/nushell/engine-q) on your machine in the same way you might grab the latest Nushell. As you try out engine-q, also give a read over the [in-progress breaking change list](https://github.com/nushell/engine-q/issues/522), as it shows where the new engine will differ from Nushell's current engine. -# Looking forward +## Looking forward There are still [some commands left to port](https://github.com/nushell/engine-q/issues/242) if you'd like to jump in and give porting a try. If you're interested, you can also help us by testing out engine-q itself as a shell and report your experiences with it. And of course, come join us on the [discord](https://discord.gg/NtAbbGn). We'd be happy to show you around. diff --git a/blog/2022-01-18-nushell_0_43.md b/src/content/docs/blog/2022-01-18-nushell_0_43.md similarity index 94% rename from blog/2022-01-18-nushell_0_43.md rename to src/content/docs/blog/2022-01-18-nushell_0_43.md index 9f951ecb541..7dffb88f0a6 100644 --- a/blog/2022-01-18-nushell_0_43.md +++ b/src/content/docs/blog/2022-01-18-nushell_0_43.md @@ -3,18 +3,16 @@ title: Nushell 0.43 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.43 of Nu. This release is a bugfix release of 0.42. +description: Today, we're releasing 0.43 of Nu. This release is a bugfix release of 0.42. --- -# Nushell 0.43 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing 0.43 of Nu. This release is a bugfix release of 0.42. <!-- more --> -# Where to get it +## Where to get it Nu 0.43 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.43.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,11 +20,11 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New You can now learn about some of the upcoming changes in Nushell by reading the `tutor e-q` page. It will tell you about some of the new features and breaking changes, as well as link you to the full list of changes. -## Fixes +### Fixes - Fix to the [sample configuration file](https://github.com/nushell/nushell/pull/4241) (ilius) - Fix to a [crate description](https://github.com/nushell/nushell/pull/4247) (michel-slm) @@ -34,7 +32,7 @@ You can now learn about some of the upcoming changes in Nushell by reading the ` - Update to [sysinfo support](https://github.com/nushell/nushell/pull/4261) (GuillaumeGomez) - Fix to build [on latest Rust stable + clippy](https://github.com/nushell/nushell/pull/4262) (jt) -# Engine-q progress +## Engine-q progress Engine-q is now nearly complete. Most of the commands have been ported, as has support for the `shells` feature, many reedline-related improvements, text encoding, and much more. It's now ready for early adopters to pick it up and use it as their shell, reporting any issues they find. @@ -44,7 +42,7 @@ We're hoping to merge engine-q into the main Nushell codebase after the the upco You can check out a [recent video about engine-q](https://www.youtube.com/watch?v=c18l_HPsOxs) if you'd like to see it in action. -# Looking forward +## Looking forward There are still [some commands left to port](https://github.com/nushell/engine-q/issues/242) if you'd like to jump in and give porting a try. If you're interested, you can also help us by testing out engine-q itself as a shell and report your experiences with it. And of course, come join us on the [discord](https://discord.gg/NtAbbGn). We'd be happy to show you around. diff --git a/blog/2022-02-08-nushell_0_44.md b/src/content/docs/blog/2022-02-08-nushell_0_44.md similarity index 91% rename from blog/2022-02-08-nushell_0_44.md rename to src/content/docs/blog/2022-02-08-nushell_0_44.md index 2c0edeb18eb..f2cd5388e44 100644 --- a/blog/2022-02-08-nushell_0_44.md +++ b/src/content/docs/blog/2022-02-08-nushell_0_44.md @@ -3,10 +3,10 @@ title: Nushell 0.44 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing 0.44 of Nu. This is the last release before engine-q becomes the new engine. +description: Today, we're releasing 0.44 of Nu. This is the last release before engine-q becomes the new engine. --- -# Nushell 0.44 - the calm before the storm +- the calm before the storm Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. @@ -14,7 +14,7 @@ Today, we're releasing 0.44 of Nu. This is the last release before engine-q beco <!-- more --> -# Where to get it +## Where to get it Nu 0.44 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.44.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,15 +22,15 @@ If you want all the goodies, you can install `cargo install nu --features=extra` As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What's New +## What's New The `drop nth` command can now also take a range, allowing you to drop a range of rows as well. -# It's time +## It's time Here we are. The last release before engine-q merges into Nushell main. There are an [enormous amount of changes coming](https://github.com/nushell/nushell/pull/4364), including many [breaking changes](https://github.com/nushell/nushell/issues/4305). We encourage you to take a look at the breaking changes ahead of the engine-q releases so that you're familiar with the differences in commands. -# Looking forward +## Looking forward A few things are coming up: diff --git a/blog/2022-03-01-nushell_0_59.md b/src/content/docs/blog/2022-03-01-nushell_0_59.md similarity index 90% rename from blog/2022-03-01-nushell_0_59.md rename to src/content/docs/blog/2022-03-01-nushell_0_59.md index 0f484aab50f..4e1b59703d0 100644 --- a/blog/2022-03-01-nushell_0_59.md +++ b/src/content/docs/blog/2022-03-01-nushell_0_59.md @@ -3,10 +3,10 @@ title: Nushell 0.59 (aka 0.60 beta) author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing a beta release of 0.60 of Nu. This is to get early feedback on 0.60 before it's full release in three weeks. +description: Today, we're releasing a beta release of 0.60 of Nu. This is to get early feedback on 0.60 before it's full release in three weeks. --- -# Nushell 0.59 (aka 0.60 beta) +(aka 0.60 beta) Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. @@ -14,43 +14,43 @@ Today, we're releasing a beta release of 0.60 of Nu. This is to get early feedba <!-- more --> -# What's new +## What's new We'll wait until the full release for the final set of features going into 0.60, but suffice to say it's a _lot_. Some of the main things we want to cover for this beta release: the new engine, language improvements, new plugin infrastructure, and more. -# New Engine +## New Engine You can now try out the improvements that came with engine-q as part of a Nushell release. The engine offers a lot of improvements over the previous one. You can now get much better errors, run code in parallel, run code generally faster, and more correctly. We'll be talking about this more in the full release announcement, but we'd also love your help in testing the engine as you port your code over to it. Crashes, incorrect answers, or just plain weirdness are things we'd like to work on. -# Language improvements +## Language improvements We've made a bunch of improvements to the language, from the change to `if` to allow `else`, to modules and imports, operator short-circuiting, and much more. -We're working to bring the [book up to date](https://www.nushell.sh/book/), and it's a good place to find explanations of these improvements. Be sure to also look at the [updated command documentation](https://www.nushell.sh/book/command_reference.html) for more information on the updated commands. +We're working to bring the [book up to date](https://www.nushell.sh/book/), and it's a good place to find explanations of these improvements. Be sure to also look at the [updated command documentation](https://www.nushell.sh/book/command_reference) for more information on the updated commands. -# New plugin architecture +## New plugin architecture The new plugin architecture is now multi-protocol, allowing you to pick the right protocol for your plugin. We currently support json and capnp. Rather that scanning for all new plugins on startup like we did with 0.44, there is also a new `register` command you use a plugin for use: -``` +```nu > register -e capnp ~/.cargo/bin/nu_plugin_extra_query ``` -# And more +## And more We're still hard at work finishing up the 0.60 release, and we're excited to tell you everything it can do. You'll notice some new chapters in the [book](https://www.nushell.sh/book/) on some of these, including: support for exit codes, better stderr support, new language literals for dates and binary data, a whole new line editor with an improved interface, and much more. -# One more thing +## One more thing Before we go, we thought we should mention that Nushell now supports completions for external commands. When you first start up nushell, you'll notice that it asks if you want to create a default configuration. If you say yes, and look at the file, you'll see a few of these: -``` +```nu def "nu-complete git branches" [] { ^git branch | lines | each { |line| $line | str find-replace "\* " "" | str trim } } @@ -67,6 +67,6 @@ extern "git checkout" [ These are completions for external commands (here `git checkout`) written all in Nushell. We're already getting contributions for [other completions](https://github.com/nushell/nu_scripts/tree/main/custom-completions), too! -# Looking forward +## Looking forward It's time to polish 0.60 and get it to a nice shine. Your help in testing this beta release is invaluable to help making that happen. If you'd like to help us with docs, samples, code, or anything else that crosses your mind, come join us on the [discord](https://discord.gg/NtAbbGn). diff --git a/blog/2022-03-22-nushell_0_60.md b/src/content/docs/blog/2022-03-22-nushell_0_60.md similarity index 96% rename from blog/2022-03-22-nushell_0_60.md rename to src/content/docs/blog/2022-03-22-nushell_0_60.md index 7507c492d35..6eae08862a4 100644 --- a/blog/2022-03-22-nushell_0_60.md +++ b/src/content/docs/blog/2022-03-22-nushell_0_60.md @@ -3,20 +3,18 @@ title: Nushell 0.60 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.60 of Nu. This is an enormous release, with lots of changes across all aspects of Nushell. +description: Today, we're releasing version 0.60 of Nu. This is an enormous release, with lots of changes across all aspects of Nushell. --- _Before we begin, as the Russian invasion of Ukraine still continues to threaten lives, [here](https://war.ukraine.ua) are ways you can help._ -# Nushell 0.60 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing a beta release of 0.60 of Nu. This is an enormous release, with lots of changes across all aspects of Nushell. <!-- more --> -# Where to get it +## Where to get it Nu 0.60 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.60.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -24,13 +22,13 @@ If you want all the built-in goodies, you can install `cargo install nu --all-fe As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Party! 🥳 +## Party! 🥳 It's here! 🎉🎉 We're excited to announce the first full release of Nushell using the new engine, new line editor, and so much more! -# Skipping versions +## Skipping versions The first thing you'll notice is that we're skipping from version 0.44 to 0.60. This is on purpose, you didn't miss anything! @@ -38,13 +36,13 @@ Because of the number of changes, and the number of breaking changes, we wanted Let's talk about the features new in this release. -# Custom completions +## Custom completions - + Let's start with Nushell's most-requested feature: custom completions. The long-awaited, long-requested feature of having nice completions is finally here. With 0.60, you'll be able to write scripts that help you complete parameters and flag values. Let's take a look at an example. When you create a new config, you'll see a section like this: -``` +```nu # This is a simplified version of completions for git branches and git remotes def "nu-complete git branches" [] { ^git branch | lines | each { |line| $line | str find-replace '\* ' '' | str trim } @@ -57,7 +55,7 @@ def "nu-complete git remotes" [] { To call these function at the right time, we need to tell Nushell which parameter can complete with them. -``` +```nu extern "git checkout" [ branch?: string@"nu-complete git branches" # name of the branch to checkout -b: string # create and checkout a new branch @@ -72,21 +70,21 @@ You may also notice the `@` followed by the name of the completion function. Thi We've already seen early adopters starting to write their own completions for other commands, and we're excited to see what people will do. -# A new config file +## A new config file With 0.60, we've moved away from the .toml style of config to a config built from a Nushell script. We've found this to be both more intuitive and much easier to work with. When you first start up Nushell, you'll be asked if you'd like to create a default config file. This is a great way to see the new defaults and to change them to meet your needs. You'll also see some examples in how to modify the stylings, prompt, keybindings, and external completions. -# Table improvements +## Table improvements - + Tables can now be configured to show a footer with the column names. Nushell will now also respect your `LS_COLORS` environment variable if set. If it's not set, Nushell will provide a default 8-bit setting so people with color terminal can see file types in different colors as seen below in the following screenshots. -# Language improvements +## Language improvements There's quite a list of changes to the language itself. Let's talk about each one to help you transition to the new Nushell: @@ -94,7 +92,7 @@ There's quite a list of changes to the language itself. Let's talk about each on With 0.60, Nushell now divides strings into two types: strings with escape characters and strings without. The escaping case is written with double-quotes (`"`) and the non-escaping case is written with single-quotes (`'`): -``` +```nu > "hello\nworld" hello world @@ -106,7 +104,7 @@ Nushell will prefer the single-quotes for things like path names that include sp The difference in double-quoted and single-quoted strings also extends to interpolated strings (`$""` and `$''`): -``` +```nu > let x = 100 > $"value is:\n($x)" value is: @@ -123,7 +121,7 @@ The 0.60 release also brings with it a number of new value forms. You now can write a record, or a list of key/value pairs, as a native data type in Nushell: -``` +```nu > {name: "Bob", age: 10} ╭──────┬─────╮ │ name │ Bob │ @@ -135,7 +133,7 @@ You now can write a record, or a list of key/value pairs, as a native data type With the introduction of records, a second way to define a table is a list (or stream) of records: -``` +```nu > seq 3 | each { |x| { name: Bob, x: $x } } # name x ──────────────── @@ -156,7 +154,7 @@ Likewise, we're moving away from 'bigdecimal' to signed 64-bit float values. Earlier versions of Nushell supported dates as a value type, but they lacked a way to write them. You can now write a date literal in one of three ways: -``` +```nu # A date > 2022-02-02 @@ -173,7 +171,7 @@ These come from the [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) st Like dates, earlier versions of Nushell also supported binary data but there was no way to write a binary data literal. You're now able to write them using the `0x[...]` form: -``` +```nu > 0x[11 ff] Length: 2 (0x2) bytes | printable whitespace ascii_other non_ascii 00000000: 11 ff •× @@ -191,7 +189,7 @@ The dataframe support in 0.60 uses this feature. We've improved the syntax of Nushell in a few key places. Previously, in 0.44 you'd write: -``` +```nu > if $x < 3 { echo "true!" } { echo "false" } ``` @@ -201,7 +199,7 @@ This led to a new concept in Nushell: the keyword shape. Shapes in Nushell are a Taken together, in 0.60 we can now not only write the above like this: -``` +```nu if $x < 3 { echo "true!" } else { @@ -211,7 +209,7 @@ if $x < 3 { We can also string together multiple if/else: -``` +```nu if $x < 3 { echo "less than three" } else if $x < 10 { @@ -237,7 +235,7 @@ You can now use `get`, `skip`, and `first` on binary data to reach the bytes you Inside of Nu, the environment can now hold any kind of structured value. For example, opening the `PATH` environment variable now might look like this in macOS: -``` +```nu > $env.PATH ╭───┬─────────────────────────────────╮ │ 0 │ /opt/homebrew/opt/openssl@3/bin │ @@ -253,7 +251,7 @@ Inside of Nu, the environment can now hold any kind of structured value. For exa This allows you to more easily add and update to the environment. For example, we can add a new entry to the PATH: -``` +```nu > let-env PATH = ($env.PATH | prepend '/my/path') ``` @@ -263,7 +261,7 @@ Environment variables that aren't strings can be converted to strings automatica In this release, we're also moving to keeping the current directory in the environment as `$env.PWD`. This leads to a few interesting twists in the design. For one, this means that `cd` is now scoped to the block you're currently in. -``` +```nu > cd ./foo ./foo> do { cd ./bar } ./foo> @@ -271,13 +269,13 @@ In this release, we're also moving to keeping the current directory in the envir This allows you to more easily loop over subdirectories without having to do the bookkeeping of remembering to change back to the previous directory: -``` +```nu > ls | where type == dir | each { |it| cd $it.name; ls | length } ``` That said, it takes a little getting used to. It does mean that changing a directory in a traditional custom command won't work, as the `PWD` environment variable will reset after the call completes. To help with this, we're also introducing `def-env`, a way to work inside the caller's environment and not lose any environment changes made by the custom command: -``` +```nu > def-env my-cd [path] { cd $path } @@ -294,7 +292,7 @@ With this release, we've simplified the commands for working with tables. The tw The `select` command allows you to keep the structure of what you're working on and reduce it to only the part you want. For example, just as before you can pass `select` to get a column: -``` +```nu > ls | select name ╭────┬───────────────────╮ │ # │ name │ @@ -310,7 +308,7 @@ The `select` command allows you to keep the structure of what you're working on You can now also use `select` on rows, by passing in a row number: -``` +```nu > ls | select 1 ╭───┬─────────────────┬──────┬───────┬────────────╮ │ # │ name │ type │ size │ modified │ @@ -325,7 +323,7 @@ The other fundamental command for working with tables is `get`. Like `select`, ` Via a column: -``` +```nu > ls | get name ╭────┬───────────────────╮ │ 0 │ CNAME │ @@ -339,7 +337,7 @@ Via a column: Via a row: -``` +```nu > ls | get 1 ╭──────────┬─────────────────╮ │ name │ CONTRIBUTING.md │ @@ -353,7 +351,7 @@ You'll notice that getting rows out of a table with columns gives you back a rec You can combine working with rows and columns together into a "cell path", a way of reaching the data you want. If we only wanted to get the cell's data in row 1, column "size", we can do: -``` +```nu > ls | get size.1 ``` @@ -361,7 +359,7 @@ You can combine working with rows and columns together into a "cell path", a way When writing scripts in Nushell, often folks want to be able to build up a pipeline and line up all the pipes on the left. This is now supported in scripts: -``` +```nu ls | where size > 10kb | length @@ -373,7 +371,7 @@ A common request as more people tried Nushell was "can we have default values fo Now, you're able to set a default value for any optional parameter in your command: -``` +```nu def add-maybe-hundred [x:int, y = 100] { $x + $y } @@ -389,7 +387,7 @@ In previous versions of Nushell, you generally had easy access to the stdout of With 0.60, we've introduced the `complete` command. Running an external command and then pipeline it to `complete` runs the external to completion and then gives you the stdout, stderr, and exit code of that external. -``` +```nu > cat CNAME | complete ╭───────────┬────────────────╮ │ stdout │ www.nushell.sh │ @@ -400,7 +398,7 @@ With 0.60, we've introduced the `complete` command. Running an external command To redirect stderr, you can call through `do -i`. For example, let's say we're calling `cat` again, this time with a file that doesn't exist: -``` +```nu > do -i { cat unknown.txt } | complete ╭───────────┬─────────────────────────────────────────────╮ │ stdout │ │ @@ -415,7 +413,7 @@ You can also access the last exit code via `$env.LAST_EXIT_CODE`. With 0.60, you're now able to create your own modules, allowing you to grow to larger projects with clean interfaces between files. A module can be written either using the `module` keyword: -``` +```nu module greetings { export def greet [] { print "hello!" @@ -428,13 +426,13 @@ greet You can also make modules from whole files. We can rewrite the above using a separate file: -``` -# greetings.nu +```nu title="greetings.nu" export def greet [] { print "hello!" } +``` -# main.nu +```nu title="main.nu" use greetings.nu greet greet ``` @@ -445,7 +443,7 @@ Modules allow you to `export` custom commands and environment variables to be us You can also create your own error messages in your custom commands and send these back to the user if they call your command in the wrong way. For example, let's say you wanted to require that the user pass in a value between 1 and 10: -``` +```nu > def one-to-ten [x: int] { let span = (metadata $x).span if $x > 10 || $x < 1 { @@ -488,21 +486,21 @@ To accompany the new functionality in the language, we've also added a number of | system | `complete`, `input`, `keybindings`, `keybindings default`, `keybindings list`, `keybindings listen` | | viewers | `grid` | -# Shell improvements +## Shell improvements -## Bang bang and more +### Bang bang and more You can now use `!!` to run the previous command, or `!` followed by the row number in the `history` you'd like to run again. -We're working to bring the [book up to date](https://www.nushell.sh/book/), and it's a good place to find explanations of these improvements. Be sure to also look at the [updated command documentation](https://www.nushell.sh/book/command_reference.html) for more information on the updated commands. +We're working to bring the [book up to date](https://www.nushell.sh/book/), and it's a good place to find explanations of these improvements. Be sure to also look at the [updated command documentation](https://www.nushell.sh/book/command_reference) for more information on the updated commands. -## Better multiline editing +### Better multiline editing - + With the switch to reedline, you can also get better feedback when working on multiline edits. For example, moving to the next line, you'll now see `:::` by default preceding the extended input: -``` +```nu > do { ::: echo "hello" ::: echo "world" @@ -513,59 +511,59 @@ world You can configure the `:::` default value by setting the `PROMPT_MULTILINE_INDICATOR` environment variable. For example, the above screenshot uses ANSI to give it a bit of flare. -## Grid output +### Grid output Nushell also now has a more compact `ls` representation you can use called `grid`. - + -## Better `less` support +### Better `less` support With Nushell, you can now pipe to your preferred pager, and get a page-able output. For example, if you wanted to look at a long table, you can pipe into the `less` command (or the equivalent for your OS): -``` +```nu > ls **/* | less ``` Nushell by default will strip the ANSI colors, letting you look at the data with most pagers. -## Miette +### Miette We're moving to a new error reporter called [miette](https://github.com/zkat/miette). It's an attractive way of showing errors back while you're working in the REPL or on scripts. - + -# Reedline +## Reedline Nushell has changed its line editor and now it uses [Reedline](https://github.com/nushell/reedline). This new line editor allows for improvements and added functionality to the already awesome Nushell experience. Some of the new improvements are: -## Completions menus +### Completions menus - + Do you want to search for commands using a menu? Nushell has you covered. Press tab and a completion menu will appear with options for you to select. Based on the context different options will be available to you -## History menu +### History menu - + Your shell history can be easily accessed as well via menus. Using ctrl-x, you can search for a history item or you could just simply navigate the menu until you find what you are looking for. You can also use the history menu to compose a pipe with smaller pipes you have used before. - + -## New Keybindings +### New Keybindings Now you can define complex keybindings for nushell. For example, say you have changed your config file and want to reload it in your nushell session. You can create a special keybinding to help reload your config file: -``` +```nu { name: reload_config modifier: none @@ -580,14 +578,13 @@ want to reload it in your nushell session. You can create a special keybinding t with this keybinding every time you press F5 your config file is sourced and ready to go. Neat! -# Introducing 'nuon' +### Introducing 'nuon' As the syntax for Nushell has continued to grow and evolve, we noticed that writing data in Nushell was kinda fun. The more we played with it, the more the idea grew that we could create a data file format using the Nushell syntax for data. Thus, 'nuon' was born. With it, we now include `from nuon` and `to nuon` to help you work with the new .nuon files. Nuon is a superset of JSON, allowing you to pass JSON files and parse them as Nuon. Additionally, Nuon supports the data forms from Nushell, including compact tables, durations, filesizes, and more. -``` -# sample.nuon +```nu title="sample.nuon" [ # The nuon compact table format [[a, nuon, table]; [1, 2, 3], [4, 5, 6]], @@ -614,7 +611,7 @@ Nuon is a superset of JSON, allowing you to pass JSON files and parse them as Nu Nuon is still experimental, but we're already enjoying using it and are eager to continue to improve on it. -# Smaller release size +## Smaller release size The 0.60 release is significantly smaller than the previous 0.44 release. @@ -632,11 +629,11 @@ The 0.60 release is significantly smaller than the previous 0.44 release. | nu_0_60_0_windows.msi | 10.1 MB | | nu_0_60_0_windows.zip | 10.1 MB | -# New Engine +## New Engine Nicknamed "engine-q", the new engine grew from being a rewrite of parsing and evaluation logic into a full rewrite of Nushell itself. Done over 8 months, the final result has many improvements over the 0.44 engine. -## The new delta system +### The new delta system One powerful new aspect of the new engine is its delta system. Deltas, or change sets, let the engine stay immutable except at key phase shifts. For Nushell, after the user has hit enter in the repl, it will phase shift into parsing, then take a delta of what was given by the user. This delta may contain new definitions, new variables, new modules and more. This delta is merged into the permanent state inside of the engine. After this, the engine returns to being immutable as evaluation begins. @@ -644,27 +641,27 @@ These discrete phase shifts make it possible to limit what mutates while maintai Mutation during evaluation isn't removed, instead it's isolated to the stack. -## Stacks, the site of change +### Stacks, the site of change For evaluation, stacks are now the site of change in the engine. Stacks are represented as vectors that are passed around during evaluation. They include changes to the environment, newly shadowed variables, and more. -## Closing over variables +### Closing over variables Another important aspect of the engine and the new uses of stacks is an increased focus on correctness for how blocks work with stacks. In 0.60, we've eliminated many bugs related to variables scopes, where sometimes variables would "leak" from one scope to the next. Now, a "snapshot" of a variable's value is captured when the block is taken as a value in the system. This allows us easy access to run the block later and always have the correct state to run it with. -## Spans for better errors +### Spans for better errors Another important area of correctness we wanted to fix from previous versions of Nushell was error spans. Prior Nushell versions struggled with a very common pattern: errors that happen in code that isn't the code you just typed. For example, aliases that failed, calls to custom commands that were previously defined, and more. In 0.60, along with keeping around code that's still available for the user to call, we also keep around the original span information and original source. This allows us to give better errors for the cases where the error refers to code that's not the current line. -## Bind once, run anywhere +### Bind once, run anywhere While improving the parser and engine, we also improved how the two connected to each other. One piece of this was "binding", that is, how definition sites and use sites connect to one another. In the new engine, we use unique identifiers for all forms of definition in the engine, including variables, declarations, aliases, modules and more. During parse time, we bind the use we see against the definition in scope, and replace the use with a reference to the ID we found. With this, we can later safely export or pass the containing block without losing track of what the original code meant. -## Faster than ever before +### Faster than ever before The new engine's data representation is also quite a bit lighter than before. This allows us to evaluate scripts with less overhead. Early results are already quite positive: @@ -678,13 +675,13 @@ The new engine's data representation is also quite a bit lighter than before. Th | 0.44 | 168ms | | 0.60 | 78ms | -## Going parallel +### Going parallel The new engine has a fun trick up it's sleeve: you can effortlessly convert your scripts to run in parallel by changing `each` calls to `par-each`. For example, if we had a script that opened files that fit a certain pattern and counted their number of lines: -``` +```nu ls **/*.rs | each { |it| let num_lines = (open $it.name | lines | length) {name: $it.name, loc: $num_lines} @@ -693,7 +690,7 @@ ls **/*.rs | each { |it| We can turn this into a script that runs in parallel by changing the `each` to `par-each`: -``` +```nu ls **/*.rs | par-each { |it| let num_lines = (open $it.name | lines | length) {name: $it.name, loc: $num_lines} @@ -707,12 +704,12 @@ ls **/*.rs | par-each { |it| While further improvements are possible, it's nice to know we can get such a speedup with a four character change to our script. -# New plugin architecture +## New plugin architecture Rather that scanning for all new plugins on startup like we did with 0.44 (and taking ages to start Nu), the new `register` command stores the location and signature of your plugins, making it easier to load at start up. -``` +```nu > register -e json ~/.cargo/bin/nu_plugin_extra_query ``` @@ -721,7 +718,7 @@ Also, the new plugin architecture is now multi-protocol, allowing you to pick th By the way, you are not limited to write plugins in Rust. You can even create a python script and use it as a Nushell plugin. You only need to specify what command should be used to run the plugin -``` +```nu > register -e json -s python ~/my_plugins/plugin.py ``` @@ -731,7 +728,7 @@ Nushell now has three optional plugins (all using 'json' serialization): - `gstat`: a git stats viewer - `query`: a set of three commands for querying data -# Breaking changes +## Breaking changes There are quite a number of breaking changes as we fixed design flaws, cleaned up the design, and rethought how commands should work. @@ -777,11 +774,11 @@ There are quite a number of breaking changes as we fixed design flaws, cleaned u You can find out more on [the full breaking changes list](https://github.com/nushell/nushell/issues/4305). -# Acknowledgements +## Acknowledgements A big "thank you!" to everyone who helped us build this version of Nushell! -``` +```nu ╭────┬─────────────────────────────────╮ │ 0 │ Access │ │ 1 │ adamijak │ @@ -872,6 +869,6 @@ A big "thank you!" to everyone who helped us build this version of Nushell! ╰────┴─────────────────────────────────╯ ``` -# Looking ahead +## Looking ahead With 0.60, we have a solid foundation to build on to reach 1.0. The cleaner architecture and improvements to the language will make way for future improvements, like pattern matching, tasks, and more. diff --git a/blog/2022-04-12-nushell_0_61.md b/src/content/docs/blog/2022-04-12-nushell_0_61.md similarity index 94% rename from blog/2022-04-12-nushell_0_61.md rename to src/content/docs/blog/2022-04-12-nushell_0_61.md index 2ab31ea0dd9..aeee5923d91 100644 --- a/blog/2022-04-12-nushell_0_61.md +++ b/src/content/docs/blog/2022-04-12-nushell_0_61.md @@ -3,18 +3,16 @@ title: Nushell 0.61 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.61 of Nu. This release includes UI improvements, many bugfixes, improved glob support, and more. +description: Today, we're releasing version 0.61 of Nu. This release includes UI improvements, many bugfixes, improved glob support, and more. --- -# Nushell 0.61 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing version 0.61 of Nu. This release includes UI improvements, many bugfixes, improved glob support, and more. <!-- more --> -# Where to get it +## Where to get it Nu 0.61 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.61.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,9 +20,9 @@ If you want all the built-in goodies, you can install `cargo install nu --all-fe As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Help Menu (elferherrera) +## Help Menu (elferherrera) - + In 0.61, you can now use `<ctrl+q>` to ask a question/query in Nushell. Currently, this will search through the commands and show you commands that mention the word you type. @@ -32,17 +30,17 @@ Tab lets you move between the available commands. You can use up/down to pick the example you'd like to use. Pressing enter will select the example and insert it into the input for you. -# Completion descriptions (elferherrera, fdncred, jt) +## Completion descriptions (elferherrera, fdncred, jt) - + Completions now show you a description of the command you're completing, if it's available. -# Introducing 'env.nu' (kubouch) +## Introducing 'env.nu' (kubouch) Just as we added 'config.nu' with 0.60, we're now adding a new additional startup file called 'env.nu'. The job of this file is to set up the environment that you'll run Nushell in. As a result, you're able to set up important environment variables like `$env.NU_LIB_DIRS` before 'config.nu' begins to run, let you take full advantage of the new library directories you've configured. -# Features +## Features - `input` can now [suppress output](https://github.com/nushell/nushell/pull/5017) (dev-msp) - [Termux/Android target support for new engine](https://github.com/nushell/nushell/pull/4956) (dscottboggs) @@ -56,7 +54,7 @@ Just as we added 'config.nu' with 0.60, we're now adding a new additional startu - Startup and pre-prompt setup should now be [significantly faster](https://github.com/nushell/nushell/pull/5115) (jt) - [`0b[...]` support for binary literals](https://github.com/nushell/nushell/pull/5149) (merkrafter) -# Improvements +## Improvements - Parser improvements by uasi, jt, rgwood - Error improvements by jmoore34, jt, rgwood @@ -103,12 +101,12 @@ Just as we added 'config.nu' with 0.60, we're now adding a new additional startu - Fix to the [precedence parser](https://github.com/nushell/nushell/pull/4947) (jt) - Calling out through `cmd.exe` [no longer uses AutoRun](https://github.com/nushell/nushell/pull/4903) (LebsterFace) -# Breaking changes +## Breaking changes - [`str find-replace` is now `str replace`](https://github.com/nushell/nushell/pull/5120) - [`keep` is now `take`](https://github.com/nushell/nushell/pull/5123) -# Looking ahead +## Looking ahead The 0.61 release, despite slowing down a little to recoup from the 0.60 release, is one of our largest releases. We averaged over 7 PRs/day over the last three weeks, as many new people joined on and more took an interest in Nushell. diff --git a/blog/2022-05-03-nushell_0_62.md b/src/content/docs/blog/2022-05-03-nushell_0_62.md similarity index 97% rename from blog/2022-05-03-nushell_0_62.md rename to src/content/docs/blog/2022-05-03-nushell_0_62.md index 02731d8c0c5..4199c02ad50 100644 --- a/blog/2022-05-03-nushell_0_62.md +++ b/src/content/docs/blog/2022-05-03-nushell_0_62.md @@ -3,18 +3,16 @@ title: Nushell 0.62 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.62 of Nu. This release deeper integration with sqlite, new completion logic, and much more. +description: Today, we're releasing version 0.62 of Nu. This release deeper integration with sqlite, new completion logic, and much more. --- -# Nushell 0.62 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing version 0.62 of Nu. This release deeper integration with SQLite, new completion logic, and much more. <!-- more --> -# Where to get it +## Where to get it Nu 0.62 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.62.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -26,13 +24,13 @@ If you want all the built-in goodies, you can install `cargo install nu --featur As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Database connectivity (rgwood, elferherrera, fdncred) +## Database connectivity (rgwood, elferherrera, fdncred) A gap in the "Nushell story" up to this point has been that although Nushell is a language and shell focused on data, there wasn't yet any ability to query databases and work with their data. With 0.62, we take our first step in that direction. New in this release is the `db` command, which allows you to connect to a SQLite database and create a SQL query to run on it: -``` +```nu > db open db.sqlite | db from table_a | db select a @@ -44,33 +42,33 @@ With the `db open` command we open a connection to the database, then subsequent Queries can also be written as raw SQL: -``` +```nu > db open db.sqlite | db query "SELECT a FROM table_a LIMIT 10" ``` And finally, the `open` command has been updated to be SQLite-aware: -``` +```nu > open db.sqlite ``` In all of the queries above, `db open db.sqlite` could be replaced by `open db.sqlite`; `open` is able to detect databases by looking at file contents. -# Full translation of the book to Chinese (hustcer) +## Full translation of the book to Chinese (hustcer) The book is now fully translated to [Chinese (zh-CN)](https://www.nushell.sh/zh-CN/book/). Huge shout-out to hustcer for doing all the work on the translation! -# More completions (herlon214, jt) +## More completions (herlon214, jt) Nushell can now complete record fields, cell paths in variables created in previous REPL runs, and more. Starting with 0.62, Nushell will prefer to wrap filenames with spaces in backticks when completing. This allows for filenames to have single quotes, while also being compatible with upcoming improvements in filename handling. -# New commands +## New commands - [`watch`](https://github.com/nushell/nushell/pull/5331) can now watch a filepath and run a block if a change occurs (rgwood) -# Quality-of-life Improvements +## Quality-of-life Improvements - `ctrl+o` - opens your editor of choice to edit line input (elferherrera) - Make sure to set `buffer_editor` in your configuration so Nushell can find your editor @@ -84,22 +82,22 @@ Starting with 0.62, Nushell will prefer to wrap filenames with spaces in backtic - **Note:** this is a shortened list. For the full list, see the "Changelog" section below -# Breaking changes +## Breaking changes - `^=` is now `starts-with` - config is now an environment variable - To update, move `let config = ...` to `let-env config = ...` - This change was done for performance reasons and gives considerable performance improvements in some use cases. -# Looking ahead +## Looking ahead The `db` command joins the `dfr` command in a set of experiments we're working on to better understand how to integrate Nushell with a wider set of data sources. Coming up soon are "lazy dataframes". These, like the new `db` command, will allow you to build up a query against a dataframe before you execute it. This allows for much more efficient processing of the request against the data source. The Nushell design team is deep in discussions about how to make this more universal, allowing the Nushell language to build up queries lazily against a data source, and allowing the data source to perform the optimal native query. There's more research to do here, but we're looking forward to being able to take what we've learned and grow the Nushell language. In the end, we hope, you won't need separate command sets for each data source type. Instead, you'll be able to connect and build your query all in the base Nushell language. -# Changelog +## Changelog -## Nushell +### Nushell - sholderbach created [Pin reedline to v0.5.0 for the next release](https://github.com/nushell/nushell/pull/5427), and [Fix CI to run doctests again](https://github.com/nushell/nushell/pull/5410), and [Bump reedline](https://github.com/nushell/nushell/pull/5404), and [Set to reedline main branch for development cycle](https://github.com/nushell/nushell/pull/5249) - elferherrera created [added open editor event in config parsing](https://github.com/nushell/nushell/pull/5426), and [Database commands](https://github.com/nushell/nushell/pull/5417), and [Line buffer keybinding](https://github.com/nushell/nushell/pull/5390), and [Line buffer editor](https://github.com/nushell/nushell/pull/5381), and [Database commands](https://github.com/nushell/nushell/pull/5343), and [Database commands](https://github.com/nushell/nushell/pull/5307) @@ -143,7 +141,7 @@ The Nushell design team is deep in discussions about how to make this more unive - rgwood created [Initial SQLite functionality](https://github.com/nushell/nushell/pull/5182) - schrieveslaach created [Shell Integration](https://github.com/nushell/nushell/pull/5162) -## Documentation +### Documentation - hustcer created [Update zh-CN docs](https://github.com/nushell/nushell.github.io/pull/427), and [feat: Add github action related stuff](https://github.com/nushell/nushell.github.io/pull/425), and [More proofreading work for the zh-CN translations](https://github.com/nushell/nushell.github.io/pull/422), and [Fix some broken links](https://github.com/nushell/nushell.github.io/pull/421), and [Some proofreading work for zh-CN translations](https://github.com/nushell/nushell.github.io/pull/420), and [Update zh-CN translations to the latest english version of commit: b6c91cabfa](https://github.com/nushell/nushell.github.io/pull/419), and [Update some node modules](https://github.com/nushell/nushell.github.io/pull/417), and [Translate dataframes.md to zh-CN from commit: 92fb0ac2c](https://github.com/nushell/nushell.github.io/pull/415), and [Add basic config and pages for Turkish](https://github.com/nushell/nushell.github.io/pull/414), and [Add translation guide](https://github.com/nushell/nushell.github.io/pull/413), and [Translate line_editor.md to zh-CN from commit: e0688a346](https://github.com/nushell/nushell.github.io/pull/412), and [Update i18n.nu add `outdated` command to check outdated translations](https://github.com/nushell/nushell.github.io/pull/408), and [Translate coloring_and_theming.md to zh-CN from commit: f3dc86d3d](https://github.com/nushell/nushell.github.io/pull/407), and [Translate some small docs to zh-CN from commit: f5987a82d](https://github.com/nushell/nushell.github.io/pull/403), and [Fix some typo and Translate configuration & environment to zh-CN from commit: f5987a82d](https://github.com/nushell/nushell.github.io/pull/400), and [Translate lots of small docs to zh-CN from commit: ae23eeba3](https://github.com/nushell/nushell.github.io/pull/396) - reillysiemens created [Fix broken nu_scripts repo link](https://github.com/nushell/nushell.github.io/pull/426) @@ -158,7 +156,7 @@ The Nushell design team is deep in discussions about how to make this more unive - Szune created [Typo fix in 2022-04-12-nushell_0_61.md](https://github.com/nushell/nushell.github.io/pull/398) - fennewald created [Update coming_from_bash.md](https://github.com/nushell/nushell.github.io/pull/397) -## Nu scripts +### Nu scripts - fdncred created [update get_os_icon for wsl](https://github.com/nushell/nu_scripts/pull/214), and [update type-o for windows](https://github.com/nushell/nu_scripts/pull/213), and [use $nu.os-info vs (sys).host for speed](https://github.com/nushell/nu_scripts/pull/212) - raboof created [custom completions: git: 'git fetch'](https://github.com/nushell/nu_scripts/pull/210) @@ -167,7 +165,7 @@ The Nushell design team is deep in discussions about how to make this more unive - hustcer created [Fix completions for `git push` and `git checkout`](https://github.com/nushell/nu_scripts/pull/204) - ZetaNumbers created [fix: make complitions referred to undefinded "nu-complete files"](https://github.com/nushell/nu_scripts/pull/203) -## reedline +### reedline - sholderbach created [Change keybinding for external editor](https://github.com/nushell/reedline/pull/422), and [Prepare the 0.5.0 release](https://github.com/nushell/reedline/pull/421), and [Fix README and lib.rs code examples](https://github.com/nushell/reedline/pull/419), and [Add doctests back to the CI](https://github.com/nushell/reedline/pull/418), and [Vi additions and fixes by @zim0369](https://github.com/nushell/reedline/pull/417), and [Attempt fix of `ClearScrollback`](https://github.com/nushell/reedline/pull/416), and [Fix the CI badge](https://github.com/nushell/reedline/pull/415), and [Change the CI to use caching](https://github.com/nushell/reedline/pull/414), and [Add better options for screen clearing](https://github.com/nushell/reedline/pull/400), and [Add explicit `EditCommand::InsertNewline`](https://github.com/nushell/reedline/pull/399) - elferherrera created [Buffer editor keybinding](https://github.com/nushell/reedline/pull/413), and [line buffer editor](https://github.com/nushell/reedline/pull/411) diff --git a/blog/2022-05-24-nushell_0_63.md b/src/content/docs/blog/2022-05-24-nushell_0_63.md similarity index 97% rename from blog/2022-05-24-nushell_0_63.md rename to src/content/docs/blog/2022-05-24-nushell_0_63.md index f606d8caad7..dbc8e386fca 100644 --- a/blog/2022-05-24-nushell_0_63.md +++ b/src/content/docs/blog/2022-05-24-nushell_0_63.md @@ -3,18 +3,16 @@ title: Nushell 0.63 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.63 of Nu. This release is the first to include the 'overlays' feature, hooks, lazy dataframes, and more. +description: Today, we're releasing version 0.63 of Nu. This release is the first to include the 'overlays' feature, hooks, lazy dataframes, and more. --- -# Nushell 0.63 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing version 0.63 of Nu. This release is the first to include the 'overlays' feature, hooks, lazy dataframes, and more. <!-- more --> -# Where to get it +## Where to get it Nu 0.63 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.63.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,15 +20,15 @@ If you want all the built-in goodies, you can install `cargo install nu --featur As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release +## Themes of this release -## Overlays (kubouch) +### Overlays (kubouch) We've added a new concept into this release that merges a few of our previous design ideas together: overlays. You can think of overlays like layers in a paint program. They work together to give you a set of commands, environment variables, and more that you can turn on and off as needed. For example, we can create an overlay to work in: -``` +```nu (zero) > module code { export env BAZ { "baz" } } (zero) > overlay add code (code) > $env.BAZ @@ -44,13 +42,13 @@ bagr Just like layers in a paint program, changes you make (like the update to the environment above) are part of the layer. You can use `--keep-custom` to keep the changes you have made even after you hide the overlay. Using `add` and `remove` are effectively like `show` and `hide`, allowing you to quickly switch into a new context, do some work, and switch out with little effort. -## Hooks (jt) +### Hooks (jt) Starting with 0.63, you can now set up hooks that will run code under certain conditions. These hooks run after your code has finished evaluating. Let's look first at how to set up the hooks, and then see what the hooks output. To set up a hook, you pick the kind of hook and then configure a block of code to run when that hook fires: -``` +```nu hooks: { pre_prompt: [{ print "pre_prompt hook" @@ -68,7 +66,7 @@ hooks: { Using this example, we can watch the hooks fire: -``` +```nu /home/jt/Source/nushell〉cd .. pre_execution hook pre_prompt hook @@ -78,24 +76,26 @@ PWD environment variable changed from /home/jt/Source/nushell to /home/jt/Source Used together with the "overlays" feature above, we hope to open up the possibility for a lot of powerful interactions with the shell while still keeping the workflow that makes Nushell special. -## Lazy dataframe support (elferherrera) +### Lazy dataframe support (elferherrera) We are starting to support a new way to query dataframes by using lazyframes. This new concept will allow users to build logical plans for the data operations which will result in a reduction of the dataframe processing time. Lazy dataframes are accessed through the same `dfr` command and give you a way to build up a pipeline to execute in a more optimal way than the previous eager dataframes. For example, you can perform your aggregations and group-bys lazily, and then work on the results instead of paying for the processing time of having two separate steps. -# New commands +## New commands - (Returned from the engine rewrite) `histogram` for checking distributions right inside nushell (WindSoilder) - `config nu` and `config env` to easily edit your nushell configuration files with your editor of choice (Kangaxx-0/vFrankZhang) - `str title-case` (krober) - ``` + + ```nu > 'this is a test case' | str title-case This Is A Test Case ``` + - Many new `db` subcommands (elferherrera) -# Quality-of-life Improvements +## Quality-of-life Improvements - More commands contain additional search terms to find them if you don't remember their exact name. (victormanueltn, LawlietLi) This is a great way to help out by contributing! More information can be found [here](https://github.com/nushell/nushell/issues/5093). - `print -n` option to print output without an additional new-line (fdncred) @@ -103,13 +103,15 @@ Lazy dataframes are accessed through the same `dfr` command and give you a way t - We now support octal binary literals `0o[777]` similar to the hexadecimal `0x[FF]` and binary `0b[11111111]` literals (toffaletti) - `cd` accepts abbreviation of paths to quickly jump to nested directories based on unique prefixes (fdncred) - ``` + + ```nu > $env.PWD ~/some/path > cd d/s/9 > $env.PWD ~/some/path/deep/space/9 ``` + - Various improvements make the completions feel more polished (herlon214, PurityLake) - If `$config.buffer_editor` is not set rely on the `$env.EDITOR` and `$env.VISUAL` environment variables to find a text editor to edit longer pipelines or your `config ...` (Kangaxx-0/vFrankZhang, sholderbach) - When invoking `nu` to run a script you can now pass the `--config` flag to load your `config.nu` and have the definitions available when running the script (WindSoilder) @@ -117,16 +119,16 @@ Lazy dataframes are accessed through the same `dfr` command and give you a way t **Note:** this is a shortened list. For the full list, see the "Changelog" section below -# Breaking changes +## Breaking changes -## Changed default keybindings: +### Changed default keybindings | Old binding | New binding | Action | Reason for the change | | ----------- | ----------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `Ctrl-x` | `Ctrl-r` | Visual history search menu | We replaced the simple history search (previously bound to `Ctrl-r`, `cmd: SearchHistory`) with the menu that supports previewing several entries at once for quick navigation | | `Ctrl-q` | `F1` | Interactive help menu | `F1` is generally the convention for help information, with this menu you can search for commands browse through their documentation and pick examples to include/run | -# Looking ahead +## Looking ahead Here are a few of the things we're working on: @@ -136,9 +138,9 @@ Input/output types. These will allow commands to be specialized based on the inp And more - we're still looking ahead to IDE support, better database support, and more. -# Changelog +## Changelog -## Nushell +### Nushell - kubouch created [Overlay keep](https://github.com/nushell/nushell/pull/5629), and [Add Nushell REPL simulator; Fix bug in overlay add](https://github.com/nushell/nushell/pull/5478), and created [Overlays](https://github.com/nushell/nushell/pull/5375) - jt created [Bump to 0.63](https://github.com/nushell/nushell/pull/5627), and [Add environment change hook](https://github.com/nushell/nushell/pull/5600), and [Revert "Try to do less work during capture discovery"](https://github.com/nushell/nushell/pull/5561), and [Try to do less work during capture discovery](https://github.com/nushell/nushell/pull/5560), and [Try removing debuginfo for ci builds](https://github.com/nushell/nushell/pull/5549), and [Allow hooks to be lists of blocks](https://github.com/nushell/nushell/pull/5480), and [Add hooks to cli/repl](https://github.com/nushell/nushell/pull/5479), and [Bump to the 0.62.1 dev version](https://github.com/nushell/nushell/pull/5473) @@ -167,7 +169,7 @@ And more - we're still looking ahead to IDE support, better database support, an - PurityLake created [Made a change to completion resolution order](https://github.com/nushell/nushell/pull/5440) - gipsyh created [Add split number flag in `split row`](https://github.com/nushell/nushell/pull/5434) -## Documentation +### Documentation - sholderbach created [Remove outdated reference to `open` pager](https://github.com/nushell/nushell.github.io/pull/446), and [Document the octal binary literals](https://github.com/nushell/nushell.github.io/pull/445), and [Mention default values for command parameters.](https://github.com/nushell/nushell.github.io/pull/434) - unional created [docs: add `pwd` to `coming_from_bash.md`](https://github.com/nushell/nushell.github.io/pull/444) @@ -178,7 +180,7 @@ And more - we're still looking ahead to IDE support, better database support, an - TaKO8Ki created [Translate `/ja/README.md` to Japanese](https://github.com/nushell/nushell.github.io/pull/436) - flying-sheep created [Document $in](https://github.com/nushell/nushell.github.io/pull/435) -## Nu_Scripts +### Nu_Scripts - thibran created [Misc tools](https://github.com/nushell/nu_scripts/pull/229) - Suyashtnt created [feat(custom-completions): add yarn completion](https://github.com/nushell/nu_scripts/pull/228) @@ -189,7 +191,7 @@ And more - we're still looking ahead to IDE support, better database support, an - kurokirasama created [added maths, defs and weather scripts](https://github.com/nushell/nu_scripts/pull/217) - drbrain created [Allow relative entries in CDPATH](https://github.com/nushell/nu_scripts/pull/216) -## reedline +### reedline - sholderbach created [Prepare the v0.6.0 release](https://github.com/nushell/reedline/pull/430), and [Do not allocate eagerly for full history capacity](https://github.com/nushell/reedline/pull/427), and [Start developer documentation](https://github.com/nushell/reedline/pull/424) - petrisch created [Typo](https://github.com/nushell/reedline/pull/429) diff --git a/blog/2022-06-14-nushell_0_64.md b/src/content/docs/blog/2022-06-14-nushell_0_64.md similarity index 97% rename from blog/2022-06-14-nushell_0_64.md rename to src/content/docs/blog/2022-06-14-nushell_0_64.md index 47195e51be2..f7c2a06d091 100644 --- a/blog/2022-06-14-nushell_0_64.md +++ b/src/content/docs/blog/2022-06-14-nushell_0_64.md @@ -3,18 +3,16 @@ title: Nushell 0.64 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.64 of Nu. It's the first to include input overloading, input/output types, and lazy dataframes. +description: Today, we're releasing version 0.64 of Nu. It's the first to include input overloading, input/output types, and lazy dataframes. --- -# Nushell 0.64 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing version 0.64 of Nu. It's the first to include input overloading, input/output types, and lazy dataframes. <!-- more --> -# Where to get it +## Where to get it Nu 0.64 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.64.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,9 +20,9 @@ If you want all the built-in goodies, you can install `cargo install nu --featur As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release +## Themes of this release -## Input overloading (elferherrera) +### Input overloading (elferherrera) Commands can now declare their [input and output types](https://github.com/nushell/nushell/pull/5750). While this support is still initial and isn't yet available in the syntax, we're already using it for one important improvement: simplifying the commands. @@ -32,29 +30,29 @@ In this release, dataframe commands can now detect the input type in the pipelin Before: -``` +```nu > [[a b]; [1 2] [3 4]] | dfr to-df | dfr drop a ``` After: -``` +```nu > [[a b]; [1 2] [3 4]] | to-df | drop a ``` This allows dataframe commands to feel more natural and fit more cleanly in with other commands. We're also looking to make similar improvements to the `db` command. In the future, you'll be able to open a data source and then use the standard nushell commands against it, and Nushell will select the best fit based on the type of data source you're opening. -## Lazy dataframes (elferherrera) +### Lazy dataframes (elferherrera) Dataframes now have [lazy operations](https://github.com/nushell/nushell/pull/5687). These lazy operations allow users to build up multiple steps of a pipeline and execute them in a much more efficient way against the dataframe. -## Future SQLite backed history (phiresky) +### Future SQLite backed history (phiresky) The API for storing history entries has changed in the background. This now supports also storing your history in a SQLite database. Currently this adds some metadata such as the current working directory, whether a command succeeded, and execution times. In the future this will enable you to query the history in a more rich and meaningful way. Currently the simple text based history is still the default. If you want to test out the new history change your config to contain: -``` +```nu let-env config = { ... history_file_format: "sqlite" # "sqlite" or "plaintext" @@ -62,7 +60,7 @@ let-env config = { } ``` -# Improvements +## Improvements - Using Nu as a login shell now has a [special config file](https://github.com/nushell/nushell/pull/5714). (sec65) - Unix-based Nushell can now [handle SIGQUIT](https://github.com/nushell/nushell/pull/5744) (WindSoilder) @@ -70,15 +68,15 @@ let-env config = { You can see the full list in the Changelog below. -# Looking ahead +## Looking ahead The new input/output types and type overloading allows for a simpler, more uniform Nushell language. We're looking forward to continuing to improve this as well as improving the Nushell language around it. We've also recent shown an experimental [graphical version of Nushell](https://www.youtube.com/watch?v=B2aLON88New). This experiment is something you can use today across the platforms that Nushell supports. -# Changelog +## Changelog -## Nushell +### Nushell - WindSoilder created [add --values flag to sort record by values, by default, sort record by keys](https://github.com/nushell/nushell/pull/5782), and [sort not change shape](https://github.com/nushell/nushell/pull/5778), and [path join support multi path](https://github.com/nushell/nushell/pull/5775), and [fix arg parse](https://github.com/nushell/nushell/pull/5754), and [While starting nu, force PWD to be current working directory](https://github.com/nushell/nushell/pull/5751), and [handle SIGQUIT](https://github.com/nushell/nushell/pull/5744), and [add as record tag to transfer result to record](https://github.com/nushell/nushell/pull/5736), and [print warning message if meet non utf-8 path](https://github.com/nushell/nushell/pull/5731), and [fix argument type](https://github.com/nushell/nushell/pull/5695), and [expand env for path](https://github.com/nushell/nushell/pull/5692), and [make ls works better with glob](https://github.com/nushell/nushell/pull/5691), and [base64 command more friendly](https://github.com/nushell/nushell/pull/5680), and [make cp can copy folders contains dangling symbolic link](https://github.com/nushell/nushell/pull/5645), and [make sure no duplicate column exists during eval and merge](https://github.com/nushell/nushell/pull/5633) - sholderbach created [Pin reedline v0.7.0 for the nushell v0.64.0 release](https://github.com/nushell/nushell/pull/5781), and [Address lints from clippy for beta/nightly](https://github.com/nushell/nushell/pull/5709), and [Use search terms in the help menu search](https://github.com/nushell/nushell/pull/5708), and [Update nu-ansi-term to remove `Deref` impl](https://github.com/nushell/nushell/pull/5706), and [Improve internal documentation of `save` command](https://github.com/nushell/nushell/pull/5704), and [Update reedline](https://github.com/nushell/nushell/pull/5678), and [Clarify error message for `let` in pipeline](https://github.com/nushell/nushell/pull/5677), and [Update reedline: Support more bindings in vi mode](https://github.com/nushell/nushell/pull/5654), and [Improve test coverage of command examples](https://github.com/nushell/nushell/pull/5650), and [Add search terms for `describe`](https://github.com/nushell/nushell/pull/5644), and [Unpin reedline for regular development](https://github.com/nushell/nushell/pull/5634) @@ -103,7 +101,7 @@ We've also recent shown an experimental [graphical version of Nushell](https://w - tenshik created [feat: add search terms to random & typo fix](https://github.com/nushell/nushell/pull/5652) - onthebridgetonowhere created [Fix drop nth bug](https://github.com/nushell/nushell/pull/5312) -## Documentation +### Documentation - aslilac created [docs(book): Update the "Coming from Bash" page](https://github.com/nushell/nushell.github.io/pull/499) - jcjolley created [Show how to cast between number types](https://github.com/nushell/nushell.github.io/pull/498) @@ -122,7 +120,7 @@ We've also recent shown an experimental [graphical version of Nushell](https://w - kubouch created [Fix config variable name](https://github.com/nushell/nushell.github.io/pull/459), and [Add 'overlay new' tip](https://github.com/nushell/nushell.github.io/pull/457), and [Add overlays chapter](https://github.com/nushell/nushell.github.io/pull/456) - schuelermine created [book/operators.md: add `not` operator](https://github.com/nushell/nushell.github.io/pull/458) -## Nu_Scripts +### Nu_Scripts - Yethal created [Update branch-protections.nu](https://github.com/nushell/nu_scripts/pull/251), and [Add branch protections](https://github.com/nushell/nu_scripts/pull/250), and [Update remoting.nu](https://github.com/nushell/nu_scripts/pull/239), and [Update ssh script for 0.63.0](https://github.com/nushell/nu_scripts/pull/238), and [Update make-completions.nu](https://github.com/nushell/nu_scripts/pull/232) - skelly37 created [Update checker for /etc/hosts](https://github.com/nushell/nu_scripts/pull/249), and [cdpath.nu -- more clear for windows](https://github.com/nushell/nu_scripts/pull/248), and [cdpath fixed for windows](https://github.com/nushell/nu_scripts/pull/247), and [cdpath.nu moved and improved](https://github.com/nushell/nu_scripts/pull/245) @@ -132,7 +130,7 @@ We've also recent shown an experimental [graphical version of Nushell](https://w - sholderbach created [Script to gather test coverage for nushell](https://github.com/nushell/nu_scripts/pull/234) - fdncred created [use default bg color for execution time](https://github.com/nushell/nu_scripts/pull/231) -## reedline +### reedline - sholderbach created [Prepare 0.7.0 release](https://github.com/nushell/reedline/pull/440), and [Expose the `History` query functionality](https://github.com/nushell/reedline/pull/439), and [Update nu-ansi-term/update crate patch versions](https://github.com/nushell/reedline/pull/437), and [Fix clippy lints that will become warnings](https://github.com/nushell/reedline/pull/435), and [Organize the common keybindings](https://github.com/nushell/reedline/pull/433) - WindSoilder created [Don't panic when parent directory does not exist](https://github.com/nushell/reedline/pull/436) diff --git a/blog/2022-07-05-nushell-0_65.md b/src/content/docs/blog/2022-07-05-nushell-0_65.md similarity index 96% rename from blog/2022-07-05-nushell-0_65.md rename to src/content/docs/blog/2022-07-05-nushell-0_65.md index 9c24496e9d4..df0227bca7b 100644 --- a/blog/2022-07-05-nushell-0_65.md +++ b/src/content/docs/blog/2022-07-05-nushell-0_65.md @@ -3,18 +3,16 @@ title: Nushell 0.65 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.65 of Nu. This release includes better support for binary data, a new way of checking source files for correctness, improved command unification, and more. +description: Today, we're releasing version 0.65 of Nu. This release includes better support for binary data, a new way of checking source files for correctness, improved command unification, and more. --- -# Nushell 0.65 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing version 0.65 of Nu. This release includes better support for binary data, a new way of checking source files for correctness, improved command unification, and more. <!-- more --> -# Where to get it +## Where to get it Nu 0.65 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.65.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,9 +20,9 @@ If you want all the built-in goodies, you can install `cargo install nu --featur As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release +## Themes of this release -## Better support for binary data (hustcer, jt, CBenoit) +### Better support for binary data (hustcer, jt, CBenoit) Binary support in Nushell has steadily improved, and in this release, it's gotten a strong push forward. New features include: @@ -32,17 +30,17 @@ Binary support in Nushell has steadily improved, and in this release, it's gotte - A new `encode` command as well as binary support for `hash` - Improved binary support for `skip` and `take`. -## Nu-check (Kangaxx-0) +### Nu-check (Kangaxx-0) Starting with this release, Nushell now provides a `nu-check` command which can do a check over a source file for potential parsing and typechecking errors. This will make it easier for script authors to check their scripts without running them. In the future, this may also be an easy way for editors to check a script and return errors during editing. -## Unification continues (elferherrera) +### Unification continues (elferherrera) In 0.65, we've also continued the process to unify commands for different datatypes. In this release, `db` and mysql support has simplified, bringing it closer to the already existing dataframe support. Before: -``` +```nu open myfile.db | db select a | db from table_1 @@ -51,7 +49,7 @@ open myfile.db Now: -``` +```nu open myfile.db | select a | from table_1 @@ -60,17 +58,17 @@ open myfile.db Like the dataframe support, this is built on the new support to overload commands based on their input type. This will allow Nushell to have a nice, uniform syntax that just works over a variety of data types in the future. -## Additional new commands +### Additional new commands You can now use the `port` command to find the next available port. (WindSoilder) -# Looking ahead +## Looking ahead With 0.65, Nushell continues to move towards a more polished, more full-featured language that can handle a wider range of datatypes well. We're continuing to work towards this goal and find ways to continue to unify the language, allowing you to learn one language and apply that knowledge to many types of data. -# Full changelog +## Full changelog -## Nushell +### Nushell - sholderbach created [Pin reedline to new 0.8.0 release](https://github.com/nushell/nushell/pull/5954) - jt created [bump to 0.65](https://github.com/nushell/nushell/pull/5952), and [Fix 'skip' support for binary streams](https://github.com/nushell/nushell/pull/5943), and [Make `take` work like `first`](https://github.com/nushell/nushell/pull/5942), and [Binary into int](https://github.com/nushell/nushell/pull/5941), and [Rename bitwise operators for readability](https://github.com/nushell/nushell/pull/5937), and [Move input/output type from Command to Signature](https://github.com/nushell/nushell/pull/5880), and [Clippy and remove unused is_binary](https://github.com/nushell/nushell/pull/5879), and [Bump to 0.64.1 dev version](https://github.com/nushell/nushell/pull/5865) @@ -90,11 +88,11 @@ With 0.65, Nushell continues to move towards a more polished, more full-featured - wolimst created [Add Windows Terminal profile and icon in Windows control panel](https://github.com/nushell/nushell/pull/5812) - kubouch created [Add test requirements to PR template](https://github.com/nushell/nushell/pull/5809) -## Extension +### Extension - schuelermine created [Fix typo in Snippet](https://github.com/nushell/vscode-nushell-lang/pull/55) -## Documentation +### Documentation - petrisch created [DE translation for pipelines and scripts](https://github.com/nushell/nushell.github.io/pull/526), and [DE translation for working with lists and tables](https://github.com/nushell/nushell.github.io/pull/521), and [DE translation for loading data and working with strings](https://github.com/nushell/nushell.github.io/pull/512) - merelymyself created [Changes misleading example](https://github.com/nushell/nushell.github.io/pull/525), and [Links `types_of_data` page to `describe` command](https://github.com/nushell/nushell.github.io/pull/522) @@ -104,13 +102,13 @@ With 0.65, Nushell continues to move towards a more polished, more full-featured - elferherrera created [Standard command name](https://github.com/nushell/nushell.github.io/pull/511) - rgwood created [Remove MS CRT info now that we're statically linking it](https://github.com/nushell/nushell.github.io/pull/506) -## Nu Scripts +### Nu Scripts - fdncred created [update get_weather to use the new error make](https://github.com/nushell/nu_scripts/pull/261), and [add stargazer script to monitor nushell stars](https://github.com/nushell/nu_scripts/pull/260), and [add turtle benchmark and reorganize](https://github.com/nushell/nu_scripts/pull/259) - Yethal created [Added delete-merged-branches.nu](https://github.com/nushell/nu_scripts/pull/255) - skelly37 created [maths refactor](https://github.com/nushell/nu_scripts/pull/254), and [up.nu fixed](https://github.com/nushell/nu_scripts/pull/252) -## Reedline +### Reedline - sholderbach created [Prepare the 0.8.0 release](https://github.com/nushell/reedline/pull/448) - nibon7 created [Avoid subtraction overflow when using usize.](https://github.com/nushell/reedline/pull/446) diff --git a/blog/2022-07-26-nushell-0_66.md b/src/content/docs/blog/2022-07-26-nushell-0_66.md similarity index 97% rename from blog/2022-07-26-nushell-0_66.md rename to src/content/docs/blog/2022-07-26-nushell-0_66.md index add39ce68f0..45538fcd851 100644 --- a/blog/2022-07-26-nushell-0_66.md +++ b/src/content/docs/blog/2022-07-26-nushell-0_66.md @@ -3,18 +3,16 @@ title: Nushell 0.66 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.66 of Nu. This is release includes a new table output, better exit code support, and more. +description: Today, we're releasing version 0.66 of Nu. This is release includes a new table output, better exit code support, and more. --- -# Nushell 0.66 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing version 0.66 of Nu. This is release includes a new table output, better exit code support, and more. <!-- more --> -# Where to get it +## Where to get it Nu 0.66 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.66.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,29 +20,29 @@ If you want all the built-in goodies, you can install `cargo install nu --featur As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release +## Themes of this release -## New table output (zhiburt) +### New table output (zhiburt) When you pull up 0.66 and print out a table you might notice something - that it looks surprisingly similar to previous releases of Nushell. But, under the hood, something has changed. In 0.66, we've moved to a new table renderer: `tabled`. We're looking forward to really [getting creative](https://github.com/zhiburt/tabled/issues/198) with future releases and what tabled allows us to do. -## Exit codes (WindSoilder, jt) +### Exit codes (WindSoilder, jt) We've done work in this release that will cause pipelines and commands to stop a script from continuing if they hit a non-zero exit case, much in the same way as `a && b` in bash does not run `b` if `a` returns with a non-zero exit code. This has been extended to also work when running the full script, so that `nu` itself will return an non-zero exit code matching the error the script saw when it stopped. -# Looking ahead +## Looking ahead We're deep in preparations for the work that will get us to 0.80, including a lot of syntax improvements, pipeline improvements, and more. We'll be talking about these more as the design and implementation develops. From there, we're on our path to 1.0. -# Full changelog +## Full changelog -## Nushell +### Nushell - jt created [fix 0.66 nu-command crate](https://github.com/nushell/nushell/pull/6138), and [bump to 0.66](https://github.com/nushell/nushell/pull/6137), and [move to latest stable reedline](https://github.com/nushell/nushell/pull/6136), and [Revert "`extern` command should be treated as external"](https://github.com/nushell/nushell/pull/6116), and [exit with non-zero exit code when script ends with non-zero exit](https://github.com/nushell/nushell/pull/6115), and [Use simpler reedline](https://github.com/nushell/nushell/pull/6016) - merelymyself created [allow view-source to view aliases](https://github.com/nushell/nushell/pull/6135), and [remove misleading example from `source`](https://github.com/nushell/nushell/pull/6118), and [throw error if any? or all? expression invokes invalid command](https://github.com/nushell/nushell/pull/6110), and [Prevents panic when parsing JSON containing large number](https://github.com/nushell/nushell/pull/6096), and [add a fair amount of search terms](https://github.com/nushell/nushell/pull/6090), and [make `into string --decimals` add decimals to integer numbers](https://github.com/nushell/nushell/pull/6084), and [add config option to limit external command completions](https://github.com/nushell/nushell/pull/6076), and [add `split list` subcommand to split up lists](https://github.com/nushell/nushell/pull/6062), and [add `wc` search term for `size` and `length`](https://github.com/nushell/nushell/pull/6056), and [allow for easy reset of config files with a single command](https://github.com/nushell/nushell/pull/6041), and [make auto-cd change `$env.OLDPWD`](https://github.com/nushell/nushell/pull/6019), and [add `unspanned` flag to error make, add tests](https://github.com/nushell/nushell/pull/6017), and [throw parser error when multiple short flags are defined without whitespace](https://github.com/nushell/nushell/pull/6000), and [adds better error for failed string-to-duration conversions](https://github.com/nushell/nushell/pull/5977) @@ -66,7 +64,7 @@ From there, we're on our path to 1.0. - valdaarhun created [Add search terms to 'math' commands](https://github.com/nushell/nushell/pull/5990) - moxuze created [Add --directory (-D) flag to ls, list the directory itself instead of its contents](https://github.com/nushell/nushell/pull/5970) -## Documentation +### Documentation - kubouch created [Add overviews of chapters; Move Introduction to top level](https://github.com/nushell/nushell.github.io/pull/542), and [Add hooks documentation](https://github.com/nushell/nushell.github.io/pull/537) - hustcer created [Translate hooks.md to Chinese](https://github.com/nushell/nushell.github.io/pull/541), and [Update zh-CN translation for moving_around and theming](https://github.com/nushell/nushell.github.io/pull/539), and [Update some zh-CN translations](https://github.com/nushell/nushell.github.io/pull/538), and [update vuepress and related plugins](https://github.com/nushell/nushell.github.io/pull/535) @@ -75,13 +73,13 @@ From there, we're on our path to 1.0. - WindSoilder created [add light theme relative doc](https://github.com/nushell/nushell.github.io/pull/532) - fdncred created [add some new operators](https://github.com/nushell/nushell.github.io/pull/530) -## Nu_Scripts +### Nu_Scripts - Eun created [Use autojump with nushell](https://github.com/nushell/nu_scripts/pull/265), and [`select-aws-profile.nu` an alias to select an aws profile with ease](https://github.com/nushell/nu_scripts/pull/262) - WindSoilder created [fix env.PATH after conda activate](https://github.com/nushell/nu_scripts/pull/264) - fdncred created [add nana to twin script](https://github.com/nushell/nu_scripts/pull/263) -## reedline +### reedline - jt created [bump to 0.9](https://github.com/nushell/reedline/pull/454), and [Remove animations and resize repaint](https://github.com/nushell/reedline/pull/451) - fdncred created [update some deps](https://github.com/nushell/reedline/pull/453) diff --git a/blog/2022-08-16-nushell-0_67.md b/src/content/docs/blog/2022-08-16-nushell-0_67.md similarity index 92% rename from blog/2022-08-16-nushell-0_67.md rename to src/content/docs/blog/2022-08-16-nushell-0_67.md index f7bcf500455..27b3ee3f01d 100644 --- a/blog/2022-08-16-nushell-0_67.md +++ b/src/content/docs/blog/2022-08-16-nushell-0_67.md @@ -3,18 +3,16 @@ title: Nushell 0.67 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.67 of Nu. This is release includes a new variable naming convention, improvements to file modules and file sourcing, and more. +description: Today, we're releasing version 0.67 of Nu. This is release includes a new variable naming convention, improvements to file modules and file sourcing, and more. --- -# Nushell 0.67 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing version 0.67 of Nu. This is release includes a new variable naming convention, improvements to module imports and file sourcing, and more. <!-- more --> -# Where to get it +## Where to get it Nu 0.67 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.67.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,22 +20,22 @@ If you want all the built-in goodies, you can install `cargo install nu --featur As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release +## Themes of this release -## We have a new welcome banner ([fdncred](https://github.com/nushell/nushell/pull/6163)) +### We have a new welcome banner ([fdncred](https://github.com/nushell/nushell/pull/6163)) - + You can disable the banner using the `config nu` command to modify the config.nu file, just set `show_banner` to false: -``` +```nu let-env config { show_banner: false ... } ``` -## New variable naming convention ([jt](https://github.com/nushell/nushell/pull/6125)) +### New variable naming convention ([jt](https://github.com/nushell/nushell/pull/6125)) **WARNING! Breaking change!** @@ -47,15 +45,13 @@ Make sure to rename your variables from `kebab-case` to `snake_case`. This is true also for variables created from command flags. For example, a `--foo-bar` flag in a command signature will be referenced by a `$foo_bar` variable. -## Relative paths in scripts are file-relative ([kubouch](https://github.com/nushell/nushell/pull/6150)) +### Relative paths in scripts are file-relative ([kubouch](https://github.com/nushell/nushell/pull/6150)) When you use `source`, `use`, or `overlay add` with a relative path in a script or a module file, the path is assumed to be relative to the file, not the current working directory. Example: -``` -# script.nu - +```nu title="script.nu" use foo.nu * # foo.nu is assumed to be relative to script.nu ``` @@ -63,7 +59,7 @@ use foo.nu * # foo.nu is assumed to be relative to script.nu We added a fun way to create SQLite databases: -``` +```nu title="script.nu" # create a database with a single table named `main` ls | into sqlite my_ls.db @@ -73,23 +69,23 @@ ls | into sqlite my_ls.db -t foo Previously Nushell was limited to reading SQLite database files. Now we allow you to take tables or lists and create database files like `ls | into sqlite my_ls.db`. Currently this functionality works with regular table output from commands, table literals like `[[col1 col2]; [a b] [c d]]` and lists like `[one 10mib 20sec 2 2.5]`. -## Shell integration ([fdncred and Tyriar](https://github.com/nushell/nushell/pull/6087)) +### Shell integration ([fdncred and Tyriar](https://github.com/nushell/nushell/pull/6087)) @fdncred worked with @Tyriar from the Visual Studio Code team on shell integration. Now Nushell will display round blue/red/gray decorations indicating the start of commands in the [VS Code terminal](https://code.visualstudio.com/docs/terminal/shell-integration): - + -## Error Messages ([rgwood](https://github.com/nushell/nushell/pull/6256)) +### Error Messages ([rgwood](https://github.com/nushell/nushell/pull/6256)) - + The error message when an external command is not found has been improved. Nu now displays fancy [`miette`](https://github.com/zkat/miette) errors on all platforms including Windows, and it offers helpful suggestions for typos and mistaken command names. -## Windows `cmd.exe` changes ([rgwood](https://github.com/nushell/nushell/pulls?q=is%3Apr+is%3Aclosed+author%3Argwood+cmd)) +### Windows `cmd.exe` changes ([rgwood](https://github.com/nushell/nushell/pulls?q=is%3Apr+is%3Aclosed+author%3Argwood+cmd)) Potentially breaking change: Nu no longer "shells out" to `cmd.exe` for any command that can't be found - only [a few known `cmd.exe` internal commands](https://github.com/rgwood/nushell/blob/00bace9e82d3f3e3e337c510ce6cef0818ade7aa/crates/nu-command/src/system/run_external.rs#L134). This change improves error handling and error messages, but let us know if it causes you any trouble. -## Bits and Bytes (hustcer and WindSoilder) +### Bits and Bytes (hustcer and WindSoilder) Nushell now has a full array of `bits` and `bytes` commands for working with binary data. @hustcer and @WindSoilder implemented the following: @@ -99,7 +95,7 @@ Nushell now has a full array of `bits` and `bytes` commands for working with bin - [bits root command and bits and](https://github.com/nushell/nushell/pull/6188) - [bits not](https://github.com/nushell/nushell/pull/6143) -## Hiding Environment Variables ([kubouch](https://github.com/nushell/nushell/pull/6313)) +### Hiding Environment Variables ([kubouch](https://github.com/nushell/nushell/pull/6313)) A new `hide-env` command is added that can hide environment variables in the current scope. `hide` still retains this functionality, but in the future, we expect `hide` to be able to hide only parser definitions (commands and aliases). @@ -107,7 +103,7 @@ It is therefore recommended to change your `hide` calls to `hide-env` when deali Unlike `hide`, `hide-env` has a slightly different signature: It accepts multiple arguments and the arguments can be constructed dynamically: -``` +```nu > load-env { ENV_FOO: 'foo' ENV_BAR: 'bar' @@ -118,14 +114,14 @@ Unlike `hide`, `hide-env` has a slightly different signature: It accepts multipl > hide-env ($prefix + 'FOO') ($prefix + 'BAR') ``` -## Prefixed Overlays ([kubouch](https://github.com/nushell/nushell/pull/6301)) +### Prefixed Overlays ([kubouch](https://github.com/nushell/nushell/pull/6301)) The `overlay add spam` command would take all commands and aliases from the module and put them directly into the current namespace. Sometimes, however, you might want them behind a prefix. That's what `--prefix` is for. Here is an example: -``` +```nu > module spam { export def foo [] { "foo" } } @@ -136,11 +132,11 @@ Here is an example: foo ``` -## Customize Added Overlay Name ([kubouch](https://github.com/nushell/nushell/pull/6314)) +### Customize Added Overlay Name ([kubouch](https://github.com/nushell/nushell/pull/6314)) You can now change the name of the added overlay using the new `as` keyword: -``` +```nu > module spam { export def foo [] { "foo" } } > overlay add spam as eggs @@ -158,7 +154,7 @@ This can be useful if you have a generic script name, such as virtualenv's `acti It is also compatible with the `--prefix` flag introduced above. -# Next Steps +## Next Steps Time for a new engine! @@ -170,9 +166,9 @@ By the end of this, we'll be heading towards 0.80 which should have all, or most Oh, and if you're scared this will turn into another engine-q, this time our goal is to try to make the updates incrementally instead of building a new Nushell on the side and then replacing everything. -# Full changelog +## Full changelog -## Nushell +### Nushell - jt created [bump to 0.67](https://github.com/nushell/nushell/pull/6336), and [Fix intermittent test crash](https://github.com/nushell/nushell/pull/6268), and [bump dev version ahead of language changes](https://github.com/nushell/nushell/pull/6267), and [Move `ls` back to last-known-good state](https://github.com/nushell/nushell/pull/6175), and [Revert cp and mv back to last-known-good state](https://github.com/nushell/nushell/pull/6169) - skelly37 created [Bug issue template](https://github.com/nushell/nushell/pull/6329) @@ -191,12 +187,12 @@ Oh, and if you're scared this will turn into another engine-q, this time our goa - winterqt created [Allow using the system's copy of zstd for Polars](https://github.com/nushell/nushell/pull/6232) - x3rAx created [Add decimals to int when using `into string --decimals`](https://github.com/nushell/nushell/pull/6085) -## Extension +### Extension - fdncred created [one last tweak before release](https://github.com/nushell/vscode-nushell-lang/pull/58), and [prepare for new release](https://github.com/nushell/vscode-nushell-lang/pull/57), and [update gitignore](https://github.com/nushell/vscode-nushell-lang/pull/56) - Yethal created [Updated patterns and added generation script](https://github.com/nushell/vscode-nushell-lang/pull/54) -## Documentation +### Documentation - amtoine created [FIX: there is a minor typo in the modules page](https://github.com/nushell/nushell.github.io/pull/562), and [FIX: update the links to the default config files](https://github.com/nushell/nushell.github.io/pull/552) - johnae created [Update direnv.md](https://github.com/nushell/nushell.github.io/pull/561), and [Update config.js/cookbook with direnv example](https://github.com/nushell/nushell.github.io/pull/555), and [Create direnv.md](https://github.com/nushell/nushell.github.io/pull/554) @@ -208,7 +204,7 @@ Oh, and if you're scared this will turn into another engine-q, this time our goa - petrisch created [DE Translation for Coloring and Theming ](https://github.com/nushell/nushell.github.io/pull/548) - fdncred created [update gitignore](https://github.com/nushell/nushell.github.io/pull/547) -## Nu_Scripts +### Nu_Scripts - johnae created [Update direnv example to run in pre_prompt rather than env_change](https://github.com/nushell/nu_scripts/pull/276), and [Add direnv config example.](https://github.com/nushell/nu_scripts/pull/272) - fantasyzhjk created [add rbenv script](https://github.com/nushell/nu_scripts/pull/274) @@ -216,7 +212,7 @@ Oh, and if you're scared this will turn into another engine-q, this time our goa - WindSoilder created [Migrate some scripts to fit new variable and arguments naming style](https://github.com/nushell/nu_scripts/pull/268) - skelly37 created [Unspanned error](https://github.com/nushell/nu_scripts/pull/267) -## reedline +### reedline - sholderbach created [Prepare 0.10.0 release](https://github.com/nushell/reedline/pull/463), and [Clippy fix for tests](https://github.com/nushell/reedline/pull/462), and [Reduce dev-deps by narrowing `rstest` features](https://github.com/nushell/reedline/pull/458), and [Export the crossterm key types](https://github.com/nushell/reedline/pull/457), and [Update crossterm to 0.24](https://github.com/nushell/reedline/pull/447) - morzel85 created [Ctrl+h edit binding moved from emacs to common](https://github.com/nushell/reedline/pull/461) diff --git a/blog/2022-09-06-nushell-0_68.md b/src/content/docs/blog/2022-09-06-nushell-0_68.md similarity index 92% rename from blog/2022-09-06-nushell-0_68.md rename to src/content/docs/blog/2022-09-06-nushell-0_68.md index 9c8d9d27b92..cdf2afab90d 100644 --- a/blog/2022-09-06-nushell-0_68.md +++ b/src/content/docs/blog/2022-09-06-nushell-0_68.md @@ -3,18 +3,16 @@ title: Nushell 0.68 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.68 of Nu. This is release a rework of modules, a new source-env command, overlay changes, and more. +description: Today, we're releasing version 0.68 of Nu. This is release a rework of modules, a new source-env command, overlay changes, and more. --- -# Nushell 0.68 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing version 0.68 of Nu. This is release a rework of modules, a new source-env command, overlay changes, and more. <!-- more --> -# Where to get it +## Where to get it Nu 0.68 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.68.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,9 +20,9 @@ If you want all the built-in goodies, you can install `cargo install nu --featur As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release +## Themes of this release -## (Major changes!) Rework of modules and environment +### (Major changes!) Rework of modules and environment _Some of the changes here have far-reaching consequences and it might take a while to get the book up to speed._ @@ -33,28 +31,28 @@ For now, we kept also the old functionality, but in the 0.69, it will be removed It is therefore recommended to port your scripts and modules to the new style to avoid breakages in the next release. You can read a more complete write-up on the motivation and overall design in [this document](https://hackmd.io/@nucore/r1zilyw6q). -### `source` becomes `source-env` ([JT, kubouch](https://github.com/nushell/nushell/pull/6277)) +#### `source` becomes `source-env` ([JT, kubouch](https://github.com/nushell/nushell/pull/6277)) _**Note: Since the release we found out that `source-env` with a dynamic path is not viable and had to make it require a constant string or path, just like `source`. The command still works as described below but as of 0.68.1, `source-env` requires a static path as an argument. This is not where our design was supposed to land and we'll be searching for alternatives. We might also postpone the deprecation of the existing module commands beyond 0.69. Thanks for understanding.**_ One of the most common pitfalls of Nushell was trying to `source` a dynamic path, such as `source ($env.PWD | path join foo.nu)`. Since Nushell is a "compiled" language where commands and aliases are analyzed while parsing ("compiling") the code, sourcing dynamic paths is not possible for the same reason you cannot dynamically set `#include` file names in C or `use` modules in Rust. -You can read a bit more about this in [our Thinking in Nu book chapter](https://www.nushell.sh/book/thinking_in_nu.html#think-of-nushell-as-a-compiled-language). +You can read a bit more about this in [our Thinking in Nu book chapter](https://www.nushell.sh/book/thinking_in_nu#think-of-nushell-as-a-compiled-language). To address this pitfall, we decided to change `source` to `source-env` which can be used to bring in the environment, but not custom commands, aliases and variables anymore. ~~A benefit of doing so is that it is now **possible to pass dynamic paths**: `source-env ($env.PWD | path join foo.nu)` would bring in the environment from the `foo.nu` file.~~ -_How do you bring in commands and aliases without `source`?_ You need to use a module and the `use` keyword. See our book chapter [about modules](https://www.nushell.sh/book/modules.html), it's quite simple. Alternatively, you can use [overlays](https://www.nushell.sh/book/overlays.html). +_How do you bring in commands and aliases without `source`?_ You need to use a module and the `use` keyword. See our book chapter [about modules](https://www.nushell.sh/book/modules), it's quite simple. Alternatively, you can use [overlays](https://www.nushell.sh/book/overlays). _How do you bring in variables without `source`?_ This is not possible anymore. A workaround is to define a command in your module that will return the value you want. `source` still continues to work in this release but will be removed in 0.69. In 0.69, we will also change all config files to be modules, not plain scripts. -### Module environment changes ([kubouch](https://github.com/nushell/nushell/pull/6355), [kubouch](https://github.com/nushell/nushell/pull/6382)) +#### Module environment changes ([kubouch](https://github.com/nushell/nushell/pull/6355), [kubouch](https://github.com/nushell/nushell/pull/6382)) The way to define environment variables from modules used to be -``` +```nu > module spam { export env FOO { 'bar' } } @@ -73,16 +71,14 @@ Also, we simplified defining the environment in modules. Instead of defining env If you call `source-env` on that module, the `export-env` command will get evaluated and its environment kept in the current scope. -``` -# spam.nu - +```nu title="spam.nu" export-env { let-env FOO = 'foo' let-env BAR = 'bar' } ``` -``` +```nu > source-env spam.nu > $env.FOO @@ -94,7 +90,7 @@ bar This release makes `export env` deprecated and it will be removed in 0.69. -### Syntax unification ([kubouch](https://github.com/nushell/nushell/pull/6357)) +#### Syntax unification ([kubouch](https://github.com/nushell/nushell/pull/6357)) Previously, modules had some reserved syntax that was not valid in scripts: the `export` keywords. In this release, we allowed `export` keywords to be used in scripts (they do nothing: `export def` acts as `def` etc.) and thus **script syntax is a superset of module syntax**. @@ -103,16 +99,14 @@ Modules can now be evaluated. This is the reason the above example with `source- Another nice thing about the unified syntax is that commands like `nu-highlight` now do not break or do not need to rely on heuristics if they are asked to parse a module code. Any module code is a valid script code. -### Overlay changes ([kubouch](https://github.com/nushell/nushell/pull/6425), [WindSoilder](https://github.com/nushell/nushell/pull/6375)) +#### Overlay changes ([kubouch](https://github.com/nushell/nushell/pull/6425), [WindSoilder](https://github.com/nushell/nushell/pull/6375)) `overlay add` and `overlay remove` are now renamed to `overlay use` and `overlay hide` (see the breaking changes later). The functionality of these commands remains largely the same with one change being that `overlay use` will now evaluate the `export-env { }` block. Consider this module: -``` -# spam.nu - +```nu title="spam.nu" export-env { load-env { FOO: 'foo' @@ -126,7 +120,7 @@ export alias bar = 'bar' instead of: -``` +```nu > source-env spam.nu > use spam.nu * @@ -134,13 +128,13 @@ instead of: you can do just: -``` +```nu > overlay use spam.nu ``` You can think of `overlay use` as calling `source-env` and `use` in one command and putting the result into a new overlay. -### Summary +#### Summary Here is a table that summarizes the changes: @@ -159,18 +153,18 @@ Here is a table that summarizes the changes: | `env.nu` | plain script | plain script | module | | `login.nu` | plain script | plain script | module | -## Allow parentheses around command signatures ([JT](https://github.com/nushell/nushell/pull/6444)) +### Allow parentheses around command signatures ([JT](https://github.com/nushell/nushell/pull/6444)) To bring more familiarity with other languages, we added the option to define command signatures with parentheses `()` instead of only braces `[]`: -``` +```nu def foo (x: int) { $x + 100 } ``` The square braces `[]` continue to work as well. This change is intended to test it with a larger audience to decide which one we prefer the most. -## We added a new command `str distance` which implements the Levenshtein algorithm [fdncred](https://github.com/nushell/nushell/pull/6383) +### We added a new command `str distance` which implements the Levenshtein algorithm [fdncred](https://github.com/nushell/nushell/pull/6383) This example shows that the `edit distance` is one edit step difference using the Levenshtein algorithm. @@ -183,7 +177,7 @@ This example shows that the `edit distance` is one edit step difference using th We'd eventually like to add more similarity comparison functionality to nushell. -## We added string duration conversion to named durations [fdncred](https://github.com/nushell/nushell/pull/6406) +### We added string duration conversion to named durations [fdncred](https://github.com/nushell/nushell/pull/6406) The new parameter on `into duration` `--convert` allows you to convert from string durations into named durations. @@ -192,14 +186,13 @@ The new parameter on `into duration` `--convert` allows you to convert from stri 420 sec ``` -## External Completions (experimental) ([herlon214, rsteube](https://github.com/nushell/nushell/pull/6295)) +### External Completions (experimental) ([herlon214, rsteube](https://github.com/nushell/nushell/pull/6295)) In this release, we're trying out integrating Nushell with external completers, instead of relying solely on Nushell ones. It is possible to set the `external_completer` field in a config to be a block which will be evaluated if no Nushell completions were found. You can configure the block to run an external completer, such as [carapace](https://github.com/rsteube/carapace). This example should enable carapace external completions: -``` -# config.nu +```nu title="config.nu" let carapace_completer = {|spans| carapace $spans.0 nushell $spans | from json } @@ -216,9 +209,9 @@ Note that this functionality is not perfectly polished yet and in some cases the It is also possible to extend the parameters passed to the completer block that are required for other tools than carapace, such as cursor position etc. In theory, this feature could allow you to utilize any existing completions library from any shell, such as bash, as long as you can somehow get a list of completions from them. -# Breaking changes +## Breaking changes -## Renaming of `all?` to `all`, `any?` to `any`, and `empty?` to `is-empty` ([adamijak](https://github.com/nushell/nushell/pull/6464)) +### Renaming of `all?` to `all`, `any?` to `any`, and `empty?` to `is-empty` ([adamijak](https://github.com/nushell/nushell/pull/6464)) The `?` suffix on the three commands `all?`, `any?`, `empty?` did not indicate a specific meaning across other commands. Other commands returning a boolean value, like `str contains` for example, don't carry the suffix. @@ -232,7 +225,7 @@ Please update your scripts accordingly: | `any?` | `any` | | `empty?` | `is-empty` | -## Renaming `overlay` commands ([WindSoilder](https://github.com/nushell/nushell/pull/6375)) +### Renaming `overlay` commands ([WindSoilder](https://github.com/nushell/nushell/pull/6375)) | old name | new name | | ---------------- | -------------- | @@ -243,21 +236,21 @@ The main reason is that the `overlay remove` does not _really_ remove the overla It deactivates it and it can be resumed again from where you left off. Therefore, we felt like `hide` is a better word to match this functionality and aligns with our existing `use` and `hide` keywords. -## `path split` behaviour for Windows paths ([merelymyself](https://github.com/nushell/nushell/pull/6485)) +### `path split` behaviour for Windows paths ([merelymyself](https://github.com/nushell/nushell/pull/6485)) `path split` no longer returns drive letters and the root directory as separate elements for absolute Windows paths. Previously, `` `C:\temp` | path split`` returned `C:`, `\`, and `temp`. Now it returns `C:\` and `temp`. -# Next Steps +## Next Steps We've been progressing with our design towards 0.80 as outlined in [this Notion page](https://kubouch.notion.site/4db276462ba24704919edb4cc4b86be7?v=10506505557f4f7b9a65155128c04250). Some time was spent trying out possible new syntax directions but we were not confident to release them yet. In the next release we'll see a removal of features deprecated in this release and we'll continue to push ahead for the 0.80. -# Full changelog +## Full changelog -## Nushell +### Nushell - jt created [bump to 0.68](https://github.com/nushell/nushell/pull/6501), and [Reverted "Make `$` on variable names optional" (just in case)](https://github.com/nushell/nushell/pull/6446), and [Allow parens around signatures](https://github.com/nushell/nushell/pull/6444), and [Make `$` on variable names optional](https://github.com/nushell/nushell/pull/6434), and [Move from `source` to `source-env`](https://github.com/nushell/nushell/pull/6277) - sholderbach created [Pin reedline to 0.11.0 release](https://github.com/nushell/nushell/pull/6497), and [Terminate REPL if not connected to tty input](https://github.com/nushell/nushell/pull/6480), and [Fix search terms for `str distance`](https://github.com/nushell/nushell/pull/6398), and [[Experiment] Reenable CI build cache for tests](https://github.com/nushell/nushell/pull/6390), and [Test command names and search terms for redundancy](https://github.com/nushell/nushell/pull/6380) @@ -279,7 +272,7 @@ Some time was spent trying out possible new syntax directions but we were not co - dbuch created [Fix slice indexing](https://github.com/nushell/nushell/pull/6322) - CohenAriel created [Add --execute option](https://github.com/nushell/nushell/pull/6302) -## Documentation +### Documentation - rgwood created [Add Homebrew PATH documentation](https://github.com/nushell/nushell.github.io/pull/592) - sholderbach created [Update former question mark commands in docs](https://github.com/nushell/nushell.github.io/pull/590) @@ -293,7 +286,7 @@ Some time was spent trying out possible new syntax directions but we were not co - 1submarine created [correct escapes in coming_from_bash.md](https://github.com/nushell/nushell.github.io/pull/569), and [deduplicate `\*\*' in operators.md](https://github.com/nushell/nushell.github.io/pull/568) - amtoine created [FIX: `overlay remove` flags](https://github.com/nushell/nushell.github.io/pull/565) -## Nu Scripts +### Nu Scripts - dandavison created [Async git prompt](https://github.com/nushell/nu_scripts/pull/288) - sholderbach created [Update old question mark commands `any?`/`all?`/`empty?` to `any`/`all`/`is-empty`](https://github.com/nushell/nu_scripts/pull/287) @@ -304,7 +297,7 @@ Some time was spent trying out possible new syntax directions but we were not co - mk00pl created [added webscrapping script for twitter](https://github.com/nushell/nu_scripts/pull/279) - azzamsa created [fix: zoxide support Nushell out of the box](https://github.com/nushell/nu_scripts/pull/278) -## reedline +### reedline - sholderbach created [Prepare 0.11.0 release](https://github.com/nushell/reedline/pull/471) - unrelentingtech created [Add Reedline::has_last_command_context to allow checking if update_last_command_context will fail](https://github.com/nushell/reedline/pull/470) diff --git a/blog/2022-09-27-nushell-0_69.md b/src/content/docs/blog/2022-09-27-nushell-0_69.md similarity index 97% rename from blog/2022-09-27-nushell-0_69.md rename to src/content/docs/blog/2022-09-27-nushell-0_69.md index 507d98d8879..8a21a2f43da 100644 --- a/blog/2022-09-27-nushell-0_69.md +++ b/src/content/docs/blog/2022-09-27-nushell-0_69.md @@ -3,18 +3,16 @@ title: Nushell 0.69 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.69 of Nu. This release includes bugfixes and improvements to existing languages. +description: Today, we're releasing version 0.69 of Nu. This release includes bugfixes and improvements to existing languages. --- -# Nushell 0.69 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing version 0.69 of Nu. This release includes bugfixes and improvements to existing languages. <!-- more --> -# Where to get it +## Where to get it Nu 0.69 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.69.1) or from [crates.io](https://crates.io/crates/nu). Note: this release is officially "0.69.1" because of a last-minute issue that was found and fixed. If you have Rust installed you can install it using `cargo install nu`. @@ -22,7 +20,7 @@ If you want all the built-in goodies, you can install `cargo install nu --featur As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release +## Themes of this release ## Finishing the rework of modules and environment ([WindSoilder, kubouch](https://github.com/nushell/nushell/pull/6468)) @@ -37,7 +35,7 @@ We're also keeping the `source` command for now, as well as the current config f One reason is that we want to first investigate whether it is possible to export also regular variables from modules and whether we can use the `module` keyword inside modules. However, the use of modules is still preferred over `source` as it will become the default way in the future. -### Summary of deprecations +#### Summary of deprecations Here is a recap of the table posted in the previous release post with updated entries. @@ -58,7 +56,7 @@ Here is a recap of the table posted in the previous release post with updated en - Technically, `hide` still hides environment variables but it works in a "compatibility mode" that is intended to only serve its purpose in the virtualenv activation script. As soon as the virtualenv integration gets updated, hiding environment variables with `hide` will be removed completely. -## Upcoming `virtualenv` activation changes (kubouch) +### Upcoming `virtualenv` activation changes (kubouch) To reflect the recent changes to the module environment, we are changing the virtualenv integration to use overlays. This will come in effect as soon as [this PR](https://github.com/pypa/virtualenv/pull/2422) gets merged. @@ -67,25 +65,25 @@ In practice, this means that instead of `source activate.nu`, you'll use `overla Under the hood, calling `overlay use activate.nu` will activate the `activate` overlay and `deactivate` is just an alias for calling `overlay hide activate`. If you wish, you can manually name the overlay, for example `overlay use activate.nu as spam`, but then you'd need to remove it with `overlay hide spam` instead of `deactivate`. -## Grammar Experiments (JT) +### Grammar Experiments (JT) We've recently also started working on some improvements to Nushell's syntax. While these aren't part of Nushell 0.69, you can try this experimental syntax in our new [grammar](https://github.com/nushell/grammar) repo. Some experiments we're looking into: Traditional function definition syntax -``` +```nu def foo(x: int) { ... } ``` Traditional function call syntax -``` +```nu foo(3) ``` And much more. We're hoping to talk more about these experiments as they mature. -# Breaking changes +## Breaking changes We found a regression in the correctness of the `-d` and `-t` flags of `touch`. To get the release out, we've removed these flags, but hope to replace them with correct implementations in the future. @@ -93,15 +91,15 @@ We also removed support for duration literals above weeks, including month, year The `str collect` command is now `str join`. -# Next Steps +## Next Steps We've been progressing with our design towards 0.80 as outlined in [this Notion page](https://kubouch.notion.site/4db276462ba24704919edb4cc4b86be7?v=10506505557f4f7b9a65155128c04250). Some time was spent trying out possible new syntax directions but we were not confident to release them yet. In the next release we'll see a removal of features deprecated in this release and we'll continue to push ahead for the 0.80. -# Full changelog +## Full changelog -## Nushell +### Nushell - jt created [bump to 0.69.1](https://github.com/nushell/nushell/pull/6631), and [remove -d and -t from touch](https://github.com/nushell/nushell/pull/6629), and [bump to updated reedline](https://github.com/nushell/nushell/pull/6626), and [bump to 0.69](https://github.com/nushell/nushell/pull/6623), and [Remove month and year duration constants](https://github.com/nushell/nushell/pull/6613), and [touchup some clippy warnings in tests](https://github.com/nushell/nushell/pull/6612) - sholderbach created [Clippy with the current stable toolchain](https://github.com/nushell/nushell/pull/6615), and [Update reedline to better vi behavior](https://github.com/nushell/nushell/pull/6614), and [Add "space" key to bind in vi normal mode](https://github.com/nushell/nushell/pull/6590), and [Improve wording around `all` and `any`](https://github.com/nushell/nushell/pull/6524) @@ -120,12 +118,12 @@ Some time was spent trying out possible new syntax directions but we were not co - CBenoit created [build: update `cpufeatures` crate](https://github.com/nushell/nushell/pull/6527) - unrelentingtech created [Add a 'commandline' command for manipulating the current buffer](https://github.com/nushell/nushell/pull/6492), and [shell_integration: Report current working directory as OSC 7](https://github.com/nushell/nushell/pull/6481) -## Extension +### Extension - fdncred created [Update readme screenshots](https://github.com/nushell/vscode-nushell-lang/pull/65), and [bump version for release](https://github.com/nushell/vscode-nushell-lang/pull/64), and [add some tweaks to the auto-generated syntax](https://github.com/nushell/vscode-nushell-lang/pull/63), and [remove themes + cleanup](https://github.com/nushell/vscode-nushell-lang/pull/62), and [correct syntax highlighting for block parameters](https://github.com/nushell/vscode-nushell-lang/pull/61) - Yethal created [Updated syntax + fixed generation script](https://github.com/nushell/vscode-nushell-lang/pull/60) -## Documentation +### Documentation - drbrain created [Explain … for a repeating positional parameter](https://github.com/nushell/nushell.github.io/pull/613) - tensorush created [Fix built-in and plug-in typos](https://github.com/nushell/nushell.github.io/pull/611), and [Fix some typos](https://github.com/nushell/nushell.github.io/pull/610) @@ -136,7 +134,7 @@ Some time was spent trying out possible new syntax directions but we were not co - Yethal created [Update modules.md](https://github.com/nushell/nushell.github.io/pull/603) - dandavison created [`str collect` => `str join`](https://github.com/nushell/nushell.github.io/pull/602) -## Nu_Scripts +### Nu_Scripts - Neur1n created [feat: added coloring/hl.nu, a highlighting module](https://github.com/nushell/nu_scripts/pull/299) - WindSoilder created [add background feature](https://github.com/nushell/nu_scripts/pull/298) @@ -145,7 +143,7 @@ Some time was spent trying out possible new syntax directions but we were not co - e2dk4r created [custom completions: scoop: fix getting environmental variables on nu v0.68.0](https://github.com/nushell/nu_scripts/pull/293) - Lightfire228 created [[WIP] Feature/auto venv](https://github.com/nushell/nu_scripts/pull/289) -## reedline +### reedline - sholderbach created [Prepare 0.12.0 release](https://github.com/nushell/reedline/pull/487), and [List that space can be bound through `Char(' ')`](https://github.com/nushell/reedline/pull/486), and [Vi-Refactor: Properly parse motions separate from the actions](https://github.com/nushell/reedline/pull/484), and [Fix vi character search parsing](https://github.com/nushell/reedline/pull/483), and [Fix documentation string formatting and linking](https://github.com/nushell/reedline/pull/482) - fdncred created [enable easier history session id conversion](https://github.com/nushell/reedline/pull/485), and [change history session_id to a systematically generated number](https://github.com/nushell/reedline/pull/481) diff --git a/blog/2022-10-18-nushell-0_70.md b/src/content/docs/blog/2022-10-18-nushell-0_70.md similarity index 96% rename from blog/2022-10-18-nushell-0_70.md rename to src/content/docs/blog/2022-10-18-nushell-0_70.md index 25ff7478c22..3f8acc26394 100644 --- a/blog/2022-10-18-nushell-0_70.md +++ b/src/content/docs/blog/2022-10-18-nushell-0_70.md @@ -3,18 +3,16 @@ title: Nushell 0.70 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.70 of Nu. This release includes big improvements to table drawing and lots of overall polish. +description: Today, we're releasing version 0.70 of Nu. This release includes big improvements to table drawing and lots of overall polish. --- -# Nushell 0.70 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing version 0.70 of Nu. This release includes big improvements to table drawing and lots of overall polish. <!-- more --> -# Where to get it +## Where to get it Nu 0.70 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.70.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,11 +20,11 @@ If you want all the built-in goodies, such as support for dataframes and SQLite As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release +## Themes of this release -## New table flags +### New table flags - + - `--expand`: changes a standard table view; expand the table structure so internally all data will be displayed as inner tables @@ -46,18 +44,18 @@ As part of this release, we also publish a set of optional plugins you can insta The `collapse` mode can be considered generally slower than a base table view. So, if you have a large data set it may be slow. -# Breaking changes +## Breaking changes - The command `first 1` now returns a list with the single value rather than the value itself. This brings it in line with the behaviour of `last 1`. - The dataframe command `with-sql` or `query dfr` has been renamed to `query df` for consistency. -# Next Steps +## Next Steps We're continuing to work on language updates and hope to have more information for you soon. If you'd like to become part of the effort, please [join the discord](https://discord.gg/NtAbbGn). -# Full changelog +## Full changelog -## Nushell +### Nushell - jt created [Fix let-env in banner](https://github.com/nushell/nushell/pull/6795), and [Allow auto-cd to work with backticks](https://github.com/nushell/nushell/pull/6728) - sholderbach created [Pin reedline to the 0.13.0 release](https://github.com/nushell/nushell/pull/6789), and [Upgrade reedline to latest dev version](https://github.com/nushell/nushell/pull/6778), and [Backport fixes from nushell/nushell.github.io#633](https://github.com/nushell/nushell/pull/6712), and [Fix e.g. completion `git push --force-with-lease`](https://github.com/nushell/nushell/pull/6702) @@ -83,7 +81,7 @@ We're continuing to work on language updates and hope to have more information f - Kangaxx-0 created [Fix issue 6596](https://github.com/nushell/nushell/pull/6603) - zhiburt created [WIP/ Checkout to new `tabled`](https://github.com/nushell/nushell/pull/6286) -## Documentation +### Documentation - WindSoilder created [Add note about subexpression with external commands](https://github.com/nushell/nushell.github.io/pull/641) - zephaniahong created [Update working_with_lists.md](https://github.com/nushell/nushell.github.io/pull/638), and [Update working_with_lists.md](https://github.com/nushell/nushell.github.io/pull/637), and [Update working_with_strings.md](https://github.com/nushell/nushell.github.io/pull/636) @@ -98,7 +96,7 @@ We're continuing to work on language updates and hope to have more information f - SUPERCILEX created [Add example of inline string concat](https://github.com/nushell/nushell.github.io/pull/621) - dandavison created [Some copy editing of initial book sections ](https://github.com/nushell/nushell.github.io/pull/620) -## Nu_Scripts +### Nu_Scripts - dandavison created [sockets command](https://github.com/nushell/nu_scripts/pull/306) - eggcaker created [fix the PATH not working on windows](https://github.com/nushell/nu_scripts/pull/305) @@ -106,7 +104,7 @@ We're continuing to work on language updates and hope to have more information f - Yethal created [add update-path.nu](https://github.com/nushell/nu_scripts/pull/303) - ehdevries created [Replace str collect with str join in panache-git](https://github.com/nushell/nu_scripts/pull/301) -## reedline +### reedline - sholderbach created [Fix completion example in README/lib.rs](https://github.com/nushell/reedline/pull/497), and [Fix examples in README based on lib.rs](https://github.com/nushell/reedline/pull/496), and [Prepare 0.13 release](https://github.com/nushell/reedline/pull/495) - perlindgren created [examples updated](https://github.com/nushell/reedline/pull/493) diff --git a/blog/2022-11-08-nushell-0.71.md b/src/content/docs/blog/2022-11-08-nushell-0.71.md similarity index 96% rename from blog/2022-11-08-nushell-0.71.md rename to src/content/docs/blog/2022-11-08-nushell-0.71.md index 5291f3245cd..126705aa879 100644 --- a/blog/2022-11-08-nushell-0.71.md +++ b/src/content/docs/blog/2022-11-08-nushell-0.71.md @@ -3,18 +3,16 @@ title: Nushell 0.71 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.71 of Nu. This release includes new operators, better consistency, improved completions, and more. +description: Today, we're releasing version 0.71 of Nu. This release includes new operators, better consistency, improved completions, and more. --- -# Nushell 0.71 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines. Today, we're releasing version 0.71 of Nu. This release includes new operators, better consistency, improved completions, and more. <!-- more --> -# Where to get it +## Where to get it Nu 0.71 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.71.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,7 +20,7 @@ If you want all the built-in goodies, such as support for dataframes and SQLite As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release +## Themes of this release ## New `++` operator (merelymyself) @@ -36,7 +34,7 @@ For example, you can combine two lists into a new lists made up of the both list _Note: Currently, this operator cannot be used to join two tables. This functionality is still being worked on and will likely be present in the next version._ -## Improved consistency across commands and types +### Improved consistency across commands and types Nushell continues improve quality of the language and shell with a set of consistency improvements in this release. These include: @@ -50,12 +48,12 @@ Nushell continues improve quality of the language and shell with a set of consis - `from` and `to` now [show help info](https://github.com/nushell/nushell/pull/6856) (rgwood) -## Right prompts can now be on the last line (nibon7) +### Right prompts can now be on the last line (nibon7) Previously the right prompt appeared only on the same line where the user input started. Now you can choose to [place the right prompt part on the last line of user input](https://github.com/nushell/nushell/pull/6781). This feature is not enabled by default, you can enable it using the `config nu` command to modify the config.nu file, just set `render_right_prompt_on_last_line` to true: -``` +```nu let-env config { render_right_prompt_on_last_line : true ... @@ -64,13 +62,13 @@ let-env config { Default - + Right prompt at bottom - + -## Configuring the default value viewer via `display_output` hook (perbothner) +### Configuring the default value viewer via `display_output` hook (perbothner) You're now able to configure a new hook, [called `display_output`](https://github.com/nushell/nushell/pull/6915), which will become the default way that you view data. @@ -78,7 +76,7 @@ Using this, you can for example, use `table --expand` to always see fully expand If your terminal supports it, you can this to render a more full-featured output. For example, DomTerm could be used by setting the `display_output` hook to: `to html --partial --no-color | domterm hcat`, sending html to the terminal to be rendered when displaying values. -## Updated PR Review Process +### Updated PR Review Process Recently, we have been fortunate to see a rise in submitted pull requests (PRs) and we are super grateful for this growing desire to improve Nushell. Unfortunately, in some cases, a well-intended PR does not match the direction Nushell is going, forcing us to close it which leads to wasted time and effort. @@ -96,7 +94,7 @@ To summarize: We hope the new policy will help us make the PR review process smoother. -## Completion actions now more familiar (dandavison) +### Completion actions now more familiar (dandavison) We've also recently improved how completions work in Nushell to feel closer to how other shells work. Specifically: @@ -104,7 +102,7 @@ We've also recently improved how completions work in Nushell to feel closer to h - Removes the quick completion behavior whereby a word was completed automatically as soon as the input came to have a unique completion. - Tab now completes instead of selecting the next menu item (this can be configured) -# Breaking changes +## Breaking changes - New `--force (-f)` flag for the `mv` command. This change alters `mv` default behavior. By default overwriting existing files is now prevented (You can use `alias mv = mv -f` in you config to get the old defaults back). ([#6904](https://github.com/nushell/nushell/pull/6904)) - The column name for the command name in `$nu.scope.commands` has been changed from `command` to `name`. Thus, `$nu.scope.commands | where name =~ zip` would give you specific command info. ([#7007](https://github.com/nushell/nushell/pull/7007)) @@ -112,13 +110,13 @@ We've also recently improved how completions work in Nushell to feel closer to h - The argument order of `format filesize` was made consistent with other commands that accept a `CellPath` to specify fields that should be affected by it. Now the string specifying the format is the first positional argument and the cell path is specified in the following positional argument(s). ([#6879]https://github.com/nushell/nushell/pull/6879) - The `--perf` flag for Nu was removed as part of an effort to simplify diagnostics logging [#6834](https://github.com/nushell/nushell/pull/6834) -# Next Steps +## Next Steps We've drafted a version of the [design philosophy for 0.80](https://github.com/nushell/nushell.github.io/pull/656), and would love to get your feedback. If you'd like to become part of the effort, please [join the discord](https://discord.gg/NtAbbGn). -# Full changelog +## Full changelog -## Nushell +### Nushell - jt created [bump to 0.71, use 1.63 toolchain](https://github.com/nushell/nushell/pull/7061), and [Remove unnecessary clone in par-each](https://github.com/nushell/nushell/pull/6995) - sholderbach created [Pin reedline to `0.14.0` release](https://github.com/nushell/nushell/pull/7050), and [Make the example names unique across workspace](https://github.com/nushell/nushell/pull/7046), and [Update reedline](https://github.com/nushell/nushell/pull/7023), and [Make example binaries proper cargo examples](https://github.com/nushell/nushell/pull/7019), and [Refactor ansi stripping into `nu-util` functions](https://github.com/nushell/nushell/pull/6966), and [Remove inadvertent dep on original `ansi_term`](https://github.com/nushell/nushell/pull/6965), and [Update reedline to latest dev](https://github.com/nushell/nushell/pull/6953), and [Remove unused dependencies](https://github.com/nushell/nushell/pull/6945), and [Move nu-test-support into dev deps on nu-command](https://github.com/nushell/nushell/pull/6940), and [Update `nix` crate to `0.25` and narrow features](https://github.com/nushell/nushell/pull/6924), and [Fix `each while` behavior when printing and maybe in other situations by fusing the iterator](https://github.com/nushell/nushell/pull/6897), and [Wrap `open` parse errors from `from` commands](https://github.com/nushell/nushell/pull/6877), and [Remove unnecessary `#[allow(...)]` annotations](https://github.com/nushell/nushell/pull/6870), and [Reduce required dependencies for diagnostics](https://github.com/nushell/nushell/pull/6648) @@ -146,11 +144,11 @@ We've drafted a version of the [design philosophy for 0.80](https://github.com/n - Decodetalkers created [fix: fixcd](https://github.com/nushell/nushell/pull/6799), and [feat: coredump](https://github.com/nushell/nushell/pull/6791) - merelymyself created [make `++` append lists](https://github.com/nushell/nushell/pull/6766), and [add more helpful error for calling a decl that exists in a module](https://github.com/nushell/nushell/pull/6752) -## Extension +### Extension - melMass created [fix: ⚡️ add path for arm brew](https://github.com/nushell/vscode-nushell-lang/pull/68) -## Documentation +### Documentation - kubouch created [Add review process change](https://github.com/nushell/nushell.github.io/pull/664), and [Update Modules and Overlays chapters](https://github.com/nushell/nushell.github.io/pull/612) - webbedspace created [Fix let-env Path example to be accurate for Windows](https://github.com/nushell/nushell.github.io/pull/663), and [Update types_of_data.md](https://github.com/nushell/nushell.github.io/pull/661), and [Updated working_with_strings.md (closes #640)](https://github.com/nushell/nushell.github.io/pull/660), and [Simplified examples by removing unneeded `echo` calls](https://github.com/nushell/nushell.github.io/pull/657), and [Add categories column to command_reference](https://github.com/nushell/nushell.github.io/pull/646) @@ -163,14 +161,14 @@ We've drafted a version of the [design philosophy for 0.80](https://github.com/n - kambala-decapitator created [fix description of build-string's second example](https://github.com/nushell/nushell.github.io/pull/649) - hustcer created [Refresh commands docs for nu v0.70](https://github.com/nushell/nushell.github.io/pull/644) -## Nu scripts +### Nu scripts - fdncred created [oh-my-nu-v2 script - a new prompt for 8bit/24bit terminals](https://github.com/nushell/nu_scripts/pull/311), and [tweak no back progress bar example](https://github.com/nushell/nu_scripts/pull/308) - 1Kinoti created [Make the default for the `up` command (in the filesystem directory) 1](https://github.com/nushell/nu_scripts/pull/310) - SUPERCILEX created [Add prompt with exit code and command duration](https://github.com/nushell/nu_scripts/pull/309) - WindSoilder created [fix conda deactivate error when activate with no-prompt](https://github.com/nushell/nu_scripts/pull/307) -## Reedline +### Reedline - sholderbach created [Use `Box::default()` in more places](https://github.com/nushell/reedline/pull/512), and [Prepare the `0.14.0` release](https://github.com/nushell/reedline/pull/511), and [Fix the additional moves of normal mode `hjkl`](https://github.com/nushell/reedline/pull/510), and [Split the main example binary into examples](https://github.com/nushell/reedline/pull/506), and [Update workflow to new actions (alternative)](https://github.com/nushell/reedline/pull/505) - jcgruenhage created [fix: actually use sqlite-dynlib feature](https://github.com/nushell/reedline/pull/504) diff --git a/blog/2022-11-29-nushell-0.72.md b/src/content/docs/blog/2022-11-29-nushell-0.72.md similarity index 95% rename from blog/2022-11-29-nushell-0.72.md rename to src/content/docs/blog/2022-11-29-nushell-0.72.md index 0d5bdfa7a0f..536b393b074 100644 --- a/blog/2022-11-29-nushell-0.72.md +++ b/src/content/docs/blog/2022-11-29-nushell-0.72.md @@ -3,18 +3,16 @@ title: Nushell 0.72 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.72 of Nu. This release includes many new features include mutability, looping, early returns, changes to the core commands, and much more. +description: Today, we're releasing version 0.72 of Nu. This release includes many new features include mutability, looping, early returns, changes to the core commands, and much more. --- -# Nushell 0.72 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. Today, we're releasing version 0.72 of Nu. This release includes many new features: mutability, looping, early returns, changes to the core commands, and much more. <!-- more --> -# Where to get it +## Where to get it Nu 0.72 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.72.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,9 +20,9 @@ NOTE: as part of this release, we are no longer including additional features in As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release / New features +## Themes of this release / New features -## Try/catch +### Try/catch Starting with 0.72, it's now much easier to run a command that might fail and then handle the failure if it happens. @@ -49,15 +47,15 @@ try { } ``` -## Auto-expanding data views +### Auto-expanding data views - + With the new default config, we now also detect the terminal width and will automatically expand the data view to include more information if it's available. This uses an improved expanding data view capability from 0.70. -## Redirection +### Redirection This release also includes a new way of redirecting the stdout and/or stderr of external commands. This gives easier access to the output streams than was previously possible. @@ -75,7 +73,7 @@ You can also create a stream built from the above, allowing one stream to empty > git status out+err> git_status.txt ``` -## Closures/blocks +### Closures/blocks We have now split closures and blocks into two separate value types. A closure can have parameters, can close over variables outside of its scope, and can be passed as a value. @@ -99,7 +97,7 @@ if true { Blocks don't close over (or capture) variables, don't have parameters, and can't be passed as a value. Blocks, however, do have one special trick... -## Mutation +### Mutation Starting in this release, you can create local mutable variables. You can create mutable variables using the `mut` keyword: @@ -119,7 +117,7 @@ if true { print $x ``` -## Loop/while +### Loop/while The 0.72 release also includes a few new looping commands: `loop` and `while`. @@ -141,11 +139,11 @@ while $x < 10 { } ``` -## Break/continue +### Break/continue Loops can now also use the `break` and `continue` feature common in many programming languages. `break` will break out of the current loop. And `continue` will continue the loop at the next iteration. -## Return +### Return The 0.72 release also includes the ability to return early from a closure or command. @@ -158,17 +156,17 @@ def foo [x] { } ``` -## Command refinement, simplification, and elimination +### Command refinement, simplification, and elimination This release contains many breaking changes to Nu's built-in commands (sorry!). As we move toward version 1.0 we want to ensure that Nu ships with a small curated set of consistent, well-designed "standard library" commands. This requires taking a hard look at existing commands, and in some cases breaking changes are unavoidable. We expect that this effort will span a few release cycles. -## Dataframes no longer included by default - smaller binaries +### Dataframes no longer included by default - smaller binaries Nu's dataframe support is extensive, impressive, and very useful to users who rely on it. However, it comes at a high cost in terms of compile time, binary size, and complexity. Starting with version 0.72, dataframe commands are no longer included in the release binaries published on GitHub or the default binaries published via package managers (like Homebrew, winget, Scoop). As a result of this change, the main Nu executable is now about 50% smaller. -To continue using dataframe commands, you can build Nu from source using the `dataframe` [Cargo feature](https://doc.rust-lang.org/cargo/reference/features.html). For example, to install using Cargo: `cargo install nu --features=dataframe` +To continue using dataframe commands, you can build Nu from source using the `dataframe` [Cargo feature](https://doc.rust-lang.org/cargo/reference/features). For example, to install using Cargo: `cargo install nu --features=dataframe` -## Allow reloading overlay definitions ([kubouch](https://github.com/nushell/nushell/pull/7231)) +### Allow reloading overlay definitions ([kubouch](https://github.com/nushell/nushell/pull/7231)) A common pattern in using overlays is shadowing an existing environment variable, such as PROMPT_COMMAND. However, `overlay use` would keep loading the value from the first activation. It is best explained with an example. Assume the following module: @@ -182,11 +180,11 @@ module prompt { Calling `overlay use prompt` for the first time changes the prompt to the current time, however, subsequent calls to `overlay use` won't change the time. That's because overlays, once activated, store their state so they can be hidden and restored at later time. To force-reload the environment, we added a new `--reload` flag: Calling `overlay use --reload prompt` repeatedly now updates the prompt with the current time each time. -## virtualenv activation changes ([kubouch](https://github.com/pypa/virtualenv/pull/2422)) +### virtualenv activation changes ([kubouch](https://github.com/pypa/virtualenv/pull/2422)) Since the version 20.17.0 of [virtualenv](https://github.com/pypa/virtualenv), the new way to activate an environment is to call `overlay use activate.nu` instead of the `source activate.nu`. This change is in line with gradual deprecation of `source` and moving us towards using modules as overlays in more cases. Please, check the [activation script itself](https://github.com/pypa/virtualenv/blob/main/src/virtualenv/activation/nushell/activate.nu) for more details. -# Breaking changes +## Breaking changes - As mentioned above, dataframe support has been removed from the default Nu binaries. - [Nu's SQLite DSL commands have been removed](https://github.com/nushell/nushell/pull/7040). `open foo.db` and `open foo.db | query db "SELECT * ..."` still work, but the commands which mapped 1-to-1 with SQL clauses (ex: `open foo.db | into db | select * | from table some_table | order-by some_column`) have been removed. These commands were an interesting experiment but they didn't work out, and we're removing them to simplify database access in Nu. @@ -196,23 +194,23 @@ Since the version 20.17.0 of [virtualenv](https://github.com/pypa/virtualenv), t - [The `--predicate` flag has been removed from `find`](https://github.com/nushell/nushell/pull/7042). `where` can be used in all situations where `find --predicate` was previously used. - [`sort-by` now requires a column name to sort by](https://github.com/nushell/nushell/pull/7042). To sort lists without specifying a column name, `sort` can be used. - `seq`, `seq char`, and `seq date` no longer have `--separator` and `--terminator` flags ([#7045](https://github.com/nushell/nushell/pull/7045), [#7054](https://github.com/nushell/nushell/pull/7054), [#7096](https://github.com/nushell/nushell/pull/7096)). This helps ensure that the return type for those commands is consistent, and `str join` can be used to accomplish the same effect. -- [The `build-string` command has been removed](https://github.com/nushell/nushell/pull/7144). To concatenate strings, use the `+` operator, [string interpolation](https://www.nushell.sh/book/working_with_strings.html#string-interpolation), or `str join`. +- [The `build-string` command has been removed](https://github.com/nushell/nushell/pull/7144). To concatenate strings, use the `+` operator, [string interpolation](https://www.nushell.sh/book/working_with_strings#string-interpolation), or `str join`. - [`wrap` now expands ranges](https://github.com/nushell/nushell/pull/7159). It works the same as with lists or `seq`. - [`url parse` `url scheme`, `url host`, `url path`, and `url query` commands have been removed. We added the command `url parse`.](https://github.com/nushell/nushell/pull/7124) This new command returns a Record with scheme, username, password, host, path, query, params (as a Record) and fragment. - [`sort`, `sort-by`, `str contains` and `find` have had their `--insensitive` flags renamed to `--ignore-case`.](https://github.com/nushell/nushell/pull/7198). `--ignore-case` is used by `uniq`, as well as popular external commands like `less`, `grep` and `wget`, so it could be considered a standard flag name. -## New boolean operator `xor` - Planned operator simplification +### New boolean operator `xor` - Planned operator simplification To complement our logical boolean operators `and`/`&&` and `or`/`||` we [added boolean `xor`](https://github.com/nushell/nushell/pull/7242). This is consistent with `bit-and`, `bit-xor`, and `bit-or`. We are currently considering to deprecate the C-style symbols `&&`/`||` in favor of the spelled out `and`/`or` to increase consistency and provide more actionable error messages when trying to use `&&`/`||` in a similar fashion to bash. -## Config options have been grouped together +### Config options have been grouped together The structure of $env.config (and thus the record used with `let-env config = ` statements in `config.nu` and other places) has been reorganised. Various options are now grouped into subrecords (similar to `table_trim`) and had their names shortened. This allows `config.nu` files to be better structured, and thus easier to edit and read, while also allowing future options to be added without making the -:::warning +:::caution[warning] Your existing `config.nu` options WILL still work in this version!! However, you will get a warning message if you use the old versions of the options (as you might already be aware). Support for these old options will be dropped in a future Nushell update, so take care to convert your `config.nu` files when you can. ::: @@ -278,13 +276,13 @@ To output your existing options in the above format (that could be pasted into y $env.config | do { { ls: { use_ls_colors: $in.use_ls_colors clickable_links: $in.show_clickable_links_in_ls } rm: { always_trash: $in.rm_always_trash } cd: { abbreviations: $in.cd_with_abbreviations } table: { mode: $in.table_mode index_mode: $in.table_index_mode trim: $in.table_trim } history: { max_size: $in.max_history_size sync_on_enter: $in.sync_history_on_enter file_format: $in.history_file_format } completions: { case_sensitive: $in.case_sensitive_completions quick: $in.quick_completions partial: $in.partial_completions algorithm:$in.completion_algorithm external: { enable: $in.enable_external_completion max_results: $in.max_external_completion_results completer:$in.external_completer } } } } | to nuon | str substring 1..-1 ``` -## Minimum Rust version has bumped to 1.65 +### Minimum Rust version has bumped to 1.65 Due to some breakage in dependencies, we've gone ahead and bumped the required version of Rust to 1.65, which addresses the issue. Apologies to anyone who is inconvenienced by the bump. We anticipate returning to the Rust-1 versions in the future. -# Full changelog +## Full changelog -## Nushell +### Nushell - fdncred created [update release-pkg.nu to include more recent less version](https://github.com/nushell/nushell/pull/7265), and [add a more verbose description of operators](https://github.com/nushell/nushell/pull/7263), and [add `help operators` command](https://github.com/nushell/nushell/pull/7254), and [pin to rust v1.65](https://github.com/nushell/nushell/pull/7249), and [pin to a version of zstd that doesn't break dataframe compilation](https://github.com/nushell/nushell/pull/7227), and [add `into record` command](https://github.com/nushell/nushell/pull/7225), and [update default_config.nu with display_output](https://github.com/nushell/nushell/pull/7146), and [fix `ansi --osc` parameter adding extra semi-colon](https://github.com/nushell/nushell/pull/7113), and [reset stack size to 10mb vs 2gb](https://github.com/nushell/nushell/pull/7103), and [fix plugin detection in help commands](https://github.com/nushell/nushell/pull/7088), and [add commented out mold linker usage](https://github.com/nushell/nushell/pull/7081), and [use path.try_exist() to fix silent errors](https://github.com/nushell/nushell/pull/7069), and [bump to dev release 0.71.1](https://github.com/nushell/nushell/pull/7064), and [return value::int instead of value::record in `history session`](https://github.com/nushell/nushell/pull/7049) - rgwood created [Clean up .sh scripts with shellcheck](https://github.com/nushell/nushell/pull/7261), and [Make catch block a closure w/ access to error](https://github.com/nushell/nushell/pull/7228), and [Feature cleanup](https://github.com/nushell/nushell/pull/7182), and [Remove `build-string` command](https://github.com/nushell/nushell/pull/7144), and [Return errors on unexpected inputs to `take` and `first`](https://github.com/nushell/nushell/pull/7123), and [Improve `rm` error message when file not found](https://github.com/nushell/nushell/pull/7098), and [Remove --separator from `seq date`](https://github.com/nushell/nushell/pull/7096), and [Fix CI failures after PR merge conflicts](https://github.com/nushell/nushell/pull/7072), and [Simplify `seq char`](https://github.com/nushell/nushell/pull/7054), and [Make seq output type consistent (by removing flags)](https://github.com/nushell/nushell/pull/7045) @@ -307,11 +305,11 @@ Due to some breakage in dependencies, we've gone ahead and bumped the required v - dandavison created [Add missing strip-ansi-escapes dependency to Cargo.lock](https://github.com/nushell/nushell/pull/7114), and [Add input-output types to $nu.scope.commands](https://github.com/nushell/nushell/pull/7105), and [Refactor create_scope](https://github.com/nushell/nushell/pull/7104), and [Fix command_type classification](https://github.com/nushell/nushell/pull/7074), and [Collapse some `help commands` columns into a single column](https://github.com/nushell/nushell/pull/7052) - denstiny created [fix(#7097): let-env should not be able to set PWD](https://github.com/nushell/nushell/pull/7100) -## Extension +### Extension - fdncred created [updates for nushell 0.72](https://github.com/nushell/vscode-nushell-lang/pull/70) -## Documentation +### Documentation - sholderbach created [Fix tip boxes in `book/custom_commands.md`](https://github.com/nushell/nushell.github.io/pull/686), and [Fix octal literal mentions](https://github.com/nushell/nushell.github.io/pull/684), and [Update operator docs](https://github.com/nushell/nushell.github.io/pull/683) - WindSoilder created [remove `Subexpressions with external commands` session](https://github.com/nushell/nushell.github.io/pull/681) @@ -325,7 +323,7 @@ Due to some breakage in dependencies, we've gone ahead and bumped the required v - hbt created [fix 404 link](https://github.com/nushell/nushell.github.io/pull/668) - jt created [Create a section for the 0.80 philosophy](https://github.com/nushell/nushell.github.io/pull/656) -## Nu_Scripts +### Nu_Scripts - WindSoilder created [fix merge doesnt support block input](https://github.com/nushell/nu_scripts/pull/318) - Joxtacy created [Add zellij completions](https://github.com/nushell/nu_scripts/pull/317) @@ -334,6 +332,6 @@ Due to some breakage in dependencies, we've gone ahead and bumped the required v - fdncred created [updates get-weather to remove the for loop](https://github.com/nushell/nu_scripts/pull/313) - taooceros created [Fix undetected windows environment](https://github.com/nushell/nu_scripts/pull/312) -## reedline +### reedline - rgwood created [Fix example in CONTRIBUTING.md](https://github.com/nushell/reedline/pull/517) diff --git a/blog/2022-12-20-nushell-0.73.md b/src/content/docs/blog/2022-12-20-nushell-0.73.md similarity index 94% rename from blog/2022-12-20-nushell-0.73.md rename to src/content/docs/blog/2022-12-20-nushell-0.73.md index 743dc343b9a..0bae035be54 100644 --- a/blog/2022-12-20-nushell-0.73.md +++ b/src/content/docs/blog/2022-12-20-nushell-0.73.md @@ -3,18 +3,16 @@ title: Nushell 0.73 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.73 of Nu. This release includes new math commands, an interactive data viewer, and many command refinements. +description: Today, we're releasing version 0.73 of Nu. This release includes new math commands, an interactive data viewer, and many command refinements. --- -# Nushell 0.73 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. Today, we're releasing version 0.73 of Nu. This release includes new math commands, an interactive data viewer, and many command refinements. <!-- more --> -# Where to get it +## Where to get it Nu 0.73 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.73.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,15 +20,15 @@ NOTE: The optional dataframe functionality is available by `cargo install nu --f As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release / New features +## Themes of this release / New features -## PLEASE NOTE: Boolean `&&` and `||` have changed +### PLEASE NOTE: Boolean `&&` and `||` have changed The boolean `&&` is now `and` and the boolean `||` is now `or`. These were deprecated in the 0.72 release and have now been removed. Existing scripts will need to be updated to the new syntax to run in 0.73. -## Experimental interactive `explore` command ([zhiburt](https://github.com/nushell/nushell/pull/6984)) +### Experimental interactive `explore` command ([zhiburt](https://github.com/nushell/nushell/pull/6984)) - + This release includes a new experimental command called `explore` for viewing Nu data in an interactive UI. Some things to try: @@ -39,18 +37,18 @@ This release includes a new experimental command called `explore` for viewing Nu `explore` is highly experimental and we expect it to change in the future. [Please report any issues you discover](https://github.com/nushell/nushell/issues/new/choose). -## New `math` commands ([sholderbach](https://github.com/nushell/nushell/pull/7258)) +### New `math` commands ([sholderbach](https://github.com/nushell/nushell/pull/7258)) With this release we include a larger number of `math` commands for real valued math such as trigonometric functions and logarithms. The goal is to remove the `math eval` command that operates on strings instead of proper nushell expressions. -### Constants +#### Constants - `math pi` - `math tau` - `math e` -### Trigonometry and hyperbolic functions +#### Trigonometry and hyperbolic functions - `math sin` - `math cos` @@ -65,7 +63,7 @@ The goal is to remove the `math eval` command that operates on strings instead o - `math arccosh` - `math arctanh` -### Logarithms +#### Logarithms - `math log` - `math ln` @@ -79,7 +77,7 @@ The goal is to remove the `math eval` command that operates on strings instead o [4 3 2 1] ``` -## Changes to commands with predicates ([kubouch](https://github.com/nushell/nushell/pull/7428)) +### Changes to commands with predicates ([kubouch](https://github.com/nushell/nushell/pull/7428)) `any`, `all`, `skip until`, `skip while`, `take until`, and `take while` now accept a closure instead of a row condition. For example @@ -95,7 +93,7 @@ becomes This makes them slightly more verbose but it is a part of an effort to refactor our parser to allow defining concrete grammar rules for the Nu language. Row condition is currently accepted only in the `where` command which becomes a parser built-in command (like `use` or `let`). -## New `filter` command and simpler `where` ([kubouch](https://github.com/nushell/nushell/pull/7365)) +### New `filter` command and simpler `where` ([kubouch](https://github.com/nushell/nushell/pull/7365)) We found the `-b` flag of `where` quite confusing and decided to remove it in favor of a new `filter` command. Both `filter` and `where` have similar functionality but `where` now only accepts a row condition and `filter` accepts a closure. Before: @@ -118,7 +116,7 @@ let cond = {|x| $x.a > 1} On the other hand, `where` is more concise (`[{a: 1} {a: 2}] | where a > 1`) but you can't store its condition in a variable. The choice is yours! -## New command `uniq-by` ([raccmonteiro](https://github.com/nushell/nushell/pull/7295)) +### New command `uniq-by` ([raccmonteiro](https://github.com/nushell/nushell/pull/7295)) To complement `uniq` which can identify unique or duplicated values in a collection or report the number of occurrences for a particular entry, we now have `uniq-by`. It supports filtering a table by entries appearing in a particular column. @@ -135,7 +133,7 @@ It supports filtering a table by entries appearing in a particular column. ╰───┴────────┴─────────╯ ``` -## Mutable data structures can now have their inner values mutated using `=` ([webbedspace](https://github.com/nushell/nushell/pull/7318)) +### Mutable data structures can now have their inner values mutated using `=` ([webbedspace](https://github.com/nushell/nushell/pull/7318)) If a variable has been defined as mutable using the recently-added `mut` keyword, you can now deeply mutate its inner values using `=`. @@ -155,7 +153,7 @@ $env.config.table.mode = compact_double ...and it will remain in effect for the rest of the session. -## More sophisticated coloring of data values using closures ([webbedspace](https://github.com/nushell/nushell/pull/7141)) +### More sophisticated coloring of data values using closures ([webbedspace](https://github.com/nushell/nushell/pull/7141)) The `color_config` config record has new functionality: instead of specifying a single color name for all values of a given type, you may now alternatively provide a closure that dynamically computes a color for each individual value. The closure takes, as input, a single value of the given type, and must produce either a string value representing a color, or a `{ fg, bg, attr }` record (the same as what `color_config` already accepts as a color value). This feature can be used to provide important visual distinctions between ranges of values in data. @@ -181,15 +179,15 @@ The themes in the default `config.nu` file have been updated with further exampl In certain situations (most notably, during a single `ls` call that isn't piped to anything else) Nushell will parallelize the execution of these closures. As such, you cannot expect that they will run in the same order as each value appears in the output data. -:::warning +:::caution[warning] Currently, closures are only supported for output values - they do not work with color settings that begin with `shape_`, such as `shape_literal`. They also do not work with the color configuration for the new `explore` command. Only values inside of tables are highlighted using closures. ::: -## RISC V binary release +### RISC V binary release Starting with 0.73, Nushell now provides a RISC V for Linux as part of the set of release binaries. -# Breaking changes +## Breaking changes - `save` no longer overwrites files by default, you must use the new `-f`/`--force` flag to overwrite an existing file ([#7262](https://github.com/nushell/nushell/pull/7262)) - `split row` command will retain an empty string if splitted string is empty. ([#7413](https://github.com/nushell/nushell/pull/7413)) @@ -202,9 +200,9 @@ Starting with 0.73, Nushell now provides a RISC V for Linux as part of the set o - `any`, `all`, `skip until`, `skip while`, `take until`, `take while` now take only a closure as an argument. - `where` now takes only row condition argument, the `-b` flag has been removed (use `filter` instead of `where -b`). -# Full changelog +## Full changelog -## Nushell +### Nushell - jt created [bump to 0.73](https://github.com/nushell/nushell/pull/7542), and [Turn off `cd` abbreviations by default](https://github.com/nushell/nushell/pull/7536), and [Revert "Add pipeline operators to help"](https://github.com/nushell/nushell/pull/7454), and [Revert "Pipeline operators: `&&` and `||`"](https://github.com/nushell/nushell/pull/7452), and [Add pipeline operators to help](https://github.com/nushell/nushell/pull/7449), and [Pipeline operators: `&&` and `||`](https://github.com/nushell/nushell/pull/7448), and [Remove and/or from 'help operators'](https://github.com/nushell/nushell/pull/7388), and [Fix input redirect for externals](https://github.com/nushell/nushell/pull/7387), and [Add OneOf shape to fix `else`](https://github.com/nushell/nushell/pull/7385), and [Improve empty pipelines](https://github.com/nushell/nushell/pull/7383), and [couple minor updates to xml deps](https://github.com/nushell/nushell/pull/7311) - sholderbach created [Remove unused deps or move to devdeps](https://github.com/nushell/nushell/pull/7537), and [Use `nu-path` correctly in `nu!` test macro to make dev-dependency transitive](https://github.com/nushell/nushell/pull/7488), and [Add example showing first class closure to `do`](https://github.com/nushell/nushell/pull/7473), and [Add arbitrary base `math log`](https://github.com/nushell/nushell/pull/7409), and [Add `math tau`](https://github.com/nushell/nushell/pull/7408), and [Fix `math e` usage text](https://github.com/nushell/nushell/pull/7406) @@ -226,11 +224,11 @@ Starting with 0.73, Nushell now provides a RISC V for Linux as part of the set o - JohnJohnstone created [fix menus in default config](https://github.com/nushell/nushell/pull/7352) - bgeron created [Fix documentation for merge](https://github.com/nushell/nushell/pull/7329) -## Extension +### Extension - fdncred created [add `and` and `or` so they highlight properly](https://github.com/nushell/vscode-nushell-lang/pull/72) -## Documentation +### Documentation - WindSoilder created [add breaking change for fetch](https://github.com/nushell/nushell.github.io/pull/708), and [add breaking change for split row](https://github.com/nushell/nushell.github.io/pull/696), and [add command signature section](https://github.com/nushell/nushell.github.io/pull/671) - webbedspace created [[release-notes-0.73] Add color closures and deeply mutable data structure features](https://github.com/nushell/nushell.github.io/pull/707) @@ -245,7 +243,7 @@ Starting with 0.73, Nushell now provides a RISC V for Linux as part of the set o - Kissaki created [Fix typo in 0.71 release notes](https://github.com/nushell/nushell.github.io/pull/692) - sholderbach created [Autoformat book/types_of_data.md](https://github.com/nushell/nushell.github.io/pull/685) -## Nu_Scripts +### Nu_Scripts - jt created [Since last release script](https://github.com/nushell/nu_scripts/pull/330), and [Fix TWiN script](https://github.com/nushell/nu_scripts/pull/328), and [Switch to 'and' and 'or'](https://github.com/nushell/nu_scripts/pull/322) - xlittlerag created [fixed get-weather celsius loop](https://github.com/nushell/nu_scripts/pull/326) @@ -255,6 +253,6 @@ Starting with 0.73, Nushell now provides a RISC V for Linux as part of the set o - ehdevries created [Replace deprecated operators in panache-git](https://github.com/nushell/nu_scripts/pull/321) - Decodetalkers created [feat: add example for starship and shell_space](https://github.com/nushell/nu_scripts/pull/320) -## reedline +### reedline - jmoore34 created [Make DefaultPrompt configurable](https://github.com/nushell/reedline/pull/519) diff --git a/blog/2023-01-10-nushell_0_74.md b/src/content/docs/blog/2023-01-10-nushell_0_74.md similarity index 91% rename from blog/2023-01-10-nushell_0_74.md rename to src/content/docs/blog/2023-01-10-nushell_0_74.md index 5fe9b730cee..ba950dccbcb 100644 --- a/blog/2023-01-10-nushell_0_74.md +++ b/src/content/docs/blog/2023-01-10-nushell_0_74.md @@ -3,18 +3,16 @@ title: Nushell 0.74 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.74 of Nu. This release includes improvements on handling signatures of `exec` and known externals, improved `help`, initial support for parse-time constants, new commands, and many improvements to our existing commands. +description: Today, we're releasing version 0.74 of Nu. This release includes improvements on handling signatures of `exec` and known externals, improved `help`, initial support for parse-time constants, new commands, and many improvements to our existing commands. --- -# Nushell 0.74 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. Today, we're releasing version 0.74 of Nu. This release includes improvements on handling signatures of `exec` and known externals, improved `help`, initial support for parse-time constants, new commands, and many improvements to our existing commands. <!-- more --> -# Where to get it +## Where to get it Nu 0.74 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.74.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,9 +20,9 @@ NOTE: The optional dataframe functionality is available by `cargo install nu --f As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release / New features +## Themes of this release / New features -## Known externals commands and `exec` now have "fall-through" signatures ([merelymyself, WindSoilder, kubouch](https://github.com/nushell/nushell/pull/7527)) +### Known externals commands and `exec` now have "fall-through" signatures ([merelymyself, WindSoilder, kubouch](https://github.com/nushell/nushell/pull/7527)) A common pitfall in Nushell when defining custom signatures using `extern` used to be that unrecognized arguments passed to the command would throw an error. Now, arguments are still checked against the `extern` signature but those that are not recognized are simply ignored. @@ -39,7 +37,7 @@ A common pitfall in Nushell when defining custom signatures using `extern` used > nu -c 'exec ls -l' # does not throw an error ``` -## `help` is now more helpful ([kubouch](https://github.com/nushell/nushell/pull/7611)) +### `help` is now more helpful ([kubouch](https://github.com/nushell/nushell/pull/7611)) For a long time, Nushell had the option to provide custom help messages for commands via comments: @@ -57,15 +55,15 @@ In this release, we allow user-defined help messages with aliases and modules. T The help messages now also treat the first line followed by an empty line as a "brief" description displayed in summary tables generated by `help commands`, `$nu.scope.aliases`, etc. The full description is available when querying a particular command/alias/module (e.g., `help spam`). This brief vs. full separation was already present for built-in commands, like `path`, but now it is applied also to all user-defined help messages. An example of using custom module and alias help messages: - + The current batch of improvements can still be taken further. For example, custom help messages could possibly be defined also for variables and environment variables (via comments adjacent to `let` and `let-env`). We could also further improve the presentation of existing `help xxx` commands. -## Initial support for parse-time constants ([kubouch](https://github.com/nushell/nushell/pull/7436)) +### Initial support for parse-time constants ([kubouch](https://github.com/nushell/nushell/pull/7436)) _This is a proof-of-concept that we plan to expand in the future._ -_Tip: We also addedd a new [book section](https://www.nushell.sh/book/how_nushell_code_gets_run.html) with an in-depth explanation of Nushell's parsing and evaluation, hopefully clearing up some confusion about things like "Why can't I source a dynamic path?". It also touches on the concept of parse-time constants._ +_Tip: We also addedd a new [book section](https://www.nushell.sh/book/how_nushell_code_gets_run) with an in-depth explanation of Nushell's parsing and evaluation, hopefully clearing up some confusion about things like "Why can't I source a dynamic path?". It also touches on the concept of parse-time constants._ A new `const` keyword is added to Nushell to define "parse-time" constants. Constants defined with `const` behave the same as variables defined with `let`, but in addition, they are usable in some contexts that require values known at parse-time. Currently, this applies to files or names passed to `use`, `overlay use`, `source`, and `source-env`. For example, the following now works: @@ -110,7 +108,7 @@ overlay use $fname In general, we want to be very conservative with parse-time constants and evaluation because it can be easy to introduce awkward side-effects and performance pitfalls. We plan to extend this only where it brings some tangible benefit to Nushell's user experience. -## New `url encode` command to percent-encode URLs ([MehulG](https://github.com/nushell/nushell/pull/7664)) +### New `url encode` command to percent-encode URLs ([MehulG](https://github.com/nushell/nushell/pull/7664)) To encode text that is used as a path component in a URL we now provide `url encode`. @@ -123,7 +121,7 @@ https://example.com/foo%20bar https%3A%2F%2Fexample%2Ecom%2Ffoo%20bar ``` -## `values` command to programmatically interact with records ([webbedspace](https://github.com/nushell/nushell/pull/7583)) +### `values` command to programmatically interact with records ([webbedspace](https://github.com/nushell/nushell/pull/7583)) This is a complement to `columns`, designed to allow the values of a record to be easily filtered and iterated over using the standard list tools like `each` and `where`. The name `values` is derived from similar functions in Ruby, Python and JavaScript. @@ -154,7 +152,7 @@ It can also operate on tables to convert them to lists-of-lists: ╰───┴───────────╯ ``` -## `get`, `select`, cell path access on tables will now error when encountering a hole ([kubouch](https://github.com/nushell/nushell/pull/7002), [webbedspace](https://github.com/nushell/nushell/pull/7647)) +### `get`, `select`, cell path access on tables will now error when encountering a hole ([kubouch](https://github.com/nushell/nushell/pull/7002), [webbedspace](https://github.com/nushell/nushell/pull/7647)) Consider the following operations performed on a table: @@ -164,7 +162,7 @@ Consider the following operations performed on a table: Formerly, this would produce `['bar', null]` - converting the table hole into a `null`. Now, however, they will produce an error. The original null-conversion behaviour can, as usual, be opted into using the `-i` flag for `get` and `select`: `[{foo: 'bar'}, {}] | get -i foo` produces `['bar', null]`. (There are also plans for a future version of Nushell to expand the cell path syntax to allow certain cell names to be "nullable" - converted to `null` if they don't exist.) -## Behavior of `-i`/`--ignore-errors` flag for `get` and `select` when the entire column is absent has changed +### Behavior of `-i`/`--ignore-errors` flag for `get` and `select` when the entire column is absent has changed Formerly, if `select -i` or `get -i` couldn't find any value for the given column, it would produce a single `null`: @@ -191,7 +189,7 @@ This change was made to make this flag work more consistently with `default` and As you can see, `default` in the above example can reliably populate an entire table column when some or all of the values don't exist. -## Certain misused punctuation in `def` definitions are now errors ([webbedspace](https://github.com/nushell/nushell/pull/7624), [webbedspace](https://github.com/nushell/nushell/pull/7606)) +### Certain misused punctuation in `def` definitions are now errors ([webbedspace](https://github.com/nushell/nushell/pull/7624), [webbedspace](https://github.com/nushell/nushell/pull/7606)) The following misuses of punctuation in `def` definitions now produce errors: @@ -200,32 +198,32 @@ The following misuses of punctuation in `def` definitions now produce errors: - Consecutive colons, like `def a [foo::int] {}` - Using `^` in command names, like `def ^a [] {}` -## `$in` now works in `catch` closures +### `$in` now works in `catch` closures `$in` in `catch` closures now behaves identically to how it does in other closures, like those given to `each` (it's equivalent to what would be the first named argument). `try { 'x' | math abs } catch { print $in }` behaves the same as `try { 'x' | math abs } catch {|e| print $e }`. -## MIME-types are supported in `ls` with an additional flag. ([fdncred](https://github.com/nushell/nushell/pull/7616)) +### MIME-types are supported in `ls` with an additional flag. ([fdncred](https://github.com/nushell/nushell/pull/7616)) To find out what application your operating system associates with a particular file, you can now use the `--mime-type` or `-m` flag on our `ls` command. This simplifies filtering for particular files and can help you dispatch files to particular programs. When opening files with Nushell directly, `open` will still follow the same heuristics using file endings and the built-in `from ...` command parsers. -## Regular expression queries are cached for performance ([rgwood](https://github.com/nushell/nushell/pull/7587)) +### Regular expression queries are cached for performance ([rgwood](https://github.com/nushell/nushell/pull/7587)) The primary motivation for this is to make regex and `=~` operator uses in hooks and `color_config` closures more performant. -## All built-in commands now declare their pipeline input and output types ([sholderbach](https://github.com/nushell/nushell/pull/7532)) +### All built-in commands now declare their pipeline input and output types ([sholderbach](https://github.com/nushell/nushell/pull/7532)) A few releases back commands internally got the capability to declare not only the types of parameters but also pairs for the input and output on the pipeline. With this release we finally declare those input and output types for all core nushell commands. This can help you as user to see what a command expects from the pipeline and might return. We are exploring how nushell can leverage that for more useful diagnostics and completions. In the future we may introduce syntax for user-defined commands to declare their input and output types explicitly. - + -# Breaking changes +## Breaking changes - [Nushell 0.74](#nushell-074) - [Where to get it](#where-to-get-it) @@ -249,9 +247,9 @@ We are exploring how nushell can leverage that for more useful diagnostics and c - [Nu_Scripts](#nu_scripts) - [reedline](#reedline) -# Full changelog +## Full changelog -## Nushell +### Nushell - sholderbach created [Commit the lockfile for 0.74](https://github.com/nushell/nushell/pull/7719), and [Bump version to `0.74.0`](https://github.com/nushell/nushell/pull/7718), and [[Chore] cleanup in `where` implementation](https://github.com/nushell/nushell/pull/7679), and [Try to use the latest tagged virtualenv](https://github.com/nushell/nushell/pull/7638), and [Fix quoting of empty string in `to nuon`](https://github.com/nushell/nushell/pull/7632), and [Update `Cargo.lock` to `powierza-coefficient 1.0.2`](https://github.com/nushell/nushell/pull/7629), and [Fix the syntax highlighting in `help metadata`](https://github.com/nushell/nushell/pull/7628), and [Fix usage of deprecated C-style logical `and`](https://github.com/nushell/nushell/pull/7627), and [Include clippy check for dataframe in CI](https://github.com/nushell/nushell/pull/7596), and [Further cleanup of `Span::test_data` usage + span fixes](https://github.com/nushell/nushell/pull/7595), and [Fix `&&` quotation in `to nuon` after proptest fail](https://github.com/nushell/nushell/pull/7564), and [Bump to new development version `0.73.1`](https://github.com/nushell/nushell/pull/7544), and [Fix line-end trimming in subexpression](https://github.com/nushell/nushell/pull/7543), and [Add more input/output type annotations](https://github.com/nushell/nushell/pull/7532), and [Remove `math eval` command](https://github.com/nushell/nushell/pull/7284) - WindSoilder created [Auto-Completion: put ` tildes around filenames with parentheses](https://github.com/nushell/nushell/pull/7712), and [revert changes on prepend and append](https://github.com/nushell/nushell/pull/7660), and [last, skip, drop, take until, take while, skip until, skip while, where, reverse, shuffle, append, prepend and sort-by raise error when given non-lists ](https://github.com/nushell/nushell/pull/7623), and [fix python plugin example](https://github.com/nushell/nushell/pull/7599), and [avoid panic when using from nuon](https://github.com/nushell/nushell/pull/7533) @@ -280,7 +278,7 @@ We are exploring how nushell can leverage that for more useful diagnostics and c - swarnimarun created [chore: make the config setup messages consistent](https://github.com/nushell/nushell/pull/7560) - raccmonteiro created [`uniq` and `uniq-by` optimization (#7477)](https://github.com/nushell/nushell/pull/7534) -## Documentation +### Documentation - kubouch created [Link to the new parse-eval page](https://github.com/nushell/nushell.github.io/pull/735), and [Start Design Notes chapter; Add parse-eval notes](https://github.com/nushell/nushell.github.io/pull/734), and [Fix wrong PATH append example](https://github.com/nushell/nushell.github.io/pull/721), and [Add image; Fmt](https://github.com/nushell/nushell.github.io/pull/718) - WindSoilder created [update breaking changes](https://github.com/nushell/nushell.github.io/pull/733), and [Try to rename from blog text to changeLog](https://github.com/nushell/nushell.github.io/pull/732) @@ -293,14 +291,14 @@ We are exploring how nushell can leverage that for more useful diagnostics and c - merelymyself created [clarify columns and rows](https://github.com/nushell/nushell.github.io/pull/711) - rgwood created [Mention breaking save change](https://github.com/nushell/nushell.github.io/pull/710) -## Nu_Scripts +### Nu_Scripts - kubouch created [Fix broken conda prompt](https://github.com/nushell/nu_scripts/pull/338) - fdncred created [update coloring scripts with newer syntax](https://github.com/nushell/nu_scripts/pull/336), and [update 20k script with save changes](https://github.com/nushell/nu_scripts/pull/335), and [update sparkline script](https://github.com/nushell/nu_scripts/pull/334) - skelly37 created [Fix `dict` and `cdpath` for 0.73](https://github.com/nushell/nu_scripts/pull/333) - maxim-uvarov created [Function to format nicely big numbers: number-format.nu](https://github.com/nushell/nu_scripts/pull/332) -## reedline +### reedline - sholderbach created [Fix the Github actions badge](https://github.com/nushell/reedline/pull/523) - CozyPenguin created [Make reedline handling cursor shapes more configurable](https://github.com/nushell/reedline/pull/515) diff --git a/blog/2023-01-31-nushell_0_75.md b/src/content/docs/blog/2023-01-31-nushell_0_75.md similarity index 94% rename from blog/2023-01-31-nushell_0_75.md rename to src/content/docs/blog/2023-01-31-nushell_0_75.md index a52dc31409e..1c683efe251 100644 --- a/blog/2023-01-31-nushell_0_75.md +++ b/src/content/docs/blog/2023-01-31-nushell_0_75.md @@ -3,18 +3,16 @@ title: Nushell 0.75 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.75 of Nu. This release extends our unicode support, renames some important HTTP-related commands, and improves our module system. It also contains a good amount of polish and refactoring behind the scenes. +description: Today, we're releasing version 0.75 of Nu. This release extends our unicode support, renames some important HTTP-related commands, and improves our module system. It also contains a good amount of polish and refactoring behind the scenes. --- -# Nushell 0.75 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. Today, we're releasing version 0.75 of Nu. This release extends our unicode support, renames some important HTTP-related commands, and improves our module system. It also contains a good amount of polish and refactoring behind the scenes. <!-- more --> -# Where to get it +## Where to get it Nu 0.75 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.75.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,11 +20,11 @@ NOTE: The optional dataframe functionality is available by `cargo install nu --f As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release / New features +## Themes of this release / New features -## Changed Unicode escapes in strings ([bobhy](https://github.com/nushell/nushell/pull/7883)) +### Changed Unicode escapes in strings ([bobhy](https://github.com/nushell/nushell/pull/7883)) -::: warning +:::caution[warning] **Breaking Change**: You need to update escapes like `"\u0043"` to `"\u{0043}"` @@ -52,11 +50,11 @@ This format allows you to insert any Unicode code point into a string by specify We've simply dropped support for the old format since we're pre-1.0 and didn't want to carry forward redundant syntax. You will have to change any unicode escapes in your scripts to the new format. -_Why change?_ The old 4-digit syntax could not natively address recent extensions to Unicode standard, such as emoji, CJK extension and traditional scripts. There is a cumbersome workaround in the form of [surrogate pairs](https://unicodebook.readthedocs.io/unicode_encodings.html#surrogates), but this is not intuitive. +_Why change?_ The old 4-digit syntax could not natively address recent extensions to Unicode standard, such as emoji, CJK extension and traditional scripts. There is a cumbersome workaround in the form of [surrogate pairs](https://unicodebook.readthedocs.io/unicode_encodings#surrogates), but this is not intuitive. Why this change? The new format allows you to specify any Unicode code point with a single, predictable syntax. Rust and ECMAScript 6 support the same syntax. (Full disclosure: C++, Python and Java don't.) -## `-g` grapheme cluster flags for `str length`, `str substring`, `str index-of`, `split words` and `split chars` ([webbedspace](https://github.com/nushell/nushell/pull/7752)) +### `-g` grapheme cluster flags for `str length`, `str substring`, `str index-of`, `split words` and `split chars` ([webbedspace](https://github.com/nushell/nushell/pull/7752)) As you know, `str length`, `str substring`, `str index-of` and `split words` measure the length of strings and substrings in UTF-8 bytes, which is often very unintuitive - all non-ASCII characters are of length 2 or more, and splitting a non-ASCII character can create garbage characters as a result. A much better alternative is to measure the length in _extended grapheme clusters_. In Unicode, a "grapheme cluster" tries to map as closely as possible to a single visible character. This means, among many other things: @@ -85,17 +83,17 @@ In addition, the flag has been added to `split chars`. Notably, this command spl These commands also have `--utf-8-bytes`/`-b` flags which enable the legacy behavior (and `split chars` has `--code-points`/`-c`). These currently _do not do anything_ and need not strictly be used, since UTF-8 byte lengths are still the default behaviour. However, if this default someday changes, then these flags will guarantee that the legacy behaviour is used. -::: tip +:::tip It is currently being debated whether or not grapheme clusters should be used as the default string length measurement in Nushell (making the `-g` flag the default behaviour for these commands), due to their intuitiveness, consistency across non-Latin scripts, and better correspondence to the length of strings displayed in the terminal (after stripping ANSI codes). Currently, the Nushell developers are uncertain what the long-term impact of such a change would be, whether existing scripts would be non-trivially harmed by it, or whether it would hinder interoperability with external programs. If you have any personal insight or opinion about this change, or about which behaviour you'd prefer not to require a flag, your input is desired! ::: -## New `enumerate` command ([JT](https://github.com/nushell/nushell/pull/7871)) +### New `enumerate` command ([JT](https://github.com/nushell/nushell/pull/7871)) A new `enumerate` command will enumerate the input, and add an index and item record for each item. The index is the number of the item in the input stream, and item is the original value of the item. -``` +```nu > ls | enumerate | get 14 ╭───────┬────────────────────────────╮ │ index │ 14 │ @@ -110,7 +108,7 @@ A new `enumerate` command will enumerate the input, and add an index and item re Rather than relying on the `--numbered` flags of commands like `each`, with the `enumerate` command we take more modular and composable approach than hard-coding flags to our commands. (Note: The `--numbered` flags have not been removed yet.) -## Breaking changes to the web-related commands ([Kazuki-Ya](https://github.com/nushell/nushell/pull/7796), [VincenzoCarlino](https://github.com/nushell/nushell/pull/7702)) +### Breaking changes to the web-related commands ([Kazuki-Ya](https://github.com/nushell/nushell/pull/7796), [VincenzoCarlino](https://github.com/nushell/nushell/pull/7702)) We decided to move some of the important command for interacting with HTTP under their own `http` subcommands for better discoverability. The common `fetch` command is now `http get`. @@ -121,12 +119,11 @@ The common `fetch` command is now `http get`. | `post` | `http post` | | `to url` | `url build-query` | -## `main` command exported from module defines top-level module command ([kubouch](https://github.com/nushell/nushell/pull/7764)) +### `main` command exported from module defines top-level module command ([kubouch](https://github.com/nushell/nushell/pull/7764)) Defining and exporting a `main`command from a module allows creating a command with the same name as the module. Consider this example: -```nu -# command.nu +```nu title="command.nu" export def main [] { 'This is a command' } export def subcommand [] { 'This is a subcommand' } @@ -155,9 +152,7 @@ Combined with a [recent bugfix](https://github.com/nushell/nushell/pull/7830), t Before: -```nu -# cargo.nu - +```nu title="cargo.nu" export extern cargo [--version, --color: string@cargo-color-complete] export extern `cargo check` [--quiet] @@ -169,9 +164,7 @@ def cargo-color-complete [] { After: -```nu -# cargo.nu - +```nu title="cargo.nu" export extern main [--version, --color: string@cargo-color-complete] export extern check [--quiet] @@ -183,14 +176,14 @@ def cargo-color-complete [] { It is also a stepping stone towards being able to handle directories which in turn is a stepping stone towards having proper Nushell packages. -## Progress bar for `save` command ([Xoffio](https://github.com/nushell/nushell/pull/7661)) +### Progress bar for `save` command ([Xoffio](https://github.com/nushell/nushell/pull/7661)) To watch the progress when saving large files you can now pass the `--progress` flag to `save`. It gives information about the throughput and an interactive progress bar if available. - + -# Breaking changes +## Breaking changes - Unicode escapes in strings now use and extended format `\u{X...}`, any scripts using the old syntax `\uXXXX` will have to be updated. See also [#7883](https://github.com/nushell/nushell/pull/7883). - The `to url` command has been renamed and moved to `url build-query` as this better reflects is role as a nushell specific `url` command compared to a conversion. ([#7702](https://github.com/nushell/nushell/pull/7702)) @@ -201,9 +194,9 @@ It gives information about the throughput and an interactive progress bar if ava - `last`, `skip`, `drop`, `take until`, `take while`, `skip until`, `skip while`, `where`, `reverse`, `shuffle`, `append`, `prepend` and `sort-by` raise error when given non-lists ([#7623](https://github.com/nushell/nushell/pull/7623)) - `to csv` and `to tsv` now throw error on unsupported inputs ([7850](https://github.com/nushell/nushell/pull/7850)) -# Full changelog +## Full changelog -## Nushell +### Nushell - kubouch created [Remove deprecated `where -b` parameter](https://github.com/nushell/nushell/pull/7927), and [Fix panic when assigning value to $env](https://github.com/nushell/nushell/pull/7894), and [Fix wrong VarId of $in variable](https://github.com/nushell/nushell/pull/7893), and [Fix command name lookup for known externals](https://github.com/nushell/nushell/pull/7830), and [Allow main command to define top-level module command](https://github.com/nushell/nushell/pull/7764), and [Add const support for all overlay commands](https://github.com/nushell/nushell/pull/7720) - fdncred created [update type check so that ++ with lists works better](https://github.com/nushell/nushell/pull/7926), and [with the release of rust 1.67, let's bump to 1.66.1](https://github.com/nushell/nushell/pull/7866), and [add decimal to SyntaxShape](https://github.com/nushell/nushell/pull/7852), and [add some startup performance metrics](https://github.com/nushell/nushell/pull/7851), and [print nushell startup time](https://github.com/nushell/nushell/pull/7831), and [fix signature display in help commands](https://github.com/nushell/nushell/pull/7802), and [update sqlparser dependency](https://github.com/nushell/nushell/pull/7772), and [update semver dep](https://github.com/nushell/nushell/pull/7771), and [Add cursor shape configuration for each edit mode](https://github.com/nushell/nushell/pull/7745), and [update base64 implementation to newer crate](https://github.com/nushell/nushell/pull/7739), and [update release-pkg comments for manual runs](https://github.com/nushell/nushell/pull/7726) @@ -233,13 +226,13 @@ It gives information about the throughput and an interactive progress bar if ava - nanoqsh created [Detailed message during core dumped](https://github.com/nushell/nushell/pull/7737) - murex971 created [Add search terms in random and expression categories](https://github.com/nushell/nushell/pull/7736) -## Extension +### Extension - Hofer-Julian created [Add another directory where nu might be installed](https://github.com/nushell/vscode-nushell-lang/pull/75) - fdncred created [get ready for new 1.0 release](https://github.com/nushell/vscode-nushell-lang/pull/74) - glcraft created [New syntax highlight](https://github.com/nushell/vscode-nushell-lang/pull/73) -## Documentation +### Documentation - Hofer-Julian created [Reflect the separation of block and closure](https://github.com/nushell/nushell.github.io/pull/757), and [Add separate page for setting Nu as default shell](https://github.com/nushell/nushell.github.io/pull/754), and [Add Github Actions workflow to check typos](https://github.com/nushell/nushell.github.io/pull/753) - bobhy created [Document \u{x...} unicode escapes](https://github.com/nushell/nushell.github.io/pull/756), and [document 7883 for release notes](https://github.com/nushell/nushell.github.io/pull/755) @@ -252,7 +245,7 @@ It gives information about the throughput and an interactive progress bar if ava - hustcer created [Refresh commands docs for nu v0.74](https://github.com/nushell/nushell.github.io/pull/736) - hbt created [fix deprecated cmd](https://github.com/nushell/nushell.github.io/pull/667) -## Nu_Scripts +### Nu_Scripts - Neur1n created [nu_conda: Another Conda module with Better Performance](https://github.com/nushell/nu_scripts/pull/367) - fdncred created [small tweaks to get panache working again](https://github.com/nushell/nu_scripts/pull/365), and [fix oh-my.nu script after `do` changes in nushell](https://github.com/nushell/nu_scripts/pull/364), and [fix ohmy.nu path handling on windows](https://github.com/nushell/nu_scripts/pull/351), and [add timed_weather that checks the weather at timed intervals](https://github.com/nushell/nu_scripts/pull/349), and [fixed a type-o in the weather script](https://github.com/nushell/nu_scripts/pull/348), and [fix some bugs when on slash](https://github.com/nushell/nu_scripts/pull/342) @@ -270,7 +263,7 @@ It gives information about the throughput and an interactive progress bar if ava - DrakeTDL created [feat(custom-completions): add reflector completions](https://github.com/nushell/nu_scripts/pull/329) - ldsands created [Add files needed for Poetry custom-completions](https://github.com/nushell/nu_scripts/pull/319) -## reedline +### reedline - sholderbach created [Remove unstable rustdoc lint](https://github.com/nushell/reedline/pull/533), and [Bump version for `0.15` release](https://github.com/nushell/reedline/pull/532) - dgkf created [Allow configuration of multiline prompt color](https://github.com/nushell/reedline/pull/531) diff --git a/blog/2023-02-21-nushell_0_76.md b/src/content/docs/blog/2023-02-21-nushell_0_76.md similarity index 94% rename from blog/2023-02-21-nushell_0_76.md rename to src/content/docs/blog/2023-02-21-nushell_0_76.md index e48cb01be1b..ec926bebef6 100644 --- a/blog/2023-02-21-nushell_0_76.md +++ b/src/content/docs/blog/2023-02-21-nushell_0_76.md @@ -3,18 +3,16 @@ title: Nushell 0.76 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.76 of Nu. This release adds more commands for debugging, multiplication to clone strings, and moves some file formats to a plugin, thanks to better plugin support. +description: Today, we're releasing version 0.76 of Nu. This release adds more commands for debugging, multiplication to clone strings, and moves some file formats to a plugin, thanks to better plugin support. --- -# Nushell 0.76 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. Today, we're releasing version 0.76 of Nu. This release adds more commands for debugging, multiplication to clone strings, and moves some file formats to a plugin, thanks to better plugin support. <!-- more --> -# Where to get it +## Where to get it Nu 0.76 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.76.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,9 +20,9 @@ NOTE: The optional dataframe functionality is available by `cargo install nu --f As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release / New features +## Themes of this release / New features -## Debugging +### Debugging We've added a few new commands to help with nushell debugging. @@ -36,13 +34,13 @@ We've added a few new commands to help with nushell debugging. The explain command attempts to explain to you how the pipeline, in the passed in block, is going to be interpreted. It shows the pipeline and command index, the looked up and found command name, the command argument data type, and argument details, among other things. Note that spans are also included and can be used with `view span`. - + - [`inspect`](https://github.com/nushell/nushell/pull/8028) - Immediately prints out the contents of a pipeline The purpose of the `inspect` command is to help to debug pipelines. It works by allowing you to inject the `inspect` command into a pipeline at any point. Then it shows you what the input description is and what the input values are that are passed into `inspect`. With each step it prints this information out while also passing the value information on to the next step in the pipeline. - + - `metadata` - The `metadata` command works the same as before. @@ -50,7 +48,7 @@ The purpose of the `inspect` command is to help to debug pipelines. It works by Enables fine-grained profiling of individual pipeline elements and recursively stepping into blocks/closures. The recursion depth can be controlled (default is 1) and it can optionally collect the profiled source segments for easier orientation and value in each step for easier debugging. - + _Note: There are known limitations that the profiler can't run. For example, it can't collect data from subexpressions and loop iterations. It is caused by profiling data being collected as pipeline metadata and a known bug that pipeline metadata is not preserved in some cases._ @@ -65,7 +63,7 @@ _Note: There are known limitations that the profiler can't run. For example, it `view files` lists the files and entries loaded into nushell's EngineState memory. Note the spans, for use with `view span` and the size of each file's contents stored. - + - [`view source`](https://github.com/nushell/nushell/pull/7989) (formerly known as `view-source`, same functionality) @@ -96,7 +94,7 @@ Error: nu::parser::unsupported_operation (link) help: Change int or string to be the right types and try again. ``` -### Example usage: +#### Example usage ```nu 〉let a = 42 @@ -168,7 +166,7 @@ In an effort to have a little more organization, we've assigned a category of `D - view source - view span -## "Multiplication" of strings and lists is now supported. ([WindSoilder](https://github.com/nushell/nushell/pull/8061)) +### "Multiplication" of strings and lists is now supported. ([WindSoilder](https://github.com/nushell/nushell/pull/8061)) Like in Python you can now use the multiplication operator `*` to create `n` concatenated copies of a string or list. Here `n` has to be an `int` value. @@ -198,34 +196,34 @@ In the same spirit you can use it to quickly create lists with repeatedly the sa ╰───┴────╯ ``` -::: tip Community Question +:::tip[Community Question] We are interested in your feedback regarding the list multiplication. Does this match your expectations or do you want to use this operator overload more often to do scalar multiplication and look for numerical broadcasting support. Let us know! ::: -## Dataframe commands are again explicitly separated from core nushell commands. ([#7998](https://github.com/nushell/nushell/pull/7998)) +### Dataframe commands are again explicitly separated from core nushell commands. ([#7998](https://github.com/nushell/nushell/pull/7998)) -::: warning NOTE +:::note The optional dataframe functionality is available by `cargo install nu --features=dataframe` or a distribution that includes that feature. ::: Dataframe commands have all been renamed in order to avoid confusion with nushell commands. It also makes our help commands less confusing. For instance, you can now do `help select` and understand how to use the traditional nushell select command and you can do `help dfr select` and understand how to use the dataframe specific select command. Previously this was a source of cryptic error messages that were confusing to users. -## `PATH` vs `Path` ([#8003](https://github.com/nushell/nushell/pull/8003)) +### `PATH` vs `Path` ([#8003](https://github.com/nushell/nushell/pull/8003)) We fixed a `PATH` vs. `Path` bug in completions, so now you should be able to do commands like `cod<tab>` and get completions like `code` and `code.cmd` across all operating systems. -## More commands become plugins and plugins get first-class help support (WindSoilder, [#7984](https://github.com/nushell/nushell/pull/7984), [#7942](https://github.com/nushell/nushell/pull/7942)) +### More commands become plugins and plugins get first-class help support (WindSoilder, [#7984](https://github.com/nushell/nushell/pull/7984), [#7942](https://github.com/nushell/nushell/pull/7942)) In an effort to both make the core nushell binary smaller and to improve our plugins system along the way we moved the commands for several less common file formats to `nu_plugin_formats`. To make sure you still have a first-class experience while using these commands, our plugins can now support code examples in the `help` and `F1` menu. - + As a result, plugin authors need to slightly update their command `Signature` to `PluginSignature` which supports the examples and recompile. -## Improved error messages for int and string literals +### Improved error messages for int and string literals Nushell now gives more specific and helpful messages when it detects syntax errors. In this release we've improved errors for `string` and `int` literals but we hope to improve more in the future. [#7952](https://github.com/nushell/nushell/pull/7952) @@ -239,7 +237,7 @@ Errors in the format of escapes within double-quoted strings are reported specif <tr> <td> -``` +```nu ------------------------------------------ # Invalid 2 character escape ------------------------------------------ @@ -271,7 +269,7 @@ Error: nu::parser::parse_mismatch (link) </td> <td> -``` +```nu ------------------------------------------------------- # Invalid 2 character escape ------------------------------------------------------- @@ -314,7 +312,7 @@ Invalid digits in radix-prefixed int literals are now flagged as a specific erro <tr> <td> -``` +```nu ------------------------------------------------------ # invalid radix-prefixed integer literals ------------------------------------------------------ @@ -337,7 +335,7 @@ Error: nu::parser::unsupported_operation (link) </td> <td> -``` +```nu -------------------------------------------------------- # invalid radix-prefixed integer literals -------------------------------------------------------- @@ -362,7 +360,7 @@ Error: </tr> </table> -## General housekeeping in the Nu codebase (Hofer-Julian, fdncred, rgwood, sholderbach) +### General housekeeping in the Nu codebase (Hofer-Julian, fdncred, rgwood, sholderbach) We are very lucky that we recently had a number of new contributors starting to help out with bug fixes and improvements to Nushell. We want to thank you and want to welcome you all! @@ -371,7 +369,7 @@ This includes work to break up less readable code in important places, and a sig We also updated a number of dependencies and want to continue to improve our dependency tree. We recently enlisted the relentless help of the dependabot. Furthermore, we enabled rudimentary tracking of test coverage through `codecov.io`. This should help us identify areas were additional tests are needed and can be a great contribution to the project. -# Breaking changes +## Breaking changes - `load-env` can not accidentally set `$env.PWD` anymore ([#7963](https://github.com/nushell/nushell/pull/7963)) - The `--numbered` flag to enumerate entries has been removed from `each`, `par-each`, `each while`, and `reduce`. Use the `enumerate` command added in 0.75 instead. ([#7777](https://github.com/nushell/nushell/pull/7777)) @@ -386,9 +384,9 @@ Furthermore, we enabled rudimentary tracking of test coverage through `codecov.i - Filesystem commands now print to stderr when using `--verbose` flag ([8014](https://github.com/nushell/nushell/pull/8014)) - The `parse` command will now create 0 indexed columns instead of 1 indexed ([7897](https://github.com/nushell/nushell/pull/7897)) -# Full changelog +## Full changelog -## Nushell +### Nushell - amtoine created [TEST: add the output to the new `with-env` example](https://github.com/nushell/nushell/pull/8148), and [DOCUMENTATION: add a new "key-value" example to `with-env`](https://github.com/nushell/nushell/pull/8119), and [remove the `--encoding` option from `register` in the examples](https://github.com/nushell/nushell/pull/8038) - sholderbach created [Pin `reedline` to `0.16.0`](https://github.com/nushell/nushell/pull/8142), and [Add a script to generate coverage locally](https://github.com/nushell/nushell/pull/8125), and [Bump version for `0.76.0` release](https://github.com/nushell/nushell/pull/8121), and [Make patch coverage check informational only](https://github.com/nushell/nushell/pull/8069), and [Add a `codecov.yml` configuration](https://github.com/nushell/nushell/pull/8059), and [Disable auto-benchmark harness for crates](https://github.com/nushell/nushell/pull/8057), and [Minor clippy: inline format string](https://github.com/nushell/nushell/pull/8043), and [Fix imported virtualenv testsuite](https://github.com/nushell/nushell/pull/8001), and [Test return in `reduce` closure from #7961](https://github.com/nushell/nushell/pull/7973), and [Fix `def-env` docs according to docs#761](https://github.com/nushell/nushell/pull/7972), and [Fix code in benchmarks](https://github.com/nushell/nushell/pull/7949), and [Another shot at trying to setup codecov](https://github.com/nushell/nushell/pull/7948) @@ -414,12 +412,12 @@ Furthermore, we enabled rudimentary tracking of test coverage through `codecov.i - merelymyself created [allow `parse` to work better with streams](https://github.com/nushell/nushell/pull/7870), and [ensure that when nu evaluates files, it allows early returns](https://github.com/nushell/nushell/pull/7415) - dmatos2012 created [Support URLs in `start` command](https://github.com/nushell/nushell/pull/7799) -## Extension +### Extension - glcraft created [Fix `use` syntax ](https://github.com/nushell/vscode-nushell-lang/pull/79) - kecrily created [feat: add icon for `.nu` extension in VS Code](https://github.com/nushell/vscode-nushell-lang/pull/77) -## Documentation +### Documentation - WindSoilder created [Add breaking change](https://github.com/nushell/nushell.github.io/pull/790), and [Add breaking change for plugin signature](https://github.com/nushell/nushell.github.io/pull/775) - Hofer-Julian created [Prepare for generation of categories](https://github.com/nushell/nushell.github.io/pull/789), and [Move `book/commands` to `commands/commands`](https://github.com/nushell/nushell.github.io/pull/785), and [Move command reference to navbar](https://github.com/nushell/nushell.github.io/pull/782) @@ -431,7 +429,7 @@ Furthermore, we enabled rudimentary tracking of test coverage through `codecov.i - FilipAndersson245 created [replaces fetch with http in varius places](https://github.com/nushell/nushell.github.io/pull/769), and [Updated cookbook with http get instead of fetch.](https://github.com/nushell/nushell.github.io/pull/763) - das-g created [[pt-BR] fix statement about `lines` output type ("tabela"→"lista")](https://github.com/nushell/nushell.github.io/pull/766), and [[es] fix statement about `lines` output type ("tabla"→"lista")](https://github.com/nushell/nushell.github.io/pull/765), and [fix statement about `lines` output type ("table"→"list")](https://github.com/nushell/nushell.github.io/pull/764) -## Nu_Scripts +### Nu_Scripts - sholderbach created [Update release script to `nu_plugin_formats`](https://github.com/nushell/nu_scripts/pull/384) - amtoine created [FEATURE: export all the math functions to use them in `nushell`](https://github.com/nushell/nu_scripts/pull/382), and [FIX: the math functions can not be `use`d](https://github.com/nushell/nu_scripts/pull/381) @@ -442,7 +440,7 @@ Furthermore, we enabled rudimentary tracking of test coverage through `codecov.i - WindSoilder created [update themes' readme](https://github.com/nushell/nu_scripts/pull/372) - Neur1n created [added nu_msvs module](https://github.com/nushell/nu_scripts/pull/370) -## reedline +### reedline - sholderbach created [Bump version for `0.16.0` release.](https://github.com/nushell/reedline/pull/542), and [Bump `rstest` to 0.16](https://github.com/nushell/reedline/pull/541) - rgwood created [VACUUM after deleting SQLite data](https://github.com/nushell/reedline/pull/538), and [Add History::clear() function](https://github.com/nushell/reedline/pull/536) diff --git a/blog/2023-03-14-nushell_0_77.md b/src/content/docs/blog/2023-03-14-nushell_0_77.md similarity index 96% rename from blog/2023-03-14-nushell_0_77.md rename to src/content/docs/blog/2023-03-14-nushell_0_77.md index 4becc4fdaab..5db16b991f6 100644 --- a/blog/2023-03-14-nushell_0_77.md +++ b/src/content/docs/blog/2023-03-14-nushell_0_77.md @@ -3,18 +3,16 @@ title: Nushell 0.77 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.77 of Nu. This release adds reworked aliases, more consistent timestamp handling, reworked XML support, and more. +description: Today, we're releasing version 0.77 of Nu. This release adds reworked aliases, more consistent timestamp handling, reworked XML support, and more. --- -# Nushell 0.77 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. Today, we're releasing version 0.77 of Nu. This release adds reworked aliases, more consistent timestamp handling, reworked XML support, and more. <!-- more --> -# Where to get it +## Where to get it Nu 0.77 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.77.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,9 +20,9 @@ NOTE: The optional dataframe functionality is available by `cargo install nu --f As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release / New features +## Themes of this release / New features -## Reworked aliases (Breaking changes!) ([kubouch](https://github.com/nushell/nushell/pull/8123)) +### Reworked aliases (Breaking changes!) ([kubouch](https://github.com/nushell/nushell/pull/8123)) Aliases have been a constant source of panics and growing code complexity as a result of trying to patch the panics. In this release, we re-implement aliases from scratch. Instead of replacing spans of expressions, aliases are implemented as another type of command, quite like `extern` is used to implement known externals. Alias is a command that wraps another command call. As a result, in some cases, aliases do not behave exactly the same as before. Here are the key facts: @@ -38,7 +36,7 @@ Aliases have been a constant source of panics and growing code complexity as a r If some of the above is too limiting for you, the old aliases are still unchanged and available as `old-alias`. Just change `alias` to `old-alias` and it should work the same as before. If there are no more problems with the new alias implementation, and we manage to iron out the recursive alias issue, we will remove `old-alias` in the next release, otherwise, we'll keep it around longer. -## More consistent timestamp handling ([bobhy](https://github.com/nushell/nushell/pull/8337)) +### More consistent timestamp handling ([bobhy](https://github.com/nushell/nushell/pull/8337)) Simplified conversion between Nushell `date` type and unix timestamps ([#8244](https://github.com/nushell/nushell/pull/8244)). @@ -98,7 +96,7 @@ And finally, although not strictly required by the above fix, `<date> | date to- ╰───┴──────┴───────┴─────┴──────┴────────┴────────┴────────────┴──────────╯ ``` -## New XML format ([NotLebedev](https://github.com/nushell/nushell/pull/7947)) +### New XML format ([NotLebedev](https://github.com/nushell/nushell/pull/7947)) New format for xml data created and accepted by `from xml` and `to xml` commands ([#7947](https://github.com/nushell/nushell/pull/7947)). @@ -152,7 +150,7 @@ empty fields of records: <html><body><h1>Hello from Nushell !</h1><a href="https://www.nushell.sh/">Learn more here</a><p>Current time is Mon, 13 Mar 2023 21:20:56 +0300 (now)</p></body></html> ``` -## New additions to `$nu` ([StevenDoesStuffs](https://github.com/nushell/nushell/pull/8306), [amtoine](https://github.com/nushell/nushell/pull/8353)) +### New additions to `$nu` ([StevenDoesStuffs](https://github.com/nushell/nushell/pull/8306), [amtoine](https://github.com/nushell/nushell/pull/8353)) The builtin `$nu` variable now contains new entries: @@ -160,11 +158,11 @@ The builtin `$nu` variable now contains new entries: - `is-login`: Nushell was launched in login mode - `startup_time`: Nushell's startup time -## Reworked `http` subcommands ([jaudiger](https://github.com/nushell/nushell/pull/8135), [jaudiger](https://github.com/nushell/nushell/pull/8144)) +### Reworked `http` subcommands ([jaudiger](https://github.com/nushell/nushell/pull/8135), [jaudiger](https://github.com/nushell/nushell/pull/8144)) The `http` command now has more subcommands and existing subcommands have been reworked: -``` +```nu > help http Various commands for working with http methods. @@ -192,7 +190,7 @@ Signatures: Make sure to browse the help messages of these commands. They contain fully functional examples thanks to pointing at www.example.com. -## Examples results are now shown in `help` pages ([amtoine](https://github.com/nushell/nushell/pull/8189)) +### Examples results are now shown in `help` pages ([amtoine](https://github.com/nushell/nushell/pull/8189)) When commands define expected results for their examples, the output is now shown just below the associated examples. @@ -243,10 +241,11 @@ Examples: ╰───┴─────────┴─────────╯ ``` -> :bulb: **Note** -> the website has been modified accordingly with the same outputs. +:::tip +the website has been modified accordingly with the same outputs. +::: -# Breaking changes +## Breaking changes - Alias changes, see above - Comments on the same line as code now require a space before ` #` to be recognized as such. This allows you to have a string `foo#bar` with a pound sign. ([#8151](https://github.com/nushell/nushell/pull/8151)) @@ -261,7 +260,7 @@ Examples: - Plugin authors relying on `nu_protocol::Value` may need to update their code to account for a change to `Value::Error` ([#8375](https://github.com/nushell/nushell/pull/8375)) - Different types of lists can now be appended. This can break scripts that were relying on the stricter behavior (https://github.com/nushell/nushell/pull/8157) -# Full changelog +## Full changelog - sholderbach created [Pin to `reedline` 0.17](https://github.com/nushell/nushell/pull/8441), and [Pin to `nu-ansi-term` 0.47](https://github.com/nushell/nushell/pull/8440), and [Remove unused `nu-json` from `nu-protocol`](https://github.com/nushell/nushell/pull/8417), and [Bump version to `0.77.0`](https://github.com/nushell/nushell/pull/8410), and [Update all dependencies in `Cargo.lock`](https://github.com/nushell/nushell/pull/8408), and [Box `ShellError` in `Value::Error`](https://github.com/nushell/nushell/pull/8375), and [Document and critically review `ShellError` variants - Ep. 3](https://github.com/nushell/nushell/pull/8340), and [Document and critically review `ShellError` variants - Ep. 2](https://github.com/nushell/nushell/pull/8326), and [Fix codecov badge](https://github.com/nushell/nushell/pull/8279), and [Pull bleeding edge virtualenv tests again](https://github.com/nushell/nushell/pull/8262), and [Document and critically review `ShellError` variants - Ep. 1](https://github.com/nushell/nushell/pull/8229), and [Test more datatypes in nuon](https://github.com/nushell/nushell/pull/8211), and [Revert range expansion for `to nuon`](https://github.com/nushell/nushell/pull/8210), and [Add links to the remaining README badges](https://github.com/nushell/nushell/pull/8191), and [Disable Windows coverage tracking for now](https://github.com/nushell/nushell/pull/8190) - BlacAmDK created [Fix SQLite table creation sql](https://github.com/nushell/nushell/pull/8430) @@ -298,12 +297,12 @@ Examples: - zhiburt created [table --collapse dont do truncation return message instead](https://github.com/nushell/nushell/pull/8172) - Yethal created [Added examples to query web plugin](https://github.com/nushell/nushell/pull/8171) -## Extensions +### Extensions - fdncred created [next release won't be a preview](https://github.com/nushell/vscode-nushell-lang/pull/85), and [update language, version, changelog](https://github.com/nushell/vscode-nushell-lang/pull/84) - adhadse created [modified extension.ts to include standard dir for binary files on linux](https://github.com/nushell/vscode-nushell-lang/pull/82) -## Documentation +### Documentation - kubouch created [Add alias note](https://github.com/nushell/nushell.github.io/pull/824) - NotLebedev created [Add description for #8205 and #8014](https://github.com/nushell/nushell.github.io/pull/821) @@ -322,7 +321,7 @@ Examples: - hustcer created [Add short flags to command docs, fix #509](https://github.com/nushell/nushell.github.io/pull/795), and [Add registry query doc for Windows](https://github.com/nushell/nushell.github.io/pull/794), and [Refresh docs for v0.76](https://github.com/nushell/nushell.github.io/pull/791) - Hofer-Julian created [Generate categories](https://github.com/nushell/nushell.github.io/pull/793), and [Fix typo](https://github.com/nushell/nushell.github.io/pull/792) -## nu_scripts +### nu_scripts - sholderbach created [Add `nu-cmd-lang` to `nu_release.nu`](https://github.com/nushell/nu_scripts/pull/411) - siph created [Replace deprecated `str collect` command](https://github.com/nushell/nu_scripts/pull/410) @@ -339,7 +338,7 @@ Examples: - Kinchkun created [job.nu: update view source usage](https://github.com/nushell/nu_scripts/pull/392) - baehyunsol created [make `up.nu` much simpler](https://github.com/nushell/nu_scripts/pull/391), and [remove `build-string`, which is deprecated](https://github.com/nushell/nu_scripts/pull/390) -## reedline +### reedline - sholderbach created [Apply clippy lints](https://github.com/nushell/reedline/pull/551), and [Bump version for `0.17.0` release](https://github.com/nushell/reedline/pull/550), and [Update `nu-ansi-term` to 0.47.0](https://github.com/nushell/reedline/pull/549) - merelymyself created [allow reedline ctrl+o to take editor arguments](https://github.com/nushell/reedline/pull/544) diff --git a/blog/2023-04-04-nushell_0_78.md b/src/content/docs/blog/2023-04-04-nushell_0_78.md similarity index 94% rename from blog/2023-04-04-nushell_0_78.md rename to src/content/docs/blog/2023-04-04-nushell_0_78.md index 69372d6cd45..ff06fdb0f75 100644 --- a/blog/2023-04-04-nushell_0_78.md +++ b/src/content/docs/blog/2023-04-04-nushell_0_78.md @@ -3,18 +3,16 @@ title: Nushell 0.78 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.78 of Nu. This release adds pattern matching, speed improvements, easier cell paths when columns may be missing, better error handling, and much more. +description: Today, we're releasing version 0.78 of Nu. This release adds pattern matching, speed improvements, easier cell paths when columns may be missing, better error handling, and much more. --- -# Nushell 0.78 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. Today, we're releasing version 0.78 of Nu. This release adds pattern matching, speed improvements, easier cell paths when columns may be missing, better error handling, and much more. <!-- more --> -# Where to get it +## Where to get it Nu 0.78 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.78.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,9 +20,9 @@ NOTE: The optional dataframe functionality is available by `cargo install nu --f As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release / New features +## Themes of this release / New features -## Pattern matching (jt) +### Pattern matching (jt) With 0.78, Nushell now comes with the `match` expression, which allows you to do pattern matching on a value. It supports a variety of different kinds of patterns, which can be mixed and matched to create more complicated patterns. @@ -56,9 +54,9 @@ match $list { } ``` -## Alias changes ([kubouch](https://github.com/nushell/nushell/pull/8557)) +### Alias changes ([kubouch](https://github.com/nushell/nushell/pull/8557)) -### Aliases now can shadow +#### Aliases now can shadow We've updated the new `alias` command we introduced in 0.77 to work more closely to the previous one. For example: @@ -69,7 +67,7 @@ We've updated the new `alias` command we introduced in 0.77 to work more closely Will now create the `l` alias that points to `ls -l`, with most recent line getting precedence during alias expansion. -### Alias can be named the same as the aliased command +#### Alias can be named the same as the aliased command ```nu > alias ls = ls -a @@ -77,11 +75,11 @@ Will now create the `l` alias that points to `ls -l`, with most recent line gett Now correctly displays all files when calling `ls`, instead of throwing an unhelpful error. -### Old alias still keeps working +#### Old alias still keeps working Since there are still some remaining issues to fix with the new alias implementation, we still keep `old-alias` around for this release. -## Speed improvements ([jt](https://github.com/nushell/nushell/pull/8609)) +### Speed improvements ([jt](https://github.com/nushell/nushell/pull/8609)) We've sped up the performance of tight loops like `for` and `while` considerably in this release. For example, on our test machine: @@ -95,7 +93,7 @@ Example 2: `timeit { mut x = 1; while $x < 1000000 { $x += 1 } }` - 0.77.1: 1082ms - 0.78.0: 170ms -## Optional cell path members ([rgwood](https://github.com/nushell/nushell/pull/8379)) +### Optional cell path members ([rgwood](https://github.com/nushell/nushell/pull/8379)) In Nu 0.78, you can use `?` in cell paths to suppress errors from missing data. `?` is a more convenient+powerful version of the `-i`/`--ignore-errors` flag on `get` and `select`. Here are some examples: @@ -129,7 +127,7 @@ In Nu 0.78, you can use `?` in cell paths to suppress errors from missing data. ╰───┴─────╯ ``` -## better error handling in `error make` (`amtoine` in [#8511](https://github.com/nushell/nushell/pull/8511) and [#8570](https://github.com/nushell/nushell/pull/8570)) +### better error handling in `error make` (`amtoine` in [#8511](https://github.com/nushell/nushell/pull/8511) and [#8570](https://github.com/nushell/nushell/pull/8570)) The `error make` command now gives better hints about why the format is not a valid `error make` format: @@ -139,7 +137,7 @@ The `error make` command now gives better hints about why the format is not a va The second change disallow the use of a `$.label.start` greater than `$.label.end` as a span. -## Support for pretty output format in `to nuon` ([amtoine](https://github.com/nushell/nushell/pull/8366)) +### Support for pretty output format in `to nuon` ([amtoine](https://github.com/nushell/nushell/pull/8366)) The `to nuon` command can now output _pretty_ NUON data with whitespaces for better readability. @@ -180,60 +178,60 @@ The default _single-line_ behaviour still can be enforced with the `--raw` optio {date: 2000-01-01T00:00:00+00:00, data: [1, [2, 3], 4.56]} ``` -## New `math exp` command ([lesves](https://github.com/nushell/nushell/pull/8700)) +### New `math exp` command ([lesves](https://github.com/nushell/nushell/pull/8700)) To complement the `math ln` command, we now include a `math exp` command for exponentiation with the base e. -# Breaking changes +## Breaking changes -## `let` requires surrounding parentheses for saving command output +### `let` requires surrounding parentheses for saving command output `let x = ls` will not run the `ls` command anymore. If you need to save the output of a command, you need to wrap it in parentheses: `let x = (ls)`. -## `||` now required in closures +### `||` now required in closures To help differentiate between blocks (which can mutate variables) and closures (which can be used in a pipeline), we've changed the syntax of closures to require `||`. This means the simplest closure now looks like `{|| }` -## We no longer automatically print values as part of a script +### We no longer automatically print values as part of a script We've changed the automatic-printing rules for scripts and the REPL to now only automatically print the last value. This means two major breaking changes: - We no longer [automatically print loop values](https://github.com/nushell/nushell/pull/8618) - We no longer [print the results of every line automatically, requiring you to do it manually](https://github.com/nushell/nushell/pull/8292) -## Bare words can't start with a number +### Bare words can't start with a number Words that start with a number or are in some way number-like must [now must be wrapped in backticks to be treated at a bare word or wrapped in quotes to be a string](https://github.com/nushell/nushell/pull/8635). -## Fields can only be defined once +### Fields can only be defined once You can no longer [redefine a field in a record during initialization](https://github.com/nushell/nushell/pull/8705) -## Thread configuration moves to `par-each` +### Thread configuration moves to `par-each` Nushell no longer accepts the [-t/--threads flag to the binary as it's now part of `par-each`](https://github.com/nushell/nushell/pull/8686) -## Ranges become the standard range specifier +### Ranges become the standard range specifier `str substring` now [only accepts ranges](https://github.com/nushell/nushell/pull/8660) as does [`bytes at`](https://github.com/nushell/nushell/pull/8710). -## Alias recursion has been disabled +### Alias recursion has been disabled Alias recursion is [now disabled](https://github.com/nushell/nushell/pull/8557) -## Empty lists handled more consistently +### Empty lists handled more consistently `[] | select foo` [now returns an empty list instead of `null`](https://github.com/nushell/nushell/pull/8651) and `sort`, `uniq`, `sort-by`, and `uniq-by` [now return empty lists when given an empty list](https://github.com/nushell/nushell/pull/8669) (previously they would throw an error) These changes make it easier to work with lists of unknown size. -## Comparison operators now allow null +### Comparison operators now allow null Previously expressions like `1 < null` would error; [now they return `null`](https://github.com/nushell/nushell/pull/8617). -# Full changelog +## Full changelog -## Nushell +### Nushell - sholderbach created [Pin `reedline` to `0.18.0` release](https://github.com/nushell/nushell/pull/8728), and [Fix rest of license year ranges](https://github.com/nushell/nushell/pull/8727), and [Remove unused `atty` dep in `nu-table`](https://github.com/nushell/nushell/pull/8716), and [Bump version to `0.78.0`](https://github.com/nushell/nushell/pull/8715), and [Fix two stable `clippy` lints](https://github.com/nushell/nushell/pull/8712), and [Remove `proptest`s for nuon writing/parsing](https://github.com/nushell/nushell/pull/8688), and [Add `CONTRIBUTING` section on PRs and git](https://github.com/nushell/nushell/pull/8521) - fdncred created [Update .gitignore](https://github.com/nushell/nushell/pull/8717), and [fix test_default_config_path test after pr 8653](https://github.com/nushell/nushell/pull/8690), and [fully deprecate str collect](https://github.com/nushell/nushell/pull/8680), and [add a `threads` parameter to `par_each`](https://github.com/nushell/nushell/pull/8679), and [fix `inspect` panic with large tables](https://github.com/nushell/nushell/pull/8673), and [auto-expand paths in the `$nu` variable](https://github.com/nushell/nushell/pull/8653), and [allow startup-time to be captured when starting nushell with `nu -c`](https://github.com/nushell/nushell/pull/8599), and [tweak logging format](https://github.com/nushell/nushell/pull/8588), and [Clarify how `register` works](https://github.com/nushell/nushell/pull/8583), and [use reedline main branch](https://github.com/nushell/nushell/pull/8580), and [fixes the ability to have multiple modifiers on keybindings](https://github.com/nushell/nushell/pull/8579), and [make std.nu tests work on mac](https://github.com/nushell/nushell/pull/8576), and [Revert "Allow NU_LIBS_DIR and friends to be const"](https://github.com/nushell/nushell/pull/8501) @@ -281,11 +279,11 @@ Previously expressions like `1 < null` would error; [now they return `null`](htt - NotLebedev created [Disable pipeline echo](https://github.com/nushell/nushell/pull/8292) - alesito85 created [Ls symlink fix](https://github.com/nushell/nushell/pull/8276) -## Extension +### Extension - fdncred created [fix `use` when it's used in variable name](https://github.com/nushell/vscode-nushell-lang/pull/86) -## Documentation +### Documentation - pingiun created [Remove mention of 'env' command in environment.md](https://github.com/nushell/nushell.github.io/pull/854), and [Remove old 'env' command from configuration section](https://github.com/nushell/nushell.github.io/pull/853) - hustcer created [fix #850, make `make_docs.nu` work for nu v0.77.2+](https://github.com/nushell/nushell.github.io/pull/851), and [Update plugin docs for v0.77](https://github.com/nushell/nushell.github.io/pull/831) @@ -298,7 +296,7 @@ Previously expressions like `1 < null` would error; [now they return `null`](htt - alurm created [Fix typos in book/stdout_stderr_exit_codes.md](https://github.com/nushell/nushell.github.io/pull/835) - aidalgol created [Add "Coming from Bash" entries for discarding command output](https://github.com/nushell/nushell.github.io/pull/834) -## Nu_Scripts +### Nu_Scripts - fdncred created [replace occurences of `str collect` with `str join`](https://github.com/nushell/nu_scripts/pull/436), and [update to new nushell syntax](https://github.com/nushell/nu_scripts/pull/430), and [update script syntax to match the latest nushell](https://github.com/nushell/nu_scripts/pull/429), and [Update CODEOWNERS](https://github.com/nushell/nu_scripts/pull/428), and [updated some scripts to support the latest changes in 0.77.1](https://github.com/nushell/nu_scripts/pull/416) - fj0r created [add parameters default value to just's completion and `j` for shortcut](https://github.com/nushell/nu_scripts/pull/435), and [dp for `docker ps` support docker and podman](https://github.com/nushell/nu_scripts/pull/421) @@ -313,7 +311,7 @@ Previously expressions like `1 < null` would error; [now they return `null`](htt - amtoine created [FIX: define a `main` function to `use` the themes modules](https://github.com/nushell/nu_scripts/pull/402) - sholderbach created [Fix `since_last_release.nu` script](https://github.com/nushell/nu_scripts/pull/385) -## reedline +### reedline - sholderbach created [Bump version for `0.18.0` release](https://github.com/nushell/reedline/pull/564) - fdncred created [show the ability to have multiple modifiers](https://github.com/nushell/reedline/pull/559) diff --git a/blog/2023-04-25-nushell_0_79.md b/src/content/docs/blog/2023-04-25-nushell_0_79.md similarity index 93% rename from blog/2023-04-25-nushell_0_79.md rename to src/content/docs/blog/2023-04-25-nushell_0_79.md index bbb054a7954..70ef0b4defb 100644 --- a/blog/2023-04-25-nushell_0_79.md +++ b/src/content/docs/blog/2023-04-25-nushell_0_79.md @@ -3,18 +3,16 @@ title: Nushell 0.79 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.79 of Nu. This release adds a standard library written in nu itself and enhanced IDE support. +description: Today, we're releasing version 0.79 of Nu. This release adds a standard library written in nu itself and enhanced IDE support. --- -# Nushell 0.79 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. Today, we're releasing version 0.79 of Nu. This release adds a standard library written in nu itself and enhanced IDE support. <!-- more --> -# Where to get it +## Where to get it Nu 0.79 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.79.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,9 +20,9 @@ NOTE: The optional dataframe functionality is available by `cargo install nu --f As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release / New features +## Themes of this release / New features -## Standard library ([@amtoine, @bobhy, @fdncred, @presidento, ...][stdlib PRs]) +### Standard library ([@amtoine, @bobhy, @fdncred, @presidento, ...][stdlib PRs]) This is it. We finally release the standard library with this `0.79`! It's been on the mind of the core team of Nushell for some time and it was made real between the two releases. @@ -34,24 +32,23 @@ But first of all... **what is the _standard library_?** The nushell standard library is a **collection of nushell scripts** that are **automatically loaded** in the nushell binary and **reachable via the `use` command** without any additional setup. -> :bulb: **Note** -> some of the commands from the standard library are `use`d without human intervention as part of what we call -> the _prelude_. -> -> As said above, the other commands are available with the `use` command. -> The goal of this library is, as its name suggests, to provide a _standard_ experience and a _standardized_ set of commands and tools to any Nushell user. -> In `std`, one can find things like +:::note +some of the commands from the standard library are `use`d without human intervention as part of what we call the _prelude_. + +As said above, the other commands are available with the `use` command. +The goal of this library is, as its name suggests, to provide a _standard_ experience and a _standardized_ set of commands and tools to any Nushell user. +In `std`, one can find things like - a test framework to write robust Nushell scripts, modules and libraries - implementation of builtin commands once written in `rust` - logging commands with several log levels - ... -> :bulb: **Note** -> yes, you heard right, in the future, the standard library might become a sanctuary for non-time-critical commands that were once written in `rust` -> as part of the built-in set of commands! -> -> Right now, we are actively trying to move the `help` commands from the `nushell` core implementation to the library. +yes, you heard right, in the future, the standard library might become a sanctuary for non-time-critical commands that were once written in `rust` +as part of the built-in set of commands! + +Right now, we are actively trying to move the `help` commands from the `nushell` core implementation to the library. +::: With this release, the library comes with the following custom commands: | module | description | commands | @@ -65,7 +62,7 @@ With this release, the library comes with the following custom commands: - some other commands live under the `std` namespace, without any module: `clip`, `path add` and `run-tests` -### TL;DR +#### TL;DR As there has been quite a lot of contributions already (see the [50 closed PRs][stdlib PRs] at the time i'm writing this :o), i'm just gonna give some hints and links in this release note, leaving the rest to the amazing work of other contributors who wrote parts of the lib and its documents (shout out to @@ -75,20 +72,20 @@ i'm just gonna give some hints and links in this release note, leaving the rest - the library can be used and tested with -```nushell +```nu use std # will load the whole library under the `std` namespace use std * # - - - - - without the `std` prefix ``` or use direct imports, such as -```nushell +```nu use std 'dirs show' ``` - one can follow the activity of the library in the [roadmap](https://github.com/nushell/nushell/issues/8450) -- the library comes with a test framework; see the [_Testing your Nushell code_](https://www.nushell.sh/book/testing.html) chapter of the book -- the long term information, changelog and updates shall be found in the [_Standard library_](https://www.nushell.sh/book/standard_library.html) chapter of the Nushell book +- the library comes with a test framework; see the [_Testing your Nushell code_](https://www.nushell.sh/book/testing) chapter of the book +- the long term information, changelog and updates shall be found in the [_Standard library_](https://www.nushell.sh/book/standard_library) chapter of the Nushell book - if you are a contributor willing to help out, everything happens in the [`nu-std` crate](https://github.com/nushell/nushell/tree/main/crates/nu-std), especially the [`CONTRIBUTING.md` document](https://github.com/nushell/nushell/blob/main/crates/nu-std/CONTRIBUTING.md) which explains all there is to know about "_developing with `std`_" in great details. @@ -97,23 +94,23 @@ use std 'dirs show' If, for some reason, you want to load Nushell without the standard library, start `nu` with the `--no-std-lib`. This can be the case if you find the startup times much longer than before. We're aiming to improve the loading speed in the future. -## enhanced IDE support in our VS code extension ([JT](https://github.com/nushell/nushell/pull/8745), [fdncred](https://github.com/nushell/vscode-nushell-lang/pull/89)) +### enhanced IDE support in our VS code extension ([JT](https://github.com/nushell/nushell/pull/8745), [fdncred](https://github.com/nushell/vscode-nushell-lang/pull/89)) - + Nushell now has a first [LSP (Language Server Protocol)](https://en.wikipedia.org/wiki/Language_Server_Protocol) implementation with a VSCode integration. If you install the latest version of our [VSCode plugin](https://github.com/nushell/vscode-nushell-lang), you'll see hovers, inlays, tooltips, error squigglies and other features. We are still very early in the LSP development, but the extension is already very usable and definitely moves the experience of writing Nu code to another level! While currently we have only VSCode integration, the server itself is standalone and we welcome projects adding the LSP support to more editors. -## `atuin` now [supports Nushell](https://atuin.sh/blog/release-v14) +### `atuin` now [supports Nushell](https://atuin.sh/blog/release-v14) Thanks to [@stevenxxiu](https://github.com/stevenxxiu) you can now use `atuin` with Nushell. We are happy to see Nushell supported by more projects and we welcome PRs adding more integrations. -## Relaxed parsing rules ([JT](https://github.com/nushell/nushell/pull/8846)) +### Relaxed parsing rules ([JT](https://github.com/nushell/nushell/pull/8846)) We listened to your feedback around the syntax changes introduced with 0.78 and decided to revert to the old behavior around the parsing rules for numeric literals as well as the compulsory `||` for closures. -## Removed old alias implementation ([kubouch](https://github.com/nushell/nushell/pull/8797)) +### Removed old alias implementation ([kubouch](https://github.com/nushell/nushell/pull/8797)) While there are still some missing pieces, we removed the old alias implementation. This means that `old-alias` is no longer available. We decided to remove it to clean up the code. It makes further fixes to aliases easier as you do not need to remember which alias implementation a piece of code belongs to. @@ -124,13 +121,13 @@ There are two notable missing features from the old aliases: - Not possible to alias with environment shorthands (e.g., `alias foo = FOO=bar spam`) - Some presentation issues, such as the output of `which` and the alias `usage` pointing at the aliased call instead of the alias itself. -## Changes to default files locations ([ito](https://github.com/nushell/nushell/pull/8792)-[hiroki](https://github.com/nushell/nushell/issues/8887)) +### Changes to default files locations ([ito](https://github.com/nushell/nushell/pull/8792)-[hiroki](https://github.com/nushell/nushell/issues/8887)) `$nu.config-path` and `$nu.env-path` are now set based on `--config` and `--env-config` flags passed to Nushell and also use the path after resolving symlinks. This means that they no longer guarantee pointing at the default Nushell's config directory. To be able to refere to the default config directory, `$nu.default-config-dir` was added and used in default `env.nu` to always point `NU_LIB_DIRS` to the `scripts` directory under the default config directory. Related to that, [`$env.CURRENT_FILE`](https://github.com/nushell/nushell/pull/8861) was added to be able to show the currently evaluated file. -# Breaking changes +## Breaking changes - [#8797](https://github.com/nushell/nushell/pull/8797) `old-alias` is no longer available - [#8724](https://github.com/nushell/nushell/pull/8724) `str index-of -r` now uses ranges @@ -139,9 +136,9 @@ Related to that, [`$env.CURRENT_FILE`](https://github.com/nushell/nushell/pull/8 - [#8917](https://github.com/nushell/nushell/pull/8917) `exec` inherits Nushell's environment variables - [#8887](https://github.com/nushell/nushell/pull/8887) `NU_LIB_DIRS` definition in `env.nu` changed -# Full changelog +## Full changelog -## Nushell +### Nushell - sholderbach created [Bump to `0.79.1` dev version](https://github.com/nushell/nushell/pull/8998), and [Pin `reedline` to `0.19.0` release](https://github.com/nushell/nushell/pull/8996), and [Bump version for `0.79.0` release](https://github.com/nushell/nushell/pull/8980), and [Run coverage immediately](https://github.com/nushell/nushell/pull/8876), and [Reenable CI coverage](https://github.com/nushell/nushell/pull/8867), and [Fix span of multibyte short flags](https://github.com/nushell/nushell/pull/8866), and [Move CLI related commands to `nu-cli`](https://github.com/nushell/nushell/pull/8832), and [Follow up #8758 with a style fix](https://github.com/nushell/nushell/pull/8822) - hustcer created [Add npm installation instruction](https://github.com/nushell/nushell/pull/8982), and [Upgrade to nu v0.78 for binaries release workflow](https://github.com/nushell/nushell/pull/8840) @@ -170,13 +167,13 @@ Related to that, [`$env.CURRENT_FILE`](https://github.com/nushell/nushell/pull/8 - amtoine created [standard library: implement `help` commands with `$nu`](https://github.com/nushell/nushell/pull/8505) - bobhy created [range operator accepts bot..=top as well as bot..top](https://github.com/nushell/nushell/pull/8382) -## Extension +### Extension - fdncred created [update changelog](https://github.com/nushell/vscode-nushell-lang/pull/115), and [update syntax for 0.79.0](https://github.com/nushell/vscode-nushell-lang/pull/114), and [change the `:` separator to a record separator `\x1e`](https://github.com/nushell/vscode-nushell-lang/pull/113), and [add folding regions](https://github.com/nushell/vscode-nushell-lang/pull/111), and [rename to match readme](https://github.com/nushell/vscode-nushell-lang/pull/110), and [update readme](https://github.com/nushell/vscode-nushell-lang/pull/109), and [update example generation script and examples](https://github.com/nushell/vscode-nushell-lang/pull/107), and [add a throttle timeout so that we don't update to frequently](https://github.com/nushell/vscode-nushell-lang/pull/106), and [add timing to more server functions](https://github.com/nushell/vscode-nushell-lang/pull/105), and [update vscode launch json so we can see debug messages from client](https://github.com/nushell/vscode-nushell-lang/pull/103), and [update files to model after jakt](https://github.com/nushell/vscode-nushell-lang/pull/101), and [limit the amount of errors returned by ide-check](https://github.com/nushell/vscode-nushell-lang/pull/98), and [respect the setting to enable or disable hints/inlays](https://github.com/nushell/vscode-nushell-lang/pull/97), and [change include dir separator from semicolon to colon](https://github.com/nushell/vscode-nushell-lang/pull/96), and [revert vscodeignore changes](https://github.com/nushell/vscode-nushell-lang/pull/95), and [add include dirs setting to extension](https://github.com/nushell/vscode-nushell-lang/pull/94), and [utilize nushell IDE features with built-in vscode LSP functionality](https://github.com/nushell/vscode-nushell-lang/pull/89) - glcraft created [Add underscore separator in numbers](https://github.com/nushell/vscode-nushell-lang/pull/108) - jntrnr created [Have launch build instead of watch](https://github.com/nushell/vscode-nushell-lang/pull/102), and [Delete tmp file on exit](https://github.com/nushell/vscode-nushell-lang/pull/100), and [Limit buffer calculation to buffer size not text size](https://github.com/nushell/vscode-nushell-lang/pull/99), and [Move runCompiler to be in charge of the script include flag](https://github.com/nushell/vscode-nushell-lang/pull/93), and [Add support for -I call to nushell](https://github.com/nushell/vscode-nushell-lang/pull/92) -## Documentation +### Documentation - hustcer created [Refresh command docs for nu v0.79.0](https://github.com/nushell/nushell.github.io/pull/889), and [Add npm installation instruction](https://github.com/nushell/nushell.github.io/pull/882), and [Fix i18n script for nu v0.78](https://github.com/nushell/nushell.github.io/pull/867), and [Update some docs for nu v0.78](https://github.com/nushell/nushell.github.io/pull/863) - dependabot[bot] created [Bump yaml from 2.1.3 to 2.2.2](https://github.com/nushell/nushell.github.io/pull/888) @@ -196,7 +193,7 @@ Related to that, [`$env.CURRENT_FILE`](https://github.com/nushell/nushell/pull/8 - pingiun created [Add ppid to ps examples](https://github.com/nushell/nushell.github.io/pull/864) - SamirTalwar created [Update the Direnv recipe to use a block, rather than `code:`](https://github.com/nushell/nushell.github.io/pull/852) -## Nu_Scripts +### Nu_Scripts - fdncred created [some cleanup](https://github.com/nushell/nu_scripts/pull/463), and [update progress meter to work with latest nushell](https://github.com/nushell/nu_scripts/pull/457), and [update sg.nu to print again](https://github.com/nushell/nu_scripts/pull/456), and [some fun iterm2 drawing](https://github.com/nushell/nu_scripts/pull/449), and [update range syntax in str substring usage](https://github.com/nushell/nu_scripts/pull/448), and [move assets so they're more accessible](https://github.com/nushell/nu_scripts/pull/445), and [a little cleanup](https://github.com/nushell/nu_scripts/pull/444), and [fix some quoting bugs that the lsp found](https://github.com/nushell/nu_scripts/pull/441) - sholderbach created [Include `nu-std` in the release script](https://github.com/nushell/nu_scripts/pull/462) @@ -212,7 +209,7 @@ Related to that, [`$env.CURRENT_FILE`](https://github.com/nushell/nushell/pull/8 - Tiggax created [Fixed support for env files](https://github.com/nushell/nu_scripts/pull/439) - melMass created [refactor: ✨ ](https://github.com/nushell/nu_scripts/pull/418) -## reedline +### reedline - sholderbach created [Bump version for 0.19 release](https://github.com/nushell/reedline/pull/575) - nibon7 created [Restore the cursor shape when reedline exits](https://github.com/nushell/reedline/pull/574) diff --git a/blog/2023-05-16-nushell_0_80.md b/src/content/docs/blog/2023-05-16-nushell_0_80.md similarity index 96% rename from blog/2023-05-16-nushell_0_80.md rename to src/content/docs/blog/2023-05-16-nushell_0_80.md index db4307b397c..87446c8f92a 100644 --- a/blog/2023-05-16-nushell_0_80.md +++ b/src/content/docs/blog/2023-05-16-nushell_0_80.md @@ -3,18 +3,16 @@ title: Nushell 0.80 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.80 of Nu. This release adds record type annotations, modules from directories, and improvements to the standard library. +description: Today, we're releasing version 0.80 of Nu. This release adds record type annotations, modules from directories, and improvements to the standard library. --- -# Nushell 0.80 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. Today, we're releasing version 0.80 of Nu. This release adds record type annotations, modules from directories, and improvements to the standard library. <!-- more --> -# Where to get it +## Where to get it Nu 0.80 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.80.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,25 +20,25 @@ NOTE: The optional dataframe functionality is available by `cargo install nu --f As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release / New features +## Themes of this release / New features -## Record type annotations ([@1Kinoti](https://github.com/nushell/nushell/pull/8914)) +### Record type annotations ([@1Kinoti](https://github.com/nushell/nushell/pull/8914)) Starting with this release, you can add more information about the type of a record your command expects. For example: -``` +```nu def okay [person: record<name: string age: int>] {} ``` The above will require two fields to be present, a `name` that's a `string`, and an `age` that's an `int`. The current version requires that the record has exactly these fields, though we may loosen this in future releases to allow for structural subtyping. -## Modules from directories ([@Kubouch](https://github.com/nushell/nushell/pull/9066)) +### Modules from directories ([@Kubouch](https://github.com/nushell/nushell/pull/9066)) -It is now possible to create a module from a directory. The directory must contain `mod.nu` and all other .nu files are added as a submodule of the module. This allows some traditional shell patterns such as dumping completion files into a directory to be loaded automatically. Check out the newly updated [book chapter](https://www.nushell.sh/book/modules.html) for more details and examples. +It is now possible to create a module from a directory. The directory must contain `mod.nu` and all other .nu files are added as a submodule of the module. This allows some traditional shell patterns such as dumping completion files into a directory to be loaded automatically. Check out the newly updated [book chapter](https://www.nushell.sh/book/modules) for more details and examples. The enabling feature for module directories was organizing modules into submodule structure instead of solely relying on re-importing symbols with `export use`. `module` and especially `export module` have been added as a result of this change. While not immediately visible, the module update allows for cleaner submodule oganization without relying on re-exporting symbols with `export use`. Since modules are now aware of their submodules, in the future we hope to improve discoverability of definitions within modules, enhancing our IDE support (such as our [LSP](https://github.com/nushell/vscode-nushell-lang)). -## Stdlib update ([@amtoine, @EmilySeville7cfg, @skelly37, @YummyOreo][std-lib PRs]) +### Stdlib update ([@amtoine, @EmilySeville7cfg, @skelly37, @YummyOreo][std-lib PRs]) | hash | commit | PR | | --------- | -------------------------------------------------------------- | ----------------------------------------------------- | @@ -49,7 +47,7 @@ The enabling feature for module directories was organizing modules into submodul | edb61fc1d | Try to show help pages for external commands w/ `help` command | [#9025](https://github.com/nushell/nushell/pull/9025) | | 7a945848d | swap the date and the log level in the `std log` format | [#9138](https://github.com/nushell/nushell/pull/9138) | -## other interesting new features +### other interesting new features | hash | commit | PR | | --------- | ---------------------------------------------------------- | ----------------------------------------------------- | @@ -65,15 +63,15 @@ The enabling feature for module directories was organizing modules into submodul | b82e279f9 | REFACTOR: remove deprecated commands (`old-alias`) | [#9056](https://github.com/nushell/nushell/pull/9056) | | 10d65b611 | adds a list subcommand to input (interactive selections) | [#8963](https://github.com/nushell/nushell/pull/8963) | -# Breaking changes +## Breaking changes - [#8940](https://github.com/nushell/nushell/pull/8940) Change type of parameter default values to `Option<Value>` - [#9007](https://github.com/nushell/nushell/pull/9007) Fix unexpected flattening of data by par-each (Issue #8497) - [#9056](https://github.com/nushell/nushell/pull/9056) REFACTOR: remove deprecated commands (`old-alias`) -# Full changelog +## Full changelog -## Nushell +### Nushell - sholderbach created [Bump version for 0.80.0 release](https://github.com/nushell/nushell/pull/9212), and [Pin reedline to `0.19.1` for 0.80 release](https://github.com/nushell/nushell/pull/9211) - stormasm created [document how to run dataframe tests as well](https://github.com/nushell/nushell/pull/9188) @@ -103,12 +101,12 @@ The enabling feature for module directories was organizing modules into submodul - pingiun created [Add extern def which allows raw arguments](https://github.com/nushell/nushell/pull/8956), and [Don't run .sh files with /bin/sh](https://github.com/nushell/nushell/pull/8951), and [Add --redirect-combine option to run-external](https://github.com/nushell/nushell/pull/8918) - schicks created [Suggest existing variables on not found](https://github.com/nushell/nushell/pull/8902) -## Extension +### Extension - EmilySeville7cfg created [feat(snippets): markdown doc sections](https://github.com/nushell/vscode-nushell-lang/pull/127), and [feat(snippets): completions](https://github.com/nushell/vscode-nushell-lang/pull/126), and [Feature: add date format snippets](https://github.com/nushell/vscode-nushell-lang/pull/121), and [Feature/add remaining snippets](https://github.com/nushell/vscode-nushell-lang/pull/119), and [Feature/update snippets](https://github.com/nushell/vscode-nushell-lang/pull/116) - fdncred created [update changelog](https://github.com/nushell/vscode-nushell-lang/pull/124), and [update version and changelog](https://github.com/nushell/vscode-nushell-lang/pull/118) -## Documentation +### Documentation - mrkkrp created [Minor corrections in variables_and_subexpressions.md](https://github.com/nushell/nushell.github.io/pull/906) - VuiMuich created [small typo in `dataframes.md`](https://github.com/nushell/nushell.github.io/pull/905) @@ -119,7 +117,7 @@ The enabling feature for module directories was organizing modules into submodul - Askerad created [Fixing Tiny Typo - Update aliases.md](https://github.com/nushell/nushell.github.io/pull/894) - hustcer created [Update npm install instruction](https://github.com/nushell/nushell.github.io/pull/891) -## Nu_Scripts +### Nu_Scripts - EmilySeville7cfg created [Fix: remaining aliases](https://github.com/nushell/nu_scripts/pull/495), and [feat(aliases): reformat and use long options](https://github.com/nushell/nu_scripts/pull/489), and [feat(module): add random-list](https://github.com/nushell/nu_scripts/pull/488), and [Feature: clean-up completion directory](https://github.com/nushell/nu_scripts/pull/484), and [feat(nano): add completions](https://github.com/nushell/nu_scripts/pull/479) - Tiggax created [Added typst completion script.](https://github.com/nushell/nu_scripts/pull/494) @@ -132,7 +130,7 @@ The enabling feature for module directories was organizing modules into submodul - LiHRaM created [Fix npm-completions: move extern declaration below dependent declarations](https://github.com/nushell/nu_scripts/pull/475) - amtoine created [REFACTOR: unify git modules and aliases](https://github.com/nushell/nu_scripts/pull/472) -## reedline +### reedline - TrMen created [Allow binding of `CTRL+ALT+<c>`, `SHIFT+<c>` and `CTRL+ALT+SHIFT+<c>`](https://github.com/nushell/reedline/pull/580) - WindSoilder created [fix bracketed paste](https://github.com/nushell/reedline/pull/577) diff --git a/blog/2023-06-06-nushell_0_81.md b/src/content/docs/blog/2023-06-06-nushell_0_81.md similarity index 97% rename from blog/2023-06-06-nushell_0_81.md rename to src/content/docs/blog/2023-06-06-nushell_0_81.md index bd68302f857..467bc531e7f 100644 --- a/blog/2023-06-06-nushell_0_81.md +++ b/src/content/docs/blog/2023-06-06-nushell_0_81.md @@ -3,18 +3,16 @@ title: Nushell 0.81 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.81 of Nu. This release focuses on polishing the user experience. +description: Today, we're releasing version 0.81 of Nu. This release focuses on polishing the user experience. --- -# Nushell 0.81 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. Today, we're releasing version 0.81 of Nu. This release focuses on polishing the user experience. <!-- more --> -# Where to get it +## Where to get it Nu 0.81 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.81.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -22,9 +20,9 @@ NOTE: The optional dataframe functionality is available by `cargo install nu --f As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release / New features +## Themes of this release / New features -## Polishing the experience +### Polishing the experience This release focuses on improving the user experience, fixing some long-standing bugs, and adding a few helpful features. @@ -32,20 +30,20 @@ One of the bugs that was fixed for 0.81 was a long-standing issue with reedline, There have also been fixes to [table printing](https://github.com/nushell/nushell/pull/9304) to make it work better for more cases. -## Startup time improvements +### Startup time improvements Startup times have also been improved. Through a combination of various fixes to both how the standard library files were handles and how the parser worked, we've been able to see significant improvements, sometimes as high as 30-50% faster. -# Breaking changes +## Breaking changes - We had to remove ARMv7 and RISC-V from this release due to a breaking change in one of the dependencies. We hope to resolve this for future releases. - Exclude globs now [need square brackets](https://github.com/nushell/nushell/pull/9343) - `view source` now works over [rest arguments](https://github.com/nushell/nushell/pull/9247) - `alias` calls are now [position dependent](https://github.com/nushell/nushell/pull/9244) -# Full changelog +## Full changelog -## Nushell +### Nushell - jt created [remove arm v7, which also is broken](https://github.com/nushell/nushell/pull/9376), and [remove more of the risc release](https://github.com/nushell/nushell/pull/9375), and [bump to 0.81](https://github.com/nushell/nushell/pull/9374), and [move over to reedline git version](https://github.com/nushell/nushell/pull/9283), and [Fix clippy warnings (upcoming)](https://github.com/nushell/nushell/pull/9282), and [Cut down on unnecessary parsing for SyntaxShape::Any](https://github.com/nushell/nushell/pull/9280) - sholderbach created [Pin `reedline` to 0.20.0 release](https://github.com/nushell/nushell/pull/9370) @@ -66,7 +64,7 @@ Startup times have also been improved. Through a combination of various fixes to - michel-slm created [[nu-explore] fix Cargo description](https://github.com/nushell/nushell/pull/9297) - ayax79 created [Adding JSON lines file support to dataframes](https://github.com/nushell/nushell/pull/9291) - fnordpig created [Add a datepart expression for dfr to be used with dfr with-column](https://github.com/nushell/nushell/pull/9285), and [Fix version to show build features after crateification](https://github.com/nushell/nushell/pull/9262) -- bobhy created [std dirs simply stays in sync with CD changes to PWD](https://github.com/nushell/nushell/pull/9267) +- bobhy created [std dirs simply stays in sync with CD changes to PWD](https://github.com/nushell/nushell/pull/9267) - Tiggax created [throw an error instead of a panic if no input is provided to `inspect`](https://github.com/nushell/nushell/pull/9259) - merelymyself created [upserting data of a cellpath that doesn't exist into a record creates the cellpath](https://github.com/nushell/nushell/pull/9257), and [allow `view-source` to read rest arguments](https://github.com/nushell/nushell/pull/9247), and [Allow `input` to take a specified number of characters](https://github.com/nushell/nushell/pull/9242) - MariaSolOs created [Allow duration defaults](https://github.com/nushell/nushell/pull/9249) @@ -76,12 +74,12 @@ Startup times have also been improved. Through a combination of various fixes to - hustcer created [Add aarch64-pc-windows-msvc building target for nu binaries](https://github.com/nushell/nushell/pull/9162) - Decodetalkers created [check if is homedir first when rm](https://github.com/nushell/nushell/pull/9117) -## Extension +### Extension - gaetschwartz created [Use unique labels for `durationLogWrapper`](https://github.com/nushell/vscode-nushell-lang/pull/133) - EmilySeville7cfg created [feat(snippets): support regex groups](https://github.com/nushell/vscode-nushell-lang/pull/130) -## Documentation +### Documentation - Omochice created [Fix missing `|`](https://github.com/nushell/nushell.github.io/pull/942) - dependabot[bot] created [Bump vite from 4.0.4 to 4.0.5](https://github.com/nushell/nushell.github.io/pull/940) @@ -96,7 +94,7 @@ Startup times have also been improved. Through a combination of various fixes to - lavafroth created [Supply table instead of closure to merge command in tables.md](https://github.com/nushell/nushell.github.io/pull/919) - mrkkrp created [Minor improvements to the installation chapter](https://github.com/nushell/nushell.github.io/pull/914) -## Nu_Scripts +### Nu_Scripts - fj0r created [kubernetes: fix `-n` in completion context](https://github.com/nushell/nu_scripts/pull/523), and [more precise parsing of cmd through the information in `nu.scope.comm…](https://github.com/nushell/nu_scripts/pull/522), and [kubernetes: normalize-column-names](https://github.com/nushell/nu_scripts/pull/518), and [update docker, git-v2, kubernetes](https://github.com/nushell/nu_scripts/pull/517), and [refactor: introduce `spr` and `sprb` for spread](https://github.com/nushell/nu_scripts/pull/504) - stormasm created [update release script for most recent crate addition nu-cmd-extra](https://github.com/nushell/nu_scripts/pull/521) @@ -106,7 +104,7 @@ Startup times have also been improved. Through a combination of various fixes to - hyiltiz created [auto-venv for python: update to be compatible with nu 0.80](https://github.com/nushell/nu_scripts/pull/513) - kubouch created [Add dataframe crate to the release](https://github.com/nushell/nu_scripts/pull/507) -## reedline +### reedline - sholderbach created [Revert removal of patch versions](https://github.com/nushell/reedline/pull/590), and [Bump to `0.20.0` for release](https://github.com/nushell/reedline/pull/581) - fnordpig created [Update to make work with new lines embedded in sent string.](https://github.com/nushell/reedline/pull/588) diff --git a/blog/2023-06-27-nushell_0_82.md b/src/content/docs/blog/2023-06-27-nushell_0_82.md similarity index 94% rename from blog/2023-06-27-nushell_0_82.md rename to src/content/docs/blog/2023-06-27-nushell_0_82.md index 84e0f4870e3..1ace3b58c40 100644 --- a/blog/2023-06-27-nushell_0_82.md +++ b/src/content/docs/blog/2023-06-27-nushell_0_82.md @@ -3,22 +3,20 @@ title: Nushell 0.82 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.82 of Nu. This release focuses on polishing the user experience. +description: Today, we're releasing version 0.82 of Nu. This release focuses on polishing the user experience. --- -# Nushell 0.82 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. Today, we're releasing version 0.82 of Nu. This release focuses on polishing the user experience. <!-- more --> -::: tip Note +:::note Beginning with this release, Nushell is switching to a four-week release schedule. For details see our [special blog post](/blog/2023-06-27-road-to-1_0.md). ::: -# Where to get it +## Where to get it Nu 0.82 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.82.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -26,27 +24,28 @@ NOTE: The optional dataframe functionality is available by `cargo install nu --f As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Themes of this release / New features +## Themes of this release / New features -## Nightly builds +### Nightly builds We are pleased to inform you that we now have _nightly_ releases available for Nushell. Feeling adventurous? Wanting to keep up to date with the latest revisions of Nushell without the burden of compiling the source base yourself? You can find all available _nightly_ releases in the [release page of `nushell/nightly`](https://github.com/nushell/nightly/releases). -> **Note** -> Please note that these releases are intended for testing purposes only, and we will keep only the last 10 nightly releases. -> We highly recommend using the [latest stable official release](https://github.com/nushell/nushell/releases/latest) for regular usage. +:::note +Please note that these releases are intended for testing purposes only, and we will keep only the last 10 nightly releases. +We highly recommend using the [latest stable official release](https://github.com/nushell/nushell/releases/latest) for regular usage. +::: -## Custom datetime format ([@fnordpig](https://github.com/nushell/nushell/pull/9500)) +### Custom datetime format ([@fnordpig](https://github.com/nushell/nushell/pull/9500)) Until now, Nushell did not allow changing the default format of dates and times, leading quite often to undesired rendering, e.g. seeing `A year ago` in the output of `ls` when one wants to know the exact time. [`#9500`](https://github.com/nushell/nushell/pull/9500) introduces a new config option to change the default output of dates and times: -```nushell +```nu # from the `default_config.nu` file datetime_format: { normal: '%a, %d %b %Y %H:%M:%S %z' @@ -54,11 +53,11 @@ e.g. seeing `A year ago` in the output of `ls` when one wants to know the exact } ``` -## Support for comments in multiline pipes ([@WindSoilder](https://github.com/nushell/nushell/pull/9436)) +### Support for comments in multiline pipes ([@WindSoilder](https://github.com/nushell/nushell/pull/9436)) From now on, either in the REPL, in scripts or in modules, you can comment out any line of a multiline pipe without breaking its execution, e.g. -```nushell +```nu ls | where type == file # | sort-by size @@ -69,7 +68,7 @@ is perfectly valid. This hopefully makes debugging and testing part of a pipeline much easier! -## Continuing cratification effort +### Continuing cratification effort On the road to 1.0, we have started moving commands around to make place for those which really matter. As this process involves the creation of some new Rust crates, e.g. `nu-cmd-extra`, we call it _cratification_ :) @@ -84,7 +83,7 @@ With this new release, the `bytes` commands have been moved behind the `extra` f Apart from moving less stable or common commands behind flag, this should also improve compile times for everyone. -## Splitting the `$nu` variable ([@jntrnr](https://github.com/nushell/nushell/pull/9487)) +### Splitting the `$nu` variable ([@jntrnr](https://github.com/nushell/nushell/pull/9487)) Nushell 0.82 introduces a new familly of _stat_ commands, the `scope ...` commands. These commands allow you to access some information about the current Nushell instance that were previously @@ -92,18 +91,17 @@ available in the `$nu` variable! e.g. `$nu.scope.commands` now becomes `scope co On the other hand, `$nu` becomes much smaller and only holds simple paths and constants. -## Entering Linguist support ([@hustcer](https://github.com/nushell/nushell/pull/9491)) +### Entering Linguist support ([@hustcer](https://github.com/nushell/nushell/pull/9491)) With the efforts of [@hustcer](https://github.com/hustcer), Nushell is now an official language of Linguist, allowing for better language support in GitHub. -## REPL: Mark line entries as excluded from the history by leading with a space ([samlich](https://github.com/nushell/reedline/pull/566)) +### REPL: Mark line entries as excluded from the history by leading with a space ([samlich](https://github.com/nushell/reedline/pull/566)) In some situations you may want to avoid storing an entry inside your shell history. For example if it includes a secret or running it again in a different context could be dangerous. To stop nushell from storing a particular line in its history you can now start with a space and it will be ignored. You can still recall your last entry once by pressing the `Up-Arrow` but the command will never be written to disk and disappear as soon as you submit another command. - -# New commands +## New commands - [`http options`](https://github.com/nushell/nushell/pull/9365) - [`scope aliases`](https://github.com/nushell/nushell/pull/9487) @@ -113,8 +111,7 @@ To stop nushell from storing a particular line in its history you can now start - [`scope variables`](https://github.com/nushell/nushell/pull/9487) - [`scope`](https://github.com/nushell/nushell/pull/9487) - -# Breaking changes +## Breaking changes - [#9509](https://github.com/nushell/nushell/pull/9509) Cratification moves the `bytes` commands to `nu-cmd-extra`. They are thus only accessible with `--features extra` - [#9496](https://github.com/nushell/nushell/pull/9496) Clean up config by removing legacy options that were previously deprecated. @@ -123,9 +120,9 @@ To stop nushell from storing a particular line in its history you can now start - [#9407](https://github.com/nushell/nushell/pull/9407) In the `ls --long` output the `uid` column has been renamed to `user` to be consistent with `group` - [#9368](https://github.com/nushell/nushell/pull/9368) Don't allow `save` command to save both stdout and stderr to the same file -# Full changelog +## Full changelog -## Nushell +### Nushell - [sholderbach](https://github.com/sholderbach) created - [Pin reedline to `0.21` for release](https://github.com/nushell/nushell/pull/9532) @@ -247,7 +244,7 @@ To stop nushell from storing a particular line in its history you can now start - [Yethal](https://github.com/Yethal) created - [std: refactor test-runner to no longer require tests to be exported](https://github.com/nushell/nushell/pull/9355) -## Extension +### Extension - [gaetschwartz](https://github.com/gaetschwartz) created - [fix go to definition on windows](https://github.com/nushell/vscode-nushell-lang/pull/141) @@ -255,7 +252,7 @@ To stop nushell from storing a particular line in its history you can now start - [Fix datetime parsing](https://github.com/nushell/vscode-nushell-lang/pull/140) - [Fix TextMate regex](https://github.com/nushell/vscode-nushell-lang/pull/137) -## Documentation +### Documentation - [sholderbach](https://github.com/sholderbach) created - [Add blogpost planning towards 1.0 and slowing releases](https://github.com/nushell/nushell.github.io/pull/957) @@ -276,7 +273,7 @@ To stop nushell from storing a particular line in its history you can now start - [Mehrbod2002](https://github.com/Mehrbod2002) created - [chore: add detail to breaking changes](https://github.com/nushell/nushell.github.io/pull/947) -## Nu_Scripts +### Nu_Scripts - [Neur1n](https://github.com/Neur1n) created - [fix: fix default fg and bg coloring for hl.nu](https://github.com/nushell/nu_scripts/pull/537) @@ -304,7 +301,7 @@ To stop nushell from storing a particular line in its history you can now start - [fj0r](https://github.com/fj0r) created - [parse name of positional args in `parse cmd`](https://github.com/nushell/nu_scripts/pull/527) -## Reedline +### Reedline - [sholderbach](https://github.com/sholderbach) created - [Bump version for `0.21.0` release](https://github.com/nushell/reedline/pull/596) diff --git a/blog/2023-06-27-road-to-1_0.md b/src/content/docs/blog/2023-06-27-road-to-1_0.md similarity index 84% rename from blog/2023-06-27-road-to-1_0.md rename to src/content/docs/blog/2023-06-27-road-to-1_0.md index 5aa4d1ac43c..8da6c002240 100644 --- a/blog/2023-06-27-road-to-1_0.md +++ b/src/content/docs/blog/2023-06-27-road-to-1_0.md @@ -3,17 +3,14 @@ title: Reaching a nu phase in Nushell's development - The road from 0.82 to 1.0 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Ahead of the 0.82 release, we share our plans on how we intend to stabilize for 1.0 and announce that we slow to a four-week release schedule. +description: Ahead of the 0.82 release, we share our plans on how we intend to stabilize for 1.0 and announce that we slow to a four-week release schedule. --- - -# Reaching a nu phase in Nushell's development - The road from 0.82 to 1.0 - Today we release the 0.82 version of Nushell. Not only will it be our 65th public release it also marks an important milestone for us on the development trajectory of Nushell. Nushell reached a much wider user base in the last few months. On GitHub, Nushell is now officially recognized for [syntax highlighting](https://github.com/github-linguist/linguist/releases/tag/v7.26.0) and recently passed 25,000 stars. We are also actively thinking about how we want to move towards stabilization for our 1.0 release. -Thus, we want to use this opportunity to share our general thoughts and announce that we will be slightly slowing down our regular release schedule. +Thus, we want to use this opportunity to share our general thoughts and announce that we will be slightly slowing down our regular release schedule. Our focus going forward will be getting Nushell to a high-quality 1.0, one that has a supported language that is reliable and backward-compatible, and a high-quality shell experience to match. ## A four-week release schedule @@ -25,21 +22,20 @@ For our contributors, this change also has the benefit that the impact of our in ### Nightly builds for the eager If you think that Nushell is moving at a glacial pace after this change, we luckily now have [nightly builds for you to download](https://github.com/nushell/nightly/tags) that reflect the current state of development. -If [building Nushell yourself](https://www.nushell.sh/book/installation.html#build-from-source) was too burdensome so far, you now have to chance to try out upcoming features and provide your feedback. - +If [building Nushell yourself](https://www.nushell.sh/book/installation#build-from-source) was too burdensome so far, you now have to chance to try out upcoming features and provide your feedback. ## How things went from 0.60 to 0.8x -Our last very public milestone was the [release of the `0.60` version](https://www.nushell.sh/blog/2022-03-22-nushell_0_60.html), which included a massive refactor of Nushell's internals that we skipped to it from the `0.44` release. -Apart from rewriting the engine, it included our own line editor [reedline](https://github.com/nushell/reedline) for added [customization in the interactive experience](https://www.nushell.sh/book/line_editor.html). +Our last very public milestone was the [release of the `0.60` version](https://www.nushell.sh/blog/2022-03-22-nushell_0_60), which included a massive refactor of Nushell's internals that we skipped to it from the `0.44` release. +Apart from rewriting the engine, it included our own line editor [reedline](https://github.com/nushell/reedline) for added [customization in the interactive experience](https://www.nushell.sh/book/line_editor). The rewrite unlocked many improvements and opportunities for valuable experimentation. -Since `0.60`, we achieved a much more mature system of [modules](https://www.nushell.sh/book/modules.html) and [overlays](https://www.nushell.sh/book/overlays.html) that allow you to build more composable applications in Nu. -As part of this effort to strengthen the programming language chops of Nu, we also spent a lot of time finding the balance between our [functional programming philosophy of pipelined data](https://www.nushell.sh/book/thinking_in_nu.html) and the [mutation of variables](https://www.nushell.sh/book/variables_and_subexpressions.html#mutable-variables) to allow simple imperative patterns. +Since `0.60`, we achieved a much more mature system of [modules](https://www.nushell.sh/book/modules) and [overlays](https://www.nushell.sh/book/overlays) that allow you to build more composable applications in Nu. +As part of this effort to strengthen the programming language chops of Nu, we also spent a lot of time finding the balance between our [functional programming philosophy of pipelined data](https://www.nushell.sh/book/thinking_in_nu) and the [mutation of variables](https://www.nushell.sh/book/variables_and_subexpressions#mutable-variables) to allow simple imperative patterns. -We also saw a few efforts that didn't pan out yet. For example, we tried to integrate the [Polars](https://github.com/pola-rs/polars/) dataframe engine directly into the grammar of Nushell commands, but this left many rough edges. Thus [with version 0.76, we returned to a simpler dataframe integration](https://www.nushell.sh/blog/2023-02-21-nushell_0_76.html#dataframe-commands-are-again-explicitly-separated-from-core-nushell-commands-7998) to focus on getting the core Nushell experience right. +We also saw a few efforts that didn't pan out yet. For example, we tried to integrate the [Polars](https://github.com/pola-rs/polars/) dataframe engine directly into the grammar of Nushell commands, but this left many rough edges. Thus [with version 0.76, we returned to a simpler dataframe integration](https://www.nushell.sh/blog/2023-02-21-nushell_0_76#dataframe-commands-are-again-explicitly-separated-from-core-nushell-commands-7998) to focus on getting the core Nushell experience right. -This all provided valuable lessons in how we decide which features are beginning to settle and where we need to focus our effort to get a consistent experience. +This all provided valuable lessons in how we decide which features are beginning to settle and where we need to focus our effort to get a consistent experience. ## What we are working on right now @@ -66,14 +62,14 @@ Achieving stability will not be possible without all of you that have dedicated We want to incorporate you in formulating the priorities for the 1.0 release by reaching out to folks interested in particular problems to get clearer roadmaps for specific areas. Those write-ups will hopefully also provide some inspiration for folks interested in helping out and pushing Nushell forward. -But setting our sights on reaching the stable 1.0 release will also impose some limitations on our development practices. We are now much less likely to accept new features, commands, or options as they need to work well together with the larger picture. +But setting our sights on reaching the stable 1.0 release will also impose some limitations on our development practices. We are now much less likely to accept new features, commands, or options as they need to work well together with the larger picture. A lot of effort will still need to go into cleaning up the internals and fixing bugs. As we want to systematically improve our binary size, compile times, and runtime performance, improving existing algorithms and paying back technical debt will be prioritized over experimental stuff. Any external dependencies will also come under much more scrutiny. This means, to reduce the total number of crates we will seek to replace redundant or mostly superfluous dependencies with fewer high-quality implementations and also severely restrict the addition of any new dependencies. ## How you can help out -As always helping out fellow users or picking up issues that are labeled with ["good-first-issue"](https://github.com/nushell/nushell/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) or ["help-wanted"](https://github.com/nushell/nushell/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) is greatly appreciated. +As always helping out fellow users or picking up issues that are labeled with ["good-first-issue"](https://github.com/nushell/nushell/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) or ["help-wanted"](https://github.com/nushell/nushell/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) is greatly appreciated. As our [issue tracker](https://github.com/nushell/nushell/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) has grown to over 800 entries (878 at the time of writing) your help to clear this backlog will accelerate our path to 1.0. diff --git a/src/content/docs/blog/2023-07-25-nushell_0_83.md b/src/content/docs/blog/2023-07-25-nushell_0_83.md new file mode 100644 index 00000000000..6c43d177693 --- /dev/null +++ b/src/content/docs/blog/2023-07-25-nushell_0_83.md @@ -0,0 +1,482 @@ +--- +title: Nushell 0.83 +author: The Nu Authors +author_site: https://twitter.com/nu_shell +author_image: https://www.nushell.sh/blog/images/nu_logo.png +description: Today, we're releasing version 0.83 of Nu. This release adds match guards, stronger type checking features, unit testing improvements, flexible variable initializations, and more. +--- + +Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. + +Today, we're releasing version 0.83 of Nu. This release adds match guards, stronger type checking features, unit testing improvements, flexible variable initializations, and more. + +<!-- more --> + +## Where to get it + +Nu 0.83 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.83.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. + +NOTE: The optional dataframe functionality is available by `cargo install nu --features=dataframe`. + +As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. + +## Themes of this release / New features + +### Fixes, stabilization and shoutouts + +| Name | Link | Description | +| ------------------------------------------------------ | ---------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| [@WindSoilder](https://github.com/WindSoilder) | [9747](https://github.com/nushell/nushell/pull/9747) | Redirection: make `o>`, `e>`, `o+e>`'s target support variables and string interpolation | +| [@kubouch](https://github.com/kubouch) | [9679](https://github.com/nushell/nushell/pull/9679) | Fix broken constants in scopes | +| [@rusty-jules](https://github.com/rusty-jules) | [9594](https://github.com/nushell/nushell/pull/9594) | Fix: return all headers with the same name from `http <method>` | +| [@baehyunsol](https://github.com/baehyunsol) | [9582](https://github.com/nushell/nushell/pull/9582) | make the behaviours of `last` and `first` more consistent | +| [@hanjunghyuk](https://github.com/hanjunghyuk) | [9623](https://github.com/nushell/nushell/pull/9623) | Fix `explore` crashes on {} | +| [@YassineHaouzane](https://github.com/YassineHaouzane) | [9616](https://github.com/nushell/nushell/pull/9616) | Fix: update engine_state when history.isolation is true (#9268) | +| [@IanManske](https://github.com/IanManske) | [9603](https://github.com/nushell/nushell/pull/9603) | Fix `headers` command handling of missing values | +| [@AyushSingh13](https://github.com/AyushSingh13) | [9580](https://github.com/nushell/nushell/pull/9580) | fixes `which` showing aliases as built-in nushell commands | +| [@mengsuenyan](https://github.com/mengsuenyan) | [9662](https://github.com/nushell/nushell/pull/9662) | fix the command `cp -u src dst`/`mv -u src dst` doesn't work when the… | + +### Changes to commands + +Since last release, some commands have changed and some have been created, here is a list of some changes and what they mean: + +- [@amtoine](https://github.com/amtoine) in [#9646]: `which` returns the type of the command instead of only whether it is builtin or not and uses more explicit column names +- [@atahabaki](https://github.com/atahabaki) in [#9750]: `str expand` now allows empty member in _brace expansion_, e.g. `A{,B,C}` would expand to `[A, AB, AC]` +- [@fdncred](https://github.com/fdncred) in [#9669]: `keybinding listen` gives more information about keys like `home` and `end`, namely their `kind` and `state` +- [@NotLebedev](https://github.com/NotLebedev) in [#9453]: `input listen` allows to query for a single key press, e.g. the following will take a 4-char input `1..4 | each { input listen } | where key_type == char | get code | str join` +- [@kubouch](https://github.com/kubouch) in [#9687]: `path` commands lose the `-c` flag; instead, use `update` to update table columns + +[#9646]: https://github.com/nushell/nushell/pull/9646 +[#9750]: https://github.com/nushell/nushell/pull/9750 +[#9669]: https://github.com/nushell/nushell/pull/9669 +[#9453]: https://github.com/nushell/nushell/pull/9453 +[#9687]: https://github.com/nushell/nushell/pull/9687 + +### Command set refinement efforts + +Again with this new release, we are continuing refining our set of core commands. As part of this, another set of commands have moved to `extra`. Thanks to folks who are helping our efforts on the road to 1.0! + +:::note +No command has been removed completely, they have just been moved in the _extra_ feature of Nushell. +simply use `cargo ... --features extra` to reenable them. +::: + +Math commands have been moved by [@stormasm] in [#9674], [#9657] and [#9647] and the following +commands have been moved in [#9404]: `fmt`, `each while`, `roll`, `roll down`, `roll left`, `roll right`, +`roll up`, `rotate`, `update cells`, `decode hex`, `encode hex`, `from url`, `to html`, `ansi gradient`, +`ansi link`and `format` + +[@stormasm]: https://github.com/stormasm +[#9674]: https://github.com/nushell/nushell/pull/9674 +[#9657]: https://github.com/nushell/nushell/pull/9657 +[#9647]: https://github.com/nushell/nushell/pull/9647 +[#9404]: https://github.com/nushell/nushell/pull/9404 + +### Language improvements + +Since last release, a few changes have happened to the Nu language itself. + +#### Declaration and assignment of variables + +Until now, declaration keywords such as `let` and `mut` have required the use of parentheses around pipelines to assign the output of a chain of command to a variable. +Thanks to [@jntrnr] in [#9658] and [#9589], this syntax has been relaxed for `let` and `mut`. Let's give some examples! + +```nu +let filenames = ls | where type == file | get name +``` + +and + +```nu +mut my_var = "hello world" | str length +``` + +are now completely valid Nushell code. + +:::note +this new syntax does not work on `const` and it does not apply to assignment of values to variables, e.g. + +```nu +$env.FILENAMES = ls | where type == file | get name +``` + +is not parsed as valid Nushell. +::: + +Another parser improvement has to do with the use of `if` and `match` in variable assignment. +In [#9650], [@Windsoilder] made the following Nushell snippets possible: + +```nu +mut a = 3 +$a = if 4 == 3 { 10 } else {20} +``` + +and + +```nu +$env.BUILD_EXT = match 3 { 1 => { 'yes!' }, _ => { 'no!' } } +``` + +[@jntrnr]: https://github.com/jntrnr +[#9658]: https://github.com/nushell/nushell/pull/9658 +[#9589]: https://github.com/nushell/nushell/pull/9589 +[@Windsoilder]: https://github.com/Windsoilder +[#9650]: https://github.com/nushell/nushell/pull/9650 + +#### Input / output type checking and annotations ([@jntrnr]) + +Nushell as a language is more strictly typed than other shell languages. +However, not everything was type-checked nor possible to annotate and this new release tries to fill this gap a bit more. + +:::note +in the following of this section, the term _input / output signature_ is used. This describes the input of a command and the associated output type of the command for the given input type, e.g. in `ls | get 0.name` the input type of +`get` is a `table` and its output type is a `string`, so we can say that the _input / output signature_ of `get` here is `table -> string`. + +Please note that _input / output signatures_ always come in pair. +::: + +First, [#9686] makes the input / output type signatures clearer in the help pages of commands. +Then, [#9690] and [#9680] enable input / output type annotations on custom commands and enforce a strong type checking +on the input and output of commands. +This means a few things + +- the input / output of custom commands can be annotated + +```nu +def sum []: list<int> -> int { + math sum +} +``` + +- some type-invalid calls to commands are now parsed as an error, e.g. `123 | get foo` gives the following error + +```nu +Error: nu::parser::input_type_mismatch + + × Command does not support int input. + ╭─[entry #2:1:1] + 1 │ 123 | get foo + · ─┬─ + · ╰── command doesn't support int input + ╰──── +``` + +This is still a work in progress, so some commands might have incorrect or missing input / output type annotations :open_mouth: +This is expected and we worked and are working on this to fix all incorrect signatures ([#9755], [#9749], [#9707], [#9706], [#9695], +[#9683], [#9775], [#9741], [#9742], [#9739] and [#9778])! + +[@jntrnr]: https://github.com/jntrnr +[#9686]: https://github.com/nushell/nushell/pull/9686 +[#9690]: https://github.com/nushell/nushell/pull/9690 +[#9680]: https://github.com/nushell/nushell/pull/9680 +[#9755]: https://github.com/nushell/nushell/pull/9755 +[#9749]: https://github.com/nushell/nushell/pull/9749 +[#9707]: https://github.com/nushell/nushell/pull/9707 +[#9706]: https://github.com/nushell/nushell/pull/9706 +[#9695]: https://github.com/nushell/nushell/pull/9695 +[#9683]: https://github.com/nushell/nushell/pull/9683 +[#9775]: https://github.com/nushell/nushell/pull/9775 +[#9741]: https://github.com/nushell/nushell/pull/9741 +[#9742]: https://github.com/nushell/nushell/pull/9742 +[#9739]: https://github.com/nushell/nushell/pull/9739 +[#9778]: https://github.com/nushell/nushell/pull/9778 + +#### Shoutouts + +In between the two releases, [@1Kinoti](https://github.com/1Kinoti) has worked on some nice improvements to the language + +- match guards have been added to the `match` command in [#9621](https://github.com/nushell/nushell/pull/9621) +- `table` types can now have parameters, just as `record`s and `list`s can, thansk to [#9613](https://github.com/nushell/nushell/pull/9613) +- structural subtyping has been improved in [#9614](https://github.com/nushell/nushell/pull/9614) and allow to match structured types regardless of the orders of the fields + +### Configuration tweaks + +Contributions have been made to give a more consistent and sensible default experience in Nushell, both when using +the `default_config.nu` config file or when not having a config, e.g. with `nu -n`. +A better right prompt has been written in [#9585] and [#9581] and the default configuration has been polished in [#9676]. + +[#9585]: https://github.com/nushell/nushell/pull/9585 +[#9581]: https://github.com/nushell/nushell/pull/9581 +[#9676]: https://github.com/nushell/nushell/pull/9676 + +### The standard library + +The biggest topic in this 0.83 release for the standard library has been the test runner! + +Thanks to [@Yethal], the test runner of the standard library can now use annotations to decide whether or not to run +a command as part of the test suite of a project: [#9628], [#9622], [#9611] and [#9406]. + +For instance, we can now write a module as follows + +```nu +def add [a: int, b: int] { + $a + $b +} + +#[test] +def addition [] { + use std assert + assert equal (add 1 2) 3 +} +``` + +and `std testing run-tests` would successfully run the `addition` test, no need to define tests with `test_` in their names! + +Thanks to [@Hofer-Julian] ([#9607]), the standard library now also comes with a `pwd` command that tells you were you are in +the filesystem. + +[@Yethal]: https://github.com/Yethal +[@Hofer-Julian]: https://github.com/Hofer-Julian +[#9628]: https://github.com/nushell/nushell/pull/9628 +[#9622]: https://github.com/nushell/nushell/pull/9622 +[#9611]: https://github.com/nushell/nushell/pull/9611 +[#9406]: https://github.com/nushell/nushell/pull/9406 +[#9607]: https://github.com/nushell/nushell/pull/9607 + +## Breaking changes + +**PLEASE NOTE:** there are some big breaking changes in this release. These include: + +- Removal of `let-env` (now use the `$env.FOO = "BAR"` form instead) +- Stricter checking of input/output types +- Transitioning of a set of commands to now be avialable via `extra` feature rather than default + +Full list of breaking changes: + +- [#9574](https://github.com/nushell/nushell/pull/9574) remove let-env, focus on mutating $env +- [#9587](https://github.com/nushell/nushell/pull/9587) disallow blocks as first-class values +- [#9589](https://github.com/nushell/nushell/pull/9589) `let` no longer allows bareword assignment (Eg, `let foo = bar` where `bar` is assumed to be a string) +- [#9582](https://github.com/nushell/nushell/pull/9582) make the behaviours of `last` and `first` more consistent +- [#9594](https://github.com/nushell/nushell/pull/9594) Fix: return all headers with the same name from `http <method>` +- [#9646](https://github.com/nushell/nushell/pull/9646) change the output of `which` to be more explicit +- [#9404](https://github.com/nushell/nushell/pull/9404) [#9647](https://github.com/nushell/nushell/pull/9647) [#9657](https://github.com/nushell/nushell/pull/9657) - a number of commands have been moved to `extra` +- [#9680](https://github.com/nushell/nushell/pull/9680) Input output checking +- [#9613](https://github.com/nushell/nushell/pull/9613) allow table types to have parameters +- [#9687](https://github.com/nushell/nushell/pull/9687) Refactor path commands +- [#9690](https://github.com/nushell/nushell/pull/9690) The `extern` command has split into `extern` and `extern-wrapped`, the latter allowing a block to be called when calling an extern + +## Full changelog + +### Nushell + +- [sholderbach](https://github.com/sholderbach) created + - [Adjust signatures for cellpath access of tables](https://github.com/nushell/nushell/pull/9778) + - [Update `nu-ansi-term`, `lscolors`, and `reedline`](https://github.com/nushell/nushell/pull/9787) + - [Abort type determination for List early](https://github.com/nushell/nushell/pull/9779) + - [Fix output signature of `split chars`/`words`](https://github.com/nushell/nushell/pull/9739) + - [Use explicit in/out list types for vectorized commands](https://github.com/nushell/nushell/pull/9742) + - [Add explicit input types for vectorized `into int` form](https://github.com/nushell/nushell/pull/9741) + - [Remove underused devdep `getset`](https://github.com/nushell/nushell/pull/9727) + - [Clean up tests containing unnecessary `cwd:` tokens](https://github.com/nushell/nushell/pull/9692) + - [Use `is-terminal` crate for now](https://github.com/nushell/nushell/pull/9670) + - [Bump deps to transitively use hashbrown 0.14](https://github.com/nushell/nushell/pull/9668) + - [Apply nightly clippy lints](https://github.com/nushell/nushell/pull/9654) + - [Update reedline dev version lock](https://github.com/nushell/nushell/pull/9644) + - [Bump `indexmap` to 2.0](https://github.com/nushell/nushell/pull/9643) + - [Remove duplicated dependency on `ansi-str 0.7`](https://github.com/nushell/nushell/pull/9641) + - [Update `proc-macro2` lock, fix nightly build](https://github.com/nushell/nushell/pull/9618) + - [Exclude deprecated commands from completions](https://github.com/nushell/nushell/pull/9612) + - [Document `fn pipeline()` used with `nu!` tests](https://github.com/nushell/nushell/pull/9609) + - [Remove unnecessary parentheses](https://github.com/nushell/nushell/pull/9605) +- [app/dependabot](https://github.com/app/dependabot) created + - [Bump pretty_assertions from 1.3.0 to 1.4.0](https://github.com/nushell/nushell/pull/9781) + - [Bump tempfile from 3.6.0 to 3.7.0](https://github.com/nushell/nushell/pull/9780) + - [Bump miette from 5.9.0 to 5.10.0](https://github.com/nushell/nushell/pull/9713) + - [Bump strum_macros from 0.24.3 to 0.25.1](https://github.com/nushell/nushell/pull/9714) + - [Bump strum from 0.24.1 to 0.25.0](https://github.com/nushell/nushell/pull/9639) + - [Bump scraper from 0.16.0 to 0.17.1](https://github.com/nushell/nushell/pull/9638) + - [Bump libproc from 0.13.0 to 0.14.0](https://github.com/nushell/nushell/pull/9640) + - [Bump tempfile from 3.5.0 to 3.6.0](https://github.com/nushell/nushell/pull/9591) + - [Bump calamine from 0.19.1 to 0.21.2](https://github.com/nushell/nushell/pull/9592) + - [Bump ureq from 2.6.2 to 2.7.1](https://github.com/nushell/nushell/pull/9590) + - [Bump open from 4.1.0 to 5.0.0](https://github.com/nushell/nushell/pull/9526) +- [amtoine](https://github.com/amtoine) created + - [add `table -> table` to `into datetime`](https://github.com/nushell/nushell/pull/9775) + - [change the output of `which` to be more explicit](https://github.com/nushell/nushell/pull/9646) + - [add `any -> record` to `metadata`](https://github.com/nushell/nushell/pull/9755) + - [sync default config / env with default behaviour without any configuration](https://github.com/nushell/nushell/pull/9676) + - [allow `into filesize` to take tables as input / output](https://github.com/nushell/nushell/pull/9706) + - [simplify the test for `let` core command](https://github.com/nushell/nushell/pull/9671) + - [fix the `std` test commands calls in dev documents](https://github.com/nushell/nushell/pull/9535) + - [refactor the CI](https://github.com/nushell/nushell/pull/9626) + - [REFACTOR: move the 0% commands to `nu-cmd-extra`](https://github.com/nushell/nushell/pull/9404) + - [simplify the `nu!` tests for `last` and `first` commands](https://github.com/nushell/nushell/pull/9608) +- [hexavik](https://github.com/hexavik) created + - [Fix: remove unnecessary `r#"..."#` (#8670)](https://github.com/nushell/nushell/pull/9764) +- [mengsuenyan](https://github.com/mengsuenyan) created + - [fix #9653 the cmd `detect columns` with the flag `-c`](https://github.com/nushell/nushell/pull/9667) + - [fix the command `cp -u src dst`/`mv -u src dst` doesn't work when the…](https://github.com/nushell/nushell/pull/9662) +- [IanManske](https://github.com/IanManske) created + - [Add functions for each `Value` case](https://github.com/nushell/nushell/pull/9736) + - [nushell should be non-interactive if `--testbin` is supplied](https://github.com/nushell/nushell/pull/9730) + - [Do not attempt to take control of terminal in non-interactive mode](https://github.com/nushell/nushell/pull/9693) + - [Fix SIGTTIN handling](https://github.com/nushell/nushell/pull/9681) + - [Fix `headers` command handling of missing values](https://github.com/nushell/nushell/pull/9603) +- [fdncred](https://github.com/fdncred) created + - [update history_isolation to false](https://github.com/nushell/nushell/pull/9763) + - [change the default of history.isolation](https://github.com/nushell/nushell/pull/9762) + - [handle sqlite tables better by surrounding with brackets](https://github.com/nushell/nushell/pull/9752) + - [add range input to par-each](https://github.com/nushell/nushell/pull/9749) + - [normalize default_config/env formatting](https://github.com/nushell/nushell/pull/9731) + - [allow range as a input_output_type on filter](https://github.com/nushell/nushell/pull/9707) + - [update rust toolchain to 1.69.0](https://github.com/nushell/nushell/pull/9691) + - [add more input_output_types found from breaking scripts](https://github.com/nushell/nushell/pull/9683) + - [add kind and state to other key presses](https://github.com/nushell/nushell/pull/9669) + - [fix right prompt in the default_env.nu](https://github.com/nushell/nushell/pull/9581) + - [fix typo in deprecated message: `$nu` should be `$env`](https://github.com/nushell/nushell/pull/9579) + - [update ide-check help text](https://github.com/nushell/nushell/pull/9559) + - [add input_output type to `input list` to return string](https://github.com/nushell/nushell/pull/9557) + - [convert a string to a raw binary string of 0s and 1s](https://github.com/nushell/nushell/pull/9534) + - [update sqlparser dep to 0.34](https://github.com/nushell/nushell/pull/9549) +- [atahabaki](https://github.com/atahabaki) created + - [str-expand: new capability, empty collection item](https://github.com/nushell/nushell/pull/9750) + - [A new subcommand to str, str-expand.](https://github.com/nushell/nushell/pull/9290) +- [jntrnr](https://github.com/jntrnr) created + - [Fix capture logic for inner closures](https://github.com/nushell/nushell/pull/9754) + - [fix input signature of let/mut](https://github.com/nushell/nushell/pull/9695) + - [Revert "Fix SIGTTIN handling"](https://github.com/nushell/nushell/pull/9694) + - [Custom command input/output types](https://github.com/nushell/nushell/pull/9690) + - [Change input/output types in help to a table](https://github.com/nushell/nushell/pull/9686) + - [Input output checking](https://github.com/nushell/nushell/pull/9680) + - [Remove broken compile-time overload system](https://github.com/nushell/nushell/pull/9677) + - [allow mut to take pipelines](https://github.com/nushell/nushell/pull/9658) + - [Move to using a safer shell integration default setting](https://github.com/nushell/nushell/pull/9600) + - [Let with pipeline](https://github.com/nushell/nushell/pull/9589) + - [disallow blocks as first-class values](https://github.com/nushell/nushell/pull/9587) + - [use an easier-to-read date format in prompt](https://github.com/nushell/nushell/pull/9585) + - [fix a few clippy issues](https://github.com/nushell/nushell/pull/9578) + - [remove let-env, focus on mutating $env](https://github.com/nushell/nushell/pull/9574) + - [Improve type hovers](https://github.com/nushell/nushell/pull/9515) +- [cramt](https://github.com/cramt) created + - [fix removing symlinks on windows](https://github.com/nushell/nushell/pull/9704) +- [WindSoilder](https://github.com/WindSoilder) created + - [Redirection: make `o>`, `e>`, `o+e>`'s target support variables and string interpolation](https://github.com/nushell/nushell/pull/9747) + - [support env assignment and mutable variable assignment with `if` block and `match` guard](https://github.com/nushell/nushell/pull/9650) + - [dependency: use notify-debouncer-full(based on notify v6) instead of notify v4](https://github.com/nushell/nushell/pull/9606) + - [Bracketed paste refactor](https://github.com/nushell/nushell/pull/9547) + - [fix cd permissions when user belongs to folder group](https://github.com/nushell/nushell/pull/9531) + - [`rename`: add -b flag to support closure input](https://github.com/nushell/nushell/pull/8948) +- [stormasm](https://github.com/stormasm) created + - [add in a Readme for the crate nu-cmd-extra](https://github.com/nushell/nushell/pull/9745) + - [remove warning: unused import pipeline](https://github.com/nushell/nushell/pull/9675) + - [cratification: part III of the math commands to nu-cmd-extra](https://github.com/nushell/nushell/pull/9674) + - [cratification: part II of the math commands to nu-cmd-extra](https://github.com/nushell/nushell/pull/9657) + - [cratification: start moving over the math commands to nu-cmd-extra](https://github.com/nushell/nushell/pull/9647) +- [dmatos2012](https://github.com/dmatos2012) created + - [Disallow empty record with empty key,value pairs on ini format](https://github.com/nushell/nushell/pull/9722) +- [nibon7](https://github.com/nibon7) created + - [Remove `is-root` crate](https://github.com/nushell/nushell/pull/9615) + - [Replace `users` with `nix` crate](https://github.com/nushell/nushell/pull/9610) + - [Fix cargo-build-nu](https://github.com/nushell/nushell/pull/9571) + - [Refactor cargo-build-nu](https://github.com/nushell/nushell/pull/9554) + - [Fix release workflows](https://github.com/nushell/nushell/pull/9542) +- [1Kinoti](https://github.com/1Kinoti) created + - [add match guards](https://github.com/nushell/nushell/pull/9621) + - [allow tables to have annotations](https://github.com/nushell/nushell/pull/9613) + - [improve subtyping](https://github.com/nushell/nushell/pull/9614) +- [kubouch](https://github.com/kubouch) created + - [Refactor path commands](https://github.com/nushell/nushell/pull/9687) + - [Fix broken constants in scopes](https://github.com/nushell/nushell/pull/9679) +- [zhiburt](https://github.com/zhiburt) created + - [nu-explore/ Add handlers for HOME/END keys](https://github.com/nushell/nushell/pull/9666) + - [Fix #9548](https://github.com/nushell/nushell/pull/9552) +- [hanjunghyuk](https://github.com/hanjunghyuk) created + - [Remove unnecessary `cwd`, `pipeline()`, `r#` from various tests](https://github.com/nushell/nushell/pull/9645) + - [Fix `explore` crashes on {}](https://github.com/nushell/nushell/pull/9623) +- [Yethal](https://github.com/Yethal) created + - [test-runner: add configurable threading](https://github.com/nushell/nushell/pull/9628) + - [test-runner: Performance improvements + regex match for test include/exclude](https://github.com/nushell/nushell/pull/9622) + - [test-runner: Add option to exclude single test and module](https://github.com/nushell/nushell/pull/9611) + - [Implement annotations support in test runner](https://github.com/nushell/nushell/pull/9406) + - [Pre-register plugins inside docker container](https://github.com/nushell/nushell/pull/9533) +- [AyushSingh13](https://github.com/AyushSingh13) created + - [fixes `which` showing aliases as built-in nushell commands](https://github.com/nushell/nushell/pull/9580) +- [YassineHaouzane](https://github.com/YassineHaouzane) created + - [Fix: update engine_state when history.isolation is true (#9268)](https://github.com/nushell/nushell/pull/9616) +- [Hofer-Julian](https://github.com/Hofer-Julian) created + - [Add `pwd` command to stdlib](https://github.com/nushell/nushell/pull/9607) +- [NotLebedev](https://github.com/NotLebedev) created + - [Command to get individual keys](https://github.com/nushell/nushell/pull/9453) +- [rusty-jules](https://github.com/rusty-jules) created + - [Fix: return all headers with the same name from `http <method>`](https://github.com/nushell/nushell/pull/9594) +- [baehyunsol](https://github.com/baehyunsol) created + - [make the behaviours of `last` and `first` more consistent](https://github.com/nushell/nushell/pull/9582) +- [bgmort](https://github.com/bgmort) created + - [Add useful example to `http options` documentation](https://github.com/nushell/nushell/pull/9576) + +### Extension + +- [fdncred](https://github.com/fdncred) created + - [forgot to merge changes for 1.60](https://github.com/nushell/vscode-nushell-lang/pull/145) + +### Documentation + +- [amtoine](https://github.com/amtoine) created + - [refactor `ssh-agent` cookbook example](https://github.com/nushell/nushell.github.io/pull/982) + - [remove all `| table` from the book](https://github.com/nushell/nushell.github.io/pull/976) + - [add a more complete example to persist aliases in `config.nu`](https://github.com/nushell/nushell.github.io/pull/973) +- [Heidar-An](https://github.com/Heidar-An) created + - [Update nushell_map_imperative.md](https://github.com/nushell/nushell.github.io/pull/986) +- [JoaquinTrinanes](https://github.com/JoaquinTrinanes) created + - [Add external completers cookbook entry to sidebar](https://github.com/nushell/nushell.github.io/pull/985) + - [Expand external completer docs](https://github.com/nushell/nushell.github.io/pull/984) +- [fachammer](https://github.com/fachammer) created + - [Fix link](https://github.com/nushell/nushell.github.io/pull/981) + - [Fix typo](https://github.com/nushell/nushell.github.io/pull/980) + - [Fix typo](https://github.com/nushell/nushell.github.io/pull/979) +- [hustcer](https://github.com/hustcer) created + - [Use lefthook instead of husky and lint-staged for git hooks](https://github.com/nushell/nushell.github.io/pull/978) + - [Refresh commands docs for Nu v0.82](https://github.com/nushell/nushell.github.io/pull/965) +- [Equationzhao](https://github.com/Equationzhao) created + - [fix a broken link in plugins page in zh-CN](https://github.com/nushell/nushell.github.io/pull/975) +- [Hofer-Julian](https://github.com/Hofer-Julian) created + - [Remove `&&` and `||`](https://github.com/nushell/nushell.github.io/pull/974) +- [jarrodu](https://github.com/jarrodu) created + - [Fix typo](https://github.com/nushell/nushell.github.io/pull/971) +- [sholderbach](https://github.com/sholderbach) created + - [Automate response to PRs trying to update commands](https://github.com/nushell/nushell.github.io/pull/969) +- [waldyrious](https://github.com/waldyrious) created + - [Fix typo in 2023-06-27-nushell_0_82.md](https://github.com/nushell/nushell.github.io/pull/967) + +### Nu_Scripts + +- [amtoine](https://github.com/amtoine) created + - [add `$.version` to `package.nuon`](https://github.com/nushell/nu_scripts/pull/548) + - [move the extra menus of Nushell into `custom-menus/extra/`](https://github.com/nushell/nu_scripts/pull/550) + - [make the release note TODOs HTML comments](https://github.com/nushell/nu_scripts/pull/557) + - [refactor: simplify the `nu_release` script](https://github.com/nushell/nu_scripts/pull/540) + - [fix the release note scripts](https://github.com/nushell/nu_scripts/pull/538) + - [update the `make_release/Readme.md` with the whole process](https://github.com/nushell/nu_scripts/pull/541) + - [use `$env.` instead of `let-env `](https://github.com/nushell/nu_scripts/pull/543) +- [jntrnr](https://github.com/jntrnr) created + - [Update some benchmarks. Re-port the gradient benchmark](https://github.com/nushell/nu_scripts/pull/558) +- [JalonWong](https://github.com/JalonWong) created + - [Add a git prompt](https://github.com/nushell/nu_scripts/pull/555) +- [fj0r](https://github.com/fj0r) created + - [ssh complete cache use whitelist](https://github.com/nushell/nu_scripts/pull/553) + - [upgrade to 0.82](https://github.com/nushell/nu_scripts/pull/539) +- [fdncred](https://github.com/fdncred) created + - [fix error background color in oh-my.nu script](https://github.com/nushell/nu_scripts/pull/551) +- [maxim-uvarov](https://github.com/maxim-uvarov) created + - [conda fix](https://github.com/nushell/nu_scripts/pull/547) +- [trantor](https://github.com/trantor) created + - [Update README.md: typo](https://github.com/nushell/nu_scripts/pull/545) +- [dedebenui](https://github.com/dedebenui) created + - [fix pass-completion as `let` cannot be used at module level](https://github.com/nushell/nu_scripts/pull/544) +- [bobhy](https://github.com/bobhy) created + - [full line v2; with git status!](https://github.com/nushell/nu_scripts/pull/542) + +### Reedline + +- [sholderbach](https://github.com/sholderbach) created + - [Bump `nu-ansi-term` to 0.49.0](https://github.com/nushell/reedline/pull/613) + - [Update the `Cargo.lock` for tests and demo](https://github.com/nushell/reedline/pull/611) + - [Fix clippy lint for DoubleEndedIterator](https://github.com/nushell/reedline/pull/610) + - [Update (dev-)deps strum/pretty-assertions,rstest](https://github.com/nushell/reedline/pull/600) +- [nibon7](https://github.com/nibon7) created + - [Fix big_word_left_index](https://github.com/nushell/reedline/pull/609) + - [Remove unneeded features of chrono](https://github.com/nushell/reedline/pull/599) +- [NotLebedev](https://github.com/NotLebedev) created + - [Replace crossterm ScrollUp with universal workaround](https://github.com/nushell/reedline/pull/601) +- [WindSoilder](https://github.com/WindSoilder) created + - [always disable bracketed paste after read_line](https://github.com/nushell/reedline/pull/598) diff --git a/blog/2023-07-30-nushell_0_83_1.md b/src/content/docs/blog/2023-07-30-nushell_0_83_1.md similarity index 91% rename from blog/2023-07-30-nushell_0_83_1.md rename to src/content/docs/blog/2023-07-30-nushell_0_83_1.md index 9ce68058713..5af15b5c3ce 100644 --- a/blog/2023-07-30-nushell_0_83_1.md +++ b/src/content/docs/blog/2023-07-30-nushell_0_83_1.md @@ -3,11 +3,9 @@ title: Nushell 0.83.1 (hot-fix) author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing patch version 0.83.1 of Nu. This hot-fix release aims to fix issues introduced by 0.83.0 and its type system changes. +description: Today, we're releasing patch version 0.83.1 of Nu. This hot-fix release aims to fix issues introduced by 0.83.0 and its type system changes. --- -# Nushell 0.83.1 (hot-fix) - A few days ago, we released the 0.83 version of Nushell. As you can see in the [release notes][Nushell 0.83 notes], the release included a major upgrade to the type system as well as wide-reaching breaking changes. Today, we're releasing a hot-fix for that release. @@ -24,7 +22,7 @@ bugs have been found. Many commands needed additional updates to play well with We decided to release a hotfix release to address what had been found, and this is that release. You can find out more about the hotfix in [_Tracking issue for 0.83.0 fixup_ #9812][#9812]. -# Where to get it +## Where to get it Nu 0.83.1 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.83.1) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. @@ -32,38 +30,38 @@ NOTE: The optional dataframe functionality is available by `cargo install nu --f As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# What does the hot-fix release address? +## What does the hot-fix release address? Most of the _type-system_-related issues have been fixed, hopefully bringing most of the command set of Nushell back to its previous feature level with the nice addition of better input/output type checking and annotations. In a few places, the type system itself was fixed, as with the case of `$rest` args now type-checking correctly in a pipeline. -# What will the hot-fix release NOT address? +## What will the hot-fix release NOT address? -## Bring the `let-env` command back to life. +### Bring the `let-env` command back to life. Thankfully, the community helped by updating their Nushell integrations and releasing corresponding new versions. Please, check your tools like `starship` for updates. -## Fully fix the dataframe integration. +### Fully fix the dataframe integration. When upgrading the type system for the 0.83, we removed a semi-working system that enabled the dataframe commands to run both in a lazy and eager mode, but only if the types were known at parse-time. Due to the complexity of reworking this and the dataframe support currently being a tier-two feature in Nushell, we won't be able to fully fix this with this patch release. Thankfully [@ayax79](https://github.com/ayax79) started work in [#9858](https://github.com/nushell/nushell/pull/9858) which promises to make the dataframe commands work again within the general Nushell type system. -# Breaking changes for plugin authors +## Breaking changes for plugin authors With the type system changes in `0.83.0` any plugins that declared that their signature `"vectorizes_over_list": true` were not able to automatically broadcast their operation for a type `T` (e.g. `number`) over a `list<T>` input. With this patch release, [we removed this field from `nu-protocol`](https://github.com/nushell/nushell/pull/9777). You need to add the `list<T>` signature if necessary. Also recompile your plugins using `nu-plugin 0.83.1` or remove the `vectorizes_over_list` field from the signature information if you don't use `nu-plugin` (e.g. plugins not implemented in Rust). -# Breaking changes for plugin users +## Breaking changes for plugin users You may need to recompile or update your plugins and then re-register your plugins. -# Changelog +## Changelog - [ayax79](https://github.com/ayax79) created - [merging into one `dfr into-nu` command](https://github.com/nushell/nushell/pull/9858) @@ -98,6 +96,6 @@ You may need to recompile or update your plugins and then re-register your plugi [Nushell 0.83]: https://github.com/nushell/nushell/releases/tag/0.83.0 [Nushell 0.83 notes]: https://www.nushell.sh/blog/2023-07-25-nushell_0_83.html -[input/output types]: https://www.nushell.sh/blog/2023-07-25-nushell_0_83.html#input-output-type-checking-and-annotations-jntrnr -[breaking changes]: https://www.nushell.sh/blog/2023-07-25-nushell_0_83.html#breaking-changes +[input/output types]: https://www.nushell.sh/blog/2023-07-25-nushell_0_83#input-output-type-checking-and-annotations-jntrnr +[breaking changes]: https://www.nushell.sh/blog/2023-07-25-nushell_0_83#breaking-changes [#9812]: https://github.com/nushell/nushell/issues/9812 diff --git a/src/content/docs/blog/2023-08-22-nushell_0_84_0.md b/src/content/docs/blog/2023-08-22-nushell_0_84_0.md new file mode 100644 index 00000000000..ef5d3de184f --- /dev/null +++ b/src/content/docs/blog/2023-08-22-nushell_0_84_0.md @@ -0,0 +1,428 @@ +--- +title: Nushell 0.84.0 +author: The Nu Authors +author_site: https://twitter.com/nu_shell +author_image: https://www.nushell.sh/blog/images/nu_logo.png +description: Today, we're releasing version 0.84.0 of Nu. This release adds adds exporting constants from modules, `scope` commands improvements, cosmetic changes, and many smaller changes to our commands. +--- + +Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. + +Today, we're releasing version 0.84.0 of Nu. This release adds exporting constants from modules, `scope` commands improvements, cosmetic changes, and many smaller changes to our commands. + +<!-- more --> + +## Where to get it + +Nu 0.84.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.84.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. + +NOTE: The optional dataframe functionality is available by `cargo install nu --features=dataframe`. + +As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. + +## Themes of this release / New features + +## (Major Breaking Change!) `str replace` matches substring by default ([kubouch](https://github.com/nushell/nushell/pull/10038)) + +:::caution[Breaking change] +See a full overview of the [breaking changes](#breaking-changes) +::: + +`str replace` now matches a substring instead of a regular expression by default and the `-s`/`--string` flag is deprecated (will be removed altogether in 0.85). Matching a substring by default makes it more consistent with the rest of the Nushell's commands. + +:::note +Since `str replace` is a widely used command, many scripts are going to break. Fixing it is easy: + +- If you used `str replace` **without** the `-s`/`--string` flag, you used regex matching and you should add `--regex` flag to keep the previous functionality. +- If you used `str replace` **with** the `-s`/`--string` flag, you will get a deprecation warning. To get rid of the warning, simply remove the flag. + +::: + +### Constants from modules ([WindSoilder](https://github.com/nushell/nushell/pull/9773), [kubouch](https://github.com/nushell/nushell/pull/10049)) + +You can now use constants in modules and export them. Calling `use` on a module will create record containing all module's constants. You can also import the constants directly, for example with `use module.nu const-name`, without creating the module's record. Example: + +```nu +> module spam { + export const X = 'x' + export module eggs { + export const Y = 'y' + export const viking = 'eats' + } +} + +> use spam + +> $spam +╭──────┬───────────────────╮ +│ eggs │ {record 2 fields} │ +│ X │ x │ +╰──────┴───────────────────╯ + +> $spam.eggs +╭────────┬──────╮ +│ Y │ y │ +│ viking │ eats │ +╰────────┴──────╯ + +> use spam eggs viking + +> $viking +eats +``` + +The exported values are true constants which means that you can use them in some scenarios where you cannot use normal variables, such as: + +```nu +> module files { + export const MY_CONFIG = '/home/viking/.config/nushell/my_config.nu' +} + +> use files MY_CONFIG + +> source $MY_CONFIG # sources '/home/viking/.config/nushell/my_config.nu' +``` + +### New options for more compact table display ([@zhiburt](https://github.com/nushell/nushell/pull/9983), [#9796](https://github.com/nushell/nushell/pull/9796)) + +To save screen space, you can now display tables with the header directly displayed on the border through the `$env.config.table.header_on_separator` option. + + + +Additionally you can now configure the `padding` left and right of the table cell content either separately or all at once to adjust the layout for your readability needs. + + + +### More consistent `format ...` commands ([@sholderbach](https://github.com/nushell/nushell/pull/9788), [@WindSoilder](https://github.com/nushell/nushell/pull/9902)) + +:::caution[Breaking change] +See a full overview of the [breaking changes](#breaking-changes) +::: + +With this release we moved several commands that serve to produce string output from a particular data type as `format` subcommands. + +1. `date format` has been renamed to `format date` ([#9788](https://github.com/nushell/nushell/pull/9788)). +2. `into duration --convert` was previously used to provide string representations of `duration`s. This option has been removed and you should now use `format duration`. ([#9902](https://github.com/nushell/nushell/pull/9902)) +3. `format filesize` that was previously moved into the `--features extra` set is back in the core ([#9978](https://github.com/nushell/nushell/pull/9978)). + +### `scope` commands enhancements ([kubouch](https://github.com/nushell/nushell/pull/10023), [kubouch](https://github.com/nushell/nushell/pull/10045)) + +`scope` commands received a significant amount of improvements making them more useful for advanced introspection of Nushell's definitions. + +- `scope externs` now lists known externals (defined with `extern`) +- `scope aliases` is now fixed and lists names and usages of the aliases, not of the aliased commands (this used to cause some confusion) +- `scope modules` now lists all the exportable of the module, including submodules with their contents +- all `scope` commands now list the definition's ID which can be used for reliable tracking of definitions. For example, a command `foo` imported from a module `spam` using `use spam` will be named `spam foo`, therefore, relying solely on names of the definitions can sometimes be misleading. +- `module_name` field is no longer present +- `scope variables` now denotes whether a variable is a constant or not + +### `http` commands now handle headers better ([@jflics6460](https://github.com/nushell/nushell/pull/9771), [@ineu](https://github.com/nushell/nushell/pull/10022) + +You can now pass headers directly as a record to the `-H` flag. + +```nu +http get -H {cookie: "acc=foobar"} http://example.com +``` + +When running a `http` command with `--full` to get additional metadata about the response you can now get both the request and the reponse header + +```nu +http get --full -H {cooke: "my=cookie"} | get headers | get response +``` + +### Work on the optional dataframe features ([@ayax79](https://github.com/ayax79)) + +[@ayax79](https://github.com/ayax79) has been working hard to update our dataframe command to work again with the stricter type check by consolidating internal logic ([#9860](https://github.com/nushell/nushell/pull/9860), +[#9951](https://github.com/nushell/nushell/pull/9951)). + +Furthermore, `dfr open` now suppports the avro exchange format and a new `dfr to-avro` command was added in [#10019](https://github.com/nushell/nushell/pull/10019) + +### Changes to other commands + +Since last release, some commands have changed, here is a list of some interesting changed + +- [@atahabaki](https://github.com/atahabaki) in [#9841](https://github.com/nushell/nushell/pull/9841), [#9856](https://github.com/nushell/nushell/pull/9856) and [#9940](https://github.com/nushell/nushell/pull/9940): Some refinement of the `str expand` command (it's a really cool command, i recommend you check it out :)) +- [@fdncred](https://github.com/fdncred) in [#9987](https://github.com/nushell/nushell/pull/9987): Allow `select` to take a variable with a list of columns +- [@fdncred](https://github.com/fdncred) in [#10048](https://github.com/nushell/nushell/pull/10048): Allow `int` as a _cellpath_ for `select` + +### Command organization ([@storm](https://github.com/nushell/nushell/pull/9926), [@jntrnr](https://github.com/nushell/nushell/pull/10051)) + +In our efforts towards stabilization we moved several commands either behind the `--features extra` build-flag or back into the core set of commands. +The special `str *-case` commands for example have been moved out of the core set, while the `bytes` commands to deal with bytes in arbitrary encodings have returned to the core set. +Furthermore all commands in the core set should now have helpful categories associated with them. + +### Deprecation and removal of commands ([@amtoine](https://github.com/nushell/nushell/pull/9840), [@sholderbach](https://github.com/nushell/nushell/pull/10000)) + +We previously used the term "deprecation" pretty loosely to describe the removal of commands while emitting a helpful error. We intend to now start to use deprecation to warn you before the final removal of a particular option or command. +When we removed a command we will now properly refer to it as removal and started adding warnings where appropriate (e.g. `str replace --string`). As part of this update we removed some very old error helpers nudging you to upgrade to new commands. + +### Documentation + +Thanks to [@rgwood](https://github.com/rgwood), [@sholderbach](https://github.com/sholderbach), +[@kubouch](https://github.com/kubouch) and [@fdncred](https://github.com/fdncred) the documentation +has become a bit better in [#9961](https://github.com/nushell/nushell/pull/9961), +[#9996](https://github.com/nushell/nushell/pull/9996), [#10004](https://github.com/nushell/nushell/pull/10004) +and [#10057](https://github.com/nushell/nushell/pull/10057). + +### Notable bugfixes + +- A panic when parsing the context of `let` assignments has been fixed ([@mengsuenyan](https://github.com/mengsuenyan) in [#9851](https://github.com/nushell/nushell/pull/9851)) +- Invoking `--help` on a script with a `def main` command will now report the script's name instead of a more confusing `main` ([@jntrnr](https://github.com/jntrnr) in [#9948](https://github.com/nushell/nushell/pull/9948)) +- Serious bugs in `parse` that produced incorrect output when given a long input stream have been fixed ([@panicbit](https://github.com/panicbit) in [#9925](https://github.com/nushell/nushell/pull/9925), [#9950](https://github.com/nushell/nushell/pull/9950)) + +### Bugfixes + +Thanks to all the contributors who tackled one or more bugs! +| Name | Link | Description | +| ---------------------------------------------- | ------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| [@mengsuenyan](https://github.com/mengsuenyan) | [#9853](https://github.com/nushell/nushell/pull/9853) | Fix `~ \| path type` returning empty string | +| [@mengsuenyan](https://github.com/mengsuenyan) | [#9851](https://github.com/nushell/nushell/pull/9851) | Fix the panic when type a statement similar to `let f = 'f' $` in the nushell | +| [@jntrnr](https://github.com/jntrnr) | [#9893](https://github.com/nushell/nushell/pull/9893) | Revert [#9693](https://github.com/nushell/nushell/pull/9693) to prevent CPU hangs | +| [@NotLebedev](https://github.com/NotLebedev) | [#9935](https://github.com/nushell/nushell/pull/9935) | Nothing has the correct return type | +| [@amtoine](https://github.com/amtoine) | [#9947](https://github.com/nushell/nushell/pull/9947) | Force `version` to update when installing with `toolkit.nu` | +| [@amtoine](https://github.com/amtoine) | [#9967](https://github.com/nushell/nushell/pull/9967) | Fix panic with `lines` on an error | +| [@rgwood](https://github.com/rgwood) | [#9990](https://github.com/nushell/nushell/pull/9990) | Fix `watch` not handling all file changes | +| [@nibon7](https://github.com/nibon7) | [#9784](https://github.com/nushell/nushell/pull/9784) | Fix a crash when moving the cursor after accepting a suggestion from the help menu | +| [@meskill](https://github.com/meskill) | [#10007](https://github.com/nushell/nushell/pull/10007) | Fix parser to not update plugin.nu file on nu startup | +| [@zhiburt](https://github.com/zhiburt) | [#10011](https://github.com/nushell/nushell/pull/10011) | nu-table: Fix padding 0 width issues | +| [@3lvir4](https://github.com/3lvir4) | [#10012](https://github.com/nushell/nushell/pull/10012) | Remove potential panic from path join | +| [@kubouch](https://github.com/kubouch) | [#10046](https://github.com/nushell/nushell/pull/10046) | Fix wrong path expansion in `save` | +| [@zhiburt](https://github.com/zhiburt) | [#10050](https://github.com/nushell/nushell/pull/10050) | nu-table: Fix issue with truncation and text border | +| [@jntrnr](https://github.com/jntrnr) | [#10052](https://github.com/nushell/nushell/pull/10052) | Fix default_env.nu after latest changes to `str replace` | +| [@fdncred](https://github.com/fdncred) | [#10067](https://github.com/nushell/nushell/pull/10067) | Allow `return` to return any nushell value | +| [@fdncred](https://github.com/fdncred) | [#10063](https://github.com/nushell/nushell/pull/10063) | Fix `into datetime` to accept more date/time formats | + +And also to those who did tackle purely technical challenges!! +| Name | Link | Description | +| ---------------------------------------------- | ------------------------------------------------------- | -------------------------------------------------------- | +| [@IanManske](https://github.com/IanManske) | [#9909](https://github.com/nushell/nushell/pull/9909) | Enable macOS foreground process handling | +| [@jntrnr](https://github.com/jntrnr) | [#9933](https://github.com/nushell/nushell/pull/9933) | Add tests for script subcommands | +| [@jntrnr](https://github.com/jntrnr) | [#9936](https://github.com/nushell/nushell/pull/9936) | Fix a couple clippy warnings | +| [@IanManske](https://github.com/IanManske) | [#9927](https://github.com/nushell/nushell/pull/9927) | Make `Value::columns` return slice instead of cloned Vec | +| [@jntrnr](https://github.com/jntrnr) | [#9949](https://github.com/nushell/nushell/pull/9949) | Move `help commands` to use more structure in signatures | +| [@fdncred](https://github.com/fdncred) | [#9958](https://github.com/nushell/nushell/pull/9958) | Update `strip-ansi-escapes` to use new api | +| [@rgwood](https://github.com/rgwood) | [#9971](https://github.com/nushell/nushell/pull/9971) | Put heavy dataframe dependencies behind feature flag | +| [@sholderbach](https://github.com/sholderbach) | [#9974](https://github.com/nushell/nushell/pull/9974) | Fixup dataframe build after [#9971](https://github.com/nushell/nushell/pull/9971) | +| [@meskill](https://github.com/meskill) | [#9976](https://github.com/nushell/nushell/pull/9976) | test: Clear parent environment to prevent leakage to tests | +| [@kubouch](https://github.com/kubouch) | [#10036](https://github.com/nushell/nushell/pull/10036) | Add additional span to IncorrectValue error | + +## Breaking changes + +- [#9902](https://github.com/nushell/nushell/pull/9902) `date format` has been renamed to `format date` for consistency. +- [#9788](https://github.com/nushell/nushell/pull/9788) The option `into duration --convert` to format durations has been removed. Use the `format duration` command instead. +- [#10038](https://github.com/nushell/nushell/pull/10038) `str replace` now by default matches to **strings** by default. If you want to use regexes you need to use the `-r` flag. The `--strings` flag has been removed +- [#9632](https://github.com/nushell/nushell/pull/9632) To be unambiguous the duration type now does not report months or years. The largest unit reported is weeks as they have a consistent length compared to months or years. +- [#9926](https://github.com/nushell/nushell/pull/9926) We moved some of the more exotic `str` case-commands behind the `--features extra` build-flag. This affects: + - `str camel-case` + - `str kebab-case` + - `str pascal-case` + - `str screaming-snake-case` + - `str snake-case` + - `str title-case` +- [#10053](https://github.com/nushell/nushell/pull/10053) make the charpage optional for `std clip` +- [#10023](https://github.com/nushell/nushell/pull/10023) The output of the `scope` commands has changed + +### Internal breaking change only affecting plugin authors + +- [#9927](https://github.com/nushell/nushell/pull/9927) Make `Value::columns` return slice instead of cloned Vec + +## Full changelog + +### Nushell + +- [amtoine](https://github.com/amtoine) created + - [remove Clippy flags from the PR template](https://github.com/nushell/nushell/pull/10087) + - [Revert "deprecate `--format` and `--list` in `into datetime` (#10017)"](https://github.com/nushell/nushell/pull/10055) + - [make the charpage optional for `std clip`](https://github.com/nushell/nushell/pull/10053) + - [deprecate `--format` and `--list` in `into datetime`](https://github.com/nushell/nushell/pull/10017) + - [fix the signature of `input list`](https://github.com/nushell/nushell/pull/9977) + - [fix the default config for `explore`](https://github.com/nushell/nushell/pull/9962) + - [fix panic with `lines` on an error](https://github.com/nushell/nushell/pull/9967) + - [add a test to make sure "nothing" shows up as "nothing" in help](https://github.com/nushell/nushell/pull/9941) + - [force version to update when installing with toolkit](https://github.com/nushell/nushell/pull/9947) + - [remove old deprecated commands](https://github.com/nushell/nushell/pull/9840) + - [Fix default prompt indicators](https://github.com/nushell/nushell/pull/9914) +- [fdncred](https://github.com/fdncred) created + - [update install/build scripts to include `--locked`](https://github.com/nushell/nushell/pull/10086) + - [allow `help` to return a `Type::Table`](https://github.com/nushell/nushell/pull/10082) + - [try and fix `into datetime` to accept more dt formats](https://github.com/nushell/nushell/pull/10063) + - [allow `return` to return any nushell value](https://github.com/nushell/nushell/pull/10067) + - [enable/update some example tests so they work again](https://github.com/nushell/nushell/pull/10058) + - [try to document the more obscure testbin commands](https://github.com/nushell/nushell/pull/10057) + - [allow int as a cellpath for `select`](https://github.com/nushell/nushell/pull/10048) + - [allow `select` to take a $variable with a list of columns](https://github.com/nushell/nushell/pull/9987) + - [update `strip-ansi-escapes` to 0.2.0 and the latest reedline](https://github.com/nushell/nushell/pull/9970) + - [update `strip-ansi-escapes` to use new api](https://github.com/nushell/nushell/pull/9958) + - [add keybinding for search-history](https://github.com/nushell/nushell/pull/9930) + - [add `header_on_separator` options to default_config.nu](https://github.com/nushell/nushell/pull/9922) + - [updates `let-env` signature to remove required params](https://github.com/nushell/nushell/pull/9917) + - [remove `vectorize_over_list` from python plugin](https://github.com/nushell/nushell/pull/9905) + - [update `format` signature to allow `record` to be passed in](https://github.com/nushell/nushell/pull/9898) + - [update `items` signature to allow `any` output](https://github.com/nushell/nushell/pull/9896) + - [update `char` signature with `Table`](https://github.com/nushell/nushell/pull/9895) + - [update to current reedline](https://github.com/nushell/nushell/pull/9877) + - [bump to dev version 0.83.2](https://github.com/nushell/nushell/pull/9866) +- [jntrnr](https://github.com/jntrnr) created + - [Revert "pin serde to avoid https://github.com/serde-rs/serde/issues/2538"](https://github.com/nushell/nushell/pull/10078) + - [move 'bytes' back to commands](https://github.com/nushell/nushell/pull/10051) + - [pin serde to avoid https://github.com/serde-rs/serde/issues/2538](https://github.com/nushell/nushell/pull/10061) + - [fix default-env after latest changes](https://github.com/nushell/nushell/pull/10052) + - [Rename `main` to script name when running scripts](https://github.com/nushell/nushell/pull/9948) + - [Auto-expand table based on terminal width](https://github.com/nushell/nushell/pull/9934) + - [fix the Cargo.lock file](https://github.com/nushell/nushell/pull/9955) + - [Move `help commands` to use more structure in signatures](https://github.com/nushell/nushell/pull/9949) + - [Fix a couple clippy warnings](https://github.com/nushell/nushell/pull/9936) + - [Add tests for script subcommands](https://github.com/nushell/nushell/pull/9933) + - [Revert "Add an option to move header on borders"](https://github.com/nushell/nushell/pull/9908) + - [Re-align how prompt indicators work](https://github.com/nushell/nushell/pull/9907) + - [Simplify default style and match Rust code to config](https://github.com/nushell/nushell/pull/9900) + - [Revert 9693 to prevent CPU hangs](https://github.com/nushell/nushell/pull/9893) +- [sholderbach](https://github.com/sholderbach) created + - [Polish `CONTRIBUTING`, add Rust style](https://github.com/nushell/nushell/pull/10071) + - [Remove global clippy `-A` from `toolkit.nu`](https://github.com/nushell/nushell/pull/10073) + - [Remove clippy global `-A` from CI](https://github.com/nushell/nushell/pull/10072) + - [Pin reedline to 0.23.0](https://github.com/nushell/nushell/pull/10070) + - [Rename misused "deprecation" to removal](https://github.com/nushell/nushell/pull/10000) + - [Improve I/O types of `into decimal`(/float)](https://github.com/nushell/nushell/pull/9998) + - [Add search terms to `reject`](https://github.com/nushell/nushell/pull/9996) + - [Move `format duration`/`filesize` back into core](https://github.com/nushell/nushell/pull/9978) + - [Fixup dataframe build after #9971](https://github.com/nushell/nushell/pull/9974) + - [Add `format duration` to replace `into duration --convert`](https://github.com/nushell/nushell/pull/9788) + - [Update `unicode-linebreak` to `0.1.5`](https://github.com/nushell/nushell/pull/9814) +- [kubouch](https://github.com/kubouch) created + - [Remove "let config" warning](https://github.com/nushell/nushell/pull/10068) + - [ Simplify virtualenv testing](https://github.com/nushell/nushell/pull/10035) + - [Recursively export constants from modules](https://github.com/nushell/nushell/pull/10049) + - [Add a few more fields to `scope` commands](https://github.com/nushell/nushell/pull/10045) + - [Add additional span to IncorrectValue error](https://github.com/nushell/nushell/pull/10036) + - [Allow exporting extern-wrapped](https://github.com/nushell/nushell/pull/10025) + - [Fix wrong path expansion in `save`](https://github.com/nushell/nushell/pull/10046) + - [Change `str replace` to match substring by default](https://github.com/nushell/nushell/pull/10038) + - [Remove dead code from tests](https://github.com/nushell/nushell/pull/10040) + - [Sort entries in `scope` commands; Fix usage of externs](https://github.com/nushell/nushell/pull/10039) + - [Refactor `scope` commands](https://github.com/nushell/nushell/pull/10023) + - [Fix example for `extern-wrapped`](https://github.com/nushell/nushell/pull/10004) +- [zhiburt](https://github.com/zhiburt) created + - [nu-table: fix issue with truncation and text border](https://github.com/nushell/nushell/pull/10050) + - [nu-table: Fix padding 0 width issues](https://github.com/nushell/nushell/pull/10011) + - [nu-table/ Add `table.padding` configuration](https://github.com/nushell/nushell/pull/9983) + - [Add an option to set header on border (style)](https://github.com/nushell/nushell/pull/9920) + - [Add an option to move header on borders](https://github.com/nushell/nushell/pull/9796) +- [sitiom](https://github.com/sitiom) created + - [Change Winget Releaser job to `ubuntu-latest`](https://github.com/nushell/nushell/pull/10032) +- [ineu](https://github.com/ineu) created + - [Make `http -f` display the request headers. Closes #9912](https://github.com/nushell/nushell/pull/10022) +- [3lvir4](https://github.com/3lvir4) created + - [Remove potential panic from path join](https://github.com/nushell/nushell/pull/10012) +- [ayax79](https://github.com/ayax79) created + - [Expose polars avro support](https://github.com/nushell/nushell/pull/10019) + - [Nushell table list columns -> dataframe list columns. Explode / Flatten dataframe support.](https://github.com/nushell/nushell/pull/9951) + - [Merged overloaded commands](https://github.com/nushell/nushell/pull/9860) +- [app/dependabot](https://github.com/app/dependabot) created + - [Bump quick-xml from 0.29.0 to 0.30.0](https://github.com/nushell/nushell/pull/9870) + - [Bump rstest from 0.17.0 to 0.18.1](https://github.com/nushell/nushell/pull/9782) +- [meskill](https://github.com/meskill) created + - [fix(nu-parser): do not update plugin.nu file on nu startup](https://github.com/nushell/nushell/pull/10007) + - [test: clear parent envs to prevent leakage to tests](https://github.com/nushell/nushell/pull/9976) +- [nibon7](https://github.com/nibon7) created + - [Fix a crash when moving the cursor after accepting a suggestion from the help menu](https://github.com/nushell/nushell/pull/9784) +- [rgwood](https://github.com/rgwood) created + - [Fix `watch` not handling all file changes](https://github.com/nushell/nushell/pull/9990) + - [Put heavy dataframe dependencies behind feature flag](https://github.com/nushell/nushell/pull/9971) + - [Fix cross-compiling with cross-rs](https://github.com/nushell/nushell/pull/9972) + - [Fix `match` example whitespace](https://github.com/nushell/nushell/pull/9961) +- [panicbit](https://github.com/panicbit) created + - [parse: collect external stream chunks before matching](https://github.com/nushell/nushell/pull/9950) + - [do not emit None mid-stream during parse](https://github.com/nushell/nushell/pull/9925) +- [bobhy](https://github.com/bobhy) created + - [Fix duration type to not report months or years](https://github.com/nushell/nushell/pull/9632) +- [IanManske](https://github.com/IanManske) created + - [Make `Value::columns` return slice instead of cloned Vec](https://github.com/nushell/nushell/pull/9927) + - [Enable macOS foreground process handling](https://github.com/nushell/nushell/pull/9909) + - [Replace `&Span` with `Span` since `Span` is `Copy`](https://github.com/nushell/nushell/pull/9770) +- [atahabaki](https://github.com/atahabaki) created + - [str-expand: update bracoxide to v0.1.2, fixes #9913](https://github.com/nushell/nushell/pull/9940) + - [str-expand: add path flag](https://github.com/nushell/nushell/pull/9856) + - [str-expand: Add Escaping Example](https://github.com/nushell/nushell/pull/9841) +- [stormasm](https://github.com/stormasm) created + - [Categorification: move commands histogram and version out of the default category](https://github.com/nushell/nushell/pull/9946) + - [Categorification: move from Default category to Filters](https://github.com/nushell/nushell/pull/9945) + - [Categorification: move Path commands out of the default category](https://github.com/nushell/nushell/pull/9937) + - [Categorification: graduate nuon --- from the experimental category to the formats category](https://github.com/nushell/nushell/pull/9932) + - [Categorification: move uncategorized String commands to Category::Strings](https://github.com/nushell/nushell/pull/9931) + - [Cratification: move some str case commands to nu-cmd-extra](https://github.com/nushell/nushell/pull/9926) +- [NotLebedev](https://github.com/NotLebedev) created + - [Nothing return type](https://github.com/nushell/nushell/pull/9935) +- [WindSoilder](https://github.com/WindSoilder) created + - [rename from `date format` to `format date`](https://github.com/nushell/nushell/pull/9902) + - [Module: support defining const and use const variables inside of function](https://github.com/nushell/nushell/pull/9773) +- [mengsuenyan](https://github.com/mengsuenyan) created + - [Fixed the panic when type a statement similar to `let f = 'f' $` in the nushell](https://github.com/nushell/nushell/pull/9851) + - [fixed the bug `~ | path type` return empty string](https://github.com/nushell/nushell/pull/9853) +- [app/](https://github.com/app/) created + - [Turn bare URLs into cliclable links](https://github.com/nushell/nushell/pull/9854) +- [jflics6460](https://github.com/jflics6460) created + - [Accept records for http subcommand headers (-H)](https://github.com/nushell/nushell/pull/9771) + +### Extension + +- [balupton](https://github.com/balupton) created + - [readmde: close #148 - link extension page](https://github.com/nushell/vscode-nushell-lang/pull/149) + +### Documentation + +- [jwarlander](https://github.com/jwarlander) created + - [Use '--locked' in cargo install snippet for dataframe feature](https://github.com/nushell/nushell.github.io/pull/1010) +- [hustcer](https://github.com/hustcer) created + - [Update table mode config doc, fix #1007](https://github.com/nushell/nushell.github.io/pull/1008) + - [Finish `let-env` removal in Chinese translation](https://github.com/nushell/nushell.github.io/pull/1005) + - [Upgrade some dependencies, and fix some broken assets import](https://github.com/nushell/nushell.github.io/pull/995) +- [conqp](https://github.com/conqp) created + - [Update command to list aliases](https://github.com/nushell/nushell.github.io/pull/1006) +- [sholderbach](https://github.com/sholderbach) created + - [Finish `let-env` removal in German translation](https://github.com/nushell/nushell.github.io/pull/1004) +- [amtoine](https://github.com/amtoine) created + - [remove last mentions to `let-env`](https://github.com/nushell/nushell.github.io/pull/999) + - [patch: release notes for 0.83.1](https://github.com/nushell/nushell.github.io/pull/994) +- [BrewingWeasel](https://github.com/BrewingWeasel) created + - [Remove unused empty column](https://github.com/nushell/nushell.github.io/pull/1003) +- [rgwood](https://github.com/rgwood) created + - [Cookbook cleanup](https://github.com/nushell/nushell.github.io/pull/1001) +- [oatovar](https://github.com/oatovar) created + - [Update testing examples](https://github.com/nushell/nushell.github.io/pull/997) +- [rprtr258](https://github.com/rprtr258) created + - [Update explore.md](https://github.com/nushell/nushell.github.io/pull/1000) +- [LeoniePhiline](https://github.com/LeoniePhiline) created + - [fix(docs): Fix link to "setting environment variables"](https://github.com/nushell/nushell.github.io/pull/996) + - [fix(docs): Link to Command Reference led to HTTP 404](https://github.com/nushell/nushell.github.io/pull/993) + +### Nu_Scripts + +- [fdncred](https://github.com/fdncred) created + - [fix the other place in the weather script](https://github.com/nushell/nu_scripts/pull/581) + - [fix weather duration after latest nushell changes](https://github.com/nushell/nu_scripts/pull/580) + - [update prompts scripts with new `str replace` syntax](https://github.com/nushell/nu_scripts/pull/579) + - [update `date format` to `format date` in oh-my.nu](https://github.com/nushell/nu_scripts/pull/570) + - [delete codeowners file](https://github.com/nushell/nu_scripts/pull/568) +- [WindSoilder](https://github.com/WindSoilder) created + - [Update python-venv.nu so we can enter subdirectory without an error](https://github.com/nushell/nu_scripts/pull/574) +- [Neur1n](https://github.com/Neur1n) created + - [minor changes to nu_conda.nu and nu_msvs.nu](https://github.com/nushell/nu_scripts/pull/576) +- [EmilySeville7cfg](https://github.com/EmilySeville7cfg) created + - [Simple json schema generator](https://github.com/nushell/nu_scripts/pull/577) +- [uroybd](https://github.com/uroybd) created + - [feat(completions): Ô£¿ add PDM custom completions](https://github.com/nushell/nu_scripts/pull/573) +- [amtoine](https://github.com/amtoine) created + - [rename `date format` to `format date`](https://github.com/nushell/nu_scripts/pull/571) + - [fix the date schedule in the release scripts](https://github.com/nushell/nu_scripts/pull/561) +- [e2dk4r](https://github.com/e2dk4r) created + - [custom-completions: scoop: fix getting environmental variables](https://github.com/nushell/nu_scripts/pull/567) + +### Reedline + +- [sholderbach](https://github.com/sholderbach) created + - [Bump version for 0.23 release](https://github.com/nushell/reedline/pull/626) +- [fdncred](https://github.com/fdncred) created + - [update to strip-ansi-escapes 0.2.0](https://github.com/nushell/reedline/pull/618) + - [update `strip-ansi-escapes` to their latest api](https://github.com/nushell/reedline/pull/617) + - [turn off default prompt styling (bold) to prevent leakage](https://github.com/nushell/reedline/pull/615) diff --git a/blog/2023-08-23-happy-birthday-nushell-4.md b/src/content/docs/blog/2023-08-23-happy-birthday-nushell-4.md similarity index 81% rename from blog/2023-08-23-happy-birthday-nushell-4.md rename to src/content/docs/blog/2023-08-23-happy-birthday-nushell-4.md index fde1b255773..42c36bbc530 100644 --- a/blog/2023-08-23-happy-birthday-nushell-4.md +++ b/src/content/docs/blog/2023-08-23-happy-birthday-nushell-4.md @@ -3,12 +3,10 @@ title: Celebrating 4 years of Nushell author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're celebrating 4 years since Nushell's first public release. +description: Today, we're celebrating 4 years since Nushell's first public release. --- -# Nushell turns 4 years old! - -Today marks 4 years since Nushell's [first public release](https://www.nushell.sh/blog/2019-08-23-introducing-nushell.html). In that time, Nushell has grown and changed, while always staying true to the idea that started it all: being a structure data language and shell. +Today marks 4 years since Nushell's [first public release](https://www.nushell.sh/blog/2019-08-23-introducing-nushell). In that time, Nushell has grown and changed, while always staying true to the idea that started it all: being a structure data language and shell. To celebrate, we thought we'd share stories of how people are using Nushell today. @@ -28,17 +26,17 @@ To celebrate, we thought we'd share stories of how people are using Nushell toda Using `ls | sort-by type name -i | grid -c`, it looks like this: - + ## Converting SVG to PDF in bulk (sholderbach) "Converting SVG drawings and figures to PDFs in bulk. I like how explicit and clean that is compared to a solution with xargs in bash" - + ## Gotta have a Chuck Norris joke -```nushell +```nu > (http get https://api.chucknorris.io/jokes/random).value ``` @@ -65,13 +63,13 @@ def "main" [] { ``` It even comes with its own help - + ## Crossplatform symlinks (Kubouch) "Here is my favorite: Cross-platform symlink:" -```nushell +```nu # Create a symlink export def symlink [ existing: path # The existing file @@ -96,7 +94,7 @@ export def symlink [ add `string: {|x| if $x =~ '^#[a-fA-F\d]+' { $x } else { 'white' } }` to your `$env.config.color_config` and you'll get: - + # And many more diff --git a/blog/2023-09-05-why-uu.md b/src/content/docs/blog/2023-09-05-why-uu.md similarity index 91% rename from blog/2023-09-05-why-uu.md rename to src/content/docs/blog/2023-09-05-why-uu.md index ef0349b479d..0dad93b93a6 100644 --- a/blog/2023-09-05-why-uu.md +++ b/src/content/docs/blog/2023-09-05-why-uu.md @@ -1,4 +1,10 @@ -# Nushell + Uutils = ❤️ +--- +title: Nushell + Uutils = ❤️ +author: Jonathan Turner +author_site: https://twitter.com/jntrnr +author_image: https://www.nushell.sh/blog/images/jonathandturner.jpg +description: Today, we're introducing a new shell, written in Rust. It draws inspiration from the classic Unix philosophy of pipelines, the structured data approach of PowerShell, functional programming, systems programming, and more. +--- We're happy to announce that with Nushell release 0.85.0, scheduled to be released on Sept 19, 2023, the nushell team is starting to integrate `uutils/coreutils` into nushell. The first command we have integrated is `cp`, that for a testing period lives in `ucp`. So, when you use `ucp` in this release, you're using the same code that it used in `coreutils`. 🎉 🥳 @@ -27,7 +33,7 @@ I think this is going to be a huge win-win, because nushell gets to benefit from First things first you can try out `ucp` as your regular `cp` by setting `alias cp = ucp`. After we made sure to iron out the kinks, `cp` will become the `ucp` implementation. -The next step is to move onto integrating other commands, _your help is welcome and needed!!!_ I've created a list of command and we've categorized them as `crawl`, `walk`, `run`. We use this nominclature to describe that we want to start with the really "easy" commands first, then the next "easiest", then finally, what's left. [@JT] has helped me to learn the value of `crawl`, `walk`, `run` over the years, and that mantra frequently helps our team decide how we should implement new features. +The next step is to move onto integrating other commands, _your help is welcome and needed!!!_ I've created a list of command and we've categorized them as `crawl`, `walk`, `run`. We use this nominclature to describe that we want to start with the really "easy" commands first, then the next "easiest", then finally, what's left. [@JT] has helped me to learn the value of `crawl`, `walk`, `run` over the years, and that mantra frequently helps our team decide how we should implement new features. We don't plan on implementing every command from coreutils, but there are quite a few in the `crawl` category right now that shouldn't be super difficult to build in. @@ -35,7 +41,7 @@ The next commands planned to implement, based on my notes above, are probably `m ## Parting words -Again, thanks so much to the maintainers of `uutils/coreutils`. They have made great efforts to be as welcoming as possible to nushell. They have been wonderful to work with and we, at nushell, look forward to working more with them. If you'd like to contribute to the awesome coreutils project, you can find it [here](https://github.com/uutils/coreutils). I'm sure they'd love your support. If you'd like to chat with the nushell team about this on Discord, feel free to join in on the conversation [here]( https://discord.gg/NtAbbGn). +Again, thanks so much to the maintainers of `uutils/coreutils`. They have made great efforts to be as welcoming as possible to nushell. They have been wonderful to work with and we, at nushell, look forward to working more with them. If you'd like to contribute to the awesome coreutils project, you can find it [here](https://github.com/uutils/coreutils). I'm sure they'd love your support. If you'd like to chat with the nushell team about this on Discord, feel free to join in on the conversation [here](https://discord.gg/NtAbbGn). Sincerely, [Darren](https://github.com/fdncred) diff --git a/src/content/docs/blog/2023-09-19-nushell_0_85_0.md b/src/content/docs/blog/2023-09-19-nushell_0_85_0.md new file mode 100644 index 00000000000..dd16a949ef8 --- /dev/null +++ b/src/content/docs/blog/2023-09-19-nushell_0_85_0.md @@ -0,0 +1,634 @@ +--- +title: Nushell 0.85 +author: The Nu Authors +author_site: https://twitter.com/nu_shell +author_image: https://www.nushell.sh/blog/images/nu_logo.png +description: Today, we're releasing version 0.85 of Nu. This release adds the first uutils command, unlocks more constant evaluation at parse time, and polishes many commands. +--- + +Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. + +Today, we're releasing version 0.85 of Nu. This release adds the first uutils command, unlocks more constant evaluation at parse time, and polishes many commands. + +<!-- more --> + +## Where to get it + +Nu 0.85 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.85.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. + +NOTE: The optional dataframe functionality is available by `cargo install nu --features=dataframe`. + +As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. + +## Themes of this release / New features + +### Nushell + Uutils = ❤️ + +📢The Nushell team is thrilled to announce 🥳 that we've begun working with the [`uutils/coreutils` team on integrating some of their foundational core utilies into nushell](https://www.nushell.sh/blog/2023-09-05-why-uu). With this release, we've started with the coreutils `cp` command, which we've temporarily named `ucp`. We're starting with `ucp` to allow broad testing while the current nushell `cp` command remains the default. We've already found one [bug](https://github.com/uutils/coreutils/issues/5257) in the coreutils `cp` command and you might find others. Once it stabelizes, probably with the 0.86.0 release, we'll remove the nushell `cp` command and rename `ucp` to `cp`. In keeping with the nushell style, we've only added a handful of parameters. We can, and probably will, add more if the community determines we need them. We're so very excited and would like to thank [terts](https://github.com/tertsdiepraam), from the coreutils team, for his excellent help and special appreciation to [dmatos2012](https://github.com/dmatos2012) for the, very iterative, first `uutils/coreutils` integration PR [#10097](https://github.com/nushell/nushell/pull/10097) for the `cp` command. To read more about how this came to be, checkout [our blog post](https://www.nushell.sh/blog/2023-09-05-why-uu). + +### Quite a few bug fixes + +Thanks to all the contributors below for helping us solve issues and bugs :pray: +| author | description | url | +| ------------------------------------------------ | --------------------------------------------------------------------------------- | ------------------------------------------------------- | +| [@rgwood](https://github.com/rgwood) | Fix watch not detecting modifications on Windows | [#10109](https://github.com/nushell/nushell/pull/10109) | +| [@ito-hiroki](https://github.com/ito-hiroki) | Fix tab completion order of directories to consistent with order of files | [#10102](https://github.com/nushell/nushell/pull/10102) | +| [@herobs](https://github.com/herobs) | Fix 9156 endian consistency | [#9873](https://github.com/nushell/nushell/pull/9873) | +| [@ayax79](https://github.com/ayax79) | fixed usages of deprecated chrono DateTime::from_utc | [#10161](https://github.com/nushell/nushell/pull/10161) | +| [@zhiburt](https://github.com/zhiburt) | Fix #10154 | [#10162](https://github.com/nushell/nushell/pull/10162) | +| [@ofek](https://github.com/ofek) | Fix example history command pipeline | [#10220](https://github.com/nushell/nushell/pull/10220) | +| [@dead10ck](https://github.com/dead10ck) | Fix unit tests on Android | [#10224](https://github.com/nushell/nushell/pull/10224) | +| [@amtoine](https://github.com/amtoine) | fix default after an empty where | [#10240](https://github.com/nushell/nushell/pull/10240) | +| [@IanManske](https://github.com/IanManske) | Fix `rm` on macOS | [#10282](https://github.com/nushell/nushell/pull/10282) | +| [@horasal](https://github.com/horasal) | handle empty pipeline while parsing let (fix Issue10083) | [#10116](https://github.com/nushell/nushell/pull/10116) | +| [@dmatos2012](https://github.com/dmatos2012) | Fix variables not allowed in ucp | [#10304](https://github.com/nushell/nushell/pull/10304) | +| [@sholderbach](https://github.com/sholderbach) | Update `crates-ci/typos` and fix new typos | [#10313](https://github.com/nushell/nushell/pull/10313) | +| [@GomesGoncalo](https://github.com/GomesGoncalo) | fix #10319: allow json request of value type list | [#10356](https://github.com/nushell/nushell/pull/10356) | +| [@jntrnr](https://github.com/jntrnr) | fix 'let' to properly redirect | [#10360](https://github.com/nushell/nushell/pull/10360) | +| [@amtoine](https://github.com/amtoine) | fix the pretty printing of failing tests in std | [#10373](https://github.com/nushell/nushell/pull/10373) | +| [@J-Kappes](https://github.com/J-Kappes) | fix input --until-bytes: now stops at any of given bytes | [#10235](https://github.com/nushell/nushell/pull/10235) | +| [@zhiburt](https://github.com/zhiburt) | nu-table: Fix expand table unnessary color in trail head config when wrap is used | [#10367](https://github.com/nushell/nushell/pull/10367) | +| [@fdncred](https://github.com/fdncred) | fix some new chrono warnings | [#10384](https://github.com/nushell/nushell/pull/10384) | +| [@horasal](https://github.com/horasal) | prevent crash when use redirection with let/mut | [#10139](https://github.com/nushell/nushell/pull/10139) | +| [@horasal](https://github.com/horasal) | Allow operator in constants | [#10212](https://github.com/nushell/nushell/pull/10212) | +| [@zhiburt](https://github.com/zhiburt) | nu-table: Patch restore lead trail space bg color | [#10351](https://github.com/nushell/nushell/pull/10351) | +| [@zhiburt](https://github.com/zhiburt) | nu-table: Strip custom color in the header when used on border | [#10357](https://github.com/nushell/nushell/pull/10357) | + +### Consistent use of `float` for our floating point type + +:::caution[Breaking change] +See a full overview of the [breaking changes](#breaking-changes) +::: + +Nushell currently supports two types to represent numbers without units: `int` for integer numbers and `float` for floating point numbers. +The latter type was in important places incorrectly referred to as `decimal`. This hid the fact that as floating point numbers they have limited precision in some circumstances but higher performance compared to a decimal-encoded number. + +With this release we fix this inaccuracy. + +This means we introduce the commands `into float` and `random float` and deprecate the commands `into decimal` and `random decimal`. The old commands will be removed with the next release but continue to work for this release with a warning. +Please use `into float` instead of `into decimal` and `random float` instead of `random decimal`. + +After the type returned by `describe` has been `float` for a while, we now also change which type name is allowed when specifying command argument or input/output types. + +```nu +# Argument with a specfic type +def foo [bar: float] {} +# Command taking only floating point input from the pipeline and returning the same type. +def baz [] float->float {} +``` + +Previously both `float` and `decimal` were supported in those positions. + +### Some updates on `explore` + +:::caution[Breaking change] +See a full overview of the [breaking changes](#breaking-changes) +::: + +The `explore` built-in commands have changed a bit during this release. + +Now, it supports Vim bindings out of the box thanks to [@amtoine](https://github.com/amtoine) in +[#9966](https://github.com/nushell/nushell/pull/9966). +[@rgwood](https://github.com/rgwood) has simplified the available configuration entries which used +to make the command less easy to understand in +[#10258](https://github.com/nushell/nushell/pull/10258) +[#10259](https://github.com/nushell/nushell/pull/10259) and +[#10270](https://github.com/nushell/nushell/pull/10270). + +Thanks to him again, one can now quit the `explore`r by hitting any of `ctrl+c`, `ctrl+d` or +`ctrl+q` (see [#10257](https://github.com/nushell/nushell/pull/10257)). + +### Improvements to parse-time evaluation + +_Conditional `source` and `use` is now possible._ + +The Nushell core team has been asked quite a lot of times to be able to do parse-time conditional +`source`ing or `use`ing in the configuration, e.g. to load different things depending on the system: + +```nu +if $nu.os-info.name == "windows" { + source "my_windows_config.nu" +} else { + source "my_unix_config.nu" +} +``` + +The above snippet does not work because Nushell's scoping rules keep the sourced values inside the block and the sourcing would not have any visible effect outside of the if/else statement (except environment changes). + +While scoping still works the same, a series of PRs by [@kubouch](https://github.com/kubouch) made conditional `source`/`use`/`overlay use` possible: + +- [#9499](https://github.com/nushell/nushell/pull/9499), allows parse-time evaluation of commands, pipelines and subexpressions (see also [Looking for help!](#looking-for-help)) +- with [#10326](https://github.com/nushell/nushell/pull/10326), `if` can now be evaluated at parse time +- finally, [#10160](https://github.com/nushell/nushell/pull/10160) makes the `$nu` built-in variable a true constant :partying_face: + +What does this all mean? One can now write something very similar to the proposed snippet +above! For example: + +```nu +const WINDOWS_CONFIG = "my_windows_config.nu" +const UNIX_CONFIG = "my_unix_config.nu" + +const ACTUAL_CONFIG = if $nu.os-info.name == "windows" { + $WINDOWS_CONFIG +} else { + $UNIX_CONFIG +} + +source $ACTUAL_CONFIG +``` + +#### Looking for help + +[#9499](https://github.com/nushell/nushell/pull/9499) allows running selected commands at parse time. For example, + +```nu +const f = ($nu.default-config-dir | path dirname) +``` + +is possible because `path dirname` was manually ported to allow parse time evaluation. Only a very limited subset of Nushell's commands is currently allowed to do so: + +- `str length` +- `path` commands +- Some core commands: `describe`, `ignore`, `version`, `if` + +We would like to expand this set to allow more commands to run at parse time. If you'd like to help us porting more commands, we'd welcome your help! Please, see [#10239](https://github.com/nushell/nushell/issues/10239) for more information. Porting the commands is not difficult, but requires a bit of consideration, so it's better to reply to the issue or reach out to the core team beforehand. + +### Improving accessibility + +Up until now, an issue for users using a screen reader was that Nushell errors and tables are quite +fancy with some unicode characters. +The issue is that screen reader might have trouble reading them, making the understanding of what's +going on the REPL very hard... + +For tables, it's quite easy, you can set `$env.config.table.mode` to something like `"basic"` or +`"none"` and you should be good! +But errors remained fancy + +```nu +Error: nu::shell::external_command + + × External command failed + ╭─[entry #4:1:1] + 1 │ foo + · ─┬─ + · ╰── did you mean 'for'? + ╰──── + help: No such file or directory (os error 2) +``` + +[@JoaquinTrinanes](https://github.com/JoaquinTrinanes) did implement screen reader-friendly errors +in [#10122](https://github.com/nushell/nushell/pull/10122) which will hopefully make the experience +a lot better when it comes to errors. + +### More support for more platforms + +In this release, [@dead10ck](https://github.com/dead10ck) made it possible to use Nushell in Termux +([#10013](https://github.com/nushell/nushell/pull/10013)) and fixed a bug on Android +([#10225](https://github.com/nushell/nushell/pull/10225)). + +### Improved history isolation + +:::caution[Breaking change] +See a full overview of the [breaking changes](#breaking-changes) +::: + +Like many other shells, history between open sessions can be isolated in nushell. +However, the former implementation had the disadvantage that it also blocked access to history of former sessions. +It also didn't isolate hints. +This is now fixed with [!10402](https://github.com/nushell/nushell/pull/10402) by [@Hofer-Julian](https://github.com/Hofer-Julian). +Since this was merged shortly before the release, this feature isn't the default yet. +The `file_format` has to be changed to `"sqlite"` and `isolation` has to be set to `true`. +You can find those in the [config file](https://github.com/nushell/nushell/blob/39d93b536a02c95c263925a47b9e4c34587ce021/crates/nu-utils/src/sample_config/default_config.nu#L202) under `$nu.config-path`. +Please test this so we can fix problems before history isolation becomes the default. + +### Enhancing the documentation + +Thanks to all the contributors below for helping us making the documentation of Nushell commands better :pray: +| author | description | url | +| ------------- | ------------------------------------------------------------- | ------------------------------------------------------- | +| @Hofer-Julian | Add notice to enable develop mode on Windows | [#10111](https://github.com/nushell/nushell/pull/10111) | +| @fdncred | update query web example because wikipedia changed their page | [#10173](https://github.com/nushell/nushell/pull/10173) | +| @alsuren | Point from keybindings help to the book's reedline chapter | [#10193](https://github.com/nushell/nushell/pull/10193) | +| @sholderbach | Document that `open` looks up `from` subcommands | [#10255](https://github.com/nushell/nushell/pull/10255) | +| @balupton | readme: add dorothy to supported by | [#10262](https://github.com/nushell/nushell/pull/10262) | +| @brunerm99 | feat: Search terms for use, while, and range (#5093) | [#10265](https://github.com/nushell/nushell/pull/10265) | +| @amtoine | add case-insensitive example to `where` | [#10299](https://github.com/nushell/nushell/pull/10299) | + +### Help with tests + +Some more technical work but very helpful to make the source code of Nushell better, so thanks to our +contributors who did improve the tests, often going through the whole source base and doing tideous +find and replace :pray: +| author | description | url | +| ------------ | --------------------------------------------- | ------------------------------------------------------- | +| @J-Kappes | Tests: clean up unnecessary use of pipeline() | [#10170](https://github.com/nushell/nushell/pull/10170) | +| @sholderbach | Remove dead tests depending on `inc` | [#10179](https://github.com/nushell/nushell/pull/10179) | +| @sholderbach | Simplify rawstrings in tests | [#10180](https://github.com/nushell/nushell/pull/10180) | + +### Changes to commands + +As usual, new release rhyms with changes to commands! + +- a bunch of new columns have been added to the `ps` commands: + - [@fdncred](https://github.com/fdncred) in [#10275](https://github.com/nushell/nushell/pull/10275) + and [#10344](https://github.com/nushell/nushell/pull/10344) + - [@WindSoilder](https://github.com/WindSoilder) in + [#10347](https://github.com/nushell/nushell/pull/10347) +- [@nanoqsh](https://github.com/nanoqsh) has made the behaviour of `append` and `prepend` consistent + regarding ranges in [#10231](https://github.com/nushell/nushell/pull/10231) +- [@Tiggax](https://github.com/Tiggax) has started working on making `select`, `get` and `reject` + more consistent in [#10163](https://github.com/nushell/nushell/pull/10163) and + [#10216](https://github.com/nushell/nushell/pull/10216) +- **Breaking change:** `math` constants have been moved from built-in commands to _true_ constants in + the standard library by [@amtoine](https://github.com/amtoine) in + [#9678](https://github.com/nushell/nushell/pull/9678) +- the `into duration` command now accepts integers as arguments and the unit can be specified via an + option with the changes introduced by [@amtoine](https://github.com/amtoine) in + [#10286](https://github.com/nushell/nushell/pull/10286) +- thanks to [@fdncred](https://github.com/fdncred) in + [#10354](https://github.com/nushell/nushell/pull/10354), the `commandline` command can now move + you to the end of the line, no need to "move 1000 characters to the right" anymore + +### Some table themes + +Want more delight? [@fdncred](https://github.com/fdncred) got you covered. +He added a bunch of new table themes / modes in +[#10279](https://github.com/nushell/nushell/pull/10279). + +### `echo` is evolving + +Coming from other shells, e.g. POSIX ones like Bash or Zsh, the distinction between Nushell's `echo` +and `print` commands and the behaviour of `echo` itself could be confusing :thinking: + +- `print` is a more programming-language-friendly command: it does print its arguments to the + terminal directly, consuming them and thus not allowing to pipe the "output" of print further. +- `echo` was only used to create values and pass them down a pipeline, e.g. `echo "foo" | str length` + +[@jntrnr](https://github.com/jntrnr) made the behaviour of `echo` a bit more general + +- it will print to the terminal if not redirected +- it will pass the value down to the pipeline if redirected + +```nu +echo "foo" # will behave exactly as `print` does +echo "foo" | str length # will compute the length of `"foo"` and forward the result without + # "printing" it unless it's the last command being run +``` + +### Pythonesque operators removal + +:::caution[Breaking change] +See a full overview of the [breaking changes](#breaking-changes) +::: + +Coming from Python, things like + +```python +3 * "foo" +[1, 2] * 10 +``` + +would probably appear familiar. + +However, they could lead to some strange internal behaviours and hard to debug issues :confused: + +```nu +> [3, "bob", 4] | reduce --fold 1 {|x, y| $x * $y} +bobbobbobbobbobbobbobbobbobbobbobbob +``` + +:::note +in the example above, we are mixing integer and string multiplication, which might get weird! +::: + +In this release, we decided to remove the string and list scalar multiplication in +[#10292](https://github.com/nushell/nushell/pull/10292) and +[#10293](https://github.com/nushell/nushell/pull/10293) from [@sholderbach](https://github.com/sholderbach). + +However, we do not want to leave you without any other way to achieve the same, this is why +[@amtoine](https://github.com/amtoine) did implement the `repeat` command in the standard library +in [#10339](https://github.com/nushell/nushell/pull/10339) + +- bring it into your scope with `use std repeat` +- you can do scalar string multiplication with something like `"foo" | repeat 3 | str join` +- you can do scalar list multiplication with something like `[1, 2] | repeat 3 | flatten` + +### Optimizations + +[#10378](https://github.com/nushell/nushell/pull/10378) Switched the default allocator to `mimalloc` as it's shown to reduce startup time by upwards of 30% on Windows. If it does not build on unique platforms nushell can be built without this feature, then using the platform's default allocator. + +## New commands + +- [`into float`](https://github.com/nushell/nushell/pull/9979) as a replacement for `into decimal` +- [`random float`](https://github.com/nushell/nushell/pull/10320) as a replacement for `random decimal` + +In the standard library we added the following commands: + +- [`std repeat`](https://github.com/nushell/nushell/pull/10339) as a command to repeat an element `n` times in a list. +- [`std formats from ndjson`](https://github.com/nushell/nushell/pull/10283) as a way to directly open newline-delimited JSON recrods. You can use `open` for files with the `.ndjson` ending if you `use std formats "from ndjson"`. +- [`std formats from jsonl`](https://github.com/nushell/nushell/pull/10283) as a way to directly open newline-delimited JSON records. You can use `open` for files with the `.jsonl` ending if you `use std formats "from jsonl"`. + +## Deprecations + +### Deprecated commands + +- [`into decimal`](https://github.com/nushell/nushell/pull/9979): Use `into float` instead +- [`random decimal`](https://github.com/nushell/nushell/pull/10320): Use `random float` instead + +## Breaking changes + +- Plugin authors need to update plugins after the span refactor +- Updated plugins need to be recompiled + +- [#10235](https://github.com/nushell/nushell/pull/10235) `input --until-bytes` now stops at any of given bytes +- [#10333](https://github.com/nushell/nushell/pull/10333) Consistently use `float` instead of `decimal` in type specifications +- [#10293](https://github.com/nushell/nushell/pull/10293) Remove pythonic `string * list` multiplication +- [#10292](https://github.com/nushell/nushell/pull/10292) Remove pythonic `int * list` multiplication +- [#10338](https://github.com/nushell/nushell/pull/10338) Change `echo` to print when not redirected +- [#10259](https://github.com/nushell/nushell/pull/10259) explore: remove `:config`, `:show-config`, `:tweak` commands +- [#9929](https://github.com/nushell/nushell/pull/9929) Rename the types with spaces in them to use `-` +- [#10254](https://github.com/nushell/nushell/pull/10254) Change LOG_FORMAT to NU_LOG_FORMAT in nu-std library +- [#9678](https://github.com/nushell/nushell/pull/9678) Move math constants to standard library +- [#10231](https://github.com/nushell/nushell/pull/10231) Make `append`/`prepend` consistent for ranges +- [#9966](https://github.com/nushell/nushell/pull/9966) Add support for Vim motions in `explore` +- [#10042](https://github.com/nushell/nushell/pull/10042) Spanned Value step 1: span all value cases +- [#10103](https://github.com/nushell/nushell/pull/10103) Create `Record` type +- [#10064](https://github.com/nushell/nushell/pull/10064) Fully remove `str replace --string` option after deprecation. Just use `str replace` instead. + +## Full changelog + +### Nushell + +- [tokatoka](https://github.com/tokatoka) created + - [Add 2 fuzzers for nu-path, nu-parser](https://github.com/nushell/nushell/pull/10376) +- [sholderbach](https://github.com/sholderbach) created + - [Clippy in tests](https://github.com/nushell/nushell/pull/10394) + - [Update internal use of `decimal` to `float`](https://github.com/nushell/nushell/pull/10333) + - [Optimize use of range in `std repeat`](https://github.com/nushell/nushell/pull/10353) + - [Remove python-like string multiplication](https://github.com/nushell/nushell/pull/10293) + - [Invert `&Option`s to `Option<&T>`](https://github.com/nushell/nushell/pull/10315) + - [Remove pythonic `int * list` behavior](https://github.com/nushell/nushell/pull/10292) + - [Rename `random decimal` to `random float`](https://github.com/nushell/nushell/pull/10320) + - [Rename `into decimal` to `into float`](https://github.com/nushell/nushell/pull/9979) + - [Deref `&String` arguments to `&str` where appropriate](https://github.com/nushell/nushell/pull/10321) + - [Use slices directly instead of `&Vec`](https://github.com/nushell/nushell/pull/10328) + - [Bump `calamine` and fix clippy](https://github.com/nushell/nushell/pull/10314) + - [Update `crates-ci/typos` and fix new typos](https://github.com/nushell/nushell/pull/10313) + - [Remove `Cargo.lock` in subcrates](https://github.com/nushell/nushell/pull/10280) + - [Move spellcheck config into `.github` folder](https://github.com/nushell/nushell/pull/10267) + - [Remove codecov.io setup](https://github.com/nushell/nushell/pull/10266) + - [Document that `open` looks up `from` subcommands](https://github.com/nushell/nushell/pull/10255) + - [Tweak contributor image to include more users](https://github.com/nushell/nushell/pull/10238) + - [Update `crossterm`/`ratatui`/dev-`reedline`](https://github.com/nushell/nushell/pull/10137) + - [Simplify rawstrings in tests](https://github.com/nushell/nushell/pull/10180) + - [Remove dead tests depending on `inc`](https://github.com/nushell/nushell/pull/10179) + - [Keep `arrow2` out of basic `--workspace` build](https://github.com/nushell/nushell/pull/10178) +- [fdncred](https://github.com/fdncred) created + - [fix some new chrono warnings](https://github.com/nushell/nushell/pull/10384) + - [add helper switch to move cursor to end of buffer](https://github.com/nushell/nushell/pull/10354) + - [add a few more columns to linux `ps -l` output](https://github.com/nushell/nushell/pull/10344) + - [silence some ucp warnings](https://github.com/nushell/nushell/pull/10294) + - [allow update to use metadata](https://github.com/nushell/nushell/pull/10264) + - [add 6 more table themes](https://github.com/nushell/nushell/pull/10279) + - [respect a users locale with the right prompt](https://github.com/nushell/nushell/pull/10273) + - [add more `ps` columns in Windows](https://github.com/nushell/nushell/pull/10275) + - [update format date when using %x %X %r](https://github.com/nushell/nushell/pull/10272) + - [Restore NU_LIB_DIRS and NU_PLUGIN_DIRS defaults](https://github.com/nushell/nushell/pull/10252) + - [allow `--login` to be used with nu's `--commands` parameter](https://github.com/nushell/nushell/pull/10253) + - [add plugin path when there are no signatures](https://github.com/nushell/nushell/pull/10201) + - [update query web example because wikipedia changed their page](https://github.com/nushell/nushell/pull/10173) + - [name hooks internally](https://github.com/nushell/nushell/pull/10127) + - [bump rust-toolchain to 1.70.0](https://github.com/nushell/nushell/pull/10113) +- [FilipAndersson245](https://github.com/FilipAndersson245) created + - [Adds mimalloc as default feature.](https://github.com/nushell/nushell/pull/10378) +- [zhiburt](https://github.com/zhiburt) created + - [nu-table: Fix expand table unnessary color in trail head config when wrap is used](https://github.com/nushell/nushell/pull/10367) + - [nu-table: Strip custom color in the header when used on border](https://github.com/nushell/nushell/pull/10357) + - [nu-table: Patch restore lead trail space bg color](https://github.com/nushell/nushell/pull/10351) + - [nu-explore: Refactorings](https://github.com/nushell/nushell/pull/10247) + - [Fix #10154](https://github.com/nushell/nushell/pull/10162) +- [J-Kappes](https://github.com/J-Kappes) created + - [fix input --until-bytes: now stops at any of given bytes](https://github.com/nushell/nushell/pull/10235) + - [Tests: clean up unnecessary use of pipeline()](https://github.com/nushell/nushell/pull/10170) +- [amtoine](https://github.com/amtoine) created + - [fix the pretty printing of failing tests in std](https://github.com/nushell/nushell/pull/10373) + - [add `std repeat` command to replace `"foo" * 3`](https://github.com/nushell/nushell/pull/10339) + - [add case-insensitive example to `where`](https://github.com/nushell/nushell/pull/10299) + - [allow `into duration` to take an integer amount of ns](https://github.com/nushell/nushell/pull/10286) + - [rename the types with spaces in them to use `-`](https://github.com/nushell/nushell/pull/9929) + - [fix default after an empty where](https://github.com/nushell/nushell/pull/10240) + - [move math constants to standard library](https://github.com/nushell/nushell/pull/9678) + - [support tab completion cycling](https://github.com/nushell/nushell/pull/10199) + - [add support for Vim motions in `explore`](https://github.com/nushell/nushell/pull/9966) +- [WindSoilder](https://github.com/WindSoilder) created + - [Ps: add `cwd` column on linux and macos](https://github.com/nushell/nushell/pull/10347) + - [return error when user break sleep by ctrl-c](https://github.com/nushell/nushell/pull/10234) +- [jntrnr](https://github.com/jntrnr) created + - [fix 'let' to properly redirect](https://github.com/nushell/nushell/pull/10360) + - [Change `echo` to print when not redirected](https://github.com/nushell/nushell/pull/10338) + - [remove profiling from nushell's hot loop](https://github.com/nushell/nushell/pull/10325) + - [Move Value to helpers, separate span call](https://github.com/nushell/nushell/pull/10121) + - [Spanned Value step 1: span all value cases](https://github.com/nushell/nushell/pull/10042) +- [GomesGoncalo](https://github.com/GomesGoncalo) created + - [fix #10319: allow json request of value type list](https://github.com/nushell/nushell/pull/10356) +- [Tiggax](https://github.com/Tiggax) created + - [Remove `select` error if same row/column is provided](https://github.com/nushell/nushell/pull/10350) + - [update `reject` to be able to recive arg list](https://github.com/nushell/nushell/pull/10216) + - [`reject` multiple row args support](https://github.com/nushell/nushell/pull/10163) +- [kubouch](https://github.com/kubouch) created + - [Allow parse-time evaluation of `if`](https://github.com/nushell/nushell/pull/10326) + - [Remove leftover const eval file](https://github.com/nushell/nushell/pull/10324) + - [Add NU_VERSION environment variable on startup](https://github.com/nushell/nushell/pull/10177) + - [Make $nu constant](https://github.com/nushell/nushell/pull/10160) + - [Allow parse-time evaluation of calls, pipelines and subexpressions](https://github.com/nushell/nushell/pull/9499) +- [hustcer](https://github.com/hustcer) created + - [Update Nu to v0.84 for release and nightly-build](https://github.com/nushell/nushell/pull/10334) + - [Upgrade softprops/action-gh-release to v0.1.15 for release and nightly build workflow](https://github.com/nushell/nushell/pull/10331) +- [geniusisme](https://github.com/geniusisme) created + - [provide env to commands and try to start provided path](https://github.com/nushell/nushell/pull/10302) +- [utouto97](https://github.com/utouto97) created + - [add 'from ndjson' into standard library](https://github.com/nushell/nushell/pull/10283) + - [refactor input command](https://github.com/nushell/nushell/pull/10150) +- [nanoqsh](https://github.com/nanoqsh) created + - [Keep order for `par-each`](https://github.com/nushell/nushell/pull/10249) + - [Make `append`/`prepend` consistent for ranges](https://github.com/nushell/nushell/pull/10231) +- [app/dependabot](https://github.com/app/dependabot) created + - [Bump bytesize from 1.2.0 to 1.3.0](https://github.com/nushell/nushell/pull/10306) + - [Bump tempfile from 3.7.0 to 3.8.0](https://github.com/nushell/nushell/pull/10307) + - [Bump actions/checkout from 3 to 4](https://github.com/nushell/nushell/pull/10308) + - [Bump itertools from 0.10.5 to 0.11.0](https://github.com/nushell/nushell/pull/9524) + - [Bump rust-embed from 6.8.1 to 8.0.0](https://github.com/nushell/nushell/pull/10208) + - [Bump git2 from 0.17.2 to 0.18.0](https://github.com/nushell/nushell/pull/10207) + - [Bump winreg from 0.50.0 to 0.51.0](https://github.com/nushell/nushell/pull/10209) + - [Bump notify-debouncer-full from 0.2.0 to 0.3.1](https://github.com/nushell/nushell/pull/10129) +- [dmatos2012](https://github.com/dmatos2012) created + - [Fix variables not allowed in ucp](https://github.com/nushell/nushell/pull/10304) + - [use uutils/coreutils cp command in place of nushell's cp command](https://github.com/nushell/nushell/pull/10097) +- [dzorya](https://github.com/dzorya) created + - [Added a comment that perl is required for feature static-link-openssl…](https://github.com/nushell/nushell/pull/10291) +- [nibon7](https://github.com/nibon7) created + - [Make cursor_shape optional](https://github.com/nushell/nushell/pull/10289) + - [Exit early when encountering parsing errors](https://github.com/nushell/nushell/pull/10213) + - [Auto format let-else block](https://github.com/nushell/nushell/pull/10214) + - [Use built-in is_terminal instead of is_terminal::is_terminal](https://github.com/nushell/nushell/pull/9550) + - [Don't use `oldtime` feature of chrono ](https://github.com/nushell/nushell/pull/9577) +- [alsuren](https://github.com/alsuren) created + - [signpost 'input list --types [key]' from 'keybindings list'](https://github.com/nushell/nushell/pull/10287) + - [Point from keybindings help to the book's reedline chapter](https://github.com/nushell/nushell/pull/10193) +- [IanManske](https://github.com/IanManske) created + - [Fix `rm` on macOS](https://github.com/nushell/nushell/pull/10282) + - [Restore initial foreground process group on exit](https://github.com/nushell/nushell/pull/10021) + - [Create `Record` type](https://github.com/nushell/nushell/pull/10103) +- [rgwood](https://github.com/rgwood) created + - [Start removing colour config from `explore`](https://github.com/nushell/nushell/pull/10270) + - [Exit explore on ctrl+c/d/q](https://github.com/nushell/nushell/pull/10257) + - [explore: remove `:config`, `:show-config`, `:tweak` commands](https://github.com/nushell/nushell/pull/10259) + - [Remove `exit_esc` and `show_banner` config from `explore`](https://github.com/nushell/nushell/pull/10258) + - [Fix watch not detecting modifications on Windows](https://github.com/nushell/nushell/pull/10109) +- [brunerm99](https://github.com/brunerm99) created + - [feat: Search terms for use, while, and range (#5093)](https://github.com/nushell/nushell/pull/10265) +- [balupton](https://github.com/balupton) created + - [readme: add dorothy to supported by](https://github.com/nushell/nushell/pull/10262) +- [stormasm](https://github.com/stormasm) created + - [change LOG_FORMAT to NU_LOG_FORMAT in nu-std library](https://github.com/nushell/nushell/pull/10254) + - [Move hook to nu_cmd_base](https://github.com/nushell/nushell/pull/10146) + - [remove warnings in nu_command tests](https://github.com/nushell/nushell/pull/10145) + - [update rust-toolchain doc to 4 weeks from 3](https://github.com/nushell/nushell/pull/10140) +- [horasal](https://github.com/horasal) created + - [Allow operator in constants](https://github.com/nushell/nushell/pull/10212) + - [treat path contains '?' as pattern](https://github.com/nushell/nushell/pull/10142) + - [prevent crash when use redirection with let/mut](https://github.com/nushell/nushell/pull/10139) + - [skip comments and eols while parsing pipeline](https://github.com/nushell/nushell/pull/10149) + - [handle empty pipeline while parsing let (fix Issue10083)](https://github.com/nushell/nushell/pull/10116) + - [Add encoding auto-detection for `decode`](https://github.com/nushell/nushell/pull/10030) +- [dead10ck](https://github.com/dead10ck) created + - [Clean up trash support on Android](https://github.com/nushell/nushell/pull/10225) + - [Fix unit tests on Android](https://github.com/nushell/nushell/pull/10224) + - [upgrade nix to 0.27](https://github.com/nushell/nushell/pull/10223) + - [Support Termux](https://github.com/nushell/nushell/pull/10013) +- [ofek](https://github.com/ofek) created + - [Fix example history command pipeline](https://github.com/nushell/nushell/pull/10220) +- [MasterMach50](https://github.com/MasterMach50) created + - [changed default env file to use $nu.home_path to find home](https://github.com/nushell/nushell/pull/10192) +- [matthias-Q](https://github.com/matthias-Q) created + - [feat: allow `from csv` to accept 4 byte unicode separator chars](https://github.com/nushell/nushell/pull/10138) + - [Allow for `.parq` file ending as alternative to `.parquet`](https://github.com/nushell/nushell/pull/10112) +- [ayax79](https://github.com/ayax79) created + - [fixed usages of deprecated chrono DateTime::from_utc](https://github.com/nushell/nushell/pull/10161) + - [Updating polars and sqlparser versions](https://github.com/nushell/nushell/pull/10114) +- [SED4906](https://github.com/SED4906) created + - [Update removed "MDI" icons to current MD icons](https://github.com/nushell/nushell/pull/10126) +- [JoaquinTrinanes](https://github.com/JoaquinTrinanes) created + - [Screen reader-friendly errors](https://github.com/nushell/nushell/pull/10122) +- [Hofer-Julian](https://github.com/Hofer-Julian) created + - [toolkit: Renames `pretty-print-command`](https://github.com/nushell/nushell/pull/10110) + - [Add notice to enable develop mode on Windows](https://github.com/nushell/nushell/pull/10111) +- [herobs](https://github.com/herobs) created + - [Fix 9156 endian consistency](https://github.com/nushell/nushell/pull/9873) +- [ito-hiroki](https://github.com/ito-hiroki) created + - [Fix tab completion order of directories to consistent with order of files](https://github.com/nushell/nushell/pull/10102) + +### Extension + +- [nerditation](https://github.com/nerditation) created + - [use `which` to search `nu` location, add icon too.](https://github.com/nushell/vscode-nushell-lang/pull/153) +- [adamcstephens](https://github.com/adamcstephens) created + - [fix shebang/firstLine detection](https://github.com/nushell/vscode-nushell-lang/pull/151) + +### Documentation + +- [Gryff](https://github.com/Gryff) created + - [Change direnv example to upload $env.PATH as a list](https://github.com/nushell/nushell.github.io/pull/1058) +- [edhowland](https://github.com/edhowland) created + - [Changed Python plugin example to be more portable](https://github.com/nushell/nushell.github.io/pull/1060) +- [dnsem](https://github.com/dnsem) created + - [Support for standard input in script with shebang](https://github.com/nushell/nushell.github.io/pull/1057) +- [petrisch](https://github.com/petrisch) created + - [DE translation for custom_completions.md](https://github.com/nushell/nushell.github.io/pull/1056) + - [Typos in custom_completions](https://github.com/nushell/nushell.github.io/pull/1052) +- [mb21](https://github.com/mb21) created + - [Cookbook setup: fix command to append to PATH](https://github.com/nushell/nushell.github.io/pull/1055) +- [connorjs](https://github.com/connorjs) created + - [Update variables_and_subexpressions.md - remove obsolete section](https://github.com/nushell/nushell.github.io/pull/1054) + - [Update working_with_lists.md - format date](https://github.com/nushell/nushell.github.io/pull/1053) +- [JoaquinTrinanes](https://github.com/JoaquinTrinanes) created + - [Fix external completers typo](https://github.com/nushell/nushell.github.io/pull/1051) + - [Simplify external completer](https://github.com/nushell/nushell.github.io/pull/1049) + - [Error style section](https://github.com/nushell/nushell.github.io/pull/1026) +- [hustcer](https://github.com/hustcer) created + - [Update min required node version and some node modules](https://github.com/nushell/nushell.github.io/pull/1050) +- [sholderbach](https://github.com/sholderbach) created + - [Document that `open` looks up `from`s in scope](https://github.com/nushell/nushell.github.io/pull/1048) +- [stormasm](https://github.com/stormasm) created + - [add a link to the contributor book at the end of the plugins chapter](https://github.com/nushell/nushell.github.io/pull/1045) +- [alsuren](https://github.com/alsuren) created + - [Point out where command docs should be edited](https://github.com/nushell/nushell.github.io/pull/1042) +- [dclausen](https://github.com/dclausen) created + - [Update cheat_sheet.md](https://github.com/nushell/nushell.github.io/pull/1039) +- [simonboots](https://github.com/simonboots) created + - [Fix small typo in modules.md](https://github.com/nushell/nushell.github.io/pull/1038) +- [leetemil](https://github.com/leetemil) created + - [Update docs for exiting shell in shells](https://github.com/nushell/nushell.github.io/pull/1037) +- [adamchalmers](https://github.com/adamchalmers) created + - [Clarify how to check config file paths](https://github.com/nushell/nushell.github.io/pull/1030) + - [Link to escape when discussing escapes](https://github.com/nushell/nushell.github.io/pull/1031) +- [follower](https://github.com/follower) created + - [Move launch instructions earlier in page.](https://github.com/nushell/nushell.github.io/pull/1032) +- [jamesarch](https://github.com/jamesarch) created + - [fix missing command](https://github.com/nushell/nushell.github.io/pull/1034) +- [narve](https://github.com/narve) created + - [Update loading_data.md, correct link to http command](https://github.com/nushell/nushell.github.io/pull/1033) +- [dlamei](https://github.com/dlamei) created + - [fix typo in book](https://github.com/nushell/nushell.github.io/pull/1028) +- [lomm28](https://github.com/lomm28) created + - [nu cheat sheet added](https://github.com/nushell/nushell.github.io/pull/1025) +- [fdncred](https://github.com/fdncred) created + - [update fdncred's item + typo](https://github.com/nushell/nushell.github.io/pull/1022) +- [rgwood](https://github.com/rgwood) created + - [Update Reilly's comments in birthday blog post](https://github.com/nushell/nushell.github.io/pull/1021) +- [app/github-actions](https://github.com/app/github-actions) created + - [Compressed Images](https://github.com/nushell/nushell.github.io/pull/1020) +- [jntrnr](https://github.com/jntrnr) created + - [Add Nushell birthday post](https://github.com/nushell/nushell.github.io/pull/1019) + +### Nu_Scripts + +- [amtoine](https://github.com/amtoine) created + - [fix scripts](https://github.com/nushell/nu_scripts/pull/594) + - [add a `typeof` command](https://github.com/nushell/nu_scripts/pull/597) + - [add `$.type` to `package.nuon`](https://github.com/nushell/nu_scripts/pull/582) + - [add the `random-bytes` benchmark](https://github.com/nushell/nu_scripts/pull/595) +- [WindSoilder](https://github.com/WindSoilder) created + - [Improve background job.nu](https://github.com/nushell/nu_scripts/pull/607) + - [use closure instead of block](https://github.com/nushell/nu_scripts/pull/602) +- [Zinvoke](https://github.com/Zinvoke) created + - [FEATURE: add `catppuccin-mocha` theme](https://github.com/nushell/nu_scripts/pull/601) +- [brunerm99](https://github.com/brunerm99) created + - [Change nu_conda list to output active status of environment as well (#604)](https://github.com/nushell/nu_scripts/pull/605) +- [icp1994](https://github.com/icp1994) created + - [feat(hook): add `rusty-paths.nu`](https://github.com/nushell/nu_scripts/pull/596) +- [selfagency](https://github.com/selfagency) created + - [Add support for fnm](https://github.com/nushell/nu_scripts/pull/593) +- [fnuttens](https://github.com/fnuttens) created + - [Replace exa by eza aliases](https://github.com/nushell/nu_scripts/pull/591) +- [maxim-uvarov](https://github.com/maxim-uvarov) created + - [Update `bar` function](https://github.com/nushell/nu_scripts/pull/589) +- [StripedMonkey](https://github.com/StripedMonkey) created + - [Expand git completions](https://github.com/nushell/nu_scripts/pull/587) +- [AntoineSebert](https://github.com/AntoineSebert) created + - [Add `dfr` before `into df` and `into nu`](https://github.com/nushell/nu_scripts/pull/585) + +### Reedline + +- [sholderbach](https://github.com/sholderbach) created + - [Remove old `actions-rs/cargo`](https://github.com/nushell/reedline/pull/637) + - [Add a configuration to codecov.io](https://github.com/nushell/reedline/pull/636) + - [Setup coverage with codecov.io](https://github.com/nushell/reedline/pull/635) + - [Bump `crossterm` to 0.27.0](https://github.com/nushell/reedline/pull/625) +- [ysthakur](https://github.com/ysthakur) created + - [Let prompts choose to repaint on enter](https://github.com/nushell/reedline/pull/627) +- [Hofer-Julian](https://github.com/Hofer-Julian) created + - [Minor improvements](https://github.com/nushell/reedline/pull/633) + - [Fix `read_line` docs](https://github.com/nushell/reedline/pull/629) +- [Abdillah](https://github.com/Abdillah) created + - [Add Kitty protocol keyboard enhancement support](https://github.com/nushell/reedline/pull/607) diff --git a/blog/2023-10-17-nushell_0_86.md b/src/content/docs/blog/2023-10-17-nushell_0_86.md similarity index 91% rename from blog/2023-10-17-nushell_0_86.md rename to src/content/docs/blog/2023-10-17-nushell_0_86.md index bde80eca296..a3fc65e7074 100644 --- a/blog/2023-10-17-nushell_0_86.md +++ b/src/content/docs/blog/2023-10-17-nushell_0_86.md @@ -3,65 +3,42 @@ title: Nushell 0.86 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.86 of Nu. This release adds fish-like directory completions, type system improvements, our first officially supported uutils command, and much more. +description: Today, we're releasing version 0.86 of Nu. This release adds fish-like directory completions, type system improvements, our first officially supported uutils command, and much more. --- <!-- TODO: complete the excerpt above --> -# Nushell 0.86 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. <!-- TODO: write this excerpt --> Today, we're releasing version 0.86 of Nu. This release adds fish-like directory completions, type system improvements, our first officially supported uutils command, and much more. -# Where to get it +## Where to get it Nu 0.86 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.86.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. -> :bulb: **Note** -> The optional dataframe functionality is available by `cargo install nu --features=dataframe`. +:::tip +The optional dataframe functionality is available by `cargo install nu --features=dataframe`. +::: As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Table of content - -- [_Themes of this release / New features_](#themes-of-this-release-new-features-toc) - - [_Hall of fame_](#hall-of-fame-toc) - - [_Bug fixes_](#bug-fixes-toc) - - [_Enhancing the documentation_](#enhancing-the-documentation-toc) - - [_Internal changes_](#internal-changes-toc) - - [_Platform support_](#platform-support-toc) - - [_Making errors better_](#making-errors-better-toc) - - [_Improving the completions in the REPL_](#improving-the-completions-in-the-repl-toc) - - [_The type system_](#the-type-system-toc) - - [_Some news with the standard library_](#some-news-with-the-standard-library-toc) - - [_Miscellaneous_](#miscellaneous-toc) - - [_Our set of commands is evolving_](#our-set-of-commands-is-evolving-toc) - - [_New commands_](#new-commands-toc) - - [_Changes to existing commands_](#changes-to-existing-commands-toc) - - [_A few updates on the `explore` command_](#a-few-updates-on-the-explore-command-toc) - - [_Deprecated commands_](#deprecated-commands-toc) - - [_Removed commands_](#removed-commands-toc) -- [_Breaking changes_](#breaking-changes-toc) -- [_Full changelog_](#full-changelog-toc) - -# Themes of this release / New features [[toc](#table-of-content)] +## Themes of this release / New features [[toc](#table-of-content)] <!-- NOTE: if you wanna write a section about a breaking change, when it's a very important one, please add the following snippet to have a "warning" banner :) - > see [an example](https://www.nushell.sh/blog/2023-09-19-nushell_0_85_0.html#pythonesque-operators-removal) + > see [an example](https://www.nushell.sh/blog/2023-09-19-nushell_0_85_0#pythonesque-operators-removal) ```md - ::: warning Breaking change + :::caution[Breaking change] See a full overview of the [breaking changes](#breaking-changes) ::: ``` --> -## Hall of fame [[toc](#table-of-content)] +### Hall of fame [[toc](#table-of-content)] -### Bug fixes [[toc](#table-of-content)] +#### Bug fixes [[toc](#table-of-content)] Thanks to all the contributors below for helping us solve issues and bugs :pray:. This effort is a major part of what is moving Nushell closer to 1.0 with each release. | author | title | pr | @@ -96,7 +73,7 @@ Thanks to all the contributors below for helping us solve issues and bugs :pray: | [@bobhy](https://github.com/bobhy) | glob with ../ prefix now works; | [#10504](https://github.com/nushell/nushell/pull/10504) | | [@fnuttens](https://github.com/fnuttens) | Add support for HTTP proxy in network commands | [#10401](https://github.com/nushell/nushell/pull/10401) | -### Enhancing the documentation [[toc](#table-of-content)] +#### Enhancing the documentation [[toc](#table-of-content)] Thanks to all the contributors below for helping us making the documentation of Nushell commands better :pray: | author | title | pr | @@ -111,7 +88,7 @@ Thanks to all the contributors below for helping us making the documentation of | [@amtoine](https://github.com/amtoine) | add examples with `..` and `/` to `path join` | [#10620](https://github.com/nushell/nushell/pull/10620) | | [@DanyPDev](https://github.com/DanyPDev) | Add themes to help command when available #10318 | [#10623](https://github.com/nushell/nushell/pull/10623) | -### Internal changes [[toc](#table-of-content)] +#### Internal changes [[toc](#table-of-content)] Thanks to all the contributors below for working on the internals of Nushell, doing refactoring and bookkeeping, ... :pray: | author | title | pr | @@ -135,7 +112,7 @@ Thanks to all the contributors below for working on the internals of Nushell, do | [@quat1024](https://github.com/quat1024) | Use `heck` for string casing (again) | [#10680](https://github.com/nushell/nushell/pull/10680) | | [@lavafroth](https://github.com/lavafroth) | refactor: move the `partial_from` function to the single place it is invoked | [#10705](https://github.com/nushell/nushell/pull/10705) | -### Platform support [[toc](#table-of-content)] +#### Platform support [[toc](#table-of-content)] Thanks to all the contributors below for helping Nushell be used on more platforms easily :pray: | author | title | pr | @@ -147,7 +124,7 @@ Thanks to all the contributors below for helping Nushell be used on more platfor | [@hustcer](https://github.com/hustcer) | Improve release script for github release workflow | [#10502](https://github.com/nushell/nushell/pull/10502) | | [@hustcer](https://github.com/hustcer) | Update build flags for riscv64gc and armv7 targets | [#10564](https://github.com/nushell/nushell/pull/10564) | -### Making errors better [[toc](#table-of-content)] +#### Making errors better [[toc](#table-of-content)] Thanks to all the contributors below for making errors better and less confusing for users :pray: | author | title | pr | @@ -161,7 +138,7 @@ Thanks to all the contributors below for making errors better and less confusing | [@amtoine](https://github.com/amtoine) | make "can't follow stream paths" error a bit better | [#10569](https://github.com/nushell/nushell/pull/10569) | | [@brunerm99](https://github.com/brunerm99) | give better error if required field of `url join` is invalid | [#10589](https://github.com/nushell/nushell/pull/10589) | -## Improving the completions in the [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) [[toc](#table-of-content)] +### Improving the completions in the [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) [[toc](#table-of-content)] With Nushell `0.86.0` come a few improvements to the completions! @@ -174,9 +151,9 @@ in the [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop hitting TAB will autocomplete to `./target/debug/incremental` if you are in a Rust directory with compiled artifact. - + -::: warning Breaking change +:::caution[Breaking change] See a full overview of the [breaking changes](#breaking-changes) ::: As a consequence to [#10543](https://github.com/nushell/nushell/pull/10543), [@jntrnr](https://github.com/jntrnr) @@ -185,7 +162,7 @@ This feature will be taken care of by the _Fish-like completions_ described abov mainly means that `$env.config.cd.abbreviations` is not longer a valid config field: do not forget to update your configs :wink: -## The type system [[toc](#table-of-content)] +### The type system [[toc](#table-of-content)] With this new release, we are still working on the type system of Nushell. @@ -193,14 +170,14 @@ With this new release, we are still working on the type system of Nushell. custom commands. With [#10424](https://github.com/nushell/nushell/pull/10424), default values won't overwrite type annotations anymore, i.e. the following is now possible: -```nushell +```nu def foo [x: any = null] { print $"$x" } foo "string" # will show `x: string` foo null # will show `x: ` ``` -::: warning Breaking change +:::caution[Breaking change] See a full overview of the [breaking changes](#breaking-changes) ::: Continuing with the options on custom commands, let's talk about an important change introduced by @@ -208,7 +185,7 @@ Continuing with the options on custom commands, let's talk about an important ch - annotating a _boolean_ option will create an option and will require to pass a boolean value -```nushell +```nu def foo [--option: bool] { if $option { print "yeah" } } foo --option # will give an error @@ -218,62 +195,69 @@ foo --option true # will print "yeah" - to create a _boolean_ switch, you need to omit the type annotation -```nushell +```nu def bar [--switch] { if $switch { print "yeah" } } bar # won't print anything bar --switch # will print "yeah" ``` -> :bulb: **Note** -> Boolean options are one step towards addressing a major pain point of Nushell: Passing flags around to other commands. -> Calling a command with a flag, such as `def inner [--foo] { ... }`, from another command used to require `if`-`else` to pass the flag: -> ```nushell -> def outer [--foo] { -> if $foo { -> inner --foo -> } else { -> inner -> } -> } -> ``` -> With boolean options, it is now possible to define `def inner [--foo: bool] { ... }` and then call simply as -> ```nushell -> def outer [--foo] { -> inner --foo $foo -> } -> ``` +:::note +Boolean options are one step towards addressing a major pain point of Nushell: Passing flags around to other commands. +Calling a command with a flag, such as `def inner [--foo] { ... }`, from another command used to require `if`-`else` to pass the flag: + +```nu +def outer [--foo] { + if $foo { + inner --foo + } else { + inner + } + } +``` + +With boolean options, it is now possible to define `def inner [--foo: bool] { ... }` and then call simply as + +```nu + def outer [--foo] { + inner --foo $foo + } +``` + +::: Once again, [@NotLebedev](https://github.com/NotLebedev) has been pushing forward type annotations to their limits, this time by allowing complex types in input/output signaturate for custom commands and in `let` assignments. This means that [#10405](https://github.com/nushell/nushell/pull/10405) allows one to write things like: -```nushell +```nu let my_r: record<a :int> = { a: 123 } ``` or -```nushell +```nu def my_complex_command []: nothing -> record<a: int> { { a: 123 } } ``` -> :bulb: **Note** -> other contributions worth mentionning about the type system: -> | author | title | pr | -> | -------------------------------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------- | -> | [@sholderbach](https://github.com/sholderbach) | Use `int` type name consistently | [#10579](https://github.com/nushell/nushell/pull/10579) | -> | [@sholderbach](https://github.com/sholderbach) | Relax type-check of key-less `table`/`record` | [#10629](https://github.com/nushell/nushell/pull/10629) | -> | [@fdncred](https://github.com/fdncred) | change Type::Float => SyntaxShape::Number to SyntaxShape::Float | [#10689](https://github.com/nushell/nushell/pull/10689) | +:::note +other contributions worth mentionning about the type system: +| author | title | pr | +| -------------------------------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------- | +| [@sholderbach](https://github.com/sholderbach) | Use `int` type name consistently | [#10579](https://github.com/nushell/nushell/pull/10579) | +| [@sholderbach](https://github.com/sholderbach) | Relax type-check of key-less `table`/`record` | [#10629](https://github.com/nushell/nushell/pull/10629) | +| [@fdncred](https://github.com/fdncred) | change Type::Float => SyntaxShape::Number to SyntaxShape::Float | [#10689](https://github.com/nushell/nushell/pull/10689) | +::: -## Unified command definitions +### Unified command definitions Nushell currently has three ways to define a command: -* `def` to define a regular command -* `def-env` to define a command that preserves the environment -* `extern-wrapped` to define a command with a signature where unknown flags and parameters are collected into strings without throwing an error -* (`extern` defines an external signature, not a real command) + +- `def` to define a regular command +- `def-env` to define a command that preserves the environment +- `extern-wrapped` to define a command with a signature where unknown flags and parameters are collected into strings without throwing an error +- (`extern` defines an external signature, not a real command) In this release, [@kubouch](https://github.com/kubouch) unified the syntax in [#10566](https://github.com/nushell/nushell/pull/10566) such that the `def-env` and `extern-wrapped` are now defined with the `--env` and `--wrapped` options to the `def` keyword. We made this change to go in line with the `let-env` removal and simplifying the language in general. @@ -281,10 +265,11 @@ Also, confusingly, `extern-wrapped` has nothing to do with `extern` apart from t We hope the new notation makes it clearer. A bonus feature of this change is that now you can define `def --env --wrapped`! -> :bulb: **Note** -> In the next release, `def-env` and `extern-wrapped` will get deprecated. If you have any of those definitions in your scripts, simply replace them with `def --env` or `def --wrapped`. In the following releases, they will be removed completely. +:::note +In the next release, `def-env` and `extern-wrapped` will get deprecated. If you have any of those definitions in your scripts, simply replace them with `def --env` or `def --wrapped`. In the following releases, they will be removed completely. +::: -## Some news with the standard library [[toc](#table-of-content)] +### Some news with the standard library [[toc](#table-of-content)] Thanks to [@Yethal](https://github.com/Yethal) and their work in [#10545](https://github.com/nushell/nushell/pull/10545), the use of the test runner and the `std testing run-tests` command should be faster! @@ -297,7 +282,7 @@ Work has been done to improve the `std log` module: Finally, a bug with `std dirs goto`, a _shell_ command in the _prelude_ of the library, has been fixed by [@bobhy](https://github.com/bobhy) in [#10706](https://github.com/nushell/nushell/pull/10706). -## Miscellaneous [[toc](#table-of-content)] +### Miscellaneous [[toc](#table-of-content)] Nushell now supports the _keyboard enhancement protocol_ from [Kitty](https://sw.kovidgoyal.net/kitty/) with the work of [@Abdillah](https://github.com/Abdillah) in [#10540](https://github.com/nushell/nushell/pull/10540). @@ -321,7 +306,7 @@ Let's finish with some delight to make the Nushell experience a bit nicer: in [#10532](https://github.com/nushell/nushell/pull/10532) - a few more grid icons have been added by [@fdncred](https://github.com/fdncred) in [#10583](https://github.com/nushell/nushell/pull/10583) -## Our set of commands is evolving [[toc](#table-of-content)] +### Our set of commands is evolving [[toc](#table-of-content)] As usual, new release rhyms with changes to commands! @@ -332,14 +317,14 @@ visit our [Discord](https://discord.gg/NtAbbGn) and ask about helping. The [coreutils](https://github.com/uutils/coreutils) team would also appreciate your help since changes need to be made there before integrating into nushell. -### New commands [[toc](#table-of-content)] +#### New commands [[toc](#table-of-content)] - when parsing raw data streams from external commands, a common task in Nushell is to give explicit types to all fields and columns of the parsed data structure. Until now, this had to be done manually but, thanks to [@fdncred](https://github.com/fdncred) and [#10427](https://github.com/nushell/nushell/pull/10427), the new `into value` command should help make that task easier by trying to infer the types for you: -```nushell +```nu # should help you catch integer user and group IDs in the `/etc/passwd` file on *nix systems open /etc/passwd | lines | split column ":" user . uid gid desc home shell | into value ``` @@ -355,14 +340,14 @@ open /etc/passwd | lines | split column ":" user . uid gid desc home shell | int [@hudclark](https://github.com/hudclark) got your back with the new `unfold` command from [#10489](https://github.com/nushell/nushell/pull/10489)! The first 10 Fibonacci numbers can now be computed very easily with something like -```nushell +```nu unfold [0, 1] {|fib| {out: $fib.0, next: [$fib.1, ($fib.0 + $fib.1)]} } | first 10 ``` To crawl multi-page API responses, e.g. when listing issues of a GitHub repository, the `unfold` is very handy and allows to transform -```nushell +```nu mut pages = [] for page in 1.. { let resp = http get ( @@ -384,7 +369,7 @@ $pages into -```nushell +```nu unfold 1 {|page| let resp = http get ( { @@ -411,7 +396,7 @@ unfold 1 {|page| [#10711](https://github.com/nushell/nushell/pull/10711), should give more insight into the resources Nushell is using at runtime -### Changes to existing commands [[toc](#table-of-content)] +#### Changes to existing commands [[toc](#table-of-content)] The `open` command is now case-insensitive when it comes to file extensiens thanks to [@poketch](https://github.com/poketch) in [#10451](https://github.com/nushell/nushell/pull/10451). @@ -419,13 +404,13 @@ The `open` command is now case-insensitive when it comes to file extensiens than A bug inside `from ics` and `from vcf` has been fixed thanks to [@joergsch](https://github.com/joergsch) in [#10577](https://github.com/nushell/nushell/pull/10577). -::: warning Breaking change +:::caution[Breaking change] See a full overview of the [breaking changes](#breaking-changes) ::: With [#10526](https://github.com/nushell/nushell/pull/10526) from [@WindSoilder](https://github.com/WindSoilder), the `--column` option of the `rename` command now takes a `record` instead of a `list`: -```nushell +```nu > ls | where type == file | rename --column {name: filename, size: nb_bytes} #┬filename─┬type┬nb_bytes┬─────modified────── 0│LICENSE │file│ 35.1 KB│2022-12-23 11:34:42 @@ -436,11 +421,11 @@ the `--column` option of the `rename` command now takes a `record` instead of a The `do` command can now mutate its outside environment with a new `--env` option added by [@ClipplerBlood](https://github.com/ClipplerBlood) in [#10572](https://github.com/nushell/nushell/pull/10572). This means that the following will now be possible: -```nushell +```nu do --env { cd some/where } ``` -#### A few updates on the `explore` command [[toc](#table-of-content)] +##### A few updates on the `explore` command [[toc](#table-of-content)] Once again, [@rgwood](https://github.com/rgwood) has done work to simplify the `explore` command @@ -448,7 +433,7 @@ Once again, [@rgwood](https://github.com/rgwood) has done work to simplify the ` - some config options have been removed in[#10559](https://github.com/nushell/nushell/pull/10559), [#10562](https://github.com/nushell/nushell/pull/10562) and [#10570](https://github.com/nushell/nushell/pull/10570) -### Deprecated commands [[toc](#table-of-content)] +#### Deprecated commands [[toc](#table-of-content)] The following commands and options are being deprecated and will be removed soon: @@ -456,14 +441,14 @@ The following commands and options are being deprecated and will be removed soon - the `$nothing` built-in variable in favor of the `null` value in [#10478](https://github.com/nushell/nushell/pull/10478) - `to xml --pretty {int}` in favor of `to xml --indent {int}` in [#10660](https://github.com/nushell/nushell/pull/10660) -### Removed commands [[toc](#table-of-content)] +#### Removed commands [[toc](#table-of-content)] The following commands are being removed from Nushell: - `random decimal` in favor of `random float` in [#10342](https://github.com/nushell/nushell/pull/10342) - `into decimal` in favor of `into float` in [#10341](https://github.com/nushell/nushell/pull/10341) -# Breaking changes [[toc](#table-of-content)] +## Breaking changes [[toc](#table-of-content)] - [#10456](https://github.com/nushell/nushell/pull/10456) differentiating between `--x` and `--x: bool` @@ -471,9 +456,9 @@ In 0.86, we now differentiate between a switch `--x` and a flag with a boolean a - [#10680](https://github.com/nushell/nushell/pull/10680) Use `heck` for string casing (again) -## Before +### Before -```nushell +```nu > [UserID ABCdefGHI foo123bar] | str camel-case ╭───┬───────────╮ │ 0 │ userID │ @@ -488,9 +473,9 @@ In 0.86, we now differentiate between a switch `--x` and a flag with a boolean a ╰───┴─────────────╯ ``` -## After +### After -```nushell +```nu > [UserID ABCdefGHI foo123bar] | str camel-case ╭───┬───────────╮ │ 0 │ userId │ @@ -515,18 +500,18 @@ In 0.86, we now differentiate between a switch `--x` and a flag with a boolean a After this change, we need to use -c flag like this: -``` +```nu > [[a, b, c]; [1, 2, 3]] | rename -c { a: ham } But we can rename many columns easily, here is another example: ``` -``` +```nu > [[a, b, c]; [1, 2, 3]] | rename -c { a: ham, b: ham2 } ``` -# Full changelog [[toc](#table-of-content)] +## Full changelog [[toc](#table-of-content)] -## Nushell +### Nushell - [fdncred](https://github.com/fdncred) created - [add coreutils to cp search terms](https://github.com/nushell/nushell/pull/10738) @@ -702,12 +687,12 @@ But we can rename many columns easily, here is another example: - [GPadley](https://github.com/GPadley) created - [Map `DirectoryNotFound` to `FileNotFound` for `open` command (issue #10085)](https://github.com/nushell/nushell/pull/10089) -## Extension +### Extension - [glcraft](https://github.com/glcraft) created - [Update Textmate](https://github.com/nushell/vscode-nushell-lang/pull/160) -## Documentation +### Documentation - [app/dependabot](https://github.com/app/dependabot) created - [Bump postcss from 8.4.29 to 8.4.31](https://github.com/nushell/nushell.github.io/pull/1103) @@ -756,7 +741,7 @@ But we can rename many columns easily, here is another example: - [ysthakur](https://github.com/ysthakur) created - [Add information on transient prompt](https://github.com/nushell/nushell.github.io/pull/1074) -## Nu_Scripts +### Nu_Scripts - [TechWatching](https://github.com/TechWatching) created - [Move def before extern in winget-completions.nu](https://github.com/nushell/nu_scripts/pull/638) @@ -794,7 +779,7 @@ But we can rename many columns easily, here is another example: - [baehyunsol](https://github.com/baehyunsol) created - [use `repeat` instead of string multiplication](https://github.com/nushell/nu_scripts/pull/612) -## Reedline +### Reedline - [sholderbach](https://github.com/sholderbach) created - [Fix clippy lint from most recent Rust](https://github.com/nushell/reedline/pull/646) diff --git a/blog/2023-11-14-nushell_0_87_0.md b/src/content/docs/blog/2023-11-14-nushell_0_87_0.md similarity index 93% rename from blog/2023-11-14-nushell_0_87_0.md rename to src/content/docs/blog/2023-11-14-nushell_0_87_0.md index e4ae6cc28da..5831d04e3aa 100644 --- a/blog/2023-11-14-nushell_0_87_0.md +++ b/src/content/docs/blog/2023-11-14-nushell_0_87_0.md @@ -3,73 +3,46 @@ title: Nushell 0.87.0 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.87.0 of Nu. This release focussed heavily on improving internals, fills a few gaps in our command set and completion handling, and starts work on an integrated LSP language server. +description: Today, we're releasing version 0.87.0 of Nu. This release focussed heavily on improving internals, fills a few gaps in our command set and completion handling, and starts work on an integrated LSP language server. --- <!-- TODO: complete the excerpt above --> -# Nushell 0.87.0 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. <!-- TODO: write this excerpt --> Today, we're releasing version 0.87.0 of Nu. This release focussed heavily on improving internals, fills a few gaps in our command set and completion handling, and starts work on an integrated LSP language server. -# Where to get it +## Where to get it Nu 0.87.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.87.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. -::: tip Note +:::note The optional dataframe functionality is available by `cargo install nu --features=dataframe`. ::: As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Table of content - -- [_Themes of this release / New features_](#themes-of-this-release-new-features-toc) - - [_Hall of fame_](#hall-of-fame-toc) - - [_Bug fixes_](#bug-fixes-toc) - - [_Enhancing the documentation_](#enhancing-the-documentation-toc) - - [_Changes to the internals of Nushell_](#changes-to-the-internals-of-nushell-toc) - - [_LSP is coming to Nushell_](#lsp-is-coming-to-nushell-toc) - - [_Living in the terminal: completions and hints_](#living-in-the-terminal-completions-and-hints-toc) - - [_Handling exotic paths_](#handling-exotic-paths-toc) - - [_Improving the `match` command_](#improving-the-match-command-toc) - - [_Pipeline redirections_](#pipeline-redirections-toc) - - [_Some work on the standard library_](#some-work-on-the-standard-library-toc) - - [_New allowed operands to the modulo operator_](#new-allowed-operands-to-the-modulo-operator-toc) - - [_Disallowing invalid table definitions and manipulations_](#disallowing-invalid-table-definitions-and-manipulations-toc) - - [_The documentation becomes better_](#the-documentation-becomes-better-toc) - - [_Some progress in the "dataframe" department_](#some-progress-in-the-dataframe-department-toc) - - [_Our set of commands is evolving_](#our-set-of-commands-is-evolving-toc) - - [_New commands_](#new-commands-toc) - - [_Changes to existing commands_](#changes-to-existing-commands-toc) - - [_Deprecated commands_](#deprecated-commands-toc) - - [_Removed commands_](#removed-commands-toc) -- [_Breaking changes_](#breaking-changes-toc) -- [_Full changelog_](#full-changelog-toc) - -# Themes of this release / New features [[toc](#table-of-content)] +## Themes of this release / New features [[toc](#table-of-content)] <!-- NOTE: if you wanna write a section about a breaking change, when it's a very important one, please add the following snippet to have a "warning" banner :) - > see [an example](https://www.nushell.sh/blog/2023-09-19-nushell_0_85_0.html#pythonesque-operators-removal) + > see [an example](https://www.nushell.sh/blog/2023-09-19-nushell_0_85_0#pythonesque-operators-removal) ```md - ::: warning Breaking change + :::caution[Breaking change] See a full overview of the [breaking changes](#breaking-changes) ::: ``` --> -<!-- NOTE: see https://vuepress.github.io/reference/default-theme/markdown.html#custom-containers +<!-- NOTE: see https://vuepress.github.io/reference/default-theme/markdown#custom-containers for the list of available *containers* --> -## Hall of fame [[toc](#table-of-content)] +### Hall of fame [[toc](#table-of-content)] -### Bug fixes [[toc](#table-of-content)] +#### Bug fixes [[toc](#table-of-content)] Thanks to all the contributors below for helping us solve issues and bugs :pray: | author | description | url | @@ -99,7 +72,7 @@ Thanks to all the contributors below for helping us solve issues and bugs :pray: | [@fdncred](https://github.com/fdncred) | allow `items` to properly evaluate block settings | [#10980](https://github.com/nushell/nushell/pull/10980) | | [@WindSoilder](https://github.com/WindSoilder) | fix custom command's default value | [#11043](https://github.com/nushell/nushell/pull/11043) | -### Enhancing the documentation [[toc](#table-of-content)] +#### Enhancing the documentation [[toc](#table-of-content)] Thanks to all the contributors below for helping us making the documentation of Nushell commands better :pray: | author | description | url | @@ -117,7 +90,7 @@ Thanks to all the contributors below for helping us making the documentation of | [@fdncred](https://github.com/fdncred) | update `items` example to send data through the pipeline | [#10976](https://github.com/nushell/nushell/pull/10976) | | [@sholderbach](https://github.com/sholderbach) | Spell out our platform support policy | [#10778](https://github.com/nushell/nushell/pull/10778) | -### Changes to the internals of Nushell [[toc](#table-of-content)] +#### Changes to the internals of Nushell [[toc](#table-of-content)] Thanks to all the contributors below for helping us making the source base of Nushell better and helping with the general development process of the project :pray: | author | description | url | @@ -159,7 +132,7 @@ Thanks to all the contributors below for helping us making the source base of Nu | [@CAD97](https://github.com/CAD97) | Limit `run-external --redirect-combine sh` test to not(Windows) | [#10905](https://github.com/nushell/nushell/pull/10905) | | [@KAAtheWiseGit](https://github.com/KAAtheWiseGit) | Add special error case for `alias` | [#10975](https://github.com/nushell/nushell/pull/10975) | -## LSP is coming to Nushell [[toc](#table-of-content)] +### LSP is coming to Nushell [[toc](#table-of-content)] IDE support has been and still is one of the big goals for Nushell 1.0: a modern language needs to have proper language support to unlock pleasant and fast development with it :smile: @@ -167,7 +140,7 @@ to have proper language support to unlock pleasant and fast development with it In [#10990](https://github.com/nushell/nushell/pull/10990), [@fdncred](https://github.com/fdncred) made the shell integration with VS Code better. -::: warning +:::caution[warning] The rest of this section is in the early stages of its development. It will require time to mature and be fully featured, but we're happy to ship it with Nushell as of now. @@ -183,7 +156,7 @@ installation by default. [#10723](https://github.com/nushell/nushell/pull/10723) integrates a Language Server Protocol (LSP) implementation directly inside Nushell. Running -```nushell +```nu nu --lsp ``` @@ -207,31 +180,31 @@ configs.nulsp = { } ``` -## Living in the terminal: completions and hints [[toc](#table-of-content)] +### Living in the terminal: completions and hints [[toc](#table-of-content)] Thanks to [@lavafroth](https://github.com/lavafroth) in [#10898](https://github.com/nushell/nushell/pull/10898) Nushell will now fall back to the builtin default completer when external completers are defined but return no results for the current command. -::: tip Note +:::note The following example is fictitious, `carapace-bin` should be able to complete it :wink: ::: Let's say you have [Carapace](https://rsteube.github.io/carapace/) setup as an -[external completer](https://www.nushell.sh/cookbook/external_completers.html#carapace-completer) but +[external completer](https://www.nushell.sh/cookbook/external_completers#carapace-completer) but it is not able to autocomplete `git comm<TAB>`, then Nushell will try to do it. Because _most commands make sense only in the directory they were run in_, [@p00f](https://github.com/p00f) wrote [#10780](https://github.com/nushell/nushell/pull/10780) which will make hints aware of the current directory. -::: tip Note +:::note Hints are the shadowed incomplete completions that appear when you start typing commands, e.g. if you were to run `echo foo bar baz`, pressing `echo` would then show `foo bar baz` in a dimmed font: this is a hint. ::: -## Handling exotic paths [[toc](#table-of-content)] +### Handling exotic paths [[toc](#table-of-content)] As can be seen in [#10571](https://github.com/nushell/nushell/issues/10571) , [#10364](https://github.com/nushell/nushell/issues/10364) , [#10211](https://github.com/nushell/nushell/issues/10211) @@ -250,24 +223,24 @@ Nushell: e.g. let's say I created a bunch of files, one of them containing an obvious _globbing_ pattern -```nushell +```nu touch *.txt foo.txt bar.txt baz.txt ``` - running `rm *.txt` once will only remove `*.txt` and leave the three `{foo,bar,baz}.txt` files - running `rm *.txt` a second time will remove all the other files -::: tip +:::tip The first time `*.txt` is interpreted as a literal and the `*.txt` file is found and removed. The second time `*.txt` is not found as a literal filename. `rm` searches for `*.txt` as a _glob_ pattern; finds `foo.txt`, `bar.txt`, and `baz.txt`; and removes them. ::: -## Improving the `match` command [[toc](#table-of-content)] +### Improving the `match` command [[toc](#table-of-content)] Can we all agree for one moment that `match` is a great command? -```nushell +```nu def work-on-list []: any -> string { match $in { [$x, ..] if $x == 1 => { 'good list' }, @@ -277,7 +250,7 @@ def work-on-list []: any -> string { } ``` -```nushell +```nu > [1, 2, 3] | work-on-list good list > [2, 1, 3] | work-on-list @@ -288,7 +261,7 @@ not a list at all However, it had a pretty big flaw: it was not able to work on `null` values :open_mouth: -```nushell +```nu > match null { null => "success", _ => "failure" } failure ``` @@ -296,24 +269,24 @@ failure In [#10829](https://github.com/nushell/nushell/pull/10829), thanks to [@hudclark](https://github.com/hudclark), the `match` command is now able to work properly on `null` values. -```nushell +```nu > match null { null => "success", _ => "failure" } success ``` -## Pipeline redirections [[toc](#table-of-content)] +### Pipeline redirections [[toc](#table-of-content)] Once again [@WindSoilder](https://github.com/WindSoilder) has been working on _pipeline redirections_. Because they need to be given a target path to properly function, i.e. -```nushell +```nu echo aaa o> | ignore ``` does not make sense in itself, [#10835](https://github.com/nushell/nushell/pull/10835) makes commands such as the one just above throw a nice error: -```nushell +```nu Error: nu::parser::parse_mismatch × Parse mismatch during operation. @@ -326,17 +299,17 @@ Error: nu::parser::parse_mismatch The following will still function as expected: -```nushell +```nu echo aaa o> foo.txt | ignore ``` -## Some work on the standard library [[toc](#table-of-content)] +### Some work on the standard library [[toc](#table-of-content)] [@amtoine](https://github.com/amtoine) made the use of `std 'path add'` better in [#10710](https://github.com/nushell/nushell/pull/10710). Now this command that allows adding paths to the `$env.PATH` environment variable will (1) expand all the input paths to get only absolute paths and (2) split `$env.PATH` on `:` to make sure the command runs properly the first time it runs in the configuration. -::: tip Note +:::note If Bash is still your login shell, the value of `$env.PATH` in `env.nu` might be a `:`-separated list of system paths. This change to `std 'path add'` should help prevent the final `$env.PATH` from containing this original @@ -346,16 +319,16 @@ This change to `std 'path add'` should help prevent the final `$env.PATH` from c A new candidate to the standard library, [`null-stream`](https://github.com/nushell/nu_scripts/blob/main/stdlib-candidate/null-stream.nu), has been added by [@Hullabaloo-and-Howdy-Do](https://github.com/Hullabaloo-and-Howdy-Do) in [nushell/nu_scripts#649](https://github.com/nushell/nu_scripts/pull/649) -## New allowed operands to the modulo operator [[toc](#table-of-content)] +### New allowed operands to the modulo operator [[toc](#table-of-content)] When doing maths, _modulo_ is a ubiquitous operator, e.g. -```nushell +```nu > (11 + 5) mod 7 2 ``` -```nushell +```nu > (123 * 456) mod 13 6 ``` @@ -367,12 +340,12 @@ for `duration`s in [#10745](https://github.com/nushell/nushell/pull/10745). Thanks to their work, Nushell will now allow the following command: -```nushell +```nu > (2min + 31sec) mod 20sec 11sec ``` -## Disallowing invalid table definitions and manipulations [[toc](#table-of-content)] +### Disallowing invalid table definitions and manipulations [[toc](#table-of-content)] As can be seen in [#11020](https://github.com/nushell/nushell/issues/11020) and [#10875](https://github.com/nushell/nushell/pull/10875), Nushell will let you define or manipulate tables that have columns called the same. @@ -381,13 +354,13 @@ disallowed the definition of table literals with duplicated columns in [#10875]( Trying to define the following ill-defined table -```nushell +```nu [[a a]; [1 2]] ``` will result in an error from now onwards. -```nushell +```nu Error: nu::shell::column_defined_twice × Record field or table column used twice @@ -399,14 +372,14 @@ Error: nu::shell::column_defined_twice ╰──── ``` -## The documentation becomes better [[toc](#table-of-content)] +### The documentation becomes better [[toc](#table-of-content)] This section sheds some light on some of the contributions from [_Enhancing the documentation_](#enhancing-the-documentation-toc). - [@drbrain](https://github.com/drbrain) in [#10952](https://github.com/nushell/nushell/pull/10952) made plugins show their extra usage and search terms in `--help` -```nushell +```nu PluginSignature test 1 for plugin. Returns Value::Nothing Extra usage for nu-example-1 @@ -432,7 +405,7 @@ Examples: > nu-example-1 3 bb ``` -## Some progress in the "dataframe" department [[toc](#table-of-content)] +### Some progress in the "dataframe" department [[toc](#table-of-content)] Thanks again to [@ayax79](https://github.com/ayax79) who has been working on the dataframes. @@ -440,18 +413,18 @@ Thanks again to [@ayax79](https://github.com/ayax79) who has been working on the - with [#10943](https://github.com/nushell/nushell/pull/10943), dataframes will now be able to read _Polars structs_, such as JSONL or PARQUET files that contain rows with structured data -## Our set of commands is evolving [[toc](#table-of-content)] +### Our set of commands is evolving [[toc](#table-of-content)] As usual, new release rhymes with changes to commands! -### New commands [[toc](#table-of-content)] +#### New commands [[toc](#table-of-content)] - `whoami` using _uutils_ by [@tertsdiepraam](https://github.com/tertsdiepraam) in [#10488](https://github.com/nushell/nushell/pull/10488) - `umkdir` using _uutils_ by [@KAAtheWiseGit](https://github.com/KAAtheWiseGit) in [#10785](https://github.com/nushell/nushell/pull/10785) - In an upcoming release we intend to replace our existing `mkdir` command with this [uutils implementation](https://github.com/uutils/coreutils) - `exec` for Windows by [@IanManske](https://github.com/IanManske) in [#11001](https://github.com/nushell/nushell/pull/11001) -### Changes to existing commands [[toc](#table-of-content)] +#### Changes to existing commands [[toc](#table-of-content)] - the `ansi link` command has been put back to the default set of commands of Nushell by [@hustcer](https://github.com/hustcer) in [#10801](https://github.com/nushell/nushell/pull/10801). It should be available without any extra steps with this release. - [@Tiggax](https://github.com/Tiggax) added `--ignore-error` to `reject` [#10737](https://github.com/nushell/nushell/pull/10737) @@ -465,7 +438,7 @@ As usual, new release rhymes with changes to commands! - `input list` will now return `null` when no choice has been selected, see the contribution of [@KAAtheWiseGit](https://github.com/KAAtheWiseGit) in [#10913](https://github.com/nushell/nushell/pull/10913) - thanks to [@KAAtheWiseGit](https://github.com/KAAtheWiseGit) `error make` has been refactored in [#10923](https://github.com/nushell/nushell/pull/10923) and will now take a `$.label.span` and a `$.help` -```nushell +```nu error make { msg: "Message" label: { @@ -479,7 +452,7 @@ error make { - in [#11024](https://github.com/nushell/nushell/pull/11024) [@WindSoilder](https://github.com/WindSoilder) allowed `reject` to take lists as selector values - the `--pretty` option has been removed from `to xml` in favor of `--indent` by [@Hofer-Julian](https://github.com/Hofer-Julian) in [#10668](https://github.com/nushell/nushell/pull/10668) -### Deprecated commands [[toc](#table-of-content)] +#### Deprecated commands [[toc](#table-of-content)] - `extern-wrapped` in favor of `def --wrapped` by [@amtoine](https://github.com/amtoine) in [#10716](https://github.com/nushell/nushell/pull/10716) - `def-env` in favor of `def --env` by [@amtoine](https://github.com/amtoine) in [#10715](https://github.com/nushell/nushell/pull/10715) @@ -487,13 +460,13 @@ error make { - `size` in favor of `str stats` by [@amtoine](https://github.com/amtoine) and [@hustcer](https://github.com/hustcer) in [#10772](https://github.com/nushell/nushell/pull/10772) and [#10798](https://github.com/nushell/nushell/pull/10798) - `glob --not` in favor of `glob --exclude` by [@amtoine](https://github.com/amtoine) in [#10827](https://github.com/nushell/nushell/pull/10827) -### Removed commands [[toc](#table-of-content)] +#### Removed commands [[toc](#table-of-content)] - the `$nothing` variable by [@amtoine](https://github.com/amtoine) in [#10567](https://github.com/nushell/nushell/pull/10567) - `random integer` by [@amtoine](https://github.com/amtoine) in [#10568](https://github.com/nushell/nushell/pull/10568) in favor of `random int` - `profile` by [@kubouch](https://github.com/kubouch) in [#10807](https://github.com/nushell/nushell/pull/10807) -# Breaking changes [[toc](#table-of-content)] +## Breaking changes [[toc](#table-of-content)] - [#10884](https://github.com/nushell/nushell/pull/10884) Improve case insensitivity consistency - [#10923](https://github.com/nushell/nushell/pull/10923) Refactor `error make` @@ -505,9 +478,9 @@ error make { - [#10668](https://github.com/nushell/nushell/pull/10668) Remove `to xml --pretty` - [#10567](https://github.com/nushell/nushell/pull/10567) remove the `$nothing` variable -# Full changelog [[toc](#table-of-content)] +## Full changelog [[toc](#table-of-content)] -## Nushell +### Nushell - [WindSoilder](https://github.com/WindSoilder) created - [fix custom command's default value](https://github.com/nushell/nushell/pull/11043) @@ -670,7 +643,7 @@ error make { - [bobhy](https://github.com/bobhy) created - [Allow filesystem commands to access files with glob metachars in name](https://github.com/nushell/nushell/pull/10694) -## Extension +### Extension - [EmilyGraceSeville7cf](https://github.com/EmilyGraceSeville7cf) created - [More conditional and loop snippets](https://github.com/nushell/vscode-nushell-lang/pull/165) @@ -679,7 +652,7 @@ error make { - [fdncred](https://github.com/fdncred) created - [Prepare for release](https://github.com/nushell/vscode-nushell-lang/pull/163) -## Documentation +### Documentation - [WindSoilder](https://github.com/WindSoilder) created - [Rename back from `Changelog` to `Blog`](https://github.com/nushell/nushell.github.io/pull/1141) @@ -719,7 +692,7 @@ error make { - [0scvr](https://github.com/0scvr) created - [Update outdated std log import in `std_log.nu`](https://github.com/nushell/nushell.github.io/pull/1113) -## Nu_Scripts +### Nu_Scripts - [sholderbach](https://github.com/sholderbach) created - [Change `nu-deps` script to not care about waves](https://github.com/nushell/nu_scripts/pull/667) @@ -757,7 +730,7 @@ error make { - [drbrain](https://github.com/drbrain) created - [Improved CDPATH](https://github.com/nushell/nu_scripts/pull/644) -## Reedline +### Reedline - [Hofer-Julian](https://github.com/Hofer-Julian) created - [Also run clippy on examples](https://github.com/nushell/reedline/pull/666) diff --git a/blog/2023-11-16-nushell-2023-survey-results.md b/src/content/docs/blog/2023-11-16-nushell-2023-survey-results.md similarity index 89% rename from blog/2023-11-16-nushell-2023-survey-results.md rename to src/content/docs/blog/2023-11-16-nushell-2023-survey-results.md index 4e43efb1908..8617a8ce675 100644 --- a/blog/2023-11-16-nushell-2023-survey-results.md +++ b/src/content/docs/blog/2023-11-16-nushell-2023-survey-results.md @@ -3,18 +3,16 @@ title: Nushell 2023 Survey Results author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Let's take a look at the results of the 2023 Nushell survey +description: Let's take a look at the results of the 2023 Nushell survey --- -## Nushell Survey 2023 - In August/September of this year, we put out a survey to learn about how Nushell was being used and to learn what was holding people back from using Nushell. In this post, we'll detail the results of that survey. The survey had 451 responses, nearly triple what our 2019 survey had. ## Do you use Nushell? - + Heart-warmingly, over half of the respondents say they're using Nushell. This gives us both a good view of how Nushell is being used, as well as good info about why it isn't. @@ -22,7 +20,7 @@ Let's first look at how Nushell is being used. ## Where are you running Nushell? - + While the vast majority of Nushell users use Nushell on their personal machines, we couldn't help but notice over 50%(!) of users are using Nushell at work. @@ -30,7 +28,7 @@ That's a great vote of confidence for Nushell as a tool in the toolbox. ## What area(s) should Nushell prioritize? - + The four main areas people wanted the Nushell project to focus on are: @@ -77,7 +75,7 @@ People coming to Nushell from shells like Bash mentioned the difficulty in makin ## What platform(s) are you running Nushell on? - + Our top four platforms for Nushell area: @@ -88,7 +86,7 @@ Our top four platforms for Nushell area: ## How did you install Nushell - + - cargo install nu (44.7%) - native package manager (37.7%) diff --git a/src/content/docs/blog/2023-12-12-nushell_0_88_0.md b/src/content/docs/blog/2023-12-12-nushell_0_88_0.md new file mode 100644 index 00000000000..581de6508b0 --- /dev/null +++ b/src/content/docs/blog/2023-12-12-nushell_0_88_0.md @@ -0,0 +1,815 @@ +--- +title: Nushell 0.88.0 +author: The Nu Authors +author_site: https://twitter.com/nu_shell +author_image: https://www.nushell.sh/blog/images/nu_logo.png +description: Today, we're releasing version 0.88.0 of Nu. This release adds a spread operator, output stream improvements, dynamic switch support, and much more. +--- + +<!-- TODO: complete the excerpt above --> + +Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. + +Today, we're releasing version 0.88.0 of Nu. This release adds a spread operator, output stream improvements, dynamic switch support, and much more. + +## Where to get it + +Nu 0.88.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.88.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. + +:::note +The optional dataframe functionality is available by `cargo install nu --features=dataframe`. +::: + +As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. + +## Themes of this release / New features [[toc](#table-of-content)] + +<!-- NOTE: if you wanna write a section about a breaking change, when it's a very important one, + please add the following snippet to have a "warning" banner :) + > see [an example](https://www.nushell.sh/blog/2023-09-19-nushell_0_85_0#pythonesque-operators-removal) + + ```md + :::caution[Breaking change] + See a full overview of the [breaking changes](#breaking-changes) + ::: + ``` +--> +<!-- NOTE: see https://vuepress.github.io/reference/default-theme/markdown#custom-containers + for the list of available *containers* +--> + +### Hall of fame [[toc](#table-of-content)] + +#### Bug fixes [[toc](#table-of-content)] + +Thanks to all the contributors below for helping us solve issues and bugs :pray: +| author | description | url | +| ------------------------------------ | ----------- | ------------------------------------------------------- | +| [@dead10ck](https://github.com/dead10ck) | into binary -c: return 0 as single byte | [#11068](https://github.com/nushell/nushell/pull/11068) | +| [@zhiburt](https://github.com/zhiburt) | Fix #11047 | [#11054](https://github.com/nushell/nushell/pull/11054) | +| [@fdncred](https://github.com/fdncred) | tweak `table` example/parameter text | [#11071](https://github.com/nushell/nushell/pull/11071) | +| [@fdncred](https://github.com/fdncred) | add "default" table theme | [#11072](https://github.com/nushell/nushell/pull/11072) | +| [@fdncred](https://github.com/fdncred) | correct table example syntax | [#11074](https://github.com/nushell/nushell/pull/11074) | +| [@fdncred](https://github.com/fdncred) | optimize/clean up a few of the `table` changes | [#11076](https://github.com/nushell/nushell/pull/11076) | +| [@sophiajt](https://github.com/sophiajt) | Fix the output type for 'view files' | [#11077](https://github.com/nushell/nushell/pull/11077) | +| [@danielsomerfield](https://github.com/danielsomerfield) | Fix toolkit to run workspace on 'check pr' (issue #10906) | [#11112](https://github.com/nushell/nushell/pull/11112) | +| [@hustcer](https://github.com/hustcer) | Exit the release job if creating binary package failed | [#11145](https://github.com/nushell/nushell/pull/11145) | +| [@hustcer](https://github.com/hustcer) | Fix release and nightly build workflow | [#11146](https://github.com/nushell/nushell/pull/11146) | +| [@amtoine](https://github.com/amtoine) | fix the link to the `nu_scripts` in `std clip` deprecation | [#11150](https://github.com/nushell/nushell/pull/11150) | +| [@NotLebedev](https://github.com/NotLebedev) | Cp target expansion | [#11152](https://github.com/nushell/nushell/pull/11152) | +| [@MarikaChlebowska](https://github.com/MarikaChlebowska) | Add metadata to some filters | [#11160](https://github.com/nushell/nushell/pull/11160) | +| [@sholderbach](https://github.com/sholderbach) | Revert "Adding support for Polars structs" | [#11171](https://github.com/nushell/nushell/pull/11171) | +| [@sigoden](https://github.com/sigoden) | Fix spans passed to external_completer | [#11008](https://github.com/nushell/nushell/pull/11008) | +| [@nibon7](https://github.com/nibon7) | Add boundary check for str index-of | [#11190](https://github.com/nushell/nushell/pull/11190) | +| [@WindSoilder](https://github.com/WindSoilder) | When using redirection, if a command generates non-zero exit code, the script should stop running | [#11191](https://github.com/nushell/nushell/pull/11191) | +| [@nibon7](https://github.com/nibon7) | Fix span of invalid range | [#11207](https://github.com/nushell/nushell/pull/11207) | +| [@nibon7](https://github.com/nibon7) | Fix capacity overflow caused by large range of ports | [#11210](https://github.com/nushell/nushell/pull/11210) | +| [@IanManske](https://github.com/IanManske) | Fix `get -i` ignoring errors for only the first cellpath | [#11213](https://github.com/nushell/nushell/pull/11213) | +| [@dtolnay](https://github.com/dtolnay) | Fix `Option<&str> == Option<&String>` build error when using rust_decimal/rkyv feature | [#11205](https://github.com/nushell/nushell/pull/11205) | +| [@nibon7](https://github.com/nibon7) | Add checks for ports | [#11214](https://github.com/nushell/nushell/pull/11214) | +| [@ysthakur](https://github.com/ysthakur) | Fix highlighting of spread subexpressions in records | [#11202](https://github.com/nushell/nushell/pull/11202) | +| [@nibon7](https://github.com/nibon7) | Fix overlay_use_main_not_exported hanging when an external spam command exists | [#11261](https://github.com/nushell/nushell/pull/11261) | +| [@AucaCoyan](https://github.com/AucaCoyan) | :bug: Fixes markdown formatting on LSP hover | [#11253](https://github.com/nushell/nushell/pull/11253) | +| [@MarikaChlebowska](https://github.com/MarikaChlebowska) | Add more descriptive error message when passing list to from_csv | [#10962](https://github.com/nushell/nushell/pull/10962) | +| [@sophiajt](https://github.com/sophiajt) | Respect non-zero exit code in subexpressions and blocks | [#8984](https://github.com/nushell/nushell/pull/8984) | +| [@WindSoilder](https://github.com/WindSoilder) | Error on `use path item1 item2`, if item1 is not a module | [#11183](https://github.com/nushell/nushell/pull/11183) | +| [@KAAtheWiseGit](https://github.com/KAAtheWiseGit) | Match `++=` capabilities with `++` | [#11130](https://github.com/nushell/nushell/pull/11130) | +| [@fdncred](https://github.com/fdncred) | Add nu lib dirs default | [#11248](https://github.com/nushell/nushell/pull/11248) | + +#### Enhancing the documentation [[toc](#table-of-content)] + +Thanks to all the contributors below for helping us making the documentation of Nushell commands better :pray: +| author | description | url | +| ------------------------------------------------ | ---------------------------------------------------------------------------- | ------------------------------------------------------- | +| [@sholderbach](https://github.com/sholderbach) | Curate developer documentation in tree | [#11052](https://github.com/nushell/nushell/pull/11052) | +| [@IanManske](https://github.com/IanManske) | Build `nu-protocol` docs with all features enabled | [#11180](https://github.com/nushell/nushell/pull/11180) | +| [@poliorcetics](https://github.com/poliorcetics) | feat: Add default docs for aliases, generated from the command they point to | [#10825](https://github.com/nushell/nushell/pull/10825) | +| [@amtoine](https://github.com/amtoine) | fix `nu-std` README | [#11244](https://github.com/nushell/nushell/pull/11244) | + +#### Working on internals [[toc](#table-of-content)] + +Thanks to all the contributors below for working on internals of Nushell, such as refactoring the code :pray: +| author | description | url | +| ---------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------- | +| [@fdncred](https://github.com/fdncred) | bump rust-toolchain to 1.72.1 | [#11079](https://github.com/nushell/nushell/pull/11079) | +| [@nibon7](https://github.com/nibon7) | Apply nightly clippy fixes | [#11083](https://github.com/nushell/nushell/pull/11083) | +| [@drbrain](https://github.com/drbrain) | Convert ShellError::CommandNotFound to named fields | [#11094](https://github.com/nushell/nushell/pull/11094) | +| [@drbrain](https://github.com/drbrain) | Convert ShellError::NetworkFailure to named fields | [#11093](https://github.com/nushell/nushell/pull/11093) | +| [@drbrain](https://github.com/drbrain) | Add Argument::span() and Call::arguments_span() | [#10983](https://github.com/nushell/nushell/pull/10983) | +| [@IanManske](https://github.com/IanManske) | Refactor `Value` cell path functions to fix bugs | [#11066](https://github.com/nushell/nushell/pull/11066) | +| [@sholderbach](https://github.com/sholderbach) | Bump version to `0.87.2` | [#11114](https://github.com/nushell/nushell/pull/11114) | +| [@sholderbach](https://github.com/sholderbach) | Bump `procfs` to 0.16.0 | [#11115](https://github.com/nushell/nushell/pull/11115) | +| [@drbrain](https://github.com/drbrain) | Remove ShellError::FlagNotFound | [#11119](https://github.com/nushell/nushell/pull/11119) | +| [@drbrain](https://github.com/drbrain) | Convert ShellError::AliasNotFound to named fields | [#11118](https://github.com/nushell/nushell/pull/11118) | +| [@drbrain](https://github.com/drbrain) | Convert FileNotFound to named fields | [#11120](https://github.com/nushell/nushell/pull/11120) | +| [@hustcer](https://github.com/hustcer) | Upgrade Nu and script for release workflow | [#11121](https://github.com/nushell/nushell/pull/11121) | +| [@sholderbach](https://github.com/sholderbach) | Use record API in `describe --detailed` | [#11075](https://github.com/nushell/nushell/pull/11075) | +| [@drbrain](https://github.com/drbrain) | Convert FileNotFoundCustom to named fields | [#11123](https://github.com/nushell/nushell/pull/11123) | +| [@drbrain](https://github.com/drbrain) | Convert PluginFailedToLoad to named fields | [#11124](https://github.com/nushell/nushell/pull/11124) | +| [@drbrain](https://github.com/drbrain) | Convert PluginFailedToEncode to named fields | [#11125](https://github.com/nushell/nushell/pull/11125) | +| [@drbrain](https://github.com/drbrain) | Convert PluginFailedToDecode to named fields | [#11126](https://github.com/nushell/nushell/pull/11126) | +| [@sholderbach](https://github.com/sholderbach) | Move more commands to opaque `Record` type | [#11122](https://github.com/nushell/nushell/pull/11122) | +| [@rfaulhaber](https://github.com/rfaulhaber) | Bump `sysinfo` to 0.29.11 | [#11166](https://github.com/nushell/nushell/pull/11166) | +| [@drbrain](https://github.com/drbrain) | Convert more ShellError variants to named fields | [#11173](https://github.com/nushell/nushell/pull/11173) | +| [@WindSoilder](https://github.com/WindSoilder) | add echo_env_mixed testbin to reduce windows only tests | [#11172](https://github.com/nushell/nushell/pull/11172) | +| [@cosineblast](https://github.com/cosineblast) | Remove file I/O from tests that don't need it | [#11182](https://github.com/nushell/nushell/pull/11182) | +| [@drbrain](https://github.com/drbrain) | Convert more ShellError variants to named fields | [#11222](https://github.com/nushell/nushell/pull/11222) | +| [@nibon7](https://github.com/nibon7) | Explicitly indicate duplicate flags | [#11226](https://github.com/nushell/nushell/pull/11226) | +| [@ysthakur](https://github.com/ysthakur) | Reduce code duplication in eval.rs and eval_const.rs | [#11192](https://github.com/nushell/nushell/pull/11192) | +| [@ayax79](https://github.com/ayax79) | Upgrading to polars 0.35 | [#11241](https://github.com/nushell/nushell/pull/11241) | +| [@IanManske](https://github.com/IanManske) | Remove unnecessary boxing of `Stack::recursion_count` | [#11238](https://github.com/nushell/nushell/pull/11238) | +| [@schrieveslaach](https://github.com/schrieveslaach) | Upgrade lsp-server Dependency | [#11252](https://github.com/nushell/nushell/pull/11252) | +| [@drbrain](https://github.com/drbrain) | Convert `Shellerror::GenericError` to named fields | [#11230](https://github.com/nushell/nushell/pull/11230) | +| [@sholderbach](https://github.com/sholderbach) | Bump version to `0.87.1` | [#11056](https://github.com/nushell/nushell/pull/11056) | +| [@dead10ck](https://github.com/dead10ck) | Testing support tweaks: exit status in `Outcome` | [#10692](https://github.com/nushell/nushell/pull/10692) | +| [@nibon7](https://github.com/nibon7) | Simplify `clear` implementation | [#11273](https://github.com/nushell/nushell/pull/11273) | +| [@drbrain](https://github.com/drbrain) | Convert remainder of ShellError variants to named fields | [#11276](https://github.com/nushell/nushell/pull/11276) | + +### New _spread_ operator for list and record literals [[toc](#table-of-content)] + +[#10598](https://github.com/nushell/nushell/issues/10598) asked for a spread operator (`...`), and in [#11006](https://github.com/nushell/nushell/pull/11006) +and [#11144](https://github.com/nushell/nushell/pull/11144/), [@ysthakur](https://github.com/ysthakur/) implemented a spread operator in lists and records, respectively. +Spreading arguments to commands has not been implemented yet. + +The spread operator can help you avoid `append` in lists, e.g., this: + +```nu +let list = ["foo"] +[ + 1, + ...$list, + ...("foo" | split chars), + ...[3 9], + [] +] | to nuon +``` + +will give: + +```nu +[1, foo, f, o, o, 3, 9, []] +``` + +In records, it can help you avoid `merge`, e.g., this: + +```nu +let record = { a: "foo" } +{ + ...$record, + y: "bar", + ...{ z: 2 } +} | to nuon +``` + +will give: + +```nu +{a: foo, y: bar, z: 2} +``` + +You can spread variables, subexpressions, and either lists (inside list literals) or records (inside record literals). +Note that there needs to be no whitespace between the `...` and the expression being spread. + +### Passing boolean switches dynamically [[toc](#table-of-content)] + +In last release, a distinction has been introduced between switches, e.g. `--enable-feature`, and +boolean options, e.g. `--do-something: bool`. +The former is simply used as `--enable-feature` and the latter expects a value as +`--do-something false`. + +Up until now, this had the downside of disallowing one to pass boolean switches to inner calls of +commands. +An example would be two commands, `foo` and `bar`, which both have a `--switch` and where `foo` is +calling `bar` internally with the opposite switch. It would have to look something like + +```nu +def bar [--switch] { + print $"switch in bar: ($switch)" +} + +def foo [--switch] { + print $"switch in foo: ($switch)" + if $switch { + bar + } else { + bar --switch + } +} +``` + +or `bar` would have to take a boolean value instead of a switch, which would make the command less +nice to use as part of a public API... + +```nu +def bar [--switch: bool] { + print $"switch in bar: ($switch)" +} + +def foo [--switch] { + print $"switch in foo: ($switch)" + bar --switch (not $switch) +} +``` + +In this release and thanks to the work of [@WindSoilder](https://github.com/WindSoilder) in +[#11057](https://github.com/nushell/nushell/pull/11057), boolean switches can now be passed around. +This will simplify the code above and still preserve the nice signature of `bar` :partying: + +```nu +def bar [--switch] { + print $"switch in bar: ($switch)" +} + +def foo [--switch] { + print $"switch in foo: ($switch)" + bar --switch=(not $switch) +} +``` + +### Redirection to standard streams is getting better [[toc](#table-of-content)] + +Once again, [@WindSoilder](https://github.com/WindSoilder) has been working on the redirection +system of Nushell, fixing a bug and adding a new very nice feature: + +- [#10851](https://github.com/nushell/nushell/pull/10851): one pipeline output stream can be + redirected and the other one used as input to the rest of the pipe. + Given the following Bash script called `foo.sh` that outputs both to _stdout_ and _stderr_ + + ```sh + echo aaaaa + echo bbb 1>&2 + echo cc + ``` + + it is now possible to run the following command, redirecting `bbb` to a file and the rest + to the `lines | each { ... }` part of the pipeline: + + ```nu + bash test.sh err> err.txt | lines | each { str length} + ``` + + resulting in `[5, 2]` as expected and `bbb` inside `err.txt`. + +- [#10764](https://github.com/nushell/nushell/pull/10764): append to file with the `>>` syntax + instead of overwriting with `>` + + ```nu + (1 + 2 + 3) out> sum.txt + "\n" out>> sum.txt + (4 + 5 + 6) out>> sum.txt + ``` + + will create a file called `sum.txt` with the following content + + ```nu + 6 + 15 + ``` + +### One-time theming of tables is there [[toc](#table-of-content)] + +A common question and feature request from the community was: _how can i change the theme of Nushell +tables for just one command?_ + +Because of how Nushell works, the way to do that has been the following for a long time + +```nu +do { # use the scope of `do` to not alter the environment of the callee + $env.config.table.mode = "none" # set the theme + ls | table # call table to avoid just passing the value back to the callee and use the outside theme +} +``` + +In [#11058](https://github.com/nushell/nushell/pull/11058), [@zhiburt](https://github.com/zhiburt) +cracked the nut and added the long-wanted `table --theme` option. Below is a simple example: + +- let's define a table + +```nu +let table = ls | where type == dir | reject type +``` + +- and show it with a particular theme + +```nu +$table | table --theme ascii_rounded +``` + +```nu +.#--name----size-------modified------. +|0|assets |4.1 KB|2023-12-05 18:32:30| +|1|benches|4.1 KB|2023-12-09 22:33:44| +|2|crates |4.1 KB|2023-12-09 22:33:44| +|3|devdocs|4.1 KB|2023-12-09 22:33:44| +|4|docker |4.1 KB|2023-12-09 22:33:44| +|5|scripts|4.1 KB|2023-12-09 22:33:44| +|6|src |4.1 KB|2023-12-09 22:33:44| +|7|target |4.1 KB|2023-12-09 14:19:04| +|8|tests |4.1 KB|2023-12-05 18:32:30| +|9|wix |4.1 KB|2023-12-05 18:32:30| +'------------------------------------' +``` + +### Exposing name of script to the wild [[toc](#table-of-content)] + +Coming from languages such as Python and Bash, it's quite expected to be able to access the name of +the script itself the same way it's been called from the CLI: with `sys.argv[0]` in Python and `$0` +in Bash. + +This was not possible in Nushell until the work of [@p00f](https://github.com/p00f) in +[#11203](https://github.com/nushell/nushell/pull/11203). +This will expose to any script a new environment variable called `$env.PROCESS_PATH` and which will +contain precisely something akin to `argv[0]`! + +```nu +#!/usr/bin/env nu +# in demo.nu + +def main [] { + printf $"I was called as ($env.PROCESS_PATH)" +} +``` + +```nu +demo.nu # will show "I was called as demo.nu" +./demo.nu # will show "I was called as ./demo.nu" +/path/to/demo.nu # will show "I was called as /path/to/demo.nu" +``` + +### Parsing human-friendly dates into Nushell values [[toc](#table-of-content)] + +In [#11051](https://github.com/nushell/nushell/pull/11051), [@fdncred](https://github.com/fdncred) +added to `into datetime` the ability to parse _human readable_ dates into Nushell `datetime`. +This allows to write crazy things like + +```nu +"Now" | into datetime # same as `date now` +"A week ago" | into datetime # same as `(date now) - 1wk` +``` + +:::note +see the full list of examples with `into datetime --list-human` +::: + +### Show found externals via syntax highlighting in the [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) [[toc](#table-of-content)] + +We've added a new experimental feature that changes the syntax highlighting of text in the command position in the repl. Here's how it works. As you type, if a command is found with the current letter you've typed, the command will be highlighted according to your configuration of your color theme, specifically `shape_external_resolved`. As you keep typing, `which` fires to find out if the command is found or not. This allows you to know whether you've created a typo before you ever hit enter in the nushell repl. + +Since this might have a performance impact, we've put this behind a configuration point named `highlight_resolved_externals` in the config.nu file. Set it to `true` to enable this functionality and `false` to disable it. It defaults to `false`. + +Right now, with a dark theme, here's one way of configuring these colors, in the config.nu color theme, that showcases this funcitonality. Also, make sure you have `highlight_resolved_externals` set to `true`. + +```nu + shape_internalcall: cyan_bold # internal commands that are found will be this color + shape_external: darkorange # external "commands" that do not exist, will be this color + shape_external_resolved: light_yellow_bold # external commands that are found with `which`, will be this color +``` + +You can read more about it and see a gif in [#11135](https://github.com/nushell/nushell/pull/11135) where [@fdncred](https://github.com/fdncred) implemented the feature. + +### New "out of bound" error [[toc](#table-of-content)] + +[@nibon7](https://github.com/nibon7) introduces in +[#11201](https://github.com/nushell/nushell/pull/11201) a new error which is +pretty common to programming languages: the "out of bound" error. + +This will cause the following command to give an "out of bound" error: + +```nu +"foo" | str index-of '' --range 10..11 +``` + +### Details on the `0.87.1` hotfix release [[toc](#table-of-content)] + +In between the last `0.87.0` release and the one from today, there has been a quick hotfix release +to address two major bugs to two quite important filesystem commands: `rm` and `cp`. + +Below are some details about these two bug fixes: + +- [@IanManske](https://github.com/IanManske) fixed `rm` in + [#11064](https://github.com/nushell/nushell/pull/11064) which has + [trouble removing files after a `cd`](https://github.com/nushell/nushell/issues/11061) +- [@kubouch](https://github.com/kubouch) fixed a similar one about `cp` in + [#11080](https://github.com/nushell/nushell/pull/11080), addressing + [#10832](https://github.com/nushell/nushell/issues/10832) + +### Need help to wrap... commands? [[toc](#table-of-content)] + +In the previous release, the `extern-wrapped` command has been deprecated and it is +[now being removed](#removed-commands-toc). +An issue did persist though, making `def --wrapped` not a suitable replacement for the old command... +which was fixed in [#11235](https://github.com/nushell/nushell/pull/11235) by the changes from +[@KAAtheWiseGit](https://github.com/KAAtheWiseGit): `def --wrapped` commands won't create a help +page anymore, allowing to send `-h` and `--help` to other commands: + +```nu +def --wrapped foo [...rest] { echo $rest } +foo --help -h +``` + +will give no help page + +```nu +─┬────── +0│--help +1│-h +─┴────── +``` + +### Restricting use of internal variables [[toc](#table-of-content)] + +Nushell features some internal variables that users can't redeclare, i.e. `$nu`, `$env` and `$in`. +:::note +`$env` is the special of the three because one can mutate it with + +```nu +$env.FOO = "i'm foo" +``` + +but it is impossible to do `let env = 123` +::: + +However, up until now and the work of [@KAAtheWiseGit](https://github.com/KAAtheWiseGit) +in [#11169](https://github.com/nushell/nushell/pull/11169) and +[#11228](https://github.com/nushell/nushell/pull/11228), it was possible to redefined these variables +in command definition: the code would parse and run, but you would get the internal values instead of +the ones passed to the command, which is a nasty silent bug! +From now on, the following will give an error + +```nu +def foo [nu] { print $nu } +``` + +```nu +def bar [env] { print $env } +``` + +```nu +def baz [in] { print $in } +``` + +Also, because `$nu` and `$env` don't have spans by construction, i.e. they are not defined in any +script where a span would make sense but rather internally when Nushell starts, accessing their +`metadata` does not make sense. This release makes the error more helpful: + +```nu +metadata $env +``` + +```nu +Error: × Built-in variables `$env` and `$nu` have no metadata + ╭─[entry #1:1:1] + 1 │ metadata $env + · ──┬─ + · ╰── no metadata available + ╰──── +``` + +### A small update on the LSP [[toc](#table-of-content)] + +[@schrieveslaach](https://github.com/schrieveslaach) has been working again on the built-in LSP of +Nushell. +With [#10941](https://github.com/nushell/nushell/pull/10941), completions should get better with +this release :partying: + +### Our set of commands is evolving [[toc](#table-of-content)] + +As usual, new release rhymes with changes to commands! + +#### New commands [[toc](#table-of-content)] + +- `is-terminal` by [@drbrain](https://github.com/drbrain) in [#10970](https://github.com/nushell/nushell/pull/10970) +- `std null-device` by [@WindSoilder](https://github.com/WindSoilder) in [#11070](https://github.com/nushell/nushell/pull/11070) +- `mktemp` by [@tskinn](https://github.com/tskinn) in [#11005](https://github.com/nushell/nushell/pull/11005) +- `stor` by [@fdncred](https://github.com/fdncred) in [#11170](https://github.com/nushell/nushell/pull/11170) => see the [section below](#a-local-in-memory-database-with-stor) + +##### A local in-memory database with `stor` + +With this release we've implemented a new sqlite family of commands called `stor`. `stor` is meant to be short for "storing data in an in-memory sqlite database". That's right, this family of commands supports an _in-memory_ database. This in-memory database will be accessible as long as they share the same executable instance. A new instance is created with each new nushell instance and the in-memory database cannot be shared between instances. We're exited to see what new things you'll invent with this technology, although we still consider it in the experimental phase. Please feel free to submit PRs to make the usage of it better and more robust. There are examples of how to use each command [in the PR](https://github.com/nushell/nushell/pull/11170). + +Here the summary you get when you execute the `stor` command. + +```nu +Usage: + > stor + +Subcommands: + stor create - Create a table in the in-memory sqlite database + stor delete - Delete a table or specified rows in the in-memory sqlite database + stor export - Export the in-memory sqlite database to a sqlite database file + stor import - Import a sqlite database file into the in-memory sqlite database + stor insert - Insert information into a specified table in the in-memory sqlite database + stor open - Opens the in-memory sqlite database + stor reset - Reset the in-memory database by dropping all tables + stor update - Update information in a specified table in the in-memory sqlite database + +Flags: + -h, --help - Display the help message for this command + +Input/output types: + ╭─#─┬──input──┬─output─╮ + │ 0 │ nothing │ string │ + ╰───┴─────────┴────────╯ +``` + +#### Changes to existing commands [[toc](#table-of-content)] + +- thanks to [@KAAtheWiseGit](https://github.com/KAAtheWiseGit) in [#11195](https://github.com/nushell/nushell/pull/11195), `input list` will accept more input/output types +- the `list<string> -> string` I/O pair has been added to the `last` command by [@amtoine](https://github.com/amtoine) in [#11137](https://github.com/nushell/nushell/pull/11137) +- with the work of [@IanManske](https://github.com/IanManske) in [#11258](https://github.com/nushell/nushell/pull/11258), `insert`, `update` and `upsert` should now work more consistently with `list`s, e.g. + +```nu +[0, 2] | update 0 {|i| $i + 1 } # will give [1, 2] +[0, 1, 2] | insert 5 5 # will give "index too large" error +``` + +#### Deprecated commands [[toc](#table-of-content)] + +- `std clip` in [#11097](https://github.com/nushell/nushell/pull/11097): this command was handy but did not fit the [philosophy of the standard library](https://github.com/nushell/nushell/tree/main/crates/nu-std#--welcome-to-the-standard-library-of-nushell--) +- `std testing` in [#11151](https://github.com/nushell/nushell/pull/11151): even though in a VERY EARLY stage of its development, we would like to focus our efforts on the [Nupm](https://github.com/nushell/nupm) project and especially its simple `nupm test` command + +#### Removed commands [[toc](#table-of-content)] + +as part of the [deprecation plan of last release](https://www.nushell.sh/blog/2023-11-14-nushell_0_87_0#deprecated-commands-toc), +the following commands and options have been removed by [@amtoine](https://github.com/amtoine): + +- `extern-wrapped` and `export extern-wrapped` in favor of `def --wrapped` in [#11000](https://github.com/nushell/nushell/pull/11000) +- `--not` from `glob` in favor of `--exclude` in [#10839](https://github.com/nushell/nushell/pull/10839) +- `size` in favor of `str stats` in [#10784](https://github.com/nushell/nushell/pull/10784) +- `unfold` in favor of `generate` in [#10773](https://github.com/nushell/nushell/pull/10773) +- `def-env` and `export def-env` in favor of `def --env` in [#10999](https://github.com/nushell/nushell/pull/10999) + +## Breaking changes [[toc](#table-of-content)] + +- [#8984](https://github.com/nushell/nushell/pull/8984) Respect non-zero exit code in subexpressions and blocks + +Starting with this release, if a subexpression (eg `(echo foo.txt)`) or block (eg `if true { echo foo.txt }` evaluated to a non-zero exit code, it will no longer be lost and instead will be the exit code of that expression. This allows them to act more naturally when an external command fails. + +- [#11144](https://github.com/nushell/nushell/pull/11144) No longer allow `{a: 1, a: 2}` + +We now error if you repeat the same field name when creating a record, for example `{a: 1, a: 2}`. + +- [#10999](https://github.com/nushell/nushell/pull/10999) remove `def-env` and `export def-env` +- [#11000](https://github.com/nushell/nushell/pull/11000) remove `extern-wrapped` and `export extern-wrapped` + +We've removed the deprecated commands `def-env` and `export def-env`. Instead, use `def --env`. Likewise, we've done the same for `extern-wrapped` and `export extern-wrapped`. Instead, use `def --wrapped`. + +- [#10773](https://github.com/nushell/nushell/pull/10773) remove the `unfold` command + +We've renamed the previous `unfold` command. Instead, use the `generate` command. + +- [#10784](https://github.com/nushell/nushell/pull/10784) remove `size` command in favor of `str stats` + +We've also removed the `size` command, whch had an ambiguous name. Now, use `str stats` to get information about string content. + +- [#10839](https://github.com/nushell/nushell/pull/10839) remove `--not` from `glob` + +This releae replace the confusing `--not` flag of `glob` to instead be `glob --exclude`. + +- [#11058](https://github.com/nushell/nushell/pull/11058) nu-table/ Add `-t/theme` argument && Replace `-n/start-number` with `-i/index` + +To make how to update the table numbering more clear, we've replaced `table -n` with `table -i`/`table --index`. + +## Full changelog [[toc](#table-of-content)] + +### Nushell + +- [amtoine](https://github.com/amtoine) created + - [remove the `unfold` command](https://github.com/nushell/nushell/pull/10773) + - [remove `size` command in favor of `str stats`](https://github.com/nushell/nushell/pull/10784) + - [remove `--not` from `glob`](https://github.com/nushell/nushell/pull/10839) + - [remove `def-env` and `export def-env`](https://github.com/nushell/nushell/pull/10999) + - [remove `extern-wrapped` and `export extern-wrapped`](https://github.com/nushell/nushell/pull/11000) + - [deprecate `std clip`](https://github.com/nushell/nushell/pull/11097) + - [add `list<string> -> string` to `last`](https://github.com/nushell/nushell/pull/11137) + - [fix the link to the `nu_scripts` in `std clip` deprecation](https://github.com/nushell/nushell/pull/11150) + - [deprecate `std testing`](https://github.com/nushell/nushell/pull/11151) + - [fix `nu-std` README](https://github.com/nushell/nushell/pull/11244) + - [add `nothing -> table` to `format date`](https://github.com/nushell/nushell/pull/11290) +- [app/dependabot](https://github.com/app/dependabot) created + - [Bump winreg from 0.51.0 to 0.52.0](https://github.com/nushell/nushell/pull/11102) + - [Bump uuid from 1.5.0 to 1.6.0](https://github.com/nushell/nushell/pull/11104) + - [Bump ureq from 2.8.0 to 2.9.1](https://github.com/nushell/nushell/pull/11163) + - [Bump openssl from 0.10.59 to 0.10.60](https://github.com/nushell/nushell/pull/11176) + - [Bump actions-rust-lang/setup-rust-toolchain from 1.5.0 to 1.6.0](https://github.com/nushell/nushell/pull/11223) +- [AucaCoyan](https://github.com/AucaCoyan) created + - [:bug: Fixes markdown formatting on LSP hover](https://github.com/nushell/nushell/pull/11253) +- [ayax79](https://github.com/ayax79) created + - [Upgrading to polars 0.35](https://github.com/nushell/nushell/pull/11241) +- [cosineblast](https://github.com/cosineblast) created + - [Remove file I/O from tests that don't need it](https://github.com/nushell/nushell/pull/11182) +- [danielsomerfield](https://github.com/danielsomerfield) created + - [Fix toolkit to run workspace on 'check pr' (issue #10906)](https://github.com/nushell/nushell/pull/11112) +- [dead10ck](https://github.com/dead10ck) created + - [Testing support tweaks: exit status in `Outcome`](https://github.com/nushell/nushell/pull/10692) + - [into binary -c: return 0 as single byte](https://github.com/nushell/nushell/pull/11068) +- [drbrain](https://github.com/drbrain) created + - [Add is-terminal to determine if stdin/out/err are a terminal](https://github.com/nushell/nushell/pull/10970) + - [Add Argument::span() and Call::arguments_span()](https://github.com/nushell/nushell/pull/10983) + - [Convert ShellError::NetworkFailure to named fields](https://github.com/nushell/nushell/pull/11093) + - [Convert ShellError::CommandNotFound to named fields](https://github.com/nushell/nushell/pull/11094) + - [Convert ShellError::AliasNotFound to named fields](https://github.com/nushell/nushell/pull/11118) + - [Remove ShellError::FlagNotFound](https://github.com/nushell/nushell/pull/11119) + - [Convert FileNotFound to named fields](https://github.com/nushell/nushell/pull/11120) + - [Convert FileNotFoundCustom to named fields](https://github.com/nushell/nushell/pull/11123) + - [Convert PluginFailedToLoad to named fields](https://github.com/nushell/nushell/pull/11124) + - [Convert PluginFailedToEncode to named fields](https://github.com/nushell/nushell/pull/11125) + - [Convert PluginFailedToDecode to named fields](https://github.com/nushell/nushell/pull/11126) + - [Convert more ShellError variants to named fields](https://github.com/nushell/nushell/pull/11173) + - [Convert more ShellError variants to named fields](https://github.com/nushell/nushell/pull/11222) + - [Convert `Shellerror::GenericError` to named fields](https://github.com/nushell/nushell/pull/11230) + - [Convert remainder of ShellError variants to named fields](https://github.com/nushell/nushell/pull/11276) + - [Ensure that command usage starts uppercase and ends period](https://github.com/nushell/nushell/pull/11278) +- [dtolnay](https://github.com/dtolnay) created + - [Fix `Option<&str> == Option<&String>` build error when using rust_decimal/rkyv feature](https://github.com/nushell/nushell/pull/11205) +- [fdncred](https://github.com/fdncred) created + - [allow parsing of human readable datetimes](https://github.com/nushell/nushell/pull/11051) + - [tweak `table` example/parameter text](https://github.com/nushell/nushell/pull/11071) + - [add "default" table theme](https://github.com/nushell/nushell/pull/11072) + - [correct table example syntax](https://github.com/nushell/nushell/pull/11074) + - [optimize/clean up a few of the `table` changes](https://github.com/nushell/nushell/pull/11076) + - [bump rust-toolchain to 1.72.1](https://github.com/nushell/nushell/pull/11079) + - [add shape `ExternalResolved` to show found externals via syntax highlighting in the repl](https://github.com/nushell/nushell/pull/11135) + - [Add `stor` family of commands](https://github.com/nushell/nushell/pull/11170) + - [add some tests for `stor create`](https://github.com/nushell/nushell/pull/11194) + - [Add nu lib dirs default](https://github.com/nushell/nushell/pull/11248) +- [hustcer](https://github.com/hustcer) created + - [Upgrade Nu and script for release workflow](https://github.com/nushell/nushell/pull/11121) + - [Exit the release job if creating binary package failed](https://github.com/nushell/nushell/pull/11145) + - [Fix release and nightly build workflow](https://github.com/nushell/nushell/pull/11146) +- [IanManske](https://github.com/IanManske) created + - [Fix `rm` path handling](https://github.com/nushell/nushell/pull/11064) + - [Refactor `Value` cell path functions to fix bugs](https://github.com/nushell/nushell/pull/11066) + - [Build `nu-protocol` docs with all features enabled](https://github.com/nushell/nushell/pull/11180) + - [Fix `get -i` ignoring errors for only the first cellpath](https://github.com/nushell/nushell/pull/11213) + - [Remove unnecessary boxing of `Stack::recursion_count`](https://github.com/nushell/nushell/pull/11238) + - [Fix replacement closures for `update`, `insert`, and `upsert`](https://github.com/nushell/nushell/pull/11258) +- [KAAtheWiseGit](https://github.com/KAAtheWiseGit) created + - [Match `++=` capabilities with `++`](https://github.com/nushell/nushell/pull/11130) + - [Forbid reserved variable names for function arguments](https://github.com/nushell/nushell/pull/11169) + - [Allow more types for `input list`](https://github.com/nushell/nushell/pull/11195) + - [Add special error for calling `metadata` on $env and $nu](https://github.com/nushell/nushell/pull/11228) + - [Do not create help for wrapped command](https://github.com/nushell/nushell/pull/11235) +- [kubouch](https://github.com/kubouch) created + - [Send only absolute paths to uu_cp](https://github.com/nushell/nushell/pull/11080) +- [MarikaChlebowska](https://github.com/MarikaChlebowska) created + - [Add more descriptive error message when passing list to from_csv](https://github.com/nushell/nushell/pull/10962) + - [Add metadata to some filters](https://github.com/nushell/nushell/pull/11160) +- [nibon7](https://github.com/nibon7) created + - [Apply nightly clippy fixes](https://github.com/nushell/nushell/pull/11083) + - [Add boundary check for str index-of](https://github.com/nushell/nushell/pull/11190) + - [Add OutOfBounds error](https://github.com/nushell/nushell/pull/11201) + - [Fix span of invalid range](https://github.com/nushell/nushell/pull/11207) + - [Fix capacity overflow caused by large range of ports](https://github.com/nushell/nushell/pull/11210) + - [Add checks for ports](https://github.com/nushell/nushell/pull/11214) + - [Explicitly indicate duplicate flags](https://github.com/nushell/nushell/pull/11226) + - [Fix overlay_use_main_not_exported hanging when an external spam command exists](https://github.com/nushell/nushell/pull/11261) + - [Simplify `clear` implementation](https://github.com/nushell/nushell/pull/11273) +- [NotLebedev](https://github.com/NotLebedev) created + - [Cp target expansion](https://github.com/nushell/nushell/pull/11152) +- [p00f](https://github.com/p00f) created + - [expose argv[0] as `$env.PROCESS_PATH`](https://github.com/nushell/nushell/pull/11203) +- [poliorcetics](https://github.com/poliorcetics) created + - [feat: Add default docs for aliases, generated from the command they point to](https://github.com/nushell/nushell/pull/10825) +- [rfaulhaber](https://github.com/rfaulhaber) created + - [Bump `sysinfo` to 0.29.11](https://github.com/nushell/nushell/pull/11166) +- [schrieveslaach](https://github.com/schrieveslaach) created + - [Implement LSP Text Document Synchronization](https://github.com/nushell/nushell/pull/10941) + - [Upgrade lsp-server Dependency](https://github.com/nushell/nushell/pull/11252) +- [sholderbach](https://github.com/sholderbach) created + - [Bump version for `0.87.0` release](https://github.com/nushell/nushell/pull/11031) + - [Move to clearer reedline keyboard enhancement API](https://github.com/nushell/nushell/pull/11045) + - [Curate developer documentation in tree](https://github.com/nushell/nushell/pull/11052) + - [Pin reedline to 0.26 release](https://github.com/nushell/nushell/pull/11053) + - [Bump version to `0.87.1`](https://github.com/nushell/nushell/pull/11056) + - [Use record API in `describe --detailed`](https://github.com/nushell/nushell/pull/11075) + - [Bump version to `0.87.2`](https://github.com/nushell/nushell/pull/11114) + - [Bump `procfs` to 0.16.0](https://github.com/nushell/nushell/pull/11115) + - [Move more commands to opaque `Record` type](https://github.com/nushell/nushell/pull/11122) + - [Revert "Adding support for Polars structs"](https://github.com/nushell/nushell/pull/11171) +- [sigoden](https://github.com/sigoden) created + - [Fix spans passed to external_completer](https://github.com/nushell/nushell/pull/11008) +- [sophiajt](https://github.com/sophiajt) created + - [Respect non-zero exit code in subexpressions and blocks](https://github.com/nushell/nushell/pull/8984) + - [Fix the output type for 'view files'](https://github.com/nushell/nushell/pull/11077) +- [tskinn](https://github.com/tskinn) created + - [Add `mktemp` command](https://github.com/nushell/nushell/pull/11005) +- [WindSoilder](https://github.com/WindSoilder) created + - [Support `o>>`, `e>>`, `o+e>>` to append output to an external file](https://github.com/nushell/nushell/pull/10764) + - [Redirect: support redirect stderr with piping stdout to next commands.](https://github.com/nushell/nushell/pull/10851) + - [fix custom command's default value](https://github.com/nushell/nushell/pull/11043) + - [enable to pass switch values dynamically](https://github.com/nushell/nushell/pull/11057) + - [std: add cross platform null-device name](https://github.com/nushell/nushell/pull/11070) + - [add echo_env_mixed testbin to reduce windows only tests](https://github.com/nushell/nushell/pull/11172) + - [Error on `use path item1 item2`, if item1 is not a module](https://github.com/nushell/nushell/pull/11183) + - [When using redirection, if a command generates non-zero exit code, the script should stop running](https://github.com/nushell/nushell/pull/11191) +- [ysthakur](https://github.com/ysthakur) created + - [Spread operator for list literals](https://github.com/nushell/nushell/pull/11006) + - [Spread operator in record literals](https://github.com/nushell/nushell/pull/11144) + - [Reduce code duplication in eval.rs and eval_const.rs](https://github.com/nushell/nushell/pull/11192) + - [Fix highlighting of spread subexpressions in records](https://github.com/nushell/nushell/pull/11202) +- [zhiburt](https://github.com/zhiburt) created + - [Fix #11047](https://github.com/nushell/nushell/pull/11054) + - [nu-table/ Add `-t/theme` argument && Replace `-n/start-number` with `-i/index`](https://github.com/nushell/nushell/pull/11058) + +### Extension + +- [glcraft](https://github.com/glcraft) created + - [Syntax highlight: add "export" to "module"](https://github.com/nushell/vscode-nushell-lang/pull/166) + - [Improve type parsing in function def](https://github.com/nushell/vscode-nushell-lang/pull/167) + - [Textmate improvements](https://github.com/nushell/vscode-nushell-lang/pull/168) + - [Textmate: improvement on record entries and closure](https://github.com/nushell/vscode-nushell-lang/pull/169) + +### Documentation + +- [132ikl](https://github.com/132ikl) created + - [Add a snippet to suggest using the ? operator for environmental variables](https://github.com/nushell/nushell.github.io/pull/1142) +- [amtoine](https://github.com/amtoine) created + - [Release notes for `0.87.0`](https://github.com/nushell/nushell.github.io/pull/1114) +- [app/dependabot](https://github.com/app/dependabot) created + - [Bump vite from 4.4.9 to 4.4.12](https://github.com/nushell/nushell.github.io/pull/1165) +- [app/github-actions](https://github.com/app/github-actions) created + - [Compressed Images](https://github.com/nushell/nushell.github.io/pull/1147) +- [arnau](https://github.com/arnau) created + - [Add a cookbook comparing jq and nushell](https://github.com/nushell/nushell.github.io/pull/1150) + - [Unifies all cookbook codeblocks to use the same style.](https://github.com/nushell/nushell.github.io/pull/1151) + - [Rename def-env to def --env](https://github.com/nushell/nushell.github.io/pull/1155) +- [CAESIUS-TIM](https://github.com/CAESIUS-TIM) created + - [:memo: Replace `decimal` with `float`](https://github.com/nushell/nushell.github.io/pull/1161) + - [[zh-CN] Update README, and Getting Started (入门篇)](https://github.com/nushell/nushell.github.io/pull/1168) +- [FMotalleb](https://github.com/FMotalleb) created + - [Update coming_from_bash.md](https://github.com/nushell/nushell.github.io/pull/1158) +- [Hofer-Julian](https://github.com/Hofer-Julian) created + - [Fix jq comparison](https://github.com/nushell/nushell.github.io/pull/1162) +- [hustcer](https://github.com/hustcer) created + - [Refresh command docs for Nu v0.87](https://github.com/nushell/nushell.github.io/pull/1144) +- [KAAtheWiseGit](https://github.com/KAAtheWiseGit) created + - [Fix append to mutable variable operator](https://github.com/nushell/nushell.github.io/pull/1164) +- [Ktoks](https://github.com/Ktoks) created + - [Update creating_errors.md](https://github.com/nushell/nushell.github.io/pull/1154) +- [MarikaChlebowska](https://github.com/MarikaChlebowska) created + - [Replace usage of removed `date format` with `format date` in examples](https://github.com/nushell/nushell.github.io/pull/1157) +- [ppenguin](https://github.com/ppenguin) created + - [Add `parse` examples to _Parsing_](https://github.com/nushell/nushell.github.io/pull/1152) +- [sholderbach](https://github.com/sholderbach) created + - [Clean up contributor book](https://github.com/nushell/nushell.github.io/pull/1153) +- [sophiajt](https://github.com/sophiajt) created + - [Add 2023 survey results](https://github.com/nushell/nushell.github.io/pull/1143) +- [stfacc](https://github.com/stfacc) created + - [Improve workaround for carapace ERR output](https://github.com/nushell/nushell.github.io/pull/1159) +- [ysthakur](https://github.com/ysthakur) created + - [Add section on spread operator](https://github.com/nushell/nushell.github.io/pull/1160) + +### Nu_Scripts + +- [Abdillah](https://github.com/Abdillah) created + - [completions/git: fix support for path relative to current directory](https://github.com/nushell/nu_scripts/pull/666) +- [amtoine](https://github.com/amtoine) created + - [add a "bulk rename" command to the stdlib candidates](https://github.com/nushell/nu_scripts/pull/643) + - [add missing tasks to the release note PR](https://github.com/nushell/nu_scripts/pull/665) + - [add `clip` from standard library](https://github.com/nushell/nu_scripts/pull/674) +- [AucaCoyan](https://github.com/AucaCoyan) created + - [:sparkles: Add `rustup` completions](https://github.com/nushell/nu_scripts/pull/689) + - [Add rustup completions](https://github.com/nushell/nu_scripts/pull/690) + - [:sparkles: Add `pnpm` completions](https://github.com/nushell/nu_scripts/pull/692) +- [drbrain](https://github.com/drbrain) created + - [Improve git branch cleanup script](https://github.com/nushell/nu_scripts/pull/685) +- [Euphrasiologist](https://github.com/Euphrasiologist) created + - [Create basic-git.nu](https://github.com/nushell/nu_scripts/pull/687) + - [Adding the `A` case](https://github.com/nushell/nu_scripts/pull/688) +- [fj0r](https://github.com/fj0r) created + - [cwdhist: can place the path anywhere in the buffer](https://github.com/nushell/nu_scripts/pull/669) + - [rename `cmd parse` to `argx` to improve importing](https://github.com/nushell/nu_scripts/pull/671) + - [nu-complete kube deploys and pods](https://github.com/nushell/nu_scripts/pull/682) + - [generate completions from tree-shaped data](https://github.com/nushell/nu_scripts/pull/683) + - [container-create -w: mount $env.PWD as workdir](https://github.com/nushell/nu_scripts/pull/686) +- [fnuttens](https://github.com/fnuttens) created + - [Add bat aliases](https://github.com/nushell/nu_scripts/pull/678) +- [glcraft](https://github.com/glcraft) created + - [Add `record` module](https://github.com/nushell/nu_scripts/pull/679) +- [kjelly](https://github.com/kjelly) created + - [get deploy complete for ka/kl in kubernetes module](https://github.com/nushell/nu_scripts/pull/680) +- [RGBCube](https://github.com/RGBCube) created + - [Fix typo in bat aliases](https://github.com/nushell/nu_scripts/pull/684) +- [sholderbach](https://github.com/sholderbach) created + - [Change uses of `size` to `str stats`](https://github.com/nushell/nu_scripts/pull/647) + - [Change `nu-deps` script to not care about waves](https://github.com/nushell/nu_scripts/pull/667) + - [Update `nu_release.nu` for 0.87 release](https://github.com/nushell/nu_scripts/pull/668) +- [WindSoilder](https://github.com/WindSoilder) created + - [remove null-stream](https://github.com/nushell/nu_scripts/pull/670) + - [Using def --env instead of def-env](https://github.com/nushell/nu_scripts/pull/673) + +### Reedline + +- [ClementNerma](https://github.com/ClementNerma) created + - [Allow to construct ReedlineError values from the outside](https://github.com/nushell/reedline/pull/676) + - [Allow to build HistoryItemId values from the outside](https://github.com/nushell/reedline/pull/677) + - [ Make history-related items (de-)serializable](https://github.com/nushell/reedline/pull/678) +- [crides](https://github.com/crides) created + - [vi mode: map `cw`/`cW` to `ce`/`cE` by default](https://github.com/nushell/reedline/pull/668) +- [Hofer-Julian](https://github.com/Hofer-Julian) created + - [Also run clippy on examples](https://github.com/nushell/reedline/pull/666) +- [sholderbach](https://github.com/sholderbach) created + - [Properly handle optional event modes](https://github.com/nushell/reedline/pull/659) + - [Bump version for `0.26.0` release](https://github.com/nushell/reedline/pull/664) + - [Build docs.rs docs with all features](https://github.com/nushell/reedline/pull/672) diff --git a/blog/2023-12-21-logo-contest.md b/src/content/docs/blog/2023-12-21-logo-contest.md similarity index 84% rename from blog/2023-12-21-logo-contest.md rename to src/content/docs/blog/2023-12-21-logo-contest.md index 92dae13d0d8..e9f48240c4c 100644 --- a/blog/2023-12-21-logo-contest.md +++ b/src/content/docs/blog/2023-12-21-logo-contest.md @@ -3,10 +3,9 @@ title: Who's got talent? author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: "We are looking for a logo and a mascot: WE NEED YOU!" +description: "We are looking for a logo and a mascot: WE NEED YOU!" --- -## Who's got talent? Quite often the community asks us what the logo and the mascot of Nushell are. Unfortunately, as of today, we do not have a fully satisfying and official answer to this :open_mouth: @@ -22,6 +21,7 @@ However, as Nushell is becoming more popular and mature, we would like to have an official stamped brand for this project we love. Thus... ### We need a logo and a mascot :) + For this and to reflect as best as we can our community, we would like to get YOU involved in this endeavour :smirk: @@ -33,13 +33,14 @@ Let us explain the rules, what you'll be asked exactly, how to submit your work and how all this will unfold :yum: ## Rules + - there is one theme to follow: _your logo or mascot should evoke the idea of - Nushell_ + Nushell_ - your submitted files should be in the SVG format - any offensive or out-of-topic content will obviously be removed during the - preselection + preselection -::: warning IMPORTANT NOTE: On the use of generative algorithms +:::caution[IMPORTANT NOTE: On the use of generative algorithms] Because we (as in the Nushell project) want to fully own the logo and mascot of Nushell, we want to have a certain level of confidence in the fact that you are indeed the author of the artworks you submit and thus are able to fully, and @@ -58,36 +59,41 @@ Thanks for your understanding :innocent: ::: ### Some ideas + Here are some ideas for what we might consider as a good fit for Nushell, following the themes detailed above: + - Ellie the friendly and yet powerful mascot -<img src="../assets/images/logo-contest/ellie-mascot.png" alt="ellie-mascot" width="200"> +<img src="/assets/images/logo-contest/ellie-mascot.png" alt="ellie-mascot" width="200"> - a minimalist font-like logo, featuring "nu" and an abstract elephant -<img src="../assets/images/logo-contest/font-logo.png" alt="font-logo" width="200"> +<img src="/assets/images/logo-contest/font-logo.png" alt="font-logo" width="200"> - a blue and friendly shell mascot -<img src="../assets/images/logo-contest/shell-mascot.png" alt="shell-mascot" width="200"> +<img src="/assets/images/logo-contest/shell-mascot.png" alt="shell-mascot" width="200"> ## Submissions + In order to submit your work, please follow the instructions below: + - send an email to [the.nushell@gmail.com](mailto:the.nushell@gmail.com) - it should contain your Discord name so that we can contact you easily - your creations should be called `logo.svg` and `mascot.svg` - you can submit any number of images, as long as we can clearly know which ones are logos or mascots :wink: ## Course of events + Below are the four main phases of this event: -| phase | start (from 0AM) | deadline (to 12PM) | +| phase | start (from 0AM) | deadline (to 12PM) | | -------------- | ---------------- | ------------------ | -| _submission_ | now | **2024-01-31** | -| _preselection_ | 2024-02-01 | **2024-02-14** | -| _vote_ | 2024-02-15 | **2024-02-29** | +| _submission_ | now | **2024-01-31** | +| _preselection_ | 2024-02-01 | **2024-02-14** | +| _vote_ | 2024-02-15 | **2024-02-29** | -::: tip Note +:::note precise dates might change at some point, e.g. if submissions keep coming even close to the submission deadline. @@ -96,7 +102,7 @@ you'll be the first to be updated on that! The results and the _winners_ will be announced shortly in March 2024. -::: tip Note +:::note details on the vote will be given in due time, but will likely happen either on Discord and/or with a _Google Form_ ::: diff --git a/src/content/docs/blog/2024-01-09-nushell_0_89_0.md b/src/content/docs/blog/2024-01-09-nushell_0_89_0.md new file mode 100644 index 00000000000..7dec94238f5 --- /dev/null +++ b/src/content/docs/blog/2024-01-09-nushell_0_89_0.md @@ -0,0 +1,443 @@ +--- +title: Nushell 0.89.0 +author: The Nu Authors +author_site: https://twitter.com/nu_shell +author_image: https://www.nushell.sh/blog/images/nu_logo.png +description: Today, we're releasing version 0.89.0 of Nu. This release adds spreading of argument lists to command calls, better editor integration, and many bugfixes. +--- + +<!-- TODO: complete the excerpt above --> + +Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. + +<!-- TODO: write this excerpt --> + +Today, we're releasing version 0.89.0 of Nu. This release adds spreading of argument lists to command calls, better editor integration, and many bugfixes. + +## Where to get it + +Nu 0.89.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.89.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. + +:::note +The optional dataframe functionality is available by `cargo install nu --features=dataframe`. +::: + +As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. + + <!-- TODO: please add links to the other sections here + + the following command should help pre-generate a great deal of the table of content. + be careful with the format and false-positives :wink: + ```nu + const TOC_MARKER = "[[toc](#table-of-content)]" + rg '^#+ ' blog/... + | lines + | where ($it | str ends-with $" ($TOC_MARKER)") + | str replace $" ($TOC_MARKER)" '' + | each { + str replace '# ' '- ' + | str replace --all '#' ' ' + | str replace --regex '- (.*)' '- [*$1*](#$1-toc)' + } + | to text + ``` + --> + +- [_Breaking changes_](#breaking-changes-toc) +- [_Full changelog_](#full-changelog-toc) + +## Themes of this release / New features [[toc](#table-of-content)] + +<!-- NOTE: if you wanna write a section about a breaking change, when it's a very important one, + please add the following snippet to have a "warning" banner :) + > see [an example](https://www.nushell.sh/blog/2023-09-19-nushell_0_85_0#pythonesque-operators-removal) + + ```md + :::caution[Breaking change] + See a full overview of the [breaking changes](#breaking-changes) + ::: + ``` +--> +<!-- NOTE: see https://vuepress.github.io/reference/default-theme/markdown#custom-containers + for the list of available *containers* +--> + +### (Update 19.01.2024, Breaking change!) Removal of directory module auto-exports [[toc](#table-of-content)] + +_Release note gremlin hid this note from us and we forgot to add it. We're sorry!_ + +[@amtoine](https://github.com/amtoine) in [#11157](https://github.com/nushell/nushell/pull/11157) removed the directory module autoexport of all .nu files inside the directory. This removes the ability to "dump .nu files into a directory" and have them automatically exported. Previously, if you had the following file structure: + +```nu +spam +├── bar.nu +├── baz.nu +├── foo.nu +└── mod.nu +``` + +all you had to do was to call `use spam` and the `.nu` files would be added as submodules of `spam`. Now, to achieve the same effect, you would need to put + +```nu +export module foo.nu +export module bar.nu +export module baz.nu +``` + +to the `mod.nu`. + +This change adds one manual step you need to perform to export submodules from modules, but it gives you more control and confidence. In the previous system, .nu files would be auto-exported _even if you didn't want to_! For example, to prevent `baz.nu` from being auto-exported, you would need to put it inside a new directory that doesn't contain `mod.nu` (and thus is not considered a Nushell module), like this: + +```nu +spam +├── bar.nu +├── foo.nu +└── utils + └── baz.nu +``` + +We felt like this workaround was quite cumbersome, and the implicit behavior wasn't in the disciplined spirit of Nushell. Rather than having this auto-exporting as an _implicit_ feature of `use`, we're currently exploring ways to allow doing it _explicitly_, for example with a separate command. + +### Spread operator for commands + +In [#11289](https://github.com/nushell/nushell/pull/11289), [@ysthakur](https://github.com/ysthakur/) +implemented a spread operator for calling commands (previously, it could only be used in list and record literals). + +Now, if you have a command with a rest parameter: + +```nu +def foo [ ...args ] { $args | to nuon } +``` + +You can spread arguments to it like this: + +```nu +> let x = [foo bar baz] +> foo ...[1 2] ...$x +[1, 2, foo, bar, baz] +``` + +See [the docs](/book/operators#spread-operator) for more information. + +### Editor Improvements + +Thanks to @AucaCoyan's [#11284](https://github.com/nushell/nushell/pull/11284) and [#11320](https://github.com/nushell/nushell/pull/11320), Nushell's VSCode extension and builtin LSP server now show the same command's message on hover as abtained with `help` in Nushell. + +### Deprecation of `--flag: bool` + +In the last release, we allowed passing flags dynamically: + +```nu +def spam [--foo] { + print $foo +} + +let value = false +spam --foo=$value +# prints false +``` + +However, it is easy to confuse with `--foo: bool`. To disambiguate, we are deprecating the setting optional parameters with boolean type (`--flag: bool`). Doing so will trigger a warning: + +```nu +def spam [--foo: bool] { $foo } +Error: × Deprecated: --flag: bool + ╭─[entry #3:1:1] + 1 │ def spam [--foo: bool] { $foo } + · ──┬─ + · ╰── `--flag: bool` is deprecated and will be removed in 0.90. Please use `--flag` instead, more info: https://www.nushell.sh/book/custom_commands.html + ╰──── +``` + +### Our set of commands is evolving [[toc](#table-of-content)] + +As usual, new release rhyms with changes to commands! + +#### New commands [[toc](#table-of-content)] + +##### `ulimit` for Unix-based systems + +The new `ulimit` command added by [@nibon7](https://github.com/nushell/nushell/pull/11324) can now be used on Unix-based systems for setting or checking the resource limits, such as the stack size or virtual memory size, for the current user. + +To list the currrent limits: + +```nu +ulimit -a +``` + +Setting the limits is done via flags available in `help ulimit`. + +<!-- NOTE: to start investigating the contributions of last release, i like to list them all in a raw table. + to achieve this, one can use the [`list-merged-prs` script from `nu_scripts`](https://github.com/nushell/nu_scripts/blob/main/make_release/release-note/list-merged-prs) + as follows: + + ```nu + use ./make_release/release-note/list-merged-prs + + const LAST_RELEASE = null + + let matching_releases = ^gh api /repos/nushell/nushell/releases + | from json + | where tag_name == $LAST_RELEASE + + match ($matching_releases | length) { + 0 => { + error make --unspanned { msg: "no matching releases... did you set the last release?" } + }, + 1 => {}, + _ => { + error make --unspanned { msg: $"too many matching releases... is ($LAST_RELEASE) correct?" } + }, + } + + let last_release_date = $matching_releases | into record | get published_at | into datetime + + let prs = list-merged-prs nushell/nushell $last_release_date + | where author != "app/dependabot" + | sort-by mergedAt + | update url {|it| $"[#($it.number)]\(($it.url)\)" } + | update author { $"[@($in)]\(https://github.com/($in)\)" } + | select author title url + | rename --column {url: pr} + + $prs | to md --pretty + ``` +--> + +## Breaking changes [[toc](#table-of-content)] + +<!-- TODO: + paste the output of + ```nu + ./make_release/release-note/list-merged-prs nushell/nushell --label breaking-change --pretty --no-author + ``` + here +--> + +- [#11131](https://github.com/nushell/nushell/pull/11131) remove `std clip` +- [#11414](https://github.com/nushell/nushell/pull/11414) Lock out new direct construction of `Record` +- [#11367](https://github.com/nushell/nushell/pull/11367) Remove `Expr::MatchPattern` +- [#11355](https://github.com/nushell/nushell/pull/11355) Rename extra's `format` to `format pattern` +- [#11356](https://github.com/nushell/nushell/pull/11356) Remove `Value::MatchPattern` +- [#11313](https://github.com/nushell/nushell/pull/11313) Bubble up errors passed to `complete` +- [#11157](https://github.com/nushell/nushell/pull/11157) disable directory submodule auto export + +## Full changelog [[toc](#table-of-content)] + +<!-- TODO: + paste the output of + ```nu + ./make_release/release-note/get-full-changelog + ``` + here +--> + +### Nushell + +- [amtoine](https://github.com/amtoine) created + - [remove `std clip`](https://github.com/nushell/nushell/pull/11131) + - [improve completions of `use` and `overlay use`](https://github.com/nushell/nushell/pull/11330) + - [disable directory submodule auto export](https://github.com/nushell/nushell/pull/11157) +- [abusch](https://github.com/abusch) created + - [fix: closure captures can also be constants](https://github.com/nushell/nushell/pull/11493) +- [WindSoilder](https://github.com/WindSoilder) created + - [update reedline version to latest main](https://github.com/nushell/nushell/pull/11490) + - [Deprecate `--flag: bool` in custom command](https://github.com/nushell/nushell/pull/11365) + - [enable flag value type checking](https://github.com/nushell/nushell/pull/11311) + - [Fix piping output logic](https://github.com/nushell/nushell/pull/11317) +- [NotLebedev](https://github.com/NotLebedev) created + - [Xml errors fix](https://github.com/nushell/nushell/pull/11487) +- [nibon7](https://github.com/nibon7) created + - [Bump terminal_size to 0.3](https://github.com/nushell/nushell/pull/11486) + - [Fix cross building for target x86_64-pc-windows-gnu on linux](https://github.com/nushell/nushell/pull/11485) + - [Bump sysinfo from 0.29 to 0.30](https://github.com/nushell/nushell/pull/11484) + - [Replace `winapi` with `windows`](https://github.com/nushell/nushell/pull/11481) + - [Don't panic when `http_client` fails](https://github.com/nushell/nushell/pull/11422) + - [Don't create a thread if stderr_stream is None](https://github.com/nushell/nushell/pull/11421) + - [Fix an infinite loop if the input stream and output stream are the same](https://github.com/nushell/nushell/pull/11384) + - [Bump windows from 0.48.0 to 0.52.0 ](https://github.com/nushell/nushell/pull/11325) + - [Fix build for BSDs](https://github.com/nushell/nushell/pull/11372) + - [Allow `filesize` type as a valid limit value](https://github.com/nushell/nushell/pull/11349) + - [Allow `int` type as a valid limit value](https://github.com/nushell/nushell/pull/11346) + - [Add ulimit command](https://github.com/nushell/nushell/pull/11324) +- [yukitomoda](https://github.com/yukitomoda) created + - [Refactor tests (using cococo instead of ^echo)](https://github.com/nushell/nushell/pull/11479) + - [Fix the test which fails on windows](https://github.com/nushell/nushell/pull/11478) + - [Fix rm for symlinks pointing to directory on windows (issue #11461)](https://github.com/nushell/nushell/pull/11463) +- [hustcer](https://github.com/hustcer) created + - [Try to fix riscv64 building by using unbuntu-latest](https://github.com/nushell/nushell/pull/11476) + - [Downgrade openssl-src to fix riscv64 build target, close #11345](https://github.com/nushell/nushell/pull/11353) +- [rsteube](https://github.com/rsteube) created + - [Revert "Return external file completions if not empty (#10898)"](https://github.com/nushell/nushell/pull/11446) +- [fdncred](https://github.com/fdncred) created + - [bump rust toolchain to 1.73.0](https://github.com/nushell/nushell/pull/11445) + - [Revert "Bump reedline development version"](https://github.com/nushell/nushell/pull/11425) + - [add special emoji handling for debug --raw](https://github.com/nushell/nushell/pull/11368) + - [Revert "Only run $env.PROMPT_COMMAND once per prompt"](https://github.com/nushell/nushell/pull/11340) + - [update reedline to latest + include PR 675 for testing](https://github.com/nushell/nushell/pull/11339) +- [ysthakur](https://github.com/ysthakur) created + - [Allow spreading arguments to commands](https://github.com/nushell/nushell/pull/11289) + - [More specific errors for missing values in records](https://github.com/nushell/nushell/pull/11423) + - [Only run $env.PROMPT_COMMAND once per prompt (copy of #10986)](https://github.com/nushell/nushell/pull/11366) + - [Don't redraw prompt when transient prompt disabled](https://github.com/nushell/nushell/pull/10788) +- [cyradotpink](https://github.com/cyradotpink) created + - [Allow `http` commands' automatic redirect-following to be disabled](https://github.com/nushell/nushell/pull/11329) +- [SebastianIonel](https://github.com/SebastianIonel) created + - [Fix the bug for "bytes remove --end" .](https://github.com/nushell/nushell/pull/11428) +- [IanManske](https://github.com/IanManske) created + - [Remove unnecessary `replace_in_variable`](https://github.com/nushell/nushell/pull/11424) + - [Simplify `SIGQUIT` handling](https://github.com/nushell/nushell/pull/11381) + - [Make `Call::get_flag_expr` return `&Expression` instead of owned value ](https://github.com/nushell/nushell/pull/11388) + - [Remove `Expr::MatchPattern`](https://github.com/nushell/nushell/pull/11367) + - [Refactor `group-by` with closure grouper](https://github.com/nushell/nushell/pull/11370) + - [Remove `Value::MatchPattern`](https://github.com/nushell/nushell/pull/11356) + - [Satisfy clippy lint in benchmark](https://github.com/nushell/nushell/pull/11350) +- [sholderbach](https://github.com/sholderbach) created + - [Simplify the feature gates for `stor` commands](https://github.com/nushell/nushell/pull/11416) + - [Make polars deps optional for `cargo test --all`](https://github.com/nushell/nushell/pull/11415) + - [Lock out new direct construction of `Record`](https://github.com/nushell/nushell/pull/11414) + - [Check for clean repo after tests](https://github.com/nushell/nushell/pull/11409) + - [Bump reedline development version](https://github.com/nushell/nushell/pull/11406) + - [Fix sandboxing of redirection tests](https://github.com/nushell/nushell/pull/11407) + - [Bump `fancy-regex` to single `0.12.0` version](https://github.com/nushell/nushell/pull/11389) + - [Construct `Record`s only through checked helpers](https://github.com/nushell/nushell/pull/11386) + - [Expand the workspace `members` in `Cargo.toml`](https://github.com/nushell/nushell/pull/11387) + - [Properly update to the reedline repo patch](https://github.com/nushell/nushell/pull/11342) + - [Bump version to `0.88.2`](https://github.com/nushell/nushell/pull/11333) + - [Bump version to `0.88.1`](https://github.com/nushell/nushell/pull/11303) + - [Revert lock file changes due to openssl build fail](https://github.com/nushell/nushell/pull/11328) + - [Bump version for `0.88.0` release](https://github.com/nushell/nushell/pull/11298) +- [lavafroth](https://github.com/lavafroth) created + - [fix: prevent greedy matching of directory names](https://github.com/nushell/nushell/pull/11403) +- [AucaCoyan](https://github.com/AucaCoyan) created + - [:memo: Update `str trim` CLI help doc](https://github.com/nushell/nushell/pull/11383) + - [:sparkles: Make `hover` equal to `help` command](https://github.com/nushell/nushell/pull/11320) + - [:recycle: Match `--ide-hover` with `help` command](https://github.com/nushell/nushell/pull/11284) +- [hardfau1t](https://github.com/hardfau1t) created + - [fix(cd): on android/termux fails to cd into /sdcard](https://github.com/nushell/nushell/pull/10329) +- [0323pin](https://github.com/0323pin) created + - [Fix build on NetBSD](https://github.com/nushell/nushell/pull/11364) +- [stormasm](https://github.com/stormasm) created + - [nu-cli repl get_command_finished_marker() does not need to be pub](https://github.com/nushell/nushell/pull/11362) +- [KAAtheWiseGit](https://github.com/KAAtheWiseGit) created + - [Rename extra's `format` to `format pattern`](https://github.com/nushell/nushell/pull/11355) + - [Bubble up errors passed to `complete`](https://github.com/nushell/nushell/pull/11313) + - [Add `format` meta command](https://github.com/nushell/nushell/pull/11334) + - [Replace bash with POSIX sh in tests](https://github.com/nushell/nushell/pull/11293) +- [crides](https://github.com/crides) created + - [fix shell integration markers](https://github.com/nushell/nushell/pull/11352) +- [CAD97](https://github.com/CAD97) created + - [Only run $env.PROMPT_COMMAND once per prompt](https://github.com/nushell/nushell/pull/10986) +- [Hofer-Julian](https://github.com/Hofer-Julian) created + - [Move history into their own module](https://github.com/nushell/nushell/pull/11308) + - [Move `stor` commands to category `Database`](https://github.com/nushell/nushell/pull/11315) +- [ayax79](https://github.com/ayax79) created + - [Polars Struct support without unsafe blocks](https://github.com/nushell/nushell/pull/11229) +- [drbrain](https://github.com/drbrain) created + - [Enforce required, optional, and rest positional arguments start with an uppercase and end with a period.](https://github.com/nushell/nushell/pull/11285) +- [AntoineSebert](https://github.com/AntoineSebert) created + - [fix-`open`-is-ambiguous](https://github.com/nushell/nushell/pull/11302) +- [sophiajt](https://github.com/sophiajt) created + - [bump reedline dep to 0.27](https://github.com/nushell/nushell/pull/11299) + +### Documentation + +- [amtoine](https://github.com/amtoine) created + - [mark feature-gated commands more clearly](https://github.com/nushell/nushell.github.io/pull/1183) + - [logo contest announcement](https://github.com/nushell/nushell.github.io/pull/1180) + - [Release notes for `0.88.0`](https://github.com/nushell/nushell.github.io/pull/1146) +- [TWSiO](https://github.com/TWSiO) created + - [Adding warning to nu_plugin_formats commands](https://github.com/nushell/nushell.github.io/pull/1199) +- [yukitomoda](https://github.com/yukitomoda) created + - [JA update installation.md](https://github.com/nushell/nushell.github.io/pull/1198) + - [JA update shells_in_shells.md](https://github.com/nushell/nushell.github.io/pull/1197) + - [fix a description of usage scenario](https://github.com/nushell/nushell.github.io/pull/1196) + - [Update shells_in_shells.md](https://github.com/nushell/nushell.github.io/pull/1195) + - [update the list of commands which are interpreted by CMD](https://github.com/nushell/nushell.github.io/pull/1192) +- [hustcer](https://github.com/hustcer) created + - [Upgrade Vuepress, some Vuepress plugins and shiki syntax highlighter](https://github.com/nushell/nushell.github.io/pull/1194) + - [Refresh command docs for Nu v0.88](https://github.com/nushell/nushell.github.io/pull/1171) +- [aserowy](https://github.com/aserowy) created + - [external completer: fixed cookbook example to exchange the first span entry only](https://github.com/nushell/nushell.github.io/pull/1193) +- [YukiOnodera](https://github.com/YukiOnodera) created + - [I've revised the Japanese translation](https://github.com/nushell/nushell.github.io/pull/1179) +- [zolodev](https://github.com/zolodev) created + - [Update aliases adding new section](https://github.com/nushell/nushell.github.io/pull/1190) +- [ysthakur](https://github.com/ysthakur) created + - [Add info on spread operator in commands for 0.89 release notes](https://github.com/nushell/nushell.github.io/pull/1188) + - [Add information on spread operator](https://github.com/nushell/nushell.github.io/pull/1176) +- [frogshead](https://github.com/frogshead) created + - [fix typo](https://github.com/nushell/nushell.github.io/pull/1185) +- [Trent-Fellbootman](https://github.com/Trent-Fellbootman) created + - [Update types_of_data.md](https://github.com/nushell/nushell.github.io/pull/1184) + - [Update thinking_in_nu.md](https://github.com/nushell/nushell.github.io/pull/1172) +- [WindSoilder](https://github.com/WindSoilder) created + - [add information about switches](https://github.com/nushell/nushell.github.io/pull/1182) +- [app/github-actions](https://github.com/app/github-actions) created + - [Compressed Images](https://github.com/nushell/nushell.github.io/pull/1181) +- [MediosZ](https://github.com/MediosZ) created + - [Sync zh-CN shells_in_shells.](https://github.com/nushell/nushell.github.io/pull/1178) +- [braddunbar](https://github.com/braddunbar) created + - [Typo in history menu section](https://github.com/nushell/nushell.github.io/pull/1177) +- [IndigoLily](https://github.com/IndigoLily) created + - [Fix various spelling/grammar issues in release notes for `0.88.0`](https://github.com/nushell/nushell.github.io/pull/1175) +- [Tamnac](https://github.com/Tamnac) created + - [Add time command to nushell_map.md](https://github.com/nushell/nushell.github.io/pull/1173) +- [mb21](https://github.com/mb21) created + - [Extend globbing section in moving_around.md](https://github.com/nushell/nushell.github.io/pull/1125) +- [RGBCube](https://github.com/RGBCube) created + - [Update background_task.md](https://github.com/nushell/nushell.github.io/pull/1166) + +### Nu_Scripts + +- [fj0r](https://github.com/fj0r) created + - [comma: upgrade template](https://github.com/nushell/nu_scripts/pull/725) + - [kubernetes to docker-compose](https://github.com/nushell/nu_scripts/pull/726) + - [comma test runner](https://github.com/nushell/nu_scripts/pull/715) + - [merge container-inspect into container-process-list](https://github.com/nushell/nu_scripts/pull/711) + - [comma: support filter, watch, poll](https://github.com/nushell/nu_scripts/pull/707) + - [new module comma and some updates](https://github.com/nushell/nu_scripts/pull/704) +- [bobhy](https://github.com/bobhy) created + - [Show activated python VE at beginning of prompt.](https://github.com/nushell/nu_scripts/pull/722) +- [AucaCoyan](https://github.com/AucaCoyan) created + - [:bug: fix `(default)` and `(installed)` on rustup completions](https://github.com/nushell/nu_scripts/pull/721) + - [:bug: rename `yarn` for `yarn-v4` and add `run` cmpl](https://github.com/nushell/nu_scripts/pull/720) + - [:sparkles: `code` completions](https://github.com/nushell/nu_scripts/pull/719) + - [:sparkles: add completion to `gh pr checkout <tab>`](https://github.com/nushell/nu_scripts/pull/714) + - [:sparkles: add more `gh` completions](https://github.com/nushell/nu_scripts/pull/713) + - [:sparkles: Add the first layer of depth to the cmds](https://github.com/nushell/nu_scripts/pull/708) + - [:sparkles: First `gh` completions](https://github.com/nushell/nu_scripts/pull/706) + - [:bug: Fix `rustup` use completions and modify README](https://github.com/nushell/nu_scripts/pull/696) +- [edhowland](https://github.com/edhowland) created + - [Adds Modules/recursion : Examples of Fun with Recursive functions in Nu](https://github.com/nushell/nu_scripts/pull/717) +- [frogshead](https://github.com/frogshead) created + - [fix broken links in modules readme](https://github.com/nushell/nu_scripts/pull/718) + - [fix broken link on README.md](https://github.com/nushell/nu_scripts/pull/716) +- [robbienohra](https://github.com/robbienohra) created + - [fix: missing regex flag](https://github.com/nushell/nu_scripts/pull/712) +- [adrian5](https://github.com/adrian5) created + - [Add tokyo-moon theme variant](https://github.com/nushell/nu_scripts/pull/710) +- [kjelly](https://github.com/kjelly) created + - [fix git-v2 and kubernetes](https://github.com/nushell/nu_scripts/pull/703) +- [zyfmix](https://github.com/zyfmix) created + - [Fix: nushell at 0.88.0 start and end are deprecated](https://github.com/nushell/nu_scripts/pull/698) +- [RGBCube](https://github.com/RGBCube) created + - [Rewrite and expand background task module](https://github.com/nushell/nu_scripts/pull/691) +- [TeaDrinkingProgrammer](https://github.com/TeaDrinkingProgrammer) created + - [Added updated and improved version of the conda scripts](https://github.com/nushell/nu_scripts/pull/694) + +### Reedline + +- [WindSoilder](https://github.com/WindSoilder) created + - [Try fix prompt_start_row reset to 0 when opening a file without newline in Nushell ](https://github.com/nushell/reedline/pull/697) + - [fix clippy, add typo dict](https://github.com/nushell/reedline/pull/698) +- [sholderbach](https://github.com/sholderbach) created + - [Fix clippy from the future](https://github.com/nushell/reedline/pull/687) + - [Bump `itertools` to `0.12.0` from `0.10.x`](https://github.com/nushell/reedline/pull/686) + - [Bump version to 0.27.1](https://github.com/nushell/reedline/pull/683) + - [Try to fix the docs.rs build](https://github.com/nushell/reedline/pull/682) + - [Bump version for 0.27 release](https://github.com/nushell/reedline/pull/681) +- [nibon7](https://github.com/nibon7) created + - [Fix `prompt_start_row` reset to 0 when opening a file without newline in Nushell](https://github.com/nushell/reedline/pull/688) +- [danielsomerfield](https://github.com/danielsomerfield) created + - [Better behaviour on resize](https://github.com/nushell/reedline/pull/675) diff --git a/blog/2024-02-06-nushell_0_90_0.md b/src/content/docs/blog/2024-02-06-nushell_0_90_0.md similarity index 91% rename from blog/2024-02-06-nushell_0_90_0.md rename to src/content/docs/blog/2024-02-06-nushell_0_90_0.md index 0e9aa55ef66..876b10c6028 100644 --- a/blog/2024-02-06-nushell_0_90_0.md +++ b/src/content/docs/blog/2024-02-06-nushell_0_90_0.md @@ -3,55 +3,32 @@ title: Nushell 0.90.1 author: The Nu Authors author_site: https://twitter.com/nu_shell author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.90.1 of Nu. This release adds new completion menu improvements, unifies how globbing works across commands, and improves many existing commands. +description: Today, we're releasing version 0.90.1 of Nu. This release adds new completion menu improvements, unifies how globbing works across commands, and improves many existing commands. --- <!-- TODO: complete the excerpt above --> -# Nushell 0.90.1 - Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. <!-- TODO: write this excerpt --> Today, we're releasing version 0.90.1 of Nu. This release adds new completion menu improvements, unifies how globbing works across commands, and improves many existing commands. -# Where to get it +## Where to get it Nu 0.90.1 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.90.1) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. -::: tip Note +:::note The optional dataframe functionality is available by `cargo install nu --features=dataframe`. ::: As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`. -# Table of content - -- [Nushell 0.90.1](#nushell-0901) -- [Where to get it](#where-to-get-it) -- [Table of content](#table-of-content) -- [Themes of this release / New features \[toc\]](#themes-of-this-release--new-features-toc) - - [New Reedline coolness](#new-reedline-coolness) - - [(Breaking Change!) Handling globs](#breaking-change-handling-globs) - - [Starting a new Language Reference](#starting-a-new-language-reference) - - [Parse-time evaluation](#parse-time-evaluation) - - [Integration of more uutils commands](#integration-of-more-uutils-commands) - - [Dataframes: allow specifying schema (#11634)](#dataframes-allow-specifying-schema-11634) - - [New CLI flag: `--no-history` (#11550)](#new-cli-flag---no-history-11550) - - [Strict JSON parsing (#11592)](#strict-json-parsing-11592) - - [Our set of commands is evolving \[toc\]](#our-set-of-commands-is-evolving-toc) - - [New commands \[toc\]](#new-commands-toc) - - [Changes to existing commands \[toc\]](#changes-to-existing-commands-toc) - - [Deprecated commands \[toc\]](#deprecated-commands-toc) - - [Removed commands \[toc\]](#removed-commands-toc) -- [Breaking changes \[toc\]](#breaking-changes-toc) -- [Full changelog \[toc\]](#full-changelog-toc) <!-- TODO: please add links to the other sections here the following command should help pre-generate a great deal of the table of content. be careful with the format and false-positives :wink: - ```nushell + ```nu rg '^#+ ' blog/... | lines | each { @@ -63,23 +40,23 @@ As part of this release, we also publish a set of optional plugins you can insta ``` --> -# Themes of this release / New features [[toc](#table-of-content)] +## Themes of this release / New features [[toc](#table-of-content)] <!-- NOTE: if you wanna write a section about a breaking change, when it's a very important one, please add the following snippet to have a "warning" banner :) - > see [an example](https://www.nushell.sh/blog/2023-09-19-nushell_0_85_0.html#pythonesque-operators-removal) + > see [an example](https://www.nushell.sh/blog/2023-09-19-nushell_0_85_0#pythonesque-operators-removal) ```md - ::: warning Breaking change + :::caution[Breaking change] See a full overview of the [breaking changes](#breaking-changes) ::: ``` --> -<!-- NOTE: see https://vuepress.github.io/reference/default-theme/markdown.html#custom-containers +<!-- NOTE: see https://vuepress.github.io/reference/default-theme/markdown#custom-containers for the list of available *containers* --> -## New Reedline coolness +### New Reedline coolness We have some exciting new improvements in our line editor, thanks to [unprecedented number of contributions](https://github.com/nushell/reedline/releases/tag/v0.29.0) since the last release. @@ -97,7 +74,7 @@ Third, shift navigation ([#11535](https://github.com/nushell/nushell/pull/11535) All the new changes are configurable: See the [changes to the default config file](https://github.com/nushell/nushell/compare/0.89.0...main#diff-5c0320ebb54cd8ffd7059eb0178377c5139877d21457f6903439e7caf2e5b40e) (if the link does not bring you to the `default_config.nu` file, click the "Files changed" tab, then search for "default_config.nu" and open the diff) to see what has changed. -## (Breaking Change!) Handling globs +### (Breaking Change!) Handling globs From this release, we unified glob rules for the following commands: `open`, `rm`, `cp`, `umv`, `mv`, `du`, `ls` ([#11621](https://github.com/nushell/nushell/pull/11621)). @@ -115,11 +92,11 @@ To escape the glob pattern to match a file named `a[bc]c.txt`, `str escape-glob` The new `str escape-glob` command ([#11663](https://github.com/nushell/nushell/pull/11664)) is useful when you want to prevent globs from expanding, for example when using a closure: `ls | str escape-glob name | each {|it| ls $it.name }`, so you won't get error occasionally. -## (Breaking Change!) For existing plugin +### (Breaking Change!) For existing plugin -Nushell allows plugins to receive configuration from the nushell configuration [#10955](https://github.com/nushell/nushell/pull/10955), the communication protocol between nushell and plugin have changed to achieve the behavior. So plugins need to update `nu-plugin` dependency version and recompile it to make plugin works again. +Nushell allows plugins to receive configuration from the nushell configuration [#10955](https://github.com/nushell/nushell/pull/10955), the communication protocol between nushell and plugin have changed to achieve the behavior. So plugins need to update `nu-plugin` dependency version and recompile it to make plugin works again. -## Starting a new [Language Reference](https://www.nushell.sh/lang-guide) +### Starting a new [Language Reference](https://www.nushell.sh/lang-guide) Recently, we started a new reference page for Nushell language and its features. For years, we have used the [current book](https://www.nushell.sh/book) as both a reference point for Nushell's features _and_ a tutorial. @@ -129,29 +106,29 @@ Over time, we hope to offload content from the book to the reference page that s At the same time, we aim to refactor the book into more of a tutorial style and make it more coherent. Practical recipes for solving common problems continue being collected in the [cookbook](https://www.nushell.sh/cookbook). -## Parse-time evaluation +### Parse-time evaluation String interpolation can be now performed at parse time [#11562](https://github.com/nushell/nushell/pull/11562). This gives you another way to, for example, compose files for importing or sourcing, for example: -```nushell +```nu const name = "spam" use ($nu.default-config-dir | path join $"($name).nu") ``` The `ansi` commands now can also be evaluated at parse time: [#11682](https://github.com/nushell/nushell/pull/11682) -## Integration of more [uutils](https://github.com/uutils/coreutils) commands +### Integration of more [uutils](https://github.com/uutils/coreutils) commands Continuing our cooperation with uutils, we now have a new `umv` command, implemented by uutils, which will replace our current `mv` [#10822](https://github.com/nushell/nushell/pull/10822). Our `old-cp` was also removed [#11622](https://github.com/nushell/nushell/pull/11622) and now we rely solely on `cp` from `uutils` -## Dataframes: allow specifying schema ([#11634](https://github.com/nushell/nushell/pull/11634)) +### Dataframes: allow specifying schema ([#11634](https://github.com/nushell/nushell/pull/11634)) The `dfr into-df` command can now accept a schema. A new `dfr schema` command can be used to view the schema: -``` +```nu > {a:1, b:{a:2}} | dfr into-df -s {a: u8, b: {a: i32}} | dfr schema ╭───┬─────────────╮ │ a │ u8 │ @@ -161,27 +138,27 @@ The `dfr into-df` command can now accept a schema. A new `dfr schema` command ca ╰───┴─────────────╯ ``` -## New CLI flag: `--no-history` ([#11550](https://github.com/nushell/nushell/pull/11550)) +### New CLI flag: `--no-history` ([#11550](https://github.com/nushell/nushell/pull/11550)) If nushell is launched with the `--no-history` CLI flag, then command history file will not be read from or written to. You can check whether history is enabled using `$nu.history-enabled`. It will be false if `--no-history` was provided and true otherwise. -## Strict JSON parsing ([#11592](https://github.com/nushell/nushell/pull/11592)) +### Strict JSON parsing ([#11592](https://github.com/nushell/nushell/pull/11592)) The `from json` command now has a `--strict` flag which will error on invalid JSON. For example, comments and trailing commas are not allowed in JSON, and so will trigger an error with the `--strict` flag. -## Our set of commands is evolving [[toc](#table-of-content)] +### Our set of commands is evolving [[toc](#table-of-content)] As usual, new release rhyms with changes to commands! -### New commands [[toc](#table-of-content)] +#### New commands [[toc](#table-of-content)] Apart from commands already mentioned above, [`into cell-path`](https://github.com/nushell/nushell/pull/11322) can now be used to create cell paths dynamically. -# Breaking changes [[toc](#table-of-content)] +## Breaking changes [[toc](#table-of-content)] <!-- TODO: paste the output of @@ -199,7 +176,7 @@ Apart from commands already mentioned above, [`into cell-path`](https://github.c - [#11030](https://github.com/nushell/nushell/pull/11030) Fix parsing of strings with special characters - [#10955](https://github.com/nushell/nushell/pull/10955) Allow plugins to receive configuration from the nushell configuration -# Full changelog [[toc](#table-of-content)] +## Full changelog [[toc](#table-of-content)] <!-- TODO: paste the output of diff --git a/book/advanced.md b/src/content/docs/book/advanced.md similarity index 62% rename from book/advanced.md rename to src/content/docs/book/advanced.md index 566ec9c963a..240a0376969 100644 --- a/book/advanced.md +++ b/src/content/docs/book/advanced.md @@ -1,20 +1,22 @@ -# (Not So) Advanced +--- +title: Advanced +--- While the "Advanced" title might sound daunting and you might be tempted to skip this chapter, in fact, some of the most interesting and powerful features can be found here. -Besides the built-in commands, Nushell has a [standard library](standard_library.md). +Besides the built-in commands, Nushell has a [standard library](standard_library). Nushell operates on _structured data_. You could say that Nushell is a "data-first" shell and a programming language. To further explore the data-centric direction, Nushell includes a full-featured dataframe processing engine using [Polars](https://github.com/pola-rs/polars) as the backend. -Make sure to check the [Dataframes documentation](dataframes.md) if you want to process large data efficiently directly in your shell. +Make sure to check the [Dataframes documentation](dataframes) if you want to process large data efficiently directly in your shell. -Values in Nushell contain some extra [metadata](metadata.md). -This metadata can be used, for example, to [create custom errors](creating_errors.md). +Values in Nushell contain some extra [metadata](metadata). +This metadata can be used, for example, to [create custom errors](creating_errors). -Thanks to Nushell's strict scoping rules, it is very easy to [iterate over collections in parallel](parallelism.md) which can help you speed up long-running scripts by just typing a few characters. +Thanks to Nushell's strict scoping rules, it is very easy to [iterate over collections in parallel](parallelism) which can help you speed up long-running scripts by just typing a few characters. -You can [interactively explore data](explore.md) with the [`explore`](/commands/docs/explore.md) command. +You can [interactively explore data](explore) with the [`explore`](/commands/docs/explore) command. -Finally, you can extend Nushell's functionality with [plugins](plugins.md). +Finally, you can extend Nushell's functionality with [plugins](plugins). Almost anything can be a plugin as long as it communicates with Nushell in a protocol that Nushell understands. diff --git a/book/creating_errors.md b/src/content/docs/book/advanced/creating_errors.md similarity index 62% rename from book/creating_errors.md rename to src/content/docs/book/advanced/creating_errors.md index 4a1be7d4bbd..b1afd43064e 100644 --- a/book/creating_errors.md +++ b/src/content/docs/book/advanced/creating_errors.md @@ -1,11 +1,15 @@ -# Creating your own errors +--- +title: Creating your own errors +sidebar: + order: 4 +--- -Using the [metadata](metadata.md) information, you can create your own custom error messages. Error messages are built of multiple parts: +Using the [metadata](metadata) information, you can create your own custom error messages. Error messages are built of multiple parts: - The title of the error - The label of error message, which includes both the text of the label and the span to underline -You can use the [`error make`](/commands/docs/error_make.md) command to create your own error messages. For example, let's say you had your own command called `my-command` and you wanted to give an error back to the caller about something wrong with a parameter that was passed in. +You can use the [`error make`](/commands/docs/error_make) command to create your own error messages. For example, let's say you had your own command called `my-command` and you wanted to give an error back to the caller about something wrong with a parameter that was passed in. First, you can take the span of where the argument is coming from: @@ -13,7 +17,7 @@ First, you can take the span of where the argument is coming from: let span = (metadata $x).span; ``` -Next, you can create an error using the [`error make`](/commands/docs/error_make.md) command. This command takes in a record that describes the error to create: +Next, you can create an error using the [`error make`](/commands/docs/error_make) command. This command takes in a record that describes the error to create: ```nu error make {msg: "this is fishy", label: {text: "fish right here", span: $span } } diff --git a/book/dataframes.md b/src/content/docs/book/advanced/dataframes.md similarity index 92% rename from book/dataframes.md rename to src/content/docs/book/advanced/dataframes.md index 867e6e6b70b..4a0993a3db0 100644 --- a/book/dataframes.md +++ b/src/content/docs/book/advanced/dataframes.md @@ -1,7 +1,11 @@ -# Dataframes - -::: warning -To use the dataframe support you need a fully-featured build with `cargo build --features dataframe`. Starting with version 0.72, dataframes are *not* included with binary releases of Nushell. [See the installation instructions](/book/installation.md) for further details. +--- +title: Dataframes +sidebar: + order: 2 +--- + +:::caution[WARNING] +To use the dataframe support you need a fully-featured build with `cargo build --features dataframe`. Starting with version 0.72, dataframes are _not_ included with binary releases of Nushell. [See the installation instructions](/book/installation) for further details. ::: As we have seen so far, Nushell makes working with data its main priority. @@ -29,7 +33,7 @@ processing data. For this little benchmark exercise we will be comparing native Nushell commands, dataframe Nushell commands and [Python Pandas](https://pandas.pydata.org/) commands. For the time being don't pay too -much attention to the [`Dataframe` commands](/commands/categories/dataframe.md). They will be explained in later +much attention to the [`Dataframe` commands](/commands/categories/dataframe). They will be explained in later sections of this page. > System Details: The benchmarks presented in this section were run using a @@ -59,7 +63,7 @@ The dataset has 5 columns and 5,429,252 rows. We can check that by using the ╰───┴────────┴─────────┴─────────╯ ``` -We can have a look at the first lines of the file using [`first`](/commands/docs/first.md): +We can have a look at the first lines of the file using [`first`](/commands/docs/first): ```nu ❯ $df | dfr first @@ -88,7 +92,7 @@ We can have a look at the first lines of the file using [`first`](/commands/docs ### Loading the file Let's start by comparing loading times between the various methods. First, we -will load the data using Nushell's [`open`](/commands/docs/open.md) command: +will load the data using Nushell's [`open`](/commands/docs/open) command: ```nu ❯ timeit {open .\Data7602DescendingYearOrder.csv} @@ -100,7 +104,7 @@ loading five million records! But we can do a bit better than that. Let's now use Pandas. We are going to use the next script to load the file: -```python +```py import pandas as pd df = pd.read_csv("Data7602DescendingYearOrder.csv") @@ -132,7 +136,7 @@ data by year, and add groups using the column `geo_count`. Again, we are going to start with a Nushell native command. -::: tip +:::tip If you want to run this example, be aware that the next command will use a large amount of memory. This may affect the performance of your system while this is being executed. @@ -154,7 +158,7 @@ So, six minutes to perform this aggregated operation. Let's try the same operation in pandas: -```python +```py import pandas as pd df = pd.read_csv("Data7602DescendingYearOrder.csv") @@ -192,7 +196,7 @@ and the benchmark with dataframes is: Luckily Nushell dataframes managed to halve the time again. Isn't that great? -As you can see, Nushell's [`Dataframe` commands](/commands/categories/dataframe.md) +As you can see, Nushell's [`Dataframe` commands](/commands/categories/dataframe) are as fast as the most common tools that exist today to do data analysis. The commands that are included in this release have the potential to become your go-to tool for doing data analysis. By composing complex Nushell pipelines, you can extract information @@ -200,13 +204,13 @@ from data in a reliable way. ## Working with Dataframes -After seeing a glimpse of the things that can be done with [`Dataframe` commands](/commands/categories/dataframe.md), +After seeing a glimpse of the things that can be done with [`Dataframe` commands](/commands/categories/dataframe), now it is time to start testing them. To begin let's create a sample CSV file that will become our sample dataframe that we will be using along with the examples. In your favorite file editor paste the next lines to create out sample csv file. -``` +```csv int_1,int_2,float_1,float_2,first,second,third,word 1,11,0.1,1.0,a,b,c,first 2,12,0.2,1.0,a,b,c,second @@ -233,7 +237,7 @@ this: This should create the value `$df` in memory which holds the data we just created. -::: tip +:::tip The command `dfr open` can read either **csv** or **parquet** files. ::: @@ -276,7 +280,7 @@ dataframe variable to the stream With the dataframe in memory we can start doing column operations with the `DataFrame` -::: tip +:::tip If you want to see all the dataframe commands that are available you can use `scope commands | where category =~ dataframe` ::: @@ -297,7 +301,7 @@ that exist in `df` by using the `aggregate` command As you can see, the aggregate function computes the sum for those columns where a sum makes sense. If you want to filter out the text column, you can select -the columns you want by using the [`dfr select`](/commands/docs/dfr_select.md) command +the columns you want by using the [`dfr select`](/commands/docs/dfr_select) command ```nu ❯ $df | dfr sum | dfr select int_1 int_2 float_1 float_2 @@ -315,7 +319,7 @@ other Nushell variable ❯ let res = ($df | dfr sum | dfr select int_1 int_2 float_1 float_2) ``` -::: tip +:::tip Type `let res = ( !! )` and press enter. This will auto complete the previously executed command. Note the space between ( and !!. ::: @@ -345,7 +349,7 @@ going to join our mini dataframe with another mini dataframe. Copy these lines in another file and create the corresponding dataframe (for these examples we are going to call it `test_small_a.csv`) -``` +```csv title="test_small_a.csv" int_1,int_2,float_1,float_2,first 9,14,0.4,3.0,a 8,13,0.3,2.0,a @@ -375,10 +379,10 @@ right dataframe ╰───┴───────┴───────┴─────────┴─────────┴───────┴────────┴───────┴────────┴─────────┴───────────┴───────────┴─────────╯ ``` -::: tip +:::tip In `Nu` when a command has multiple arguments that are expecting multiple values we use brackets `[]` to enclose those values. In the case of -[`dfr join`](/commands/docs/dfr_join.md) we can join on multiple columns +[`dfr join`](/commands/docs/dfr_join) we can join on multiple columns as long as they have the same type. ::: @@ -401,14 +405,14 @@ in order to use it for further operations. ## DataFrame group-by One of the most powerful operations that can be performed with a DataFrame is -the [`dfr group-by`](/commands/docs/dfr_group-by.md). This command will allow you to perform aggregation operations +the [`dfr group-by`](/commands/docs/dfr_group-by). This command will allow you to perform aggregation operations based on a grouping criteria. In Nushell, a `GroupBy` is a type of object that can be stored and reused for multiple aggregations. This is quite handy, since the creation of the grouped pairs is the most expensive operation while doing group-by and there is no need to repeat it if you are planning to do multiple operations with the same group condition. -To create a `GroupBy` object you only need to use the [`dfr_group-by`](/commands/docs/dfr_group-by.md) command +To create a `GroupBy` object you only need to use the [`dfr_group-by`](/commands/docs/dfr_group-by) command ```nu ❯ let group = ($df | dfr group-by first) @@ -465,7 +469,7 @@ command `dfr into-df`. ❯ $a ``` -::: tip +:::tip For the time being, not all of Nushell primitives can be converted into a dataframe. This will change in the future, as the dataframe feature matures ::: @@ -507,7 +511,7 @@ while working with dataframes, and this is thanks to **Apache Arrow** and **Polars**. In a very simple representation, each column in a DataFrame is an Arrow Array, which is using several memory specifications in order to maintain the data as packed as possible (check [Arrow columnar -format](https://arrow.apache.org/docs/format/Columnar.html)). The other +format](https://arrow.apache.org/docs/format/Columnar)). The other optimization trick is the fact that whenever possible, the columns from the dataframes are shared between dataframes, avoiding memory duplication for the same data. This means that dataframes `$a` and `$a2` are sharing the same two @@ -558,7 +562,7 @@ previously created column. Now we have a new Series that was constructed by doing basic operations on the previous variable. -::: tip +:::tip If you want to see how many variables you have stored in memory you can use `scope variables` ::: @@ -745,7 +749,7 @@ Another operation that can be done with masks is setting or replacing a value from a series. For example, we can change the value in the column `first` where the value is equal to `a` -::: warning +:::caution[WARNING] This is example is not updated to recent Nushell versions. ::: @@ -786,7 +790,7 @@ extract that information ╰───┴───────┴───────┴─────────┴─────────┴───────┴────────┴───────┴────────╯ ``` -The command [`dfr take`](/commands/docs/dfr_take.md) is very handy, especially if we mix it with other commands. +The command [`dfr take`](/commands/docs/dfr_take) is very handy, especially if we mix it with other commands. Let's say that we want to extract all rows for the first duplicated element for column `first`. In order to do that, we can use the command `dfr arg-unique` as shown in the next example @@ -807,8 +811,8 @@ Or what if we want to create a new sorted dataframe using a column in specific. We can use the `arg-sort` to accomplish that. In the next example we can sort the dataframe by the column `word` -::: tip -The same result could be accomplished using the command [`sort`](/commands/docs/sort.md) +:::tip +The same result could be accomplished using the command [`sort`](/commands/docs/sort) ::: ```nu @@ -1078,64 +1082,63 @@ feature becomes more stable. The next list shows the available dataframe commands with their descriptions, and whenever possible, their analogous Nushell command. -::: warning +:::caution[WARNING] This list may be outdated. To get the up-to-date command list, see -[Dataframe](/commands/categories/dataframe.md) -[Lazyframe](/commands/categories/lazyframe.md) and -[Dataframe Or Lazyframe](/commands/categories/dataframe_or_lazyframe.md) +[Dataframe](/commands/categories/dataframe) +[Lazyframe](/commands/categories/lazyframe) and +[Dataframe Or Lazyframe](/commands/categories/dataframe_or_lazyframe) command categories. ::: - -| Command Name | Applies To | Description | Nushell Equivalent | -| --------------- | --------------------------- | -------------------------------------------------------------------------- | ----------------------------- | -| aggregate | DataFrame, GroupBy, Series | Performs an aggregation operation on a dataframe, groupby or series object | math | -| all-false | Series | Returns true if all values are false | | -| all-true | Series | Returns true if all values are true | all | -| arg-max | Series | Return index for max value in series | | -| arg-min | Series | Return index for min value in series | | -| arg-sort | Series | Returns indexes for a sorted series | | -| arg-true | Series | Returns indexes where values are true | | -| arg-unique | Series | Returns indexes for unique values | | -| count-null | Series | Counts null values | | -| count-unique | Series | Counts unique value | | -| drop | DataFrame | Creates a new dataframe by dropping the selected columns | drop | -| drop-duplicates | DataFrame | Drops duplicate values in dataframe | | -| drop-nulls | DataFrame, Series | Drops null values in dataframe | | -| dtypes | DataFrame | Show dataframe data types | | -| filter-with | DataFrame | Filters dataframe using a mask as reference | | -| first | DataFrame | Creates new dataframe with first rows | first | -| get | DataFrame | Creates dataframe with the selected columns | get | -| group-by | DataFrame | Creates a groupby object that can be used for other aggregations | group-by | -| is-duplicated | Series | Creates mask indicating duplicated values | | -| is-in | Series | Checks if elements from a series are contained in right series | in | -| is-not-null | Series | Creates mask where value is not null | | -| is-null | Series | Creates mask where value is null | `<column_name> == null` | -| is-unique | Series | Creates mask indicating unique values | | -| join | DataFrame | Joins a dataframe using columns as reference | | -| last | DataFrame | Creates new dataframe with last rows | last | -| ls-df | | Lists stored dataframes | | -| melt | DataFrame | Unpivot a DataFrame from wide to long format | | +| Command Name | Applies To | Description | Nushell Equivalent | +| --------------- | --------------------------- | -------------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| aggregate | DataFrame, GroupBy, Series | Performs an aggregation operation on a dataframe, groupby or series object | math | +| all-false | Series | Returns true if all values are false | | +| all-true | Series | Returns true if all values are true | all | +| arg-max | Series | Return index for max value in series | | +| arg-min | Series | Return index for min value in series | | +| arg-sort | Series | Returns indexes for a sorted series | | +| arg-true | Series | Returns indexes where values are true | | +| arg-unique | Series | Returns indexes for unique values | | +| count-null | Series | Counts null values | | +| count-unique | Series | Counts unique value | | +| drop | DataFrame | Creates a new dataframe by dropping the selected columns | drop | +| drop-duplicates | DataFrame | Drops duplicate values in dataframe | | +| drop-nulls | DataFrame, Series | Drops null values in dataframe | | +| dtypes | DataFrame | Show dataframe data types | | +| filter-with | DataFrame | Filters dataframe using a mask as reference | | +| first | DataFrame | Creates new dataframe with first rows | first | +| get | DataFrame | Creates dataframe with the selected columns | get | +| group-by | DataFrame | Creates a groupby object that can be used for other aggregations | group-by | +| is-duplicated | Series | Creates mask indicating duplicated values | | +| is-in | Series | Checks if elements from a series are contained in right series | in | +| is-not-null | Series | Creates mask where value is not null | | +| is-null | Series | Creates mask where value is null | `<column_name> == null` | +| is-unique | Series | Creates mask indicating unique values | | +| join | DataFrame | Joins a dataframe using columns as reference | | +| last | DataFrame | Creates new dataframe with last rows | last | +| ls-df | | Lists stored dataframes | | +| melt | DataFrame | Unpivot a DataFrame from wide to long format | | | not | Series Inverts boolean mask | | -| open | | Loads dataframe form csv file | open | -| pivot | GroupBy | Performs a pivot operation on a groupby object | pivot | -| rename | Dataframe, Series | Renames a series | rename | -| sample | DataFrame | Create sample dataframe | | -| select | DataFrame | Creates a new dataframe with the selected columns | select | -| set | Series | Sets value where given mask is true | | -| set-with-idx | Series | Sets value in the given index | | -| shift | Series | Shifts the values by a given period | | -| show | DataFrame | Converts a section of the dataframe to a Table or List value | | -| slice | DataFrame | Creates new dataframe from a slice of rows | | -| sort-by | DataFrame, Series | Creates new sorted dataframe or series | sort | -| take | DataFrame, Series | Creates new dataframe using the given indices | | -| to csv | DataFrame | Saves dataframe to csv file | to csv | -| into df | | Converts a pipelined Table or List into Dataframe | | -| dummies | DataFrame | Creates a new dataframe with dummy variables | | -| to parquet | DataFrame | Saves dataframe to parquet file | | -| unique | Series | Returns unique values from a series | uniq | -| value-counts | Series | Returns a dataframe with the counts for unique values in series | | -| where | DataFrame | Filter dataframe to match the condition | where | +| open | | Loads dataframe form csv file | open | +| pivot | GroupBy | Performs a pivot operation on a groupby object | pivot | +| rename | Dataframe, Series | Renames a series | rename | +| sample | DataFrame | Create sample dataframe | | +| select | DataFrame | Creates a new dataframe with the selected columns | select | +| set | Series | Sets value where given mask is true | | +| set-with-idx | Series | Sets value in the given index | | +| shift | Series | Shifts the values by a given period | | +| show | DataFrame | Converts a section of the dataframe to a Table or List value | | +| slice | DataFrame | Creates new dataframe from a slice of rows | | +| sort-by | DataFrame, Series | Creates new sorted dataframe or series | sort | +| take | DataFrame, Series | Creates new dataframe using the given indices | | +| to csv | DataFrame | Saves dataframe to csv file | to csv | +| into df | | Converts a pipelined Table or List into Dataframe | | +| dummies | DataFrame | Creates a new dataframe with dummy variables | | +| to parquet | DataFrame | Saves dataframe to parquet file | | +| unique | Series | Returns unique values from a series | uniq | +| value-counts | Series | Returns a dataframe with the counts for unique values in series | | +| where | DataFrame | Filter dataframe to match the condition | where | | with-column | DataFrame | Adds a series to the dataframe | `insert <column_name> <value> \| upsert <column_name> { <new_value> }` | ## Future of Dataframes diff --git a/book/explore.md b/src/content/docs/book/advanced/explore.md similarity index 87% rename from book/explore.md rename to src/content/docs/book/advanced/explore.md index 5ddab228477..9549b8a50e2 100644 --- a/book/explore.md +++ b/src/content/docs/book/advanced/explore.md @@ -1,4 +1,6 @@ -# `explore` +--- +title: explore +--- Explore is a table pager, just like `less` but for table structured data. @@ -21,7 +23,7 @@ ls | explore -i  -So the main point of [`explore`](/commands/docs/explore.md) is `:table` (Which you see on the above screenshot). +So the main point of [`explore`](/commands/docs/explore) is `:table` (Which you see on the above screenshot). You can interact with it via `<Left>`, `<Right>`, `<Up>`, `<Down>` _arrow keys_. @@ -33,7 +35,7 @@ You can obtain more information about the various aspects of it by `:help`. ## Commands -[`explore`](/commands/docs/explore.md) has a list of built in commands you can use. Commands are run through pressing `<:>` and then a command name. +[`explore`](/commands/docs/explore) has a list of built in commands you can use. Commands are run through pressing `<:>` and then a command name. To find out the comprehensive list of commands you can type `:help`. diff --git a/book/metadata.md b/src/content/docs/book/advanced/metadata.md similarity index 85% rename from book/metadata.md rename to src/content/docs/book/advanced/metadata.md index 24f711cdeb6..5bbd3243294 100644 --- a/book/metadata.md +++ b/src/content/docs/book/advanced/metadata.md @@ -1,4 +1,8 @@ -# Metadata +--- +title: Metadata +sidebar: + order: 3 +--- In using Nu, you may have come across times where you felt like there was something extra going on behind the scenes. For example, let's say that you try to open a file that Nu supports only to forget and try to convert again: @@ -13,11 +17,11 @@ error: Expected a string from pipeline | ---------- object originates from here ``` -The error message tells us not only that what we gave [`from toml`](/commands/docs/from_toml.md) wasn't a string, but also where the value originally came from. How would it know that? +The error message tells us not only that what we gave [`from toml`](/commands/docs/from_toml) wasn't a string, but also where the value originally came from. How would it know that? Values that flow through a pipeline in Nu often have a set of additional information, or metadata, attached to them. These are known as tags, like the tags on an item in a store. These tags don't affect the data, but they give Nu a way to improve the experience of working with that data. -Let's run the [`open`](/commands/docs/open.md) command again, but this time, we'll look at the tags it gives back: +Let's run the [`open`](/commands/docs/open) command again, but this time, we'll look at the tags it gives back: ```nu > metadata (open Cargo.toml) diff --git a/book/parallelism.md b/src/content/docs/book/advanced/parallelism.md similarity index 68% rename from book/parallelism.md rename to src/content/docs/book/advanced/parallelism.md index 181c2d711c1..3fe86df7c16 100644 --- a/book/parallelism.md +++ b/src/content/docs/book/advanced/parallelism.md @@ -1,4 +1,8 @@ -# Parallelism +--- +title: Parallelism +sidebar: + order: 5 +--- Nushell now has early support for running code in parallel. This allows you to process elements of a stream using more hardware resources of your computer. @@ -6,11 +10,11 @@ You will notice these commands with their characteristic `par-` naming. Each cor ## par-each -The most common parallel command is [`par-each`](/commands/docs/par-each.md), a companion to the [`each`](/commands/docs/each.md) command. +The most common parallel command is [`par-each`](/commands/docs/par-each), a companion to the [`each`](/commands/docs/each) command. -Like [`each`](/commands/docs/each.md), [`par-each`](/commands/docs/par-each.md) works on each element in the pipeline as it comes in, running a block on each. Unlike [`each`](/commands/docs/each.md), [`par-each`](/commands/docs/par-each.md) will do these operations in parallel. +Like [`each`](/commands/docs/each), [`par-each`](/commands/docs/par-each) works on each element in the pipeline as it comes in, running a block on each. Unlike [`each`](/commands/docs/each), [`par-each`](/commands/docs/par-each) will do these operations in parallel. -Let's say you wanted to count the number of files in each sub-directory of the current directory. Using [`each`](/commands/docs/each.md), you could write this as: +Let's say you wanted to count the number of files in each sub-directory of the current directory. Using [`each`](/commands/docs/each), you could write this as: ```nu > ls | where type == dir | each { |it| @@ -22,7 +26,7 @@ We create a record for each entry, and fill it with the name of the directory an On your machine, the times may vary. For this machine, it took 21 milliseconds for the current directory. -Now, since this operation can be run in parallel, let's convert the above to parallel by changing [`each`](/commands/docs/each.md) to [`par-each`](/commands/docs/par-each.md): +Now, since this operation can be run in parallel, let's convert the above to parallel by changing [`each`](/commands/docs/each) to [`par-each`](/commands/docs/par-each): ```nu > ls | where type == dir | par-each { |it| @@ -32,7 +36,7 @@ Now, since this operation can be run in parallel, let's convert the above to par On this machine, it now runs in 6ms. That's quite a difference! -As a side note: Because [environment variables are scoped](environment.md#scoping), you can use [`par-each`](/commands/docs/par-each.md) to work in multiple directories in parallel (notice the [`cd`](/commands/docs/cd.md) command): +As a side note: Because [environment variables are scoped](environment#scoping), you can use [`par-each`](/commands/docs/par-each) to work in multiple directories in parallel (notice the [`cd`](/commands/docs/cd) command): ```nu > ls | where type == dir | par-each { |it| @@ -40,4 +44,4 @@ As a side note: Because [environment variables are scoped](environment.md#scopin } ``` -You'll notice, if you look at the results, that they come back in different orders each run (depending on the number of hardware threads on your system). As tasks finish, and we get the correct result, we may need to add additional steps if we want our results in a particular order. For example, for the above, we may want to sort the results by the "name" field. This allows both [`each`](/commands/docs/each.md) and [`par-each`](/commands/docs/par-each.md) versions of our script to give the same result. +You'll notice, if you look at the results, that they come back in different orders each run (depending on the number of hardware threads on your system). As tasks finish, and we get the correct result, we may need to add additional steps if we want our results in a particular order. For example, for the above, we may want to sort the results by the "name" field. This allows both [`each`](/commands/docs/each) and [`par-each`](/commands/docs/par-each) versions of our script to give the same result. diff --git a/book/plugins.md b/src/content/docs/book/advanced/plugins.mdx similarity index 72% rename from book/plugins.md rename to src/content/docs/book/advanced/plugins.mdx index f33e7cf0422..ee27394e13b 100644 --- a/book/plugins.md +++ b/src/content/docs/book/advanced/plugins.mdx @@ -1,4 +1,10 @@ -# Plugins +--- +title: Plugins +sidebar: + order: 6 +--- + +import { Tabs, TabItem, Code } from "@astrojs/starlight/components"; Nu can be extended using plugins. Plugins behave much like Nu's built-in commands, with the added benefit that they can be added separately from Nu itself. @@ -6,23 +12,20 @@ Nu plugins are executables; Nu launches them as needed and communicates with the ## Adding a plugin -To add a plugin, call the [`register`](/commands/docs/register.md) command to tell Nu where to find it. As you do, you'll need to also tell Nushell what encoding the plugin uses. +To add a plugin, call the [`register`](/commands/docs/register) command to tell Nu where to find it. As you do, you'll need to also tell Nushell what encoding the plugin uses. Please note that the plugin name needs to start with `nu_plugin_`, Nu uses the name prefix to detect plugins. -Linux+macOS: - -```nu -> register ./my_plugins/nu_plugin_cool -``` - -Windows: - -```nu -> register .\my_plugins\nu_plugin_cool.exe -``` +<Tabs> + <TabItem label="Linux/MacOS"> + <Code code="register ./my_plugins/nu_plugin_cool" lang="nu" /> + </TabItem> + <TabItem label="Windows"> + <Code code="register .\my_plugins\nu_plugin_cool.exe" lang="nu" /> + </TabItem> +</Tabs> -When [`register`](/commands/docs/register.md) is called: +When [`register`](/commands/docs/register) is called: 1. Nu launches the plugin, and waits for the plugin to tell Nu which communication encoding it should use 2. Nu sends it a "Signature" message over stdin @@ -52,4 +55,4 @@ Nu's plugin documentation is a work in progress. If you're unsure about somethin ## More details -The [plugin chapter in the contributor book](/contributor-book/plugins.md) offers more details on the intricacies of how plugins work from a software developer point of view. +The [plugin chapter in the contributor book](/contributor-book/plugins) offers more details on the intricacies of how plugins work from a software developer point of view. diff --git a/book/standard_library.md b/src/content/docs/book/advanced/standard_library.md similarity index 67% rename from book/standard_library.md rename to src/content/docs/book/advanced/standard_library.md index f5fda93e710..768505cbf31 100644 --- a/book/standard_library.md +++ b/src/content/docs/book/advanced/standard_library.md @@ -1,3 +1,10 @@ -# Standard library (preview) +--- +title: Standard library +sidebar: + order: 1 + badge: + text: Preview + variant: caution +--- The standard library is located on the [Git repository](https://github.com/nushell/nushell/tree/main/crates/nu-std). At the moment it is an alpha development stage. You can find more documentation there. diff --git a/book/coming_from_bash.md b/src/content/docs/book/coming-to-nu/coming_from_bash.md similarity index 61% rename from book/coming_from_bash.md rename to src/content/docs/book/coming-to-nu/coming_from_bash.md index 46d2371fe21..e04db573d2f 100644 --- a/book/coming_from_bash.md +++ b/src/content/docs/book/coming-to-nu/coming_from_bash.md @@ -1,68 +1,71 @@ -# Coming from Bash +--- +title: Coming from Bash +sidebar: + order: 1 +--- If you're coming from `Git Bash` on Windows, then the external commands you're used to (bash, grep, etc) will not be available in `nu` by default (unless you had explicitly made them available in the Windows Path environment variable). To make these commands available in `nu` as well, add the following line to your `config.nu` with either `append` or `prepend`. -``` +```nu title="config.nu" $env.Path = ($env.Path | prepend 'C:\Program Files\Git\usr\bin') ``` Note: this table assumes Nu 0.60.0 or later. -| Bash | Nu | Task | -| ------------------------------------ | ------------------------------------------------------------- | ----------------------------------------------------------------- | -| `ls` | `ls` | Lists the files in the current directory | -| `ls <dir>` | `ls <dir>` | Lists the files in the given directory | -| `ls pattern*` | `ls pattern*` | Lists files that match a given pattern | -| `ls -la` | `ls --long --all` or `ls -la` | List files with all available information, including hidden files | -| `ls -d */` | `ls \| where type == dir` | List directories | -| `find . -name *.rs` | `ls **/*.rs` | Find recursively all files that match a given pattern | -| `find . -name Makefile \| xargs vim` | `ls **/Makefile \| get name \| vim $in` | Pass values as command parameters | -| `cd <directory>` | `cd <directory>` | Change to the given directory | -| `cd` | `cd` | Change to the home directory | -| `cd -` | `cd -` | Change to the previous directory | -| `mkdir <path>` | `mkdir <path>` | Creates the given path | -| `mkdir -p <path>` | `mkdir <path>` | Creates the given path, creating parents as necessary | -| `touch test.txt` | `touch test.txt` | Create a file | -| `> <path>` | `\| save --raw <path>` | Save string into a file | -| `>> <path>` | `\| save --raw --append <path>` | Append string to a file | -| `> /dev/null` | `\| ignore` | Discard command output | -| `> /dev/null 2>&1` | `out+err> /dev/null` | Discard command output, including stderr | -| `command arg1 arg2 2>&1 \| less` | `run-external --redirect-combine command [arg1 arg2] \| less` | Pipe stdout+stderr of a command into less, output updated live | -| `cat <path>` | `open --raw <path>` | Display the contents of the given file | -| | `open <path>` | Read a file as structured data | -| `mv <source> <dest>` | `mv <source> <dest>` | Move file to new location | -| `cp <source> <dest>` | `cp <source> <dest>` | Copy file to new location | -| `cp -r <source> <dest>` | `cp -r <source> <dest>` | Copy directory to a new location, recursively | -| `rm <path>` | `rm <path>` | Remove the given file | -| | `rm -t <path>` | Move the given file to the system trash | -| `rm -rf <path>` | `rm -r <path>` | Recursively removes the given path | +| Bash | Nu | Task | +| ------------------------------------ | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | +| `ls` | `ls` | Lists the files in the current directory | +| `ls <dir>` | `ls <dir>` | Lists the files in the given directory | +| `ls pattern*` | `ls pattern*` | Lists files that match a given pattern | +| `ls -la` | `ls --long --all` or `ls -la` | List files with all available information, including hidden files | +| `ls -d */` | `ls \| where type == dir` | List directories | +| `find . -name *.rs` | `ls **/*.rs` | Find recursively all files that match a given pattern | +| `find . -name Makefile \| xargs vim` | `ls **/Makefile \| get name \| vim $in` | Pass values as command parameters | +| `cd <directory>` | `cd <directory>` | Change to the given directory | +| `cd` | `cd` | Change to the home directory | +| `cd -` | `cd -` | Change to the previous directory | +| `mkdir <path>` | `mkdir <path>` | Creates the given path | +| `mkdir -p <path>` | `mkdir <path>` | Creates the given path, creating parents as necessary | +| `touch test.txt` | `touch test.txt` | Create a file | +| `> <path>` | `\| save --raw <path>` | Save string into a file | +| `>> <path>` | `\| save --raw --append <path>` | Append string to a file | +| `> /dev/null` | `\| ignore` | Discard command output | +| `> /dev/null 2>&1` | `out+err> /dev/null` | Discard command output, including stderr | +| `command arg1 arg2 2>&1 \| less` | `run-external --redirect-combine command [arg1 arg2] \| less` | Pipe stdout+stderr of a command into less, output updated live | +| `cat <path>` | `open --raw <path>` | Display the contents of the given file | +| | `open <path>` | Read a file as structured data | +| `mv <source> <dest>` | `mv <source> <dest>` | Move file to new location | +| `cp <source> <dest>` | `cp <source> <dest>` | Copy file to new location | +| `cp -r <source> <dest>` | `cp -r <source> <dest>` | Copy directory to a new location, recursively | +| `rm <path>` | `rm <path>` | Remove the given file | +| | `rm -t <path>` | Move the given file to the system trash | +| `rm -rf <path>` | `rm -r <path>` | Recursively removes the given path | | `date -d <date>` | `"<date>" \| into datetime -f <format>` | Parse a date ([format documentation](https://docs.rs/chrono/0.4.15/chrono/format/strftime/index.html)) | -| `sed` | `str replace` | Find and replace a pattern in a string | -| `grep <pattern>` | `where $it =~ <substring>` or `find <substring>` | Filter strings that contain the substring | -| `man <command>` | `help <command>` | Get the help for a given command | -| | `help commands` | List all available commands | -| | `help --find <string>` | Search for match in all available commands | -| `command1 && command2` | `command1; command2` | Run a command, and if it's successful run a second | -| `stat $(which git)` | `stat (which git).path` | Use command output as argument for other command | -| `echo /tmp/$RANDOM` | `$"/tmp/(random integer)"` | Use command output in a string | -| `cargo b --jobs=$(nproc)` | `cargo b $"--jobs=(sys \| get cpu \| length)"` | Use command output in an option | -| `echo $PATH` | `$env.PATH` (Non-Windows) or `$env.Path` (Windows) | See the current path | -| `<update ~/.bashrc>` | `vim $nu.config-path` | Update PATH permanently | -| `export PATH = $PATH:/usr/other/bin` | `$env.PATH = ($env.PATH \| append /usr/other/bin)` | Update PATH temporarily | -| `export` | `$env` | List the current environment variables | -| `<update ~/.bashrc>` | `vim $nu.config-path` | Update environment variables permanently | -| `FOO=BAR ./bin` | `FOO=BAR ./bin` | Update environment temporarily | -| `export FOO=BAR` | `$env.FOO = BAR` | Set environment variable for current session | -| `echo $FOO` | `$env.FOO` | Use environment variables | -| `echo ${FOO:-fallback}` | `$env.FOO? | default "ABC"` | Use a fallback in place of an unset variable | -| `unset FOO` | `hide-env FOO` | Unset environment variable for current session | -| `alias s="git status -sb"` | `alias s = git status -sb` | Define an alias temporarily | -| `type FOO` | `which FOO` | Display information about a command (builtin, alias, or executable) | -| `<update ~/.bashrc>` | `vim $nu.config-path` | Add and edit alias permanently (for new shells) | -| `bash -c <commands>` | `nu -c <commands>` | Run a pipeline of commands | -| `bash <script file>` | `nu <script file>` | Run a script file | -| `\` | `( <command> )` | A command can span multiple lines when wrapped with `(` and `)` | -| `pwd` | `$env.PWD` | Display the current directory | -| `read var` | `let var = input` | Get input from the user. | - +| `sed` | `str replace` | Find and replace a pattern in a string | +| `grep <pattern>` | `where $it =~ <substring>` or `find <substring>` | Filter strings that contain the substring | +| `man <command>` | `help <command>` | Get the help for a given command | +| | `help commands` | List all available commands | +| | `help --find <string>` | Search for match in all available commands | +| `command1 && command2` | `command1; command2` | Run a command, and if it's successful run a second | +| `stat $(which git)` | `stat (which git).path` | Use command output as argument for other command | +| `echo /tmp/$RANDOM` | `$"/tmp/(random integer)"` | Use command output in a string | +| `cargo b --jobs=$(nproc)` | `cargo b $"--jobs=(sys \| get cpu \| length)"` | Use command output in an option | +| `echo $PATH` | `$env.PATH` (Non-Windows) or `$env.Path` (Windows) | See the current path | +| `<update ~/.bashrc>` | `vim $nu.config-path` | Update PATH permanently | +| `export PATH = $PATH:/usr/other/bin` | `$env.PATH = ($env.PATH \| append /usr/other/bin)` | Update PATH temporarily | +| `export` | `$env` | List the current environment variables | +| `<update ~/.bashrc>` | `vim $nu.config-path` | Update environment variables permanently | +| `FOO=BAR ./bin` | `FOO=BAR ./bin` | Update environment temporarily | +| `export FOO=BAR` | `$env.FOO = BAR` | Set environment variable for current session | +| `echo $FOO` | `$env.FOO` | Use environment variables | +| `echo ${FOO:-fallback}` | `$env.FOO? \| default "ABC"` | Use a fallback in place of an unset variable | +| `unset FOO` | `hide-env FOO` | Unset environment variable for current session | +| `alias s="git status -sb"` | `alias s = git status -sb` | Define an alias temporarily | +| `type FOO` | `which FOO` | Display information about a command (builtin, alias, or executable) | +| `<update ~/.bashrc>` | `vim $nu.config-path` | Add and edit alias permanently (for new shells) | +| `bash -c <commands>` | `nu -c <commands>` | Run a pipeline of commands | +| `bash <script file>` | `nu <script file>` | Run a script file | +| `\` | `( <command> )` | A command can span multiple lines when wrapped with `(` and `)` | +| `pwd` | `$env.PWD` | Display the current directory | +| `read var` | `let var = input` | Get input from the user. | diff --git a/book/coming_from_cmd.md b/src/content/docs/book/coming-to-nu/coming_from_cmd.md similarity index 95% rename from book/coming_from_cmd.md rename to src/content/docs/book/coming-to-nu/coming_from_cmd.md index 8de01193e69..aad9350ae37 100644 --- a/book/coming_from_cmd.md +++ b/src/content/docs/book/coming-to-nu/coming_from_cmd.md @@ -1,4 +1,8 @@ -# Coming from CMD.EXE +--- +title: Coming from CMD.EXE +sidebar: + order: 2 +--- This table was last updated for Nu 0.67.0. @@ -57,4 +61,4 @@ This table was last updated for Nu 0.67.0. | `VERIFY` | | Verify that file writes happen | | `VOL` | | Show drive information | -Before Nu version 0.67, Nu [used to](https://www.nushell.sh/blog/2022-08-16-nushell-0_67.html#windows-cmd-exe-changes-rgwood) use CMD.EXE to launch external commands, which meant that the above builtins could be run as an `^external` command. As of version 0.67, however, Nu no longer uses CMD.EXE to launch externals, meaning the above builtins cannot be run from within Nu, except for `ASSOC`, `CLS`, `ECHO`, `FTYPE`, `MKLINK`, `PAUSE`, `START`, `VER`, and `VOL`, which are explicitly allowed to be interpreted by CMD if no executable by that name exists. +Before Nu version 0.67, Nu [used to](https://www.nushell.sh/blog/2022-08-16-nushell-0_67#windows-cmd-exe-changes-rgwood) use CMD.EXE to launch external commands, which meant that the above builtins could be run as an `^external` command. As of version 0.67, however, Nu no longer uses CMD.EXE to launch externals, meaning the above builtins cannot be run from within Nu, except for `ASSOC`, `CLS`, `ECHO`, `FTYPE`, `MKLINK`, `PAUSE`, `START`, `VER`, and `VOL`, which are explicitly allowed to be interpreted by CMD if no executable by that name exists. diff --git a/src/content/docs/book/coming-to-nu/nushell_map.md b/src/content/docs/book/coming-to-nu/nushell_map.md new file mode 100644 index 00000000000..60c0cd051ef --- /dev/null +++ b/src/content/docs/book/coming-to-nu/nushell_map.md @@ -0,0 +1,78 @@ +--- +title: Nushell map +sidebar: + order: 3 +--- + +The idea behind this table is to help you understand how Nu builtins and plugins relate to other known shells and domain specific languages. We've tried to produce a map of relevant Nu commands and what their equivalents are in other languages. Contributions are welcome. + +Note: this table assumes Nu 0.43 or later. + +| Nushell | SQL | .Net LINQ (C#) | PowerShell (without external modules) | Bash | +| ------------------------- | ------------------------------------------------ | ---------------------------------------------------- | ------------------------------------------ | ----------------------------------------------- | +| alias | | | alias | alias | +| append | | Append | -Append | | +| math avg | avg | Average | Measure-Object, measure | | +| calc, `<math expression>` | math operators | Aggregate, Average, Count, Max, Min, Sum | | bc | +| cd | | | Set-Location, cd | cd | +| clear | | | Clear-Host | clear | +| config | | | $Profile | vi .bashrc, .profile | +| cp | | | Copy-Item, cp, copy | cp | +| date | NOW() / getdate() | DateTime class | Get-Date | date | +| du | | | | du | +| each | cursor | | ForEach-Object, foreach, for | | +| exit | | | exit | exit | +| http | | HttpClient,WebClient, HttpWebRequest/Response | Invoke-WebRequest | wget | +| first | top, limit | First, FirstOrDefault | Select-Object -First | head | +| format | | String.Format | String.Format | | +| from | import flatfile, openjson, cast(variable as xml) | | Import/ConvertFrom-{Csv,Xml,Html,Json} | | +| get | | Select | (cmd).column | | +| group-by | group by | GroupBy, group | Group-Object, group | | +| help | sp_help | | Get-Help, help, man | man | +| history | | | Get-History, history | history | +| is-empty | is null | String.InNullOrEmpty | String.InNullOrEmpty | | +| kill | | | Stop-Process, kill | kill | +| last | | Last, LastOrDefault | Select-Object -Last | tail | +| length | count | Count | Measure-Object, measure | wc | +| lines | | | File.ReadAllLines | | +| ls | | | Get-ChildItem, dir, ls | ls | +| mkdir | | | mkdir, md | mkdir | +| mv | | | Move-Item, mv, move, mi | mv | +| nth | limit x offset y, rownumber = | ElementAt | [x], indexing operator, ElementAt | | +| open | | | Get-Content, gc, cat, type | cat | +| print | print, union all | | Write-Output, write | echo | +| transpose | pivot | | | | +| ps | | | Get-Process, ps, gps | ps | +| pwd | | | Get-Location, pwd | pwd | +| range | | Range | 1..10, 'a'..'f' | | +| reduce | | Aggregate | | | +| rename | | | Rename-Item, ren, rni | mv | +| reverse | | Reverse | [Array]::Reverse($var) | | +| rm | | | Remove-Item, del, erase, rd, ri, rm, rmdir | rm | +| save | | | Write-Output, Out-File | > foo.txt | +| select | select | Select | Select-Object, select | | +| shuffle | | Random | Sort-Object {Get-Random} | | +| size | | | Measure-Object, measure | wc | +| skip | where row_number() | Skip | Select-Object -Skip | | +| skip until | | SkipWhile | | | +| skip while | | SkipWhile | | | +| sort-by | order by | OrderBy, OrderByDescending, ThenBy, ThenByDescending | Sort-Object, sort | | +| split-by | | Split | Split | | +| str | string functions | String class | String class | | +| str join | concat_ws | Join | Join-String | | +| str trim | rtrim, ltrim | Trim, TrimStart, TrimEnd | Trim | | +| sum | sum | Sum | Measure-Object, measure | | +| sys | | | Get-ComputerInfo | uname, lshw, lsblk, lscpu, lsusb, hdparam, free | +| table | | | Format-Table, ft, Format-List, fl | | +| take | top, limit | Take | Select-Object -First | head | +| take until | | TakeWhile | | | +| take while | | TakeWhile | | | +| timeit | | | Measure-Command | time | +| to | | | Export/ConvertTo-{Csv,Xml,Html,Json} | | +| touch | | | Set-Content | touch | +| uniq | distinct | Distinct | Get-Unique, gu | uniq | +| upsert | As | | | | +| version | select @@version | | $PSVersionTable | | +| with-env | | | $env:FOO = 'bar' | export foo = "bar" | +| where | where | Where | Where-Object, where, "?" operator | | +| which | | | | which | diff --git a/book/nushell_map_functional.md b/src/content/docs/book/coming-to-nu/nushell_map_functional.md similarity index 98% rename from book/nushell_map_functional.md rename to src/content/docs/book/coming-to-nu/nushell_map_functional.md index f4e84b8a17e..ff96f81ab8e 100644 --- a/book/nushell_map_functional.md +++ b/src/content/docs/book/coming-to-nu/nushell_map_functional.md @@ -1,4 +1,8 @@ -# Nu map from functional languages +--- +title: Nushell map from functional languages +sidebar: + order: 5 +--- The idea behind this table is to help you understand how Nu builtins and plugins relate to functional languages. We've tried to produce a map of relevant Nu commands and what their equivalents are in other languages. Contributions are welcome. diff --git a/src/content/docs/book/coming-to-nu/nushell_map_imperative.md b/src/content/docs/book/coming-to-nu/nushell_map_imperative.md new file mode 100644 index 00000000000..97b8e2764b0 --- /dev/null +++ b/src/content/docs/book/coming-to-nu/nushell_map_imperative.md @@ -0,0 +1,80 @@ +--- +title: Nu map from imperative languages +sidebar: + order: 4 +--- + +The idea behind this table is to help you understand how Nu built-ins and plugins relate to imperative languages. We've tried to produce a map of programming-relevant Nu commands and what their equivalents are in other languages. Contributions are welcome. + +Note: this table assumes Nu 0.43 or later. + +| Nushell | Python | Kotlin (Java) | C++ | Rust | +| ------------ | ---------------------------------- | --------------------------------------------------- | ----------------------- | --------------------------------------------------- | +| append | list.append, set.add | add | push_back, emplace_back | push, push_back | +| math avg | statistics.mean | | | | +| calc, = math | math operators | math operators | math operators | math operators | +| count | len | size, length | length | len | +| cp | shutil.copy | | | fs::copy | +| date | datetime.date.today | java.time.LocalDate.now | | | +| drop | list[:-3] | | | | +| du | shutil.disk_usage | | | | +| each | for | for | for | for | +| exit | exit | System.exit, kotlin.system.exitProcess | exit | exit | +| http get | urllib.request.urlopen | | | | +| first | list[:x] | List[0], peek | vector[0], top | Vec[0] | +| format | format | format | format | format! | +| from | csv, json, sqlite3 | | | | +| get | dict[\"key\"] | Map[\"key\"] | map[\"key\"] | HashMap["key"], get, entry | +| group-by | itertools.groupby | groupBy | | group_by | +| headers | keys | | | | +| help | help | | | | +| insert | dict[\"key\"] = val | | map.insert({ 20, 130 }) | map.insert(\"key\", val) | +| is-empty | is None, is [] | isEmpty | empty | is_empty | +| take | list[:x] | | | &Vec[..x] | +| take until | itertools.takewhile | | | | +| take while | itertools.takewhile | | | | +| kill | os.kill | | | | +| last | list[-x:] | | | &Vec[Vec.len()-1] | +| lines | split, splitlines | split | views::split | split, split_whitespace, rsplit, lines | +| ls | os.listdir | | | fs::read_dir | +| match | match | when | | match | +| merge | dict.append | | | map.extend | +| mkdir | os.mkdir | | | fs::create_dir | +| mv | shutil.move | | | fs::rename | +| get | list[x] | List[x] | vector[x] | Vec[x] | +| open | open | | | | +| transpose | zip(\*matrix) | | | | +| http post | urllib.request.urlopen | | | | +| prepend | deque.appendleft | | | | +| print | print | println | printf | println! | +| ps | os.listdir('/proc') | | | | +| pwd | os.getcwd | | | env::current_dir | +| range | range | .., until, downTo, step | iota | .. | +| reduce | functools.reduce | reduce | reduce | fold, rfold, scan | +| reject | del | | | | +| rename | dict[\"key2\"] = dict.pop(\"key\") | | | map.insert(\"key2\", map.remove(\"key\").unwrap()); | +| reverse | reversed, list.reverse | reverse, reversed, asReversed | reverse | rev | +| rm | os.remove | | | | +| save | io.TextIOWrapper.write | | | | +| select | {k:dict[k] for k in keys} | | | | +| shuffle | random.shuffle | | | | +| size | len | | | len | +| skip | list[x:] | | | &Vec[x..],skip | +| skip until | itertools.dropwhile | | | | +| skip while | itertools.dropwhile | | | skip_while | +| sort-by | sorted, list.sort | sortedBy, sortedWith, Arrays.sort, Collections.sort | sort | sort | +| split row | str.split{,lines}, re.split | split | views::split | split | +| str | str functions | String functions | string functions | &str, String functions | +| str join | str.join | joinToString | | join | +| str trim | strip, rstrip, lstrip | trim, trimStart, trimEnd | regex | trim, trim*{start,end}, strip*{suffix,prefix} | +| sum | sum | sum | reduce | sum | +| sys | sys | | | | +| to | import csv, json, sqlite3 | | | | +| touch | open(path, 'a').close() | | | | +| uniq | set | Set | set | HashSet | +| upsert | dict[\"key\"] = val | | | | +| version | sys.version, sys.version_info | | | | +| with-env | os.environ | | | | +| where | filter | filter | filter | filter | +| which | shutil.which | | | | +| wrap | { "key" : val } | | | | diff --git a/book/nushell_operator_map.md b/src/content/docs/book/coming-to-nu/nushell_operator_map.md similarity index 97% rename from book/nushell_operator_map.md rename to src/content/docs/book/coming-to-nu/nushell_operator_map.md index 51d1c029b1e..6b2fcae40b5 100644 --- a/book/nushell_operator_map.md +++ b/src/content/docs/book/coming-to-nu/nushell_operator_map.md @@ -1,4 +1,8 @@ -# Nushell operator map +--- +title: Nushell operator map +sidebar: + order: 6 +--- The idea behind this table is to help you understand how Nu operators relate to other language operators. We've tried to produce a map of all the nushell operators and what their equivalents are in other languages. Contributions are welcome. diff --git a/src/content/docs/book/coming_to_nu.md b/src/content/docs/book/coming_to_nu.md new file mode 100644 index 00000000000..584a278f530 --- /dev/null +++ b/src/content/docs/book/coming_to_nu.md @@ -0,0 +1,11 @@ +--- +title: Coming to Nu +--- + +If you are familiar with other shells or programming languages, you might find this chapter useful to get up to speed. + +[Coming from Bash](coming_from_bash) shows how some patterns typical for Bash, or POSIX shells in general, can be mapped to Nushell. +Similarly, [Coming from CMD.EXE](coming_from_cmd) shows how built-in commands in the Windows Command Prompt can be mapped to Nushell. + +Similar comparisons are made for some [other shells and domain-specific languages](nushell_map), [imperative languages](nushell_map_imperative), and [functional languages](nushell_map_functional). +A separate comparison is made specifically for [operators](nushell_operator_map). diff --git a/de/book/design_notes.md b/src/content/docs/book/design_notes.md similarity index 53% rename from de/book/design_notes.md rename to src/content/docs/book/design_notes.md index c155e0e0e26..ccc7180524f 100644 --- a/de/book/design_notes.md +++ b/src/content/docs/book/design_notes.md @@ -1,7 +1,9 @@ -# Design Notes +--- +title: Design Notes +--- This chapter intends to give more in-depth overview of certain aspects of Nushell's design. The topics are not necessary for a basic usage, but reading them will help you understand how Nushell works and why. We intend to expand this chapter in the future. If there is some topic that you find confusing and hard to understand, let us know. It might be a good candidate for a page here. -[How Nushell Code Gets Run](how_nushell_code_gets_run.md) explains what happens when you run Nushell source code. It explains how Nushell is in many ways closer to classic compiled languages, like C or Rust, than to other shells and dynamic languages and hopefully clears some confusion that stems from that. +[How Nushell Code Gets Run](how_nushell_code_gets_run) explains what happens when you run Nushell source code. It explains how Nushell is in many ways closer to classic compiled languages, like C or Rust, than to other shells and dynamic languages and hopefully clears some confusion that stems from that. diff --git a/src/content/docs/book/getting-started/cheat_sheet.mdx b/src/content/docs/book/getting-started/cheat_sheet.mdx new file mode 100644 index 00000000000..2fcbb4c2fe4 --- /dev/null +++ b/src/content/docs/book/getting-started/cheat_sheet.mdx @@ -0,0 +1,463 @@ +--- +title: Nushell Cheat Sheet +sidebar: + order: 8 +--- + +import { Code } from "@astrojs/starlight/components"; + +## Data types + +```nu +# converts string to integer +"12" | into int +``` + +--- + +```nu +# converts present date to provided time zone +date now | date to-timezone "Europe/London" +``` + +--- + +```nu +# updates a record's language and if none is specified inserts provided value +{'name': 'nu', 'stars': 5, 'language': 'Python'} | upsert language 'Rust' +``` + +--- + +```nu +# converts list of strings to yaml +[one two three] | to yaml +``` + +--- + +```nu +# prints the table +[[framework, language]; [Django, Python] [Lavarel, PHP]] +``` + +--- + +```nu +# selects two columns from the table and prints their values +[{name: 'Robert' age: 34 position: 'Designer'} + {name: 'Margaret' age: 30 position: 'Software Developer'} + {name: 'Natalie' age: 50 position: 'Accountant'} + ] | select name position +``` + +## Strings + +```nu +# prints `greetings, Alice!` +let name = "Alice" +$"greetings, ($name)!" +``` + +--- + +```nu +# splits the string with specified delimiter and saves the list to `string_list` variable +let string_list = "one,two,three" | split row "," +$string_list +``` + +--- + +```nu +# checks if a string contains a substring and returns `boolean` +"Hello, world!" | str contains "o, w" +``` + +--- + +```nu +# joins the list of strings using provided delimiter +let str_list = [zero one two] +$str_list | str join ',' +``` + +--- + +```nu +# created a slice from a given string with start (4) and end (8) indices +'Hello World!' | str substring 4..8 +``` + +--- + +```nu +# parses the string to columns +'Nushell 0.80' | parse '{shell} {version}' +``` + +```nu +# parses comma separated values (csv) +"acronym,long\nAPL,A Programming Language" | from csv +``` + +```nu +# ansi command colors the text (alsways end with `ansi reset` to reset color to default) +$'(ansi purple_bold)This text is a bold purple!(ansi reset)' +``` + +## Lists + +```nu +# inserts `beeze` value at st index in the list +[foo bar baz] | insert 1 'beeze' +``` + +--- + +```nu +# updates 2nd value to 10 +[1, 2, 3, 4] | update 1 10 +``` + +--- + +```nu +# adds value at the beginning of the list +let numbers = [1, 2, 3, 4, 5] +$numbers | prepend 0 +``` + +--- + +```nu +# adds value at the end of the list +let numbers = [1, 2, 3, 4, 5] +$numbers | append 6 +``` + +--- + +```nu +# creates slice of first two values from `flowers` list +let flowers = [cammomile marigold rose forget-me-not] +let flowers = ($flowers | first 2) +$flowers +``` + +--- + +```nu +# iterates over a list; `it` is current list value +let planets = [Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune] +$planets | each { |it| $"($it) is a planet of solar system" } +``` + +--- + +```nu +# iterates over a list and provides index and value in `it` +$planets | enumerate | each { |it| $"($it.index + 1) - ($it.item)" } +``` + +--- + +```nu +# reduces the list to a single value, `reduce` gives access to accumulator that is applied +# to each element in the list +let scores = [3 8 4] +$"total = ($scores | reduce { |it, acc| $acc + $it })" +``` + +--- + +```nu +# initial value for accumulator value can be set with `--fold` +$"total = ($scores | reduce --fold 1 { |it, acc| $acc * $it })" +``` + +--- + +```nu +# gives access to the 3rd item in the list +let planets = [Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune] +$planets.2 +``` + +--- + +```nu +# checks if any string in the list starts with `E` +let planets = [Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune] +$planets | any {|it| $it | str starts-with "E" } +``` + +--- + +```nu +# creates slice of items that satisfy provided condition +let cond = {|x| $x < 0 }; [-1 -2 9 1] | take while $cond +``` + +## Tables + +```nu +# sorting table by size of files +ls | sort-by size +``` + +--- + +```nu +# sorting table by size of files and show first 5 entries +ls | sort-by size | first 5 +``` + +--- + +```nu +# concatenate two tables with same columns +let $a = [[first_column second_column third_column]; [foo bar snooze]] +let $b = [[first_column second_column third_column]; [hex seeze feeze]] +$a | append $b +``` + +--- + +```nu +# remove the last column of a table +let teams_scores = [[team score plays]; ['Boston Celtics' 311 3] ['Golden State Warriors', 245 2]] +$teams_scores | drop column +``` + +## Files & Filesystem + +```nu +# opens a text file with the default text editor +start file.txt +``` + +--- + +```nu +# saves a string to text file +'lorem ipsum ' | save file.txt +``` + +--- + +```nu +# appends a string to the end of file.txt +'dolor sit amet' | save --append file.txt +``` + +--- + +```nu +# saves a record to file.json +{ a: 1, b: 2 } | save file.json +``` + +--- + +```nu +# searches for `.rs` and `.toml` files recursively up to 2 folders deep +glob **/*.{rs,toml} --depth 2 +``` + +--- + +```nu +# runs cargo test whenever a Rust file changes +watch . --glob=**/*.rs {|| cargo test } +``` + +--- + +## Custom Commands + +```nu +# custom command with parameter type set to string + def greet [name: string] { + $"hello ($name)" + } +``` + +--- + +```nu +# custom command with default parameter set to nushell + def greet [name = "nushell"] { + $"hello ($name)" + } +``` + +--- + +```nu +# passing named parameter by defining flag for custom commands + def greet [ + name: string + --age: int + ] { + [$name $age] + } + + greet world --age 10 +``` + +--- + +```nu +# using flag as a switch with a shorthand flag (-a) for the age + def greet [ + name: string + --age (-a): int + --twice + ] { + if $twice { + [$name $age $name $age] + } else { + [$name $age] + } + } + greet -a 10 --twice hello +``` + +--- + +```nu +#custom command which takes any number of positional arguments using rest params + def greet [...name: string] { + print "hello all:" + for $n in $name { + print $n + } + } + + greet earth mars jupiter venus +``` + +## Variables & Subexpressions + +```nu +# an immutable variable cannot change its value after declaration +let val = 42 +print $val +``` + +--- + +```nu +# shadowing variable (declaring variable with the same name in a different scope) +let val = 42 +do { let val = 101; $val } +# outputs 101 +$val +# outputs 42 +``` + +--- + +```nu +# declaring a mutable variable with mut key word +mut val = 42 +$val += 27 +$val +``` + +--- + +```nu +# closures and nested defs cannot capture mutable variables from their environment. +# this expression results in error. +mut x = 0 +[1 2 3] | each { $x += 1 } +``` + +--- + +```nu +# a constant variable is immutable value which is fully evaluated at parse-time +const plugin = 'path/to/plugin' +register $plugin +``` + +--- + +```nu +# using question mark operator to return null instead of error if provided path is incorrect +let files = (ls) +$files.name?.0? +``` + +--- + +```nu +# using subexpression by wrapping the expression with parentheses () +let big_files = (ls | where size > 10kb) +$big_files +``` + +--- + +## Modules + +```nu +# using inline module + module greetings { + export def hello [name: string] { + $"hello ($name)!" + } + + export def hi [where: string] { + $"hi ($where)!" + } + } + + use greetings hello + hello "world" +``` + +--- + +```nu title="greetings.nu" +# importing module from file and using its environment in current scope + export-env { + $env.MYNAME = "Arthur, King of the Britons" + } + export def hello [] { + $"hello ($env.MYNAME)" + } + + use greetings.nu + $env.MYNAME + # outputs: Arthur, King of the Britons + greetings hello + #outputs: hello Arthur, King of the Britons! +``` + +--- + +```nu title="greetings.nu" + # using main command in module + export def hello [name: string] { + $"hello ($name)!" + } + + export def hi [where: string] { + $"hi ($where)!" + } + + export def main [] { + "greetings and salutations!" + } + + use greetings.nu + greetings + # outputs: greetings and salutations! + greetings hello world + # outputs: hello world! +``` + +--- diff --git a/book/default_shell.md b/src/content/docs/book/getting-started/default_shell.mdx similarity index 84% rename from book/default_shell.md rename to src/content/docs/book/getting-started/default_shell.mdx index f3e512c9da5..2ee26a3137b 100644 --- a/book/default_shell.md +++ b/src/content/docs/book/getting-started/default_shell.mdx @@ -1,11 +1,18 @@ -# Default shell +--- +title: Default shell +description: Setting Nu as your default shell +sidebar: + order: 4 +--- -## Setting Nu as default shell on your terminal +import { Code } from "@astrojs/starlight/components"; + +## Setting Nu as your default shell | Terminal | Platform | Instructions | | :--------------: | ------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | | GNOME Terminal | Linux & BSDs | Open `Edit > Preferences`. In the right-hand panel, select the `Command` tab, tick `Run a custom command instead of my shell`, and set `Custom command` to the path to Nu. | -| GNOME Console | Linux & BSDs | Type the command `gsettings set org.gnome.Console shell "['/usr/bin/nu']"` (replace `/usr/bin/nu` with the path to Nu). Equivalently, use [dconf Editor](https://apps.gnome.org/DconfEditor/) to edit the `/org/gnome/Console/shell` key. | +| GNOME Console | Linux & BSDs | Type the command `gsettings set org.gnome.Console shell "['/usr/bin/nu']"` (replace `/usr/bin/nu` with the path to Nu). Equivalently, use [dconf Editor](https://apps.gnome.org/DconfEditor/) to edit the `/org/gnome/Console/shell` key. | | Konsole | Linux & BSDs | Open `Settings > Edit Current Profile`. Set `Command` to the path to Nu. | | XFCE Terminal | Linux & BSDs | Open `Edit > Preferences`. Check `Run a custom command instead of my shell`, and set `Custom command` to the path to Nu. | | Terminal.app | macOS | Open `Terminal > Preferences`. Ensure you are on the `Profiles` tab, which should be the default tab. In the right-hand panel, select the `Shell` tab. Tick `Run command`, put the path to Nu in the textbox, and untick `Run inside shell`. | @@ -14,7 +21,7 @@ ## Setting Nu as login shell (Linux, BSD & macOS) -::: warning +:::caution[WARNING] Nu is still in development and is not intended to be POSIX compliant. Be aware that some programs on your system might assume that your login shell is [POSIX](https://en.wikipedia.org/wiki/POSIX) compatible. Breaking that assumption can lead to unexpected issues. @@ -24,7 +31,7 @@ To set the login shell you can use the [`chsh`](https://linux.die.net/man/1/chsh Some Linux distributions have a list of valid shells located in `/etc/shells` and will disallow changing the shell until Nu is in the whitelist. You may see an error similar to the one below if you haven't updated the `shells` file: -@[code](@snippets/installation/chsh_invalid_shell_error.sh) +<Code code="chsh: /home/username/.cargo/bin/nu is an invalid shell" lang="sh" /> You can add Nu to the list of allowed shells by appending your Nu binary to the `shells` file. The path to add can be found with the command `which nu`, usually it is `$HOME/.cargo/bin/nu`. diff --git a/src/content/docs/book/getting-started/getting_started.md b/src/content/docs/book/getting-started/getting_started.md new file mode 100644 index 00000000000..661e2142d79 --- /dev/null +++ b/src/content/docs/book/getting-started/getting_started.md @@ -0,0 +1,13 @@ +--- +title: Getting Started +sidebar: + order: 2 +--- + +Let's get started! :elephant: + +First, to be able to use Nushell, we need to [install it](/book/installation). + +The next sections will give you a [short tour of Nushell by example](/book/quick_tour) (including how to get help from within Nushell), and show you how to [move around your file system](/book/moving_around). + +Finally, because Nushell takes some design decisions that are quite different from typical shells or dynamic scripting languages, make sure to check [Thinking in Nu](/book/thinking_in_nu) that explains some of these concepts. diff --git a/book/installation.md b/src/content/docs/book/getting-started/installation.mdx similarity index 58% rename from book/installation.md rename to src/content/docs/book/getting-started/installation.mdx index 59aae99d8b2..fa47db527c0 100644 --- a/book/installation.md +++ b/src/content/docs/book/getting-started/installation.mdx @@ -1,10 +1,30 @@ -# Installing Nu +--- +title: Installing Nu +sidebar: + order: 3 +--- + +import { Tabs, TabItem, Code } from "@astrojs/starlight/components"; +import runNu from "../../snippets/installation/run_nu.nu?raw"; +import rustupChooseRustVersion from "../../snippets/installation/rustup_choose_rust_version.nu?raw"; +import installPkgConfigLibsslDiv from "../../snippets/installation/install_pkg_config_libssl_dev.nu?raw"; +import installRhelDependencies from "../../snippets/installation/install_rhel_dependencies.nu?raw"; +import macosDeps from "../../snippets/installation/macos_deps.nu?raw"; +import cargoInstallNu from "../../snippets/installation/cargo_install_nu.nu?raw"; +import cargoInstallNuMoreFeatures from "../../snippets/installation/cargo_install_nu_more_features.nu?raw"; +import gitCloneNu from "../../snippets/installation/git_clone_nu.nu?raw"; +import buildNuFromSource from "../../snippets/installation/build_nu_from_source.nu?raw"; +import buildNuFromSourceRelease from "../../snippets/installation/build_nu_from_source_release.nu?raw"; +import useRawkeyAndClipboard from "../../snippets/installation/use_rawkey_and_clipboard.nu?raw"; +import chshInvalidShellError from "../../snippets/installation/chsh_invalid_shell_error.nu?raw"; +import windowsTerminalDefaultShell from "../../snippets/installation/windows_terminal_default_shell.nu?raw"; +import windowsChangeDefaultProfile from "../../snippets/installation/windows_change_default_profile.nu?raw"; There are lots of ways to get Nu up and running. You can download pre-built binaries from our [release page](https://github.com/nushell/nushell/releases), [use your favourite package manager](https://repology.org/project/nushell/versions), or build from source. The main Nushell binary is named `nu` (or `nu.exe` on Windows). After installation, you can launch it by typing `nu`. -@[code](@snippets/installation/run_nu.sh) +<Code code="nu" lang="nu" /> ## Pre-built binaries @@ -16,17 +36,30 @@ Nu is available via several package managers: [](https://repology.org/project/nushell/versions) -For macOS and Linux, [Homebrew](https://brew.sh/) is a popular choice (`brew install nushell`). - -For Windows: - -- [Winget](https://docs.microsoft.com/en-us/windows/package-manager/winget/) (`winget install nushell`) -- [Chocolatey](https://chocolatey.org/) (`choco install nushell`) -- [Scoop](https://scoop.sh/) (`scoop install nu`) - -Cross Platform installation: - -- [npm](https://www.npmjs.com/) (`npm install -g nushell` Note that nu plugins are not included if you install in this way) +### macOS/Linux + +<Tabs> + <TabItem label="Homebrew"> + <Code code="brew install nushell" lang="sh" /> + </TabItem> + <TabItem label="npm"> + <Code code="npm install -g nushell" lang="sh" /> + </TabItem> +</Tabs> + +### Windows + +<Tabs> + <TabItem label="Winget"> + <Code code="winget install nushell" lang="sh" /> + </TabItem> + <TabItem label="Chocolatey"> + <Code code="choco install nushell" lang="sh" /> + </TabItem> + <TabItem label="Scoop"> + <Code code="scoop install nushell" lang="sh" /> + </TabItem> +</Tabs> ## Build from source @@ -48,7 +81,7 @@ If you don't already have Rust on our system, the best way to install it is via Nu currently requires the **latest stable (1.66.1 or later)** version of Rust. The best way is to let `rustup` find the correct version for you. When you first open `rustup` it will ask what version of Rust you wish to install: -@[code](@snippets/installation/rustup_choose_rust_version.sh) +<Code code={rustupChooseRustVersion} lang="sh" /> Once you are ready, press 1 and then enter. @@ -60,44 +93,44 @@ If you'd rather not install Rust via `rustup`, you can also install it via other You will need to install the "pkg-config" and "libssl-dev" package: -@[code](@snippets/installation/install_pkg_config_libssl_dev.sh) +<Code code={installPkgConfigLibsslDiv} lang="sh" /> #### RHEL based distros You will need to install "libxcb", "openssl-devel" and "libX11-devel": -@[code](@snippets/installation/install_rhel_dependencies.sh) +<Code code={installRhelDependencies} lang="sh" /> #### macOS Using [Homebrew](https://brew.sh/), you will need to install "openssl" and "cmake" using: -@[code](@snippets/installation/macos_deps.sh) +<Code code={macosDeps} lang="sh" /> ### Build using [crates.io](https://crates.io) Nu releases are published as source to the popular Rust package registry [crates.io](https://crates.io/). This makes it easy to build and install the latest Nu release with `cargo`: -@[code](@snippets/installation/cargo_install_nu.sh) +<Code code={cargoInstallNu} lang="sh" /> That's it! The `cargo` tool will do the work of downloading Nu and its source dependencies, building it, and installing it into the cargo bin path. -If you want to install with support for [dataframes](dataframes.md), you can install using the `--features=dataframe` flag. +If you want to install with support for [dataframes](/book/dataframes), you can install using the `--features=dataframe` flag. -@[code](@snippets/installation/cargo_install_nu_more_features.sh) +<Code code={cargoInstallNuMoreFeatures} lang="sh" /> ### Building from the GitHub repository You can also build Nu from the latest source on GitHub. This gives you immediate access to the latest features and bug fixes. First, clone the repo: -@[code](@snippets/installation/git_clone_nu.sh) +<Code code={gitCloneNu} lang="sh" /> From there, we can build and run Nu with: -@[code](@snippets/installation/build_nu_from_source.sh) +<Code code={buildNuFromSource} lang="sh" /> You can also build and run Nu in release mode, which enables more optimizations: -@[code](@snippets/installation/build_nu_from_source_release.sh) +<Code code={buildNuFromSourceRelease} lang="sh" /> People familiar with Rust may wonder why we do both a "build" and a "run" step if "run" does a build by default. This is to get around a shortcoming of the new `default-run` option in Cargo, and ensure that all plugins are built, though this may not be required in the future. diff --git a/book/README.md b/src/content/docs/book/getting-started/introduction.md similarity index 78% rename from book/README.md rename to src/content/docs/book/getting-started/introduction.md index ecf96b0b1bd..cf760b2f8c2 100644 --- a/book/README.md +++ b/src/content/docs/book/getting-started/introduction.md @@ -1,4 +1,8 @@ -# Introduction +--- +title: Introduction +sidebar: + order: 1 +--- Hello, and welcome to the Nushell project. The goal of this project is to take the Unix philosophy of shells, where pipes connect simple commands together, and bring it to the modern style of development. @@ -15,13 +19,13 @@ Nu takes cues from a lot of familiar territory: traditional shells like bash, ob The book is split into chapters which are further broken down into sections. You can click on the chapter headers to get more information about it. -- [Getting Started](getting_started.md) teaches you how to install Nushell and shows you the ropes. It also explains some of the design principles where Nushell differs from typical shells, such as bash. -- [Nu Fundamentals](nu_fundamentals.md) explains basic concepts of the Nushell language. -- [Programming in Nu](programming_in_nu.md) dives more deeply into the language features and shows several ways how to organize and structure your code. -- [Nu as a Shell](nu_as_a_shell.md) focuses on the shell features, most notably the configuration and environment. -- [Coming to Nu](coming_to_nu.md) is intended to give a quick start for users coming from other shells or languages. -- [Design Notes](design_notes.md) has in-depth explanation of some of the Nushell's design choices. -- [(Not So) Advanced](advanced.md) includes some more advanced topics (they are not _so_ advanced, make sure to check them out, too!). +- [Getting Started](/book/getting_started) teaches you how to install Nushell and shows you the ropes. It also explains some of the design principles where Nushell differs from typical shells, such as bash. +- [Nu Fundamentals](/book/nu_fundamentals) explains basic concepts of the Nushell language. +- [Programming in Nu](/book/programming_in_nu) dives more deeply into the language features and shows several ways how to organize and structure your code. +- [Nu as a Shell](/book/nu_as_a_shell) focuses on the shell features, most notably the configuration and environment. +- [Coming to Nu](/book/coming_to_nu) is intended to give a quick start for users coming from other shells or languages. +- [Design Notes](/book/design_notes) has in-depth explanation of some of the Nushell's design choices. +- [(Not So) Advanced](/book/advanced) includes some more advanced topics (they are not _so_ advanced, make sure to check them out, too!). ## The Many Parts of Nushell @@ -46,7 +50,7 @@ Most repositories contain `CONTRIBUTING.md` file with tips and details that shou Nushell itself is written in [Rust](https://www.rust-lang.org). However, you do not have to be a Rust programmer to help. If you know some web development, you can contribute to improving this website or the Nana project. -[Dataframes](dataframes.md) can use your data processing expertise. +[Dataframes](/book/dataframes) can use your data processing expertise. If you wrote a cool script, plugin or integrated Nushell somewhere, we'd welcome your contribution to `nu_scripts` or Awesome Nu. Discovering bugs with reproduction steps and filing GitHub issues for them is a valuable help, too! diff --git a/src/content/docs/book/getting-started/moving_around.mdx b/src/content/docs/book/getting-started/moving_around.mdx new file mode 100644 index 00000000000..ec3e06a54c2 --- /dev/null +++ b/src/content/docs/book/getting-started/moving_around.mdx @@ -0,0 +1,81 @@ +--- +title: Moving around your system +sidebar: + order: 6 +--- + +import { Code } from "@astrojs/starlight/components"; +import lsExample from "../../snippets/moving_around/ls_example.nu?raw"; +import lsShallowGlobExample from "../../snippets/moving_around/ls_shallow_glob_example.nu?raw"; +import lsDeepGlobExample from "../../snippets/moving_around/ls_deep_glob_example.nu?raw"; +import cdExample from "../../snippets/moving_around/cd_example.nu?raw"; +import cdWithoutCommandExample from "../../snippets/moving_around/cd_without_command_example.nu?raw"; +import mvExample from "../../snippets/moving_around/mv_example.nu?raw"; +import cpExample from "../../snippets/moving_around/cp_example.nu?raw"; +import rmExample from "../../snippets/moving_around/rm_example.nu?raw"; +import mkdirExample from "../../snippets/moving_around/mkdir_example.nu?raw"; + +Early shells allow you to move around your filesystem and run commands, and modern shells like Nu allow you to do the same. Let's take a look at some of the common commands you might use when interacting with your system. + +## Viewing directory contents + +<Code code={lsExample} lang="nu" /> + +As we've seen in other chapters, [`ls`](/commands/docs/ls) is a command for viewing the contents of a path. Nu will return the contents as a table that we can use. + +The [`ls`](/commands/docs/ls) command also takes an optional argument, to change what you'd like to view. For example, we can list the files that end in "" + +<Code code={lsShallowGlobExample} lang="nu" /> + +## Glob patterns (wildcards) + +The asterisk (\*) in the above optional argument "\*.md" is sometimes called a wildcard or a glob. It lets us match anything. You could read the glob "\*.md" as "match any filename, so long as it ends with '.md' " + +The most general glob is `*`, which will match all paths. More often, you'll see this pattern used as part of another pattern, for example `*.bak` and `temp*`. + +In Nushell, we also support double `*` to talk about traversing deeper paths that are nested inside of other directories. For example, `ls **/*` will list all the non-hidden paths nested under the current directory. + +<Code code={lsDeepGlobExample} lang="nu" /> + +Here, we're looking for any file that ends with ".md", and the two asterisks further say "in any directory starting from here". + +In other shells (like bash), glob expansion happens in the shell and the invoked program (`ls` in the example above) receives a list of matched files. In Nushell however, the string you enter is passed "as is" to the command, and some commands (like `ls`, `mv`, `cp` and `rm`) interpret their input string as a glob pattern. For example the [`ls` command's help page](https://www.nushell.sh/commands/docs/ls) shows that it takes the parameter: `pattern: the glob pattern to use (optional)`. + +Globbing syntax in these commands not only supports `*`, but also matching [single characters with `?` and character groups with `[...]`](https://docs.rs/nu-glob/latest/nu_glob/struct.Pattern). Note that this is a more limited syntax than what the dedicated [`glob` Nushell command](https://www.nushell.sh/commands/docs/glob) supports. + +Escaping `*`, `?`, `[]` works by quoting them with single quotes or double quotes. To show the contents of a directory named `[slug]`, use `ls "[slug]"` or `ls '[slug]'`. +Note that backtick quote doesn't escape glob, for example: <code>cp `test dir/*`</code> will copy all files inside `test dir` to current direcroty. + +## Changing the current directory + +<Code code={cdExample} lang="nu" /> + +To change from the current directory to a new one, we use the [`cd`](/commands/docs/cd) command. Just as in other shells, we can use either the name of the directory, or if we want to go up a directory we can use the `..` shortcut. + +Changing the current working directory can also be done if [`cd`](/commands/docs/cd) is omitted and a path by itself is given: + +<Code code={cdWithoutCommandExample} lang="nu" /> + +**Note:** changing the directory with [`cd`](/commands/docs/cd) changes the `PWD` environment variable. This means that a change of a directory is kept to the current block. Once you exit the block, you'll return to the previous directory. You can learn more about working with this in the [environment chapter](./environment). + +## Filesystem commands + +Nu also provides some basic filesystem commands that work cross-platform. + +We can move an item from one place to another using the [`mv`](/commands/docs/mv) command: + +<Code code={mvExample} lang="nu" /> + +We can copy an item from one location to another with the [`cp`](/commands/docs/cp) command: + +<Code code={cpExample} lang="nu" /> + +We can remove an item with the [`rm`](/commands/docs/rm) command: + +<Code code={rmExample} lang="nu" /> + +The three commands also can use the glob capabilities we saw earlier with [`ls`](/commands/docs/ls). + +Finally, we can create a new directory using the [`mkdir`](/commands/docs/mkdir) command: + +<Code code={mkdirExample} lang="nu" /> diff --git a/src/content/docs/book/getting-started/quick_tour.md b/src/content/docs/book/getting-started/quick_tour.md new file mode 100644 index 00000000000..c59ad17594e --- /dev/null +++ b/src/content/docs/book/getting-started/quick_tour.md @@ -0,0 +1,200 @@ +--- +title: Quick Tour +sidebar: + order: 5 +--- + +The easiest way to see what Nu can do is to start with some examples, so let's dive in. + +The first thing you'll notice when you run a command like [`ls`](/commands/docs/ls) is that instead of a block of text coming back, you get a structured table. + +```nu +ls +╭────┬───────────────────────┬──────┬───────────┬─────────────╮ +│ # │ name │ type │ size │ modified │ +├────┼───────────────────────┼──────┼───────────┼─────────────┤ +│ 0 │ 404.html │ file │ 429 B │ 3 days ago │ +│ 1 │ CONTRIBUTING │ file │ 955 B │ 8 mins ago │ +│ 2 │ Gemfile │ file │ 1.1 KiB │ 3 days ago │ +│ 3 │ Gemfile.lock │ file │ 6.9 KiB │ 3 days ago │ +│ 4 │ LICENSE │ file │ 1.1 KiB │ 3 days ago │ +│ 5 │ README │ file │ 213 B │ 3 days ago │ +``` + +The table does more than show the directory in a different way. Just like tables in a spreadsheet, this table allows us to work with the data more interactively. + +The first thing we'll do is to sort our table by size. To do this, we'll take the output from [`ls`](/commands/docs/ls) and feed it into a command that can sort tables based on the contents of a column. + +```nu +ls | sort-by size | reverse +╭────┬───────────────────────┬──────┬───────────┬─────────────╮ +│ # │ name │ type │ size │ modified │ +├────┼───────────────────────┼──────┼───────────┼─────────────┤ +│ 0 │ Gemfile.lock │ file │ 6.9 KiB │ 3 days ago │ +│ 1 │ SUMMARY │ file │ 3.7 KiB │ 3 days ago │ +│ 2 │ Gemfile │ file │ 1.1 KiB │ 3 days ago │ +│ 3 │ LICENSE │ file │ 1.1 KiB │ 3 days ago │ +│ 4 │ CONTRIBUTING │ file │ 955 B │ 9 mins ago │ +│ 5 │ books │ file │ 687 B │ 3 days ago │ +``` + +You can see that to make this work we didn't pass commandline arguments to [`ls`](/commands/docs/ls). Instead, we used the [`sort-by`](/commands/docs/sort-by) command that Nu provides to do the sorting of the output of the [`ls`](/commands/docs/ls) command. To see the biggest files on top, we also used [`reverse`](/commands/docs/reverse). + +Nu provides many commands that can work on tables. For example, we could use [`where`](/commands/docs/where) to filter the contents of the [`ls`](/commands/docs/ls) table so that it only shows files over 1 kilobyte: + +```nu +ls | where size > 1kb +╭───┬───────────────────┬──────┬─────────┬────────────╮ +│ # │ name │ type │ size │ modified │ +├───┼───────────────────┼──────┼─────────┼────────────┤ +│ 0 │ Gemfile │ file │ 1.1 KiB │ 3 days ago │ +│ 1 │ Gemfile.lock │ file │ 6.9 KiB │ 3 days ago │ +│ 2 │ LICENSE │ file │ 1.1 KiB │ 3 days ago │ +│ 3 │ SUMMARY │ file │ 3.7 KiB │ 3 days ago │ +╰───┴───────────────────┴──────┴─────────┴────────────╯ +``` + +Just as in the Unix philosophy, being able to have commands talk to each other gives us ways to mix-and-match in many different combinations. Let's look at a different command: + +```nu +ps +╭─────┬───────┬───────┬──────────────────────────────────────────────┬─────────┬───────┬──────────┬──────────╮ +│ # │ pid │ ppid │ name │ status │ cpu │ mem │ virtual │ +├─────┼───────┼───────┼──────────────────────────────────────────────┼─────────┼───────┼──────────┼──────────┤ +│ 0 │ 87194 │ 1 │ mdworker_shared │ Sleep │ 0.00 │ 25.9 MB │ 418.0 GB │ +│ 1 │ 87183 │ 2314 │ Arc Helper (Renderer) │ Sleep │ 0.00 │ 59.9 MB │ 1.6 TB │ +│ 2 │ 87182 │ 2314 │ Arc Helper (Renderer) │ Sleep │ 0.23 │ 224.3 MB │ 1.6 TB │ +│ 3 │ 87156 │ 87105 │ Code Helper (Plugin) │ Sleep │ 0.00 │ 56.0 MB │ 457.4 GB │ +``` + +You may be familiar with the [`ps`](/commands/docs/ps) command if you've used Linux. With it, we can get a list of all the current processes that the system is running, what their status is, and what their name is. We can also see the CPU load for the processes. + +What if we wanted to show the processes that were actively using the CPU? Just like we did with the [`ls`](/commands/docs/ls) command earlier, we can also work with the table that the [`ps`](/commands/docs/ps) command gives back to us: + +```nu +ps | where cpu > 5 +╭───┬───────┬───────┬─────────────────────────────────────────┬─────────┬───────┬──────────┬──────────╮ +│ # │ pid │ ppid │ name │ status │ cpu │ mem │ virtual │ +├───┼───────┼───────┼─────────────────────────────────────────┼─────────┼───────┼──────────┼──────────┤ +│ 0 │ 86759 │ 86275 │ nu │ Running │ 6.27 │ 38.7 MB │ 419.7 GB │ +│ 1 │ 89134 │ 1 │ com.apple.Virtualization.VirtualMachine │ Running │ 23.92 │ 1.5 GB │ 427.3 GB │ +│ 2 │ 70414 │ 1 │ VTDecoderXPCService │ Sleep │ 19.04 │ 17.5 MB │ 419.7 GB │ +│ 3 │ 2334 │ 1 │ TrackpadExtension │ Sleep │ 7.47 │ 25.3 MB │ 418.8 GB │ +│ 4 │ 1205 │ 1 │ iTerm2 │ Sleep │ 11.92 │ 657.2 MB │ 421.7 GB │ +╰───┴───────┴───────┴─────────────────────────────────────────┴─────────┴───────┴──────────┴──────────╯ +``` + +So far, we've been using [`ls`](/commands/docs/ls) and [`ps`](/commands/docs/ps) to list files and processes. Nu also offers other commands that can create tables of useful information. Next, let's explore [`date`](/commands/docs/date) and [`sys`](/commands/docs/sys). + +Running [`date now`](/commands/docs/date_now) gives us information about the current day and time: + +```nu +date now +Fri, 9 Feb 2024 22:32:19 -0800 (now) +``` + +To get the date as a table we can feed it into [`date to-table`](/commands/docs/date_to-table) + +```nu +date now | date to-table +╭───┬──────┬───────┬─────┬──────┬────────┬────────┬────────────┬──────────╮ +│ # │ year │ month │ day │ hour │ minute │ second │ nanosecond │ timezone │ +├───┼──────┼───────┼─────┼──────┼────────┼────────┼────────────┼──────────┤ +│ 0 │ 2024 │ 2 │ 9 │ 22 │ 35 │ 46 │ 759272000 │ -08:00 │ +╰───┴──────┴───────┴─────┴──────┴────────┴────────┴────────────┴──────────╯ +``` + +Running [`sys`](/commands/docs/sys) gives information about the system that Nu is running on: + +```nu +sys +╭───────┬───────────────────╮ +│ host │ {record 8 fields} │ +│ cpu │ [table 8 rows] │ +│ disks │ [table 2 rows] │ +│ mem │ {record 7 fields} │ +│ temp │ [table 38 rows] │ +│ net │ [table 21 rows] │ +╰───────┴───────────────────╯ +``` + +This is a bit different than the tables we saw before. The [`sys`](/commands/docs/sys) command gives us a table that contains structured tables in the cells instead of simple values. To take a look at this data, we need to _get_ the column to view: + +```nu +sys | get host +╭─────────────────┬───────────────────────────╮ +│ name │ Darwin │ +│ os_version │ 14.3.1 │ +│ long_os_version │ MacOS 14.3.1 │ +│ kernel_version │ 23.3.0 │ +│ hostname │ Johns-MacBook-Air.local │ +│ uptime │ 3hr 9min 32sec │ +│ boot_time │ 2024-02-09T19:27:03-08:00 │ +│ sessions │ [table 3 rows] │ +╰─────────────────┴───────────────────────────╯ +``` + +The [`get`](/commands/docs/get) command lets us jump into the contents of a column of the table. Here, we're looking into the "host" column, which contains information about the host that Nu is running on. The name of the OS, the hostname, the CPU, and more. Let's get the name of the users on the system: + +```nu + sys | get host.sessions.name +╭───┬──────────────╮ +│ 0 │ root │ +│ 1 │ jt │ +╰───┴──────────────╯ +``` + +Right now, there's just one user on the system named "jt". You'll notice that we can pass a column path (the `host.sessions.name` part) and not just the name of the column. Nu will take the column path and go to the corresponding bit of data in the table. + +You might have noticed something else that's different. Rather than having a table of data, we have just a single element: the string "jt". Nu works with both tables of data as well as strings. Strings are an important part of working with commands outside of Nu. + +Let's see how strings work outside of Nu in action. We'll take our example from before and run the external [`echo`](/commands/docs/echo) command (the `^` tells Nu to not use the built-in [`echo`](/commands/docs/echo) command): + +```nu +sys | get host.sessions.name | each { |it| ^echo $it } +root +jt +╭────────────╮ +│ empty list │ +╰────────────╯ +``` + +If this looks very similar to what we had before, you have a keen eye! It is similar, but with one important difference: we've called `^echo` with the value we saw earlier. This allows us to pass data out of Nu into [`echo`](/commands/docs/echo) (or any command outside of Nu, like `git` for example). + +### Getting Help + +Help text for any of Nu's built-in commands can be discovered with the [`help`](/commands/docs/help) command. To see all commands, run [`help commands`](/commands/docs/help_commands). You can also search for a topic by doing `help -f <topic>`. + +```nu +help path +* As a list of path parts, e.g., '[ / home viking spam.txt ]'. Splitting into + parts is done by the `path split` command. + +All subcommands accept all three variants as an input. Furthermore, the 'path +join' subcommand can be used to join the structured path or path parts back into +the path literal. + +Usage: + > path + +Subcommands: + path basename - Get the final component of a path. + path dirname - Get the parent directory of a path. + path exists - Check whether a path exists. + path expand - Try to expand a path to its absolute form. + path join - Join a structured path or a list of path parts. + path parse - Convert a path into structured data. + path relative-to - Express a path as relative to another path. + path split - Split a path into a list based on the system's path separator. + path type - Get the type of the object a path refers to (e.g., file, dir, symlink). + +Flags: + -h, --help - Display the help message for this command + +Input/output types: + ╭───┬─────────┬────────╮ + │ # │ input │ output │ + ├───┼─────────┼────────┤ + │ 0 │ nothing │ string │ + ╰───┴─────────┴────────╯ +``` diff --git a/book/thinking_in_nu.md b/src/content/docs/book/getting-started/thinking_in_nu.mdx similarity index 75% rename from book/thinking_in_nu.md rename to src/content/docs/book/getting-started/thinking_in_nu.mdx index 2f7c7bd412a..85f65aff96a 100644 --- a/book/thinking_in_nu.md +++ b/src/content/docs/book/getting-started/thinking_in_nu.mdx @@ -1,4 +1,10 @@ -# Thinking in Nu +--- +title: Thinking in Nu +sidebar: + order: 7 +--- + +import { Code } from "@astrojs/starlight/components"; To help you understand - and get the most out of - Nushell, we've put together this section on "thinking in Nushell". By learning to think in Nushell and use the patterns it provides, you'll hit fewer issues getting started and be better setup for success. @@ -8,23 +14,17 @@ So what does it mean to think in Nushell? Here are some common topics that come Nushell is both a programming language and a shell. Because of this, it has its own way of working with files, directories, websites, and more. We've modeled this to work closely with what you may be familiar with other shells. Pipelines work by attaching two commands together: -```nu -> ls | length -``` +<Code code="ls | length" lang="nu" /> Nushell, for example, also has support for other common capabilities like getting the exit code from previously run commands. While it does have these amenities, Nushell isn't bash. The bash way of working, and the POSIX style in general, is not one that Nushell supports. For example, in bash, you might use: -```sh -> echo "hello" > output.txt -``` +<Code code="echo 'hello' > output.txt" lang="bash" /> In Nushell, we use the `>` as the greater-than operator. This fits better with the language aspect of Nushell. Instead, you pipe to a command that has the job of saving content: -```nu -> "hello" | save output.txt -``` +<Code code="'hello' | save output.txt" lang="nu" /> **Thinking in Nushell:** The way Nushell views data is that data flows through the pipeline until it reaches the user or is handled by a final command. You can simply type data, from strings to JSON-style lists and records, and follow it with `|` to send it through the pipeline. Nushell uses commands to do work and produce more data. Learning these commands and when to use them helps you compose many kinds of pipelines. @@ -40,13 +40,11 @@ source "output.nu" abc ``` -The [`source`](/commands/docs/source.md) command will grow the source that is compiled, but the [`save`](/commands/docs/save.md) from the earlier line won't have had a chance to run. Nushell runs the whole block as if it were a single file, rather than running one line at a time. In the example, since the output.nu file is not created until after the 'compilation' step, the [`source`](/commands/docs/source.md) command is unable to read definitions from it during parse time. +The [`source`](/commands/docs/source) command will grow the source that is compiled, but the [`save`](/commands/docs/save) from the earlier line won't have had a chance to run. Nushell runs the whole block as if it were a single file, rather than running one line at a time. In the example, since the output.nu file is not created until after the 'compilation' step, the [`source`](/commands/docs/source) command is unable to read definitions from it during parse time. Another common issue is trying to dynamically create the filename to source from: -```nu -> source $"($my_path)/common.nu" -``` +<Code code="source $'($my_path)/common.nu'" lang="nu" /> This doesn't work if `my_path` is a regular runtime variable declared with `let`. This would require the evaluator to run and evaluate the string, but unfortunately Nushell needs this information at compile-time. @@ -55,38 +53,37 @@ However, if `my_path` is a [constant](/book/variables_and_subexpressions#constan would work, since the string can be evaluated at compile-time: ```nu -> const my_path = ([$nu.home-path nushell] | path join) -> source $"($my_path)/common.nu" # sources /home/user/nushell/common.nu +const my_path = ([$nu.home-path nushell] | path join) +source $"($my_path)/common.nu" # sources /home/user/nushell/common.nu ``` **Thinking in Nushell:** Nushell is designed to use a single compile step for all the source you send it, and this is separate from evaluation. This will allow for strong IDE support, accurate error messages, an easier language for third-party tools to work with, and in the future even fancier output like being able to compile Nushell directly to a binary file. -For more in-depth explanation, check [How Nushell Code Gets Run](how_nushell_code_gets_run.md). +For more in-depth explanation, check [How Nushell Code Gets Run](how_nushell_code_gets_run). ## Variables are immutable Another common surprise for folks coming from other languages is that Nushell variables are immutable (and indeed some people have started to call them "constants" to reflect this). Coming to Nushell you'll want to spend some time becoming familiar with working in a more functional style, as this tends to help write code that works best with immutable variables. -You might wonder why Nushell uses immutable variables. Early on in Nushell's development we decided to see how long we could go using a more data-focused, functional style in the language. More recently, we added a key bit of functionality into Nushell that made these early experiments show their value: parallelism. By switching from [`each`](/commands/docs/each.md) to [`par-each`](/commands/docs/par-each.md) in any Nushell script, you're able to run the corresponding block of code in parallel over the input. This is possible because Nushell's design leans heavily on immutability, composition, and pipelining. +You might wonder why Nushell uses immutable variables. Early on in Nushell's development we decided to see how long we could go using a more data-focused, functional style in the language. More recently, we added a key bit of functionality into Nushell that made these early experiments show their value: parallelism. By switching from [`each`](/commands/docs/each) to [`par-each`](/commands/docs/par-each) in any Nushell script, you're able to run the corresponding block of code in parallel over the input. This is possible because Nushell's design leans heavily on immutability, composition, and pipelining. Just because Nushell variables are immutable doesn't mean things don't change. Nushell makes heavy use of the technique of "shadowing". Shadowing means creating a new variable with the same name as a previously declared variable. For example, say you had an `$x` in scope, and you wanted a new `$x` that was one greater: -```nu -let x = $x + 1 -``` +<Code code="let x = $x + 1" lang="nu" /> This new `x` is visible to any code that follows this line. Careful use of shadowing can make for an easier time working with variables, though it's not required. -Loop counters are another common pattern for mutable variables and are built into most iterating commands, for example you can get both each item and an index of each item using [`each`](/commands/docs/each.md): +Loop counters are another common pattern for mutable variables and are built into most iterating commands, for example you can get both each item and an index of each item using [`each`](/commands/docs/each): -```nu -> ls | enumerate | each { |it| $"Number ($it.index) is size ($it.item.size)" } -``` +<Code + code="ls | enumerate | each { |it| $'Number ($it.index) is size ($it.item.size)' }" + lang="nu" +/> -You can also use the [`reduce`](/commands/docs/reduce.md) command to work in the same way you might mutate a variable in a loop. For example, if you wanted to find the largest string in a list of strings, you might do: +You can also use the [`reduce`](/commands/docs/reduce) command to work in the same way you might mutate a variable in a loop. For example, if you wanted to find the largest string in a list of strings, you might do: ```nu -> [one, two, three, four, five, six] | reduce {|curr, max| +[one, two, three, four, five, six] | reduce {|curr, max| if ($curr | str length) > ($max | str length) { $curr } else { @@ -106,16 +103,16 @@ In Nushell, blocks control their own environment. Changes to the environment are In practice, this lets you write some concise code for working with subdirectories, for example, if you wanted to build each sub-project in the current directory, you could run: ```nu -> ls | each { |it| +ls | each { |it| cd $it.name make } ``` -The [`cd`](/commands/docs/cd.md) command changes the `PWD` environment variables, and this variable change does not escape the block, allowing each iteration to start from the current directory and enter the next subdirectory. +The [`cd`](/commands/docs/cd) command changes the `PWD` environment variables, and this variable change does not escape the block, allowing each iteration to start from the current directory and enter the next subdirectory. -Having the environment scoped like this makes commands more predictable, easier to read, and when the time comes, easier to debug. Nushell also provides helper commands like [`def --env`](/commands/docs/def.md), [`load-env`](/commands/docs/load-env.md), as convenient ways of doing batches of updates to the environment. +Having the environment scoped like this makes commands more predictable, easier to read, and when the time comes, easier to debug. Nushell also provides helper commands like [`def --env`](/commands/docs/def), [`load-env`](/commands/docs/load-env), as convenient ways of doing batches of updates to the environment. -_There is one exception here, where [`def --env`](/commands/docs/def.md) allows you to create a command that participates in the caller's environment._ +_There is one exception here, where [`def --env`](/commands/docs/def) allows you to create a command that participates in the caller's environment._ **Thinking in Nushell:** - The coding best practice of no global mutable variables extends to the environment in Nushell. Using the built-in helper commands will let you more easily work with the environment in Nushell. Taking advantage of the fact that environments are scoped to blocks can also help you write more concise scripts and interact with external commands without adding things into a global environment you don't need. diff --git a/book/how_nushell_code_gets_run.md b/src/content/docs/book/how_nushell_code_gets_run.md similarity index 85% rename from book/how_nushell_code_gets_run.md rename to src/content/docs/book/how_nushell_code_gets_run.md index 73d82142b3e..4d84a415993 100644 --- a/book/how_nushell_code_gets_run.md +++ b/src/content/docs/book/how_nushell_code_gets_run.md @@ -1,6 +1,8 @@ -# How Nushell Code Gets Run +--- +title: How Nushell Code Gets Run +--- -As you probably noticed, Nushell behaves quite differently from other shells and dynamic languages. In [Thinking in Nu](thinking_in_nu.md#think-of-nushell-as-a-compiled-language), we advise you to _think of Nushell as a compiled language_ but we do not give much insight into why. This section hopefully fills the gap. +As you probably noticed, Nushell behaves quite differently from other shells and dynamic languages. In [Thinking in Nu](/book/thinking_in_nu#think-of-nushell-as-a-compiled-language), we advise you to _think of Nushell as a compiled language_ but we do not give much insight into why. This section hopefully fills the gap. First, let's give a few example which you might intuitively try but which do not work in Nushell. @@ -58,7 +60,7 @@ First, the source code is analyzed by the parser and converted into an intermedi ### Compiled Languages -On the other side are languages that are typically "compiled", such as C, C++, or Rust. Assuming a simple ["hello world"](https://doc.rust-lang.org/stable/book/ch01-02-hello-world.html) in Rust +On the other side are languages that are typically "compiled", such as C, C++, or Rust. Assuming a simple ["hello world"](https://doc.rust-lang.org/stable/book/ch01-02-hello-world) in Rust ```rust // main.rs @@ -81,7 +83,7 @@ One big difference, however, between interpreted and compiled languages is that ### Eval Function -Most languages considered as "dynamic" or "interpreted" have an eval function, for example Python (it has two, [eval](https://docs.python.org/3/library/functions.html#eval) and [exec](https://docs.python.org/3/library/functions.html#exec)) or [Bash](https://linux.die.net/man/1/bash). It is used to take source code and interpret it within a running interpreter. This can get a bit confusing, so let's give a Python example: +Most languages considered as "dynamic" or "interpreted" have an eval function, for example Python (it has two, [eval](https://docs.python.org/3/library/functions#eval) and [exec](https://docs.python.org/3/library/functions#exec)) or [Bash](https://linux.die.net/man/1/bash). It is used to take source code and interpret it within a running interpreter. This can get a bit confusing, so let's give a Python example: ```python # hello_eval.py @@ -102,7 +104,7 @@ Of course, you can have more fun and try `eval("eval(\"print('Hello eval!')\")") You can see the eval function adds a new "meta" layer into the code execution. Instead of parsing the whole source code, then evaluating it, there is an extra parse-eval step during the evaluation. This means that the IR produced by the parser (whatever it is) can be further modified during the evaluation. -We've seen that without `eval`, the difference between compiled and interpreted languages is actually not that big. This is exactly what we mean by [thinking of Nushell as a compiled language](https://www.nushell.sh/book/thinking_in_nu.html#think-of-nushell-as-a-compiled-language): Despite Nushell being an interpreted language, its lack of `eval` gives it characteristics and limitations typical for traditional compiled languages like C or Rust. We'll dig deeper into what it means in the next section. +We've seen that without `eval`, the difference between compiled and interpreted languages is actually not that big. This is exactly what we mean by [thinking of Nushell as a compiled language](https://www.nushell.sh/book/thinking_in_nu#think-of-nushell-as-a-compiled-language): Despite Nushell being an interpreted language, its lack of `eval` gives it characteristics and limitations typical for traditional compiled languages like C or Rust. We'll dig deeper into what it means in the next section. ## Implications @@ -134,13 +136,13 @@ This is the complete parse-eval sequence. Not having `eval`-like functionality prevents `eval`-related bugs from happening. Calling a non-existent function is 100% guaranteed parse-time error in Nushell. Furthermore, after the parse step, we have a deep insight into the program and we're 100% sure it is not going to change during evaluation. This trivially allows for powerful and reliable static analysis and IDE integration which is challenging to achieve with more dynamic languages. In general, you have more peace of mind when scaling Nushell programs to bigger applications. -_Before going into examples, one note about the "dynamic" and "static" terminology. Stuff that happens at runtime (during evaluation, after parsing) is considered "dynamic". Stuff that happens before running (during parsing / compilation) is called "static". Languages that have more stuff (such as `eval`, type checking, etc.) happening at runtime are sometimes called "dynamic". Languages that analyze most of the information (type checking, [data ownership](https://doc.rust-lang.org/stable/book/ch04-00-understanding-ownership.html), etc.) before evaluating the program are sometimes called "static". The whole debate can get quite confusing, but for the purpose of this text, the main difference between a "static" and "dynamic" language is whether it has or has not the eval function._ +_Before going into examples, one note about the "dynamic" and "static" terminology. Stuff that happens at runtime (during evaluation, after parsing) is considered "dynamic". Stuff that happens before running (during parsing / compilation) is called "static". Languages that have more stuff (such as `eval`, type checking, etc.) happening at runtime are sometimes called "dynamic". Languages that analyze most of the information (type checking, [data ownership](https://doc.rust-lang.org/stable/book/ch04-00-understanding-ownership), etc.) before evaluating the program are sometimes called "static". The whole debate can get quite confusing, but for the purpose of this text, the main difference between a "static" and "dynamic" language is whether it has or has not the eval function._ ## Common Mistakes By insisting on strict parse-evaluation separation, we lose much of a flexibility users expect from dynamic interpreted languages, especially other shells, such as bash, fish, zsh and others. This leads to the examples at the beginning of this page not working. Let's break them down one by one -_Note: The following examples use [`source`](/commands/docs/source.md), but similar conclusions apply to other commands that parse Nushell source code, such as [`use`](/commands/docs/use.md), [`overlay use`](/commands/docs/overlay_use.md), [`hide`](/commands/docs/hide.md), [`register`](/commands/docs/register.md) or [`source-env`](/commands/docs/source-env.md)._ +_Note: The following examples use [`source`](/commands/docs/source), but similar conclusions apply to other commands that parse Nushell source code, such as [`use`](/commands/docs/use), [`overlay use`](/commands/docs/overlay_use), [`hide`](/commands/docs/hide), [`register`](/commands/docs/register) or [`source-env`](/commands/docs/source-env)._ ### 1. Sourcing a dynamic path @@ -214,7 +216,7 @@ if ('spam/foo.nu' | path exists) { } ``` -This one is similar to the previous example. `cd spam` changes the directory _during evaluation_ but [`source-env`](/commands/docs/source-env.md) attempts to open and read `foo.nu` during parsing. +This one is similar to the previous example. `cd spam` changes the directory _during evaluation_ but [`source-env`](/commands/docs/source-env) attempts to open and read `foo.nu` during parsing. ## REPL @@ -238,7 +240,7 @@ means the following: 1. Launch `nu` 2. Type `print "Hello world!"`, press Enter -3. Type [`ls`](/commands/docs/ls.md), press Enter +3. Type [`ls`](/commands/docs/ls), press Enter Hopefully, that's clear. Now, when you press Enter, these things happen: @@ -256,7 +258,7 @@ cd spam source-env foo.nu ``` -does not work because the directory will be changed _after_ [`source-env`](/commands/docs/source-env.md) attempts to read the file. Running these commands as separate REPL entries, however, works: +does not work because the directory will be changed _after_ [`source-env`](/commands/docs/source-env) attempts to read the file. Running these commands as separate REPL entries, however, works: ```nu > cd spam @@ -275,13 +277,13 @@ To see why, let's break down what happens in the example: 6. Evaluate `source-env foo.nu` 7. Merge environment (including the current directory) into the Nushell state -When [`source-env`](/commands/docs/source-env.md) tries to open `foo.nu` during the parsing in step 5., it can do so because the directory change from step 3. was merged into the Nushell state in step 4. and therefore is visible in the following parse-evaluation cycles. +When [`source-env`](/commands/docs/source-env) tries to open `foo.nu` during the parsing in step 5., it can do so because the directory change from step 3. was merged into the Nushell state in step 4. and therefore is visible in the following parse-evaluation cycles. ### Parse-time Evaluation While it is impossible to add parsing into the evaluation, we can add _a little bit_ of evaluation into parsing. This feature has been added [only recently](https://github.com/nushell/nushell/pull/7436) and we're going to expand it as needed. -One pattern that this unlocks is being able to [`source`](/commands/docs/source.md)/[`use`](/commands/docs/use.md)/etc. a path from a "variable". We've seen that +One pattern that this unlocks is being able to [`source`](/commands/docs/source)/[`use`](/commands/docs/use)/etc. a path from a "variable". We've seen that ```nu let some_path = $nu.default-config-dir @@ -322,4 +324,4 @@ Compiled ("static") languages also tend to have a way to convey some logic at co ## Conclusion -Nushell operates in a scripting language space typically dominated by "dynamic" "interpreted" languages, such as Python, bash, zsh, fish, etc. While Nushell is also "interpreted" in a sense that it runs the code immediately, instead of storing the intermediate representation (IR) to a disk, one feature sets it apart from the pack: It does not have an **eval function**. In other words, Nushell cannot parse code and manipulate its IR during evaluation. This gives Nushell one characteristic typical for "static" "compiled" languages, such as C or Rust: All the source code must be visible to the parser beforehand, just like all the source code must be available to a C or Rust compiler. For example, you cannot [`source`](/commands/docs/source.md) or [`use`](/commands/docs/use.md) a path computed "dynamically" (during evaluation). This is surprising for users of more traditional scripting languages, but it helps to _think of Nushell as a compiled language_. +Nushell operates in a scripting language space typically dominated by "dynamic" "interpreted" languages, such as Python, bash, zsh, fish, etc. While Nushell is also "interpreted" in a sense that it runs the code immediately, instead of storing the intermediate representation (IR) to a disk, one feature sets it apart from the pack: It does not have an **eval function**. In other words, Nushell cannot parse code and manipulate its IR during evaluation. This gives Nushell one characteristic typical for "static" "compiled" languages, such as C or Rust: All the source code must be visible to the parser beforehand, just like all the source code must be available to a C or Rust compiler. For example, you cannot [`source`](/commands/docs/source) or [`use`](/commands/docs/use) a path computed "dynamically" (during evaluation). This is surprising for users of more traditional scripting languages, but it helps to _think of Nushell as a compiled language_. diff --git a/src/content/docs/book/introduction.md b/src/content/docs/book/introduction.md new file mode 100644 index 00000000000..19a867a706e --- /dev/null +++ b/src/content/docs/book/introduction.md @@ -0,0 +1,210 @@ +--- +title: Quick Tour +--- + +Nu takes cues from a lot of familiar territory: traditional shells like bash, object based shells like PowerShell, gradually typed languages like TypeScript, functional programming, systems programming, and more. But rather than trying to be a jack of all trades, Nu focuses its energy on doing a few things well: + +- Being a flexible cross-platform shell with a modern feel +- Solving problems as a modern programming language that works with the structure of your data +- Giving clear error messages and clean IDE support + +The easiest way to see what Nu can do is to start with some examples, so let's dive in. + +The first thing you'll notice when you run a command like [`ls`](/commands/docs/ls) is that instead of a block of text coming back, you get a structured table. + +```nu +> ls +╭────┬───────────────────────┬──────┬───────────┬─────────────╮ +│ # │ name │ type │ size │ modified │ +├────┼───────────────────────┼──────┼───────────┼─────────────┤ +│ 0 │ 404.html │ file │ 429 B │ 3 days ago │ +│ 1 │ CONTRIBUTING.md │ file │ 955 B │ 8 mins ago │ +│ 2 │ Gemfile │ file │ 1.1 KiB │ 3 days ago │ +│ 3 │ Gemfile.lock │ file │ 6.9 KiB │ 3 days ago │ +│ 4 │ LICENSE │ file │ 1.1 KiB │ 3 days ago │ +│ 5 │ README.md │ file │ 213 B │ 3 days ago │ +... +``` + +The table is more than just showing the directory in a different way. Just like tables in a spreadsheet, this table allows us to work with the data more interactively. + +The first thing we'll do is to sort our table by size. To do this, we'll take the output from [`ls`](/commands/docs/ls) and feed it into a command that can sort tables based on the contents of a column. + +```nu +> ls | sort-by size | reverse +╭────┬───────────────────────┬──────┬───────────┬─────────────╮ +│ # │ name │ type │ size │ modified │ +├────┼───────────────────────┼──────┼───────────┼─────────────┤ +│ 0 │ Gemfile.lock │ file │ 6.9 KiB │ 3 days ago │ +│ 1 │ SUMMARY.md │ file │ 3.7 KiB │ 3 days ago │ +│ 2 │ Gemfile │ file │ 1.1 KiB │ 3 days ago │ +│ 3 │ LICENSE │ file │ 1.1 KiB │ 3 days ago │ +│ 4 │ CONTRIBUTING.md │ file │ 955 B │ 9 mins ago │ +│ 5 │ books.md │ file │ 687 B │ 3 days ago │ +... +``` + +You can see that to make this work we didn't pass commandline arguments to [`ls`](/commands/docs/ls). Instead, we used the [`sort-by`](/commands/docs/sort-by) command that Nu provides to do the sorting of the output of the [`ls`](/commands/docs/ls) command. To see the biggest files on top, we also used [`reverse`](/commands/docs/reverse). + +Nu provides many commands that can work on tables. For example, we could filter the contents of the [`ls`](/commands/docs/ls) table so that it only shows files over 1 kilobyte: + +```nu +> ls | where size > 1kb +╭───┬───────────────────┬──────┬─────────┬────────────╮ +│ # │ name │ type │ size │ modified │ +├───┼───────────────────┼──────┼─────────┼────────────┤ +│ 0 │ Gemfile │ file │ 1.1 KiB │ 3 days ago │ +│ 1 │ Gemfile.lock │ file │ 6.9 KiB │ 3 days ago │ +│ 2 │ LICENSE │ file │ 1.1 KiB │ 3 days ago │ +│ 3 │ SUMMARY.md │ file │ 3.7 KiB │ 3 days ago │ +╰───┴───────────────────┴──────┴─────────┴────────────╯ +``` + +Just as in the Unix philosophy, being able to have commands talk to each other gives us ways to mix-and-match in many different combinations. Let's look at a different command: + +```nu +> ps +╭─────┬───────┬───────┬──────────────────────────────────────────────┬─────────┬───────┬──────────┬──────────╮ +│ # │ pid │ ppid │ name │ status │ cpu │ mem │ virtual │ +├─────┼───────┼───────┼──────────────────────────────────────────────┼─────────┼───────┼──────────┼──────────┤ +│ 0 │ 87194 │ 1 │ mdworker_shared │ Sleep │ 0.00 │ 25.9 MB │ 418.0 GB │ +│ 1 │ 87183 │ 2314 │ Arc Helper (Renderer) │ Sleep │ 0.00 │ 59.9 MB │ 1.6 TB │ +│ 2 │ 87182 │ 2314 │ Arc Helper (Renderer) │ Sleep │ 0.23 │ 224.3 MB │ 1.6 TB │ +│ 3 │ 87156 │ 87105 │ Code Helper (Plugin) │ Sleep │ 0.00 │ 56.0 MB │ 457.4 GB │ +... +``` + +You may be familiar with the [`ps`](/commands/docs/ps) command if you've used Linux. With it, we can get a list of all the current processes that the system is running, what their status is, and what their name is. We can also see the CPU load for the processes. + +What if we wanted to show the processes that were actively using the CPU? Just like we did with the [`ls`](/commands/docs/ls) command earlier, we can also work with the table that the [`ps`](/commands/docs/ps) command gives back to us: + +```nu +> ps | where cpu > 5 +╭───┬───────┬───────┬─────────────────────────────────────────┬─────────┬───────┬──────────┬──────────╮ +│ # │ pid │ ppid │ name │ status │ cpu │ mem │ virtual │ +├───┼───────┼───────┼─────────────────────────────────────────┼─────────┼───────┼──────────┼──────────┤ +│ 0 │ 86759 │ 86275 │ nu │ Running │ 6.27 │ 38.7 MB │ 419.7 GB │ +│ 1 │ 89134 │ 1 │ com.apple.Virtualization.VirtualMachine │ Running │ 23.92 │ 1.5 GB │ 427.3 GB │ +│ 2 │ 70414 │ 1 │ VTDecoderXPCService │ Sleep │ 19.04 │ 17.5 MB │ 419.7 GB │ +│ 3 │ 2334 │ 1 │ TrackpadExtension │ Sleep │ 7.47 │ 25.3 MB │ 418.8 GB │ +│ 4 │ 1205 │ 1 │ iTerm2 │ Sleep │ 11.92 │ 657.2 MB │ 421.7 GB │ +╰───┴───────┴───────┴─────────────────────────────────────────┴─────────┴───────┴──────────┴──────────╯ +``` + +So far, we've been using [`ls`](/commands/docs/ls) and [`ps`](/commands/docs/ps) to list files and processes. Nu also offers other commands that can create tables of useful information. Next, let's explore [`date`](/commands/docs/date) and [`sys`](/commands/docs/sys). + +Running [`date now`](/commands/docs/date_now) gives us information about the current day and time: + +```nu +> date now +Mon, 12 Feb 2024 12:32:15 -0800 (now) +``` + +To get the date as a table we can feed it into [`date to-table`](/commands/docs/date_to-table) + +```nu +> date now | date to-table +╭───┬──────┬───────┬─────┬──────┬────────┬────────┬────────────┬──────────╮ +│ # │ year │ month │ day │ hour │ minute │ second │ nanosecond │ timezone │ +├───┼──────┼───────┼─────┼──────┼────────┼────────┼────────────┼──────────┤ +│ 0 │ 2024 │ 2 │ 12 │ 12 │ 32 │ 50 │ 701310000 │ -08:00 │ +╰───┴──────┴───────┴─────┴──────┴────────┴────────┴────────────┴──────────╯ +``` + +Running [`sys`](/commands/docs/sys) gives information about the system that Nu is running on: + +```nu +> sys +╭───────┬──────────────────────────────────────────────────────────────────────────────────────────╮ +│ │ ╭───────────────────┬──────────────────────────────────────────────────────────────────╮ │ +│ host │ │ name │ Darwin │ │ +│ │ │ os_version │ 14.3.1 │ │ +│ │ │ long_os_version │ MacOS 14.3.1 │ │ +│ │ │ kernel_version │ 23.3.0 │ │ +│ │ │ hostname │ Johns-MacBook-Air.local │ │ +│ │ │ uptime │ 2day 17hr 6min 18sec │ │ +│ │ │ boot_time │ 2024-02-09T19:27:03-08:00 │ │ +``` + +This is a bit different than the tables we saw before. The [`sys`](/commands/docs/sys) command gives us a table that contains structured tables in the cells instead of simple values. To take a look at this data, we need to _get_ the column to view: + +```nu +> sys | get host +╭─────────────────────────┬────────────────────────────────────────────────────────────────────────╮ +│ name │ Darwin │ +│ os_version │ 14.3.1 │ +│ long_os_version │ MacOS 14.3.1 │ +│ kernel_version │ 23.3.0 │ +│ hostname │ Johns-MacBook-Air.local │ +│ uptime │ 2day 17hr 7min 14sec │ +│ boot_time │ 2024-02-09T19:27:03-08:00 │ +``` + +The [`get`](/commands/docs/get) command lets us jump into the contents of a column of the table. Here, we're looking into the "host" column, which contains information about the host that Nu is running on. The name of the OS, the hostname, the CPU, and more. Let's get the name of the users on the system: + +```nu +> sys | get host.sessions.name +╭───┬────╮ +│ 0 │ jt │ +╰───┴────╯ +``` + +Right now, there's just one user on the system named "jt". You'll notice that we can pass a column path (the `host.sessions.name` part) and not just the name of the column. Nu will take the column path and go to the corresponding bit of data in the table. + +You might have noticed something else that's different. Rather than having a table of data, we have just a single element: the string "jt". Nu works with both tables of data as well as strings. Strings are an important part of working with commands outside of Nu. + +Let's see how strings work outside of Nu in action. We'll take our example from before and run the external [`echo`](/commands/docs/echo) command (the `^` tells Nu to not use the built-in [`echo`](/commands/docs/echo) command): + +```nu +> sys | get host.sessions.name | each { |it| ^echo $it } +jt +``` + +If this looks very similar to what we had before, you have a keen eye! It is similar, but with one important difference: we've called `^echo` with the value we saw earlier. This allows us to pass data out of Nu into [`echo`](/commands/docs/echo) (or any command outside of Nu, like `git` for example). + +### Getting Help + +Help text for any of Nu's built-in commands can be discovered with the [`help`](/commands/docs/help) command. To see all commands, run [`help commands`](/commands/docs/help_commands). You can also search for a topic by doing `help -f <topic>`. + +```nu +Explore and manipulate paths. + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +There are three ways to represent a path: + +* As a path literal, e.g., '/home/viking/spam.txt' +* As a structured path: a table with 'parent', 'stem', and 'extension' (and +* 'prefix' on Windows) columns. This format is produced by the 'path parse' + subcommand. +* As a list of path parts, e.g., '[ / home viking spam.txt ]'. Splitting into + parts is done by the `path split` command. + +All subcommands accept all three variants as an input. Furthermore, the 'path +join' subcommand can be used to join the structured path or path parts back into +the path literal. + +Usage: + > path + +Subcommands: + path basename - Get the final component of a path. + path dirname - Get the parent directory of a path. + path exists - Check whether a path exists. + path expand - Try to expand a path to its absolute form. + path join - Join a structured path or a list of path parts. + path parse - Convert a path into structured data. + path relative-to - Express a path as relative to another path. + path split - Split a path into a list based on the system's path separator. + path type - Get the type of the object a path refers to (e.g., file, dir, symlink). + +Flags: + -h, --help - Display the help message for this command + +Input/output types: + ╭───┬─────────┬────────╮ + │ # │ input │ output │ + ├───┼─────────┼────────┤ + │ 0 │ nothing │ string │ + ╰───┴─────────┴────────╯ +``` diff --git a/book/3rdpartyprompts.md b/src/content/docs/book/nu-as-a-shell/3rdpartyprompts.md similarity index 98% rename from book/3rdpartyprompts.md rename to src/content/docs/book/nu-as-a-shell/3rdpartyprompts.md index cadc623c660..dafaa5a30d6 100644 --- a/book/3rdpartyprompts.md +++ b/src/content/docs/book/nu-as-a-shell/3rdpartyprompts.md @@ -1,4 +1,8 @@ -# How to configure 3rd party prompts +--- +title: 3rd party prompts +sidebar: + order: 5 +--- ## nerdfonts @@ -56,7 +60,7 @@ $env.PROMPT_INDICATOR = $"(ansi y)$> (ansi reset)" 2. Install nerdfonts depending on your preferences. 3. Use the config example below. Make sure to set the `STARSHIP_SHELL` environment variable. -::: tip +:::tip An alternate way to enable Starship is described in the [Starship Quick Install](https://starship.rs/#nushell) instructions. The link above is the official integration of Starship and Nushell and is the simplest way to get diff --git a/book/background_task.md b/src/content/docs/book/nu-as-a-shell/background_task.md similarity index 89% rename from book/background_task.md rename to src/content/docs/book/nu-as-a-shell/background_task.md index 81cbf5fc124..69561dead82 100644 --- a/book/background_task.md +++ b/src/content/docs/book/nu-as-a-shell/background_task.md @@ -1,4 +1,6 @@ -# Background tasks with Nu +--- +title: Background tasks with Nu +--- Currently, Nushell doesn't have built-in background task management feature, but you can make it "support" background task with some tools, here are some examples: @@ -25,10 +27,10 @@ Then you will get some commands to schedule background tasks. (e.g: `task spawn` Cons: It spawns a new Nushell interpreter to execute every single task, so it doesn't inherit current scope's variables, custom commands, alias definition. It only inherits environment variables whose value can be converted to a string. -Therefore, if you want to use custom commands or variables, you have to [`use`](/commands/docs/use.md) or [`def`](/commands/docs/def.md) them within the given block. +Therefore, if you want to use custom commands or variables, you have to [`use`](/commands/docs/use) or [`def`](/commands/docs/def) them within the given block. ## Using nu with terminal multiplexer You can choose and install a terminal multiplexer and use it. -It allows you to easily switch between multiple programs in one terminal, detach them (they continue to run in the background) and reconnect them to a different terminal. As a result, it is very flexible and usable. +It allows you to easily switch between multiple programs in one terminal, detach them (they continue to run in the background) and reconnect them to a different terminal. As a result, it is very flexible and usable. diff --git a/book/coloring_and_theming.md b/src/content/docs/book/nu-as-a-shell/coloring_and_theming.md similarity index 98% rename from book/coloring_and_theming.md rename to src/content/docs/book/nu-as-a-shell/coloring_and_theming.md index fc7d417a5ec..33cb3279c8f 100644 --- a/book/coloring_and_theming.md +++ b/src/content/docs/book/nu-as-a-shell/coloring_and_theming.md @@ -1,4 +1,8 @@ -# Coloring and Theming in Nu +--- +title: Coloring and Theming +sidebar: + order: 10 +--- Many parts of Nushell's interface can have their color customized. All of these can be set in the `config.nu` configuration file. If you see the hash/hashtag/pound mark `#` in the config file it means the text after it is commented out. @@ -410,9 +414,9 @@ If you want to go back to the normal left prompt, you'll have to unset `TRANSIEN > hide-env TRANSIENT_PROMPT_COMMAND ``` -## `LS_COLORS` colors for the [`ls`](/commands/docs/ls.md) command +## `LS_COLORS` colors for the [`ls`](/commands/docs/ls) command -Nushell will respect and use the `LS_COLORS` environment variable setting on Mac, Linux, and Windows. This setting allows you to define the color of file types when you do a [`ls`](/commands/docs/ls.md). For instance, you can make directories one color, _.md markdown files another color, _.toml files yet another color, etc. There are a variety of ways to color your file types. +Nushell will respect and use the `LS_COLORS` environment variable setting on Mac, Linux, and Windows. This setting allows you to define the color of file types when you do a [`ls`](/commands/docs/ls). For instance, you can make directories one color, _.md markdown files another color, _.toml files yet another color, etc. There are a variety of ways to color your file types. There's an exhaustive list [here](https://github.com/trapd00r/LS_COLORS), which is overkill, but gives you an rudimentary understanding of how to create a ls_colors file that `dircolors` can turn into a `LS_COLORS` environment variable. @@ -559,4 +563,4 @@ $env.config = { Reedline (Nu’s line editor) style is not using the `color_config` key. Instead, each menu has its own style to be configured separately. -See the [section dedicated to Reedline’s menus configuration](line_editor.md#menus) to learn more on this. +See the [section dedicated to Reedline’s menus configuration](/book/line_editor#menus) to learn more on this. diff --git a/book/configuration.md b/src/content/docs/book/nu-as-a-shell/configuration.md similarity index 82% rename from book/configuration.md rename to src/content/docs/book/nu-as-a-shell/configuration.md index 6d594be97e1..f99307e81a4 100644 --- a/book/configuration.md +++ b/src/content/docs/book/nu-as-a-shell/configuration.md @@ -1,4 +1,8 @@ -# Configuration +--- +title: Configuration +sidebar: + order: 1 +--- ## Nushell Configuration with `env.nu` and `config.nu` @@ -10,8 +14,8 @@ Nushell uses a configuration system that loads and runs two Nushell script files You can check where Nushell is reading these config files from by calling `$nu.env-path` and `$nu.config-path`. ```nu -> $nu.env-path -/Users/FirstNameLastName/Library/Application Support/nushell/env.nu +$nu.env-path +# /Users/FirstNameLastName/Library/Application Support/nushell/env.nu ``` _(You can think of the Nushell config loading sequence as executing two [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) lines on startup: `source /path/to/env.nu` and `source /path/to/config.nu`. Therefore, using `env.nu` for environment and `config.nu` for other config is just a convention.)_ @@ -60,7 +64,7 @@ These are some important variables to look at for Nushell-specific settings: ### Configurations with built-in commands -Starting with release v0.64 of Nushell, we have introduced two new commands([`config nu`](/commands/docs/config_nu.md) and [`config env`](/commands/docs/config_env.md)) which help you quickly edit nu configurations with your preferred text editor/IDE +Starting with release v0.64 of Nushell, we have introduced two new commands([`config nu`](/commands/docs/config_nu) and [`config env`](/commands/docs/config_env)) which help you quickly edit nu configurations with your preferred text editor/IDE Nushell follows underneath orders to locate the editor: @@ -72,13 +76,19 @@ Note: Previous versions of Nushell were launching `notepad` on windows, otherwis ### Color Config section -You can learn more about setting up colors and theming in the [associated chapter](coloring_and_theming.md). +You can learn more about setting up colors and theming in the [associated chapter](/book/coloring_and_theming). ## Remove Welcome Message To remove the welcome message, you need to edit your `config.nu` by typing `config nu` in your terminal, then you go to the global configuration `$env.config` and set `show_banner` option to false, like this: -@[code](@snippets/installation/remove_welcome_message.nu) +```nu title="config.nu" +$env.config = { + ... + show_banner: false, + ... +} +``` ## Configuring Nu as a login shell @@ -98,7 +108,9 @@ Next, on some distros you'll also need to ensure Nu is in the /etc/shells list: ```sh > cat /etc/shells -# /etc/shells: valid login shells +# List of acceptable shells for chpass(1). +# Ftpd will not allow users to connect who are not using +# one of these shells. /bin/sh /bin/dash /bin/bash @@ -120,9 +132,9 @@ There is an environment variable `$nu.loginshell-path` containing the path to th ### macOS: Keeping `/usr/bin/open` as `open` -Some tools (e.g. Emacs) rely on an [`open`](/commands/docs/open.md) command to open files on Mac. -As Nushell has its own [`open`](/commands/docs/open.md) command which has different semantics and shadows `/usr/bin/open`, these tools will error out when trying to use it. -One way to work around this is to define a custom command for Nushell's [`open`](/commands/docs/open.md) and create an alias for the system's [`open`](/commands/docs/open.md) in your `config.nu` file like this: +Some tools (e.g. Emacs) rely on an [`open`](/commands/docs/open) command to open files on Mac. +As Nushell has its own [`open`](/commands/docs/open) command which has different semantics and shadows `/usr/bin/open`, these tools will error out when trying to use it. +One way to work around this is to define a custom command for Nushell's [`open`](/commands/docs/open) and create an alias for the system's [`open`](/commands/docs/open) in your `config.nu` file like this: ```nu def nuopen [arg, --raw (-r)] { if $raw { open -r $arg } else { open $arg } } @@ -130,21 +142,22 @@ alias open = ^open ``` The `^` symbol _escapes_ the Nushell `open` command, which invokes the operating system's `open` command. -For more about escape and `^` see the [chapter about escapes](escaping.md). +For more about escape and `^` see the [chapter about escapes](/book/escaping). ## PATH configuration -In Nushell, [the PATH environment variable](<https://en.wikipedia.org/wiki/PATH_(variable)>) (Path on Windows) is a list of paths. To append a new path to it, you can use `$env.<var> = <val>` and [`append`](/commands/docs/append.md) in `env.nu`: +In Nushell, [the PATH environment variable](<https://en.wikipedia.org/wiki/PATH_(variable)>) (Path on Windows) is a list of paths. To append a new path to it, you can use `$env.<var> = <val>` and [`append`](/commands/docs/append) in `env.nu`: ```nu $env.PATH = ($env.PATH | split row (char esep) | append '/some/path') ``` -This will append `/some/path` to the end of PATH; you can also use [`prepend`](/commands/docs/prepend.md) to add entries to the start of PATH. +This will append `/some/path` to the end of PATH; you can also use [`prepend`](/commands/docs/prepend) to add entries to the start of PATH. -Note the `split row (char esep)` step. We need to add it because in `env.nu`, the environment variables inherited from the host process are still strings. The conversion step of environment variables to Nushell values happens after reading the config files (see also the [Environment](environment.html#environment-variable-conversions) section). After that, for example in the Nushell REPL when `PATH`/`Path` is a list , you can use [`append`](/commands/docs/append.md)/[`prepend`](/commands/docs/prepend.md) directly. +Note the `split row (char esep)` step. We need to add it because in `env.nu`, the environment variables inherited from the host process are still strings. The conversion step of environment variables to Nushell values happens after reading the config files (see also the [Environment](/book/environment#environment-variable-conversions) section). After that, for example in the Nushell REPL when `PATH`/`Path` is a list , you can use [`append`](/commands/docs/append)/[`prepend`](/commands/docs/prepend) directly. To prepend a new path only if not already listed, one can add to `env.nu`: + ```nu # create a new string holding the desired path let my_path = ( $nu.home-path | path join "bin" ) diff --git a/book/custom_completions.md b/src/content/docs/book/nu-as-a-shell/custom_completions.md similarity index 82% rename from book/custom_completions.md rename to src/content/docs/book/nu-as-a-shell/custom_completions.md index 5f76f837127..36fa8333f4c 100644 --- a/book/custom_completions.md +++ b/src/content/docs/book/nu-as-a-shell/custom_completions.md @@ -1,6 +1,10 @@ -# Custom completions +--- +title: Custom completions +sidebar: + order: 9 +--- -Custom completions allow you to mix together two features of Nushell: custom commands and completions. With them, you're able to create commands that handle the completions for positional parameters and flag parameters. These custom completions work both for [custom commands](custom_commands.md) and [known external, or `extern`, commands](externs.md). +Custom completions allow you to mix together two features of Nushell: custom commands and completions. With them, you're able to create commands that handle the completions for positional parameters and flag parameters. These custom completions work both for [custom commands](custom_commands) and [known external, or `extern`, commands](externs). There are two parts to a custom command: the command that handles a completion and attaching this command to the type of another command using `@`. @@ -15,7 +19,7 @@ Let's look at an example: cat dog eel ``` -In the first line, we create a custom command that will return a list of three different animals. These are the values we'd like to use in the completion. Once we've created this command, we can now use it to provide completions for other custom commands and [`extern`](/commands/docs/extern.md)s. +In the first line, we create a custom command that will return a list of three different animals. These are the values we'd like to use in the completion. Once we've created this command, we can now use it to provide completions for other custom commands and [`extern`](/commands/docs/extern)s. In the second line, we use `string@animals`. This tells Nushell two things: the shape of the argument for type-checking and the custom completion to use if the user wants to complete values at that position. @@ -85,9 +89,9 @@ The dog is named Enzo On the second line, once we press the `<tab>` key, the argument `"my-command dog"` is passed to the `animal-names` command as context. -## Custom completion and [`extern`](/commands/docs/extern.md) +## Custom completion and [`extern`](/commands/docs/extern) -A powerful combination is adding custom completions to [known `extern` commands](externs.md). These work the same way as adding a custom completion to a custom command: by creating the custom completion and then attaching it with a `@` to the type of one of the positional or flag arguments of the `extern`. +A powerful combination is adding custom completions to [known `extern` commands](externs). These work the same way as adding a custom completion to a custom command: by creating the custom completion and then attaching it with a `@` to the type of one of the positional or flag arguments of the `extern`. If you look closely at the examples in the default config, you'll see this: @@ -114,31 +118,31 @@ def my_commits [] { } ``` -> **Note** -> -> with the following snippet -> -> ```nu -> def my-command [commit: string@my_commits] { -> print $commit -> } -> ``` -> -> be aware that, even though the completion menu will show you something like -> -> ```nu -> >_ my-command <TAB> -> 5c2464 Add .gitignore -> f3a377 Initial commit -> ``` -> -> only the value, i.e. "5c2464" or "f3a377", will be used in the command arguments! +:::note +with the following snippet + +```nu +def my-command [commit: string@my_commits] { + print $commit +} +``` + +be aware that, even though the completion menu will show you something like + +```nu +>_ my-command <TAB> +5c2464 Add .gitignore +f3a377 Initial commit +``` + +only the value, i.e. "5c2464" or "f3a377", will be used in the command arguments! +::: ## External completions External completers can also be integrated, instead of relying solely on Nushell ones. -For this, set the `external_completer` field in `config.nu` to a [closure](types_of_data.md#closures) which will be evaluated if no Nushell completions were found. +For this, set the `external_completer` field in `config.nu` to a [closure](types_of_data#closures) which will be evaluated if no Nushell completions were found. ```nu > $env.config.completions.external = { @@ -154,8 +158,9 @@ When the closure returns unparsable json (e.g. an empty string) it defaults to f An external completer is a function that takes the current command as a string list, and outputs a list of records with `value` and `description` keys, like custom completion functions. -> **Note** -> This closure will accept the current command as a list. For example, typing `my-command --arg1 <tab>` will receive `[my-command --arg1 " "]`. +:::note +This closure will accept the current command as a list. For example, typing `my-command --arg1 <tab>` will receive `[my-command --arg1 " "]`. +::: This example will enable carapace external completions: @@ -165,4 +170,4 @@ let carapace_completer = {|spans| } ``` -[More examples of custom completers can be found in the cookbook](../cookbook/external_completers.md). +[More examples of custom completers can be found in the cookbook](../cookbook/external_completers). diff --git a/book/environment.md b/src/content/docs/book/nu-as-a-shell/environment.md similarity index 67% rename from book/environment.md rename to src/content/docs/book/nu-as-a-shell/environment.md index 80d97db9d67..2355848714e 100644 --- a/book/environment.md +++ b/src/content/docs/book/nu-as-a-shell/environment.md @@ -1,4 +1,8 @@ -# Environment +--- +title: Environment +sidebar: + order: 2 +--- A common task in a shell is to control the environment that external applications will use. This is often done automatically, as the environment is packaged up and given to the external application as it launches. Sometimes, though, we want to have more precise control over what environment variables an application sees. @@ -6,28 +10,32 @@ You can see the current environment variables in the $env variable: ```nu ~> $env | table -e -╭──────────────────────────────────┬───────────────────────────────────────────╮ -│ │ ╭──────┬────────────────────────────────╮ │ -│ ENV_CONVERSIONS │ │ │ ╭─────────────┬──────────────╮ │ │ -│ │ │ PATH │ │ from_string │ <Closure 32> │ │ │ -│ │ │ │ │ to_string │ <Closure 34> │ │ │ -│ │ │ │ ╰─────────────┴──────────────╯ │ │ -│ │ │ │ ╭─────────────┬──────────────╮ │ │ -│ │ │ Path │ │ from_string │ <Closure 36> │ │ │ -│ │ │ │ │ to_string │ <Closure 38> │ │ │ -│ │ │ │ ╰─────────────┴──────────────╯ │ │ -│ │ ╰──────┴────────────────────────────────╯ │ -│ HOME │ /Users/jelle │ -│ LSCOLORS │ GxFxCxDxBxegedabagaced │ -| ... | ... | -╰──────────────────────────────────┴───────────────────────────────────────────╯ +╭────────────────────────────┬─────────────────────────────────────────────────╮ +│ CMD_DURATION_MS │ 0823 │ +│ │ ╭───┬──────────────────╮ │ +│ DIRS_LIST │ │ 0 │ /Users/name │ │ +│ │ ╰───┴──────────────────╯ │ +│ DIRS_POSITION │ 0 │ +│ │ ╭──────┬──────────────────────────────────────╮ │ +│ ENV_CONVERSIONS │ │ │ ╭───────────────┬──────────────────╮ │ │ +│ │ │ PATH │ │ from_string │ <Closure 1212> │ │ │ +│ │ │ │ │ to_string │ <Closure 1214> │ │ │ +│ │ │ │ ╰───────────────┴──────────────────╯ │ │ +│ │ │ │ ╭───────────────┬──────────────────╮ │ │ +│ │ │ Path │ │ from_string │ <Closure 1216> │ │ │ +│ │ │ │ │ to_string │ <Closure 1218> │ │ │ +│ │ │ │ ╰───────────────┴──────────────────╯ │ │ +│ │ ╰──────┴──────────────────────────────────────╯ │ +│ HOME │ /Users/name │ +| ... | ... | +╰────────────────────────────┴─────────────────────────────────────────────────╯ ``` In Nushell, environment variables can be any value and have any type. You can see the type of an env variable with the describe command, for example: `$env.PROMPT_COMMAND | describe`. To send environment variables to external applications, the values will need to be converted to strings. See [Environment variable conversions](#environment-variable-conversions) on how this works. -The environment is initially created from the Nu [configuration files](configuration.md) and from the environment that Nu is run inside of. +The environment is initially created from the Nu [configuration files](configuration) and from the environment that Nu is run inside of. ## Setting environment variables @@ -48,11 +56,11 @@ $env.Path = ($env.Path | prepend 'C:\path\you\want\to\add') ``` Here we've prepended our folder to the existing folders in the Path, so it will have the highest priority. -If you want to give it the lowest priority instead, you can use the [`append`](/commands/docs/append.md) command. +If you want to give it the lowest priority instead, you can use the [`append`](/commands/docs/append) command. -### [`load-env`](/commands/docs/load-env.md) +### [`load-env`](/commands/docs/load-env) -If you have more than one environment variable you'd like to set, you can use [`load-env`](/commands/docs/load-env.md) to create a table of name/value pairs and load multiple variables at the same time: +If you have more than one environment variable you'd like to set, you can use [`load-env`](/commands/docs/load-env) to create a table of name/value pairs and load multiple variables at the same time: ```nu > load-env { "BOB": "FOO", "JAY": "BAR" } @@ -61,15 +69,15 @@ If you have more than one environment variable you'd like to set, you can use [` ### One-shot environment variables These are defined to be active only temporarily for a duration of executing a code block. -See [Single-use environment variables](environment.md#single-use-environment-variables) for details. +See [Single-use environment variables](environment#single-use-environment-variables) for details. -### Calling a command defined with [`def --env`](/commands/docs/def.md) +### Calling a command defined with [`def --env`](/commands/docs/def) -See [Defining environment from custom commands](environment.md#defining-environment-from-custom-commands) for details. +See [Defining environment from custom commands](environment#defining-environment-from-custom-commands) for details. ### Using module's exports -See [Modules](modules.md) for details. +See [Modules](modules) for details. ## Reading environment variables @@ -80,7 +88,8 @@ Individual environment variables are fields of a record that is stored in the `$ BAR ``` -Sometimes, you may want to access an environmental variable which might be unset. Consider using the [question mark operator](variables_and_subexpressions.md#variable-paths) to avoid an error: +Sometimes, you may want to access an environmental variable which might be unset. Consider using the [question mark operator](variables_and_subexpressions#variable-paths) to avoid an error: + ```nu > $env.FOO | describe Error: nu::shell::column_not_found @@ -102,7 +111,7 @@ BAR Alternatively, you can check for the presence of an environmental variable with `in`: -``` +```nu > $env.FOO BAR @@ -131,8 +140,8 @@ true ## Changing directory -Common task in a shell is to change directory with the [`cd`](/commands/docs/cd.md) command. -In Nushell, calling [`cd`](/commands/docs/cd.md) is equivalent to setting the `PWD` environment variable. +Common task in a shell is to change directory with the [`cd`](/commands/docs/cd) command. +In Nushell, calling [`cd`](/commands/docs/cd) is equivalent to setting the `PWD` environment variable. Therefore, it follows the same rules as other environment variables (for example, scoping). ## Single-use environment variables @@ -144,30 +153,29 @@ A common shorthand to set an environment variable once is available, inspired by BAR ``` -You can also use [`with-env`](/commands/docs/with-env.md) to do the same thing more explicitly: +You can also use [`with-env`](/commands/docs/with-env) to do the same thing more explicitly: ```nu > with-env { FOO: BAR } { $env.FOO } BAR ``` -The [`with-env`](/commands/docs/with-env.md) command will temporarily set the environment variable to the value given (here: the variable "FOO" is given the value "BAR"). Once this is done, the [block](types_of_data.md#blocks) will run with this new environment variable set. +The [`with-env`](/commands/docs/with-env) command will temporarily set the environment variable to the value given (here: the variable "FOO" is given the value "BAR"). Once this is done, the [block](types_of_data#blocks) will run with this new environment variable set. ## Permanent environment variables You can also set environment variables at startup so they are available for the duration of Nushell running. -To do this, set an environment variable inside [the Nu configuration file](configuration.md). +To do this, set an environment variable inside [the Nu configuration file](configuration). For example: -```nu -# In config.nu +```nu title="config.nu" $env.FOO = 'BAR' ``` ## Defining environment from custom commands Due to the scoping rules, any environment variables defined inside a custom command will only exist inside the command's scope. -However, a command defined as [`def --env`](/commands/docs/def.md) instead of [`def`](/commands/docs/def.md) (it applies also to [`export def`](/commands/docs/export_def.md), see [Modules](modules.md)) will preserve the environment on the caller's side: +However, a command defined as [`def --env`](/commands/docs/def) instead of [`def`](/commands/docs/def) (it applies also to [`export def`](/commands/docs/export_def), see [Modules](modules)) will preserve the environment on the caller's side: ```nu > def --env foo [] { @@ -234,7 +242,7 @@ _(Important! The environment conversion string -> value happens **after** the en ## Removing environment variables -You can remove an environment variable only if it was set in the current scope via [`hide-env`](/commands/docs/hide_env.md): +You can remove an environment variable only if it was set in the current scope via [`hide-env`](/commands/docs/hide_env): ```nu > $env.FOO = 'BAR' diff --git a/src/content/docs/book/nu-as-a-shell/escaping.md b/src/content/docs/book/nu-as-a-shell/escaping.md new file mode 100644 index 00000000000..a763390a671 --- /dev/null +++ b/src/content/docs/book/nu-as-a-shell/escaping.md @@ -0,0 +1,23 @@ +--- +title: Escaping to the system +sidebar: + order: 4 +--- + +Nu provides a set of commands that you can use across different OSes ("internal" commands), and having this consistency is helpful. Sometimes, though, you want to run an external command that has the same name as an internal Nu command. To run the external [`ls`](/commands/docs/ls) or [`date`](/commands/docs/date) command, for example, you use the caret (^) command. Escaping with the caret prefix calls the command that's in the user's PATH (e.g. `/bin/ls` instead of Nu's internal [`ls`](/commands/docs/ls) command). + +Nu internal command: + +```nu +> ls +``` + +Escape to external command: + +```nu +> ^ls +``` + +## Windows note + +When running an external command on Windows, nushell [used to](https://www.nushell.sh/blog/2022-08-16-nushell-0_67#windows-cmd-exe-changes-rgwood) use [Cmd.exe](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd) to run the command, as a number of common commands on Windows are actually shell builtins and not available as separate executables. [Coming from CMD.EXE](coming_from_cmd) contains a list of these commands and how to map them to nushell native concepts. diff --git a/book/externs.md b/src/content/docs/book/nu-as-a-shell/externs.md similarity index 97% rename from book/externs.md rename to src/content/docs/book/nu-as-a-shell/externs.md index 0f8f245e386..b5d7ba70b71 100644 --- a/book/externs.md +++ b/src/content/docs/book/nu-as-a-shell/externs.md @@ -1,4 +1,8 @@ -# Externs +--- +title: Externs +sidebar: + order: 8 +--- Calling external commands is a fundamental part of using Nushell as a shell (and often using Nushell as a language). There's a problem, though: Nushell can't help with finding errors in the call, completions, or syntax highlighting with external commands. @@ -38,13 +42,13 @@ This is where `extern` comes in. The `extern` keyword allows you to write a full You'll notice this gives you all the same descriptive syntax that internal commands do, letting you describe flags, short flags, positional parameters, types, and more. -::: warning Note +:::note A Nushell comment that continues on the same line for argument documentation purposes requires a space before the ` #` pound sign. ::: ## Types and custom completions -In the above example, you'll notice some types are followed by `@` followed by the name of a command. We talk more about [custom completions](custom_completions.md) in their own section. +In the above example, you'll notice some types are followed by `@` followed by the name of a command. We talk more about [custom completions](custom_completions) in their own section. Both the type (or shape) of the argument and the custom completion tell Nushell about how to complete values for that flag or position. For example, setting a shape to `path` allows Nushell to complete the value to a filepath for you. Using the `@` with a custom completion overrides this default behavior, letting the custom completion give you full completion list. diff --git a/book/hooks.md b/src/content/docs/book/nu-as-a-shell/hooks.md similarity index 96% rename from book/hooks.md rename to src/content/docs/book/nu-as-a-shell/hooks.md index 9ec5e6f9e6f..8352b3cb043 100644 --- a/book/hooks.md +++ b/src/content/docs/book/nu-as-a-shell/hooks.md @@ -1,4 +1,8 @@ -# Hooks +--- +title: Hooks +sidebar: + order: 11 +--- Hooks allow you to run a code snippet at some predefined situations. They are only available in the interactive mode ([REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop)), they do not work if you run a Nushell with a script (`nu script.nu`) or commands (`nu -c "print foo"`) arguments. @@ -25,7 +29,7 @@ The steps to evaluate one line in the REPL mode are as follows: ## Basic Hooks -To enable hooks, define them in your [config](configuration.md): +To enable hooks, define them in your [config](configuration): ```nu $env.config = { @@ -84,7 +88,7 @@ $env.config = ($env.config | upsert hooks { ## Changing Environment One feature of the hooks is that they preserve the environment. -Environment variables defined inside the hook **block** will be preserved in a similar way as [`def --env`](environment.md#defining-environment-from-custom-commands). +Environment variables defined inside the hook **block** will be preserved in a similar way as [`def --env`](environment#defining-environment-from-custom-commands). You can test it with the following example: ```nu @@ -116,7 +120,7 @@ $env.config = ($env.config | upsert hooks { }) ``` -This won't work because the environment will be active only within the [`if`](/commands/docs/if.md) block. +This won't work because the environment will be active only within the [`if`](/commands/docs/if) block. In this case, you could easily rewrite it as `load-env (if $after == ... { ... } else { {} })` but this pattern is fairly common and later we'll see that not all cases can be rewritten like this. To deal with the above problem, we introduce another way to define a hook -- **a record**: @@ -254,7 +258,7 @@ You can view the result by opening `file:///tmp/nu-output.html` in a web browser. Of course this isn't very convenient unless you use a browser that automatically reloads when the file changes. -Instead of the [`save`](/commands/docs/save.md) command, you would normally customize this +Instead of the [`save`](/commands/docs/save) command, you would normally customize this to send the HTML output to a desired window. ### Changing how output is displayed diff --git a/book/line_editor.md b/src/content/docs/book/nu-as-a-shell/line_editor.md similarity index 98% rename from book/line_editor.md rename to src/content/docs/book/nu-as-a-shell/line_editor.md index 82ff31324c9..f4465bebdb3 100644 --- a/book/line_editor.md +++ b/src/content/docs/book/nu-as-a-shell/line_editor.md @@ -1,4 +1,8 @@ -# Reedline, Nu's line editor +--- +title: Line editor +sidebar: + order: 7 +--- Nushell's line editor [Reedline](https://github.com/nushell/reedline) is a cross-platform line reader designed to be modular and flexible. The engine is @@ -162,7 +166,7 @@ $env.PROMPT_COMMAND = { create_left_prompt } $env.PROMPT_COMMAND_RIGHT = { create_right_prompt } ``` -::: tip +:::tip You don't have to define the environment variables using Nushell functions. You can use simple strings to define them. ::: @@ -177,7 +181,7 @@ $env.PROMPT_INDICATOR_VI_NORMAL = "〉" $env.PROMPT_MULTILINE_INDICATOR = "::: " ``` -::: tip +:::tip The prompt indicators are environment variables that represent the state of the prompt ::: @@ -237,12 +241,12 @@ Each keybinding requires the next elements: - edit - until -::: tip +:::tip All of the available modifiers, keycodes and events can be found with -the command [`keybindings list`](/commands/docs/keybindings_list.md) +the command [`keybindings list`](/commands/docs/keybindings_list) ::: -::: tip +:::tip The keybindings added to `vi_insert` mode will be available when the line editor is in insert mode (when you can write text), and the keybindings marked with `vi_normal` mode will be available when in normal (when the cursor @@ -349,7 +353,7 @@ And the syntax for `send` events is the next one ... ``` -::: tip +:::tip You can write the name of the events with capital letters. The keybinding parser is case insensitive ::: @@ -540,7 +544,7 @@ e.g. to disable screen clearing with `Ctrl + l` for all edit modes ### Troubleshooting keybinding problems Your terminal environment may not always propagate your key combinations on to nushell the way you expect it to. -You can use the command [`keybindings listen`](/commands/docs/keybindings_listen.md) to figure out if certain keypresses are actually received by nushell, and how. +You can use the command [`keybindings listen`](/commands/docs/keybindings_listen) to figure out if certain keypresses are actually received by nushell, and how. ## Menus @@ -773,8 +777,8 @@ With that in mind, the desired menu would look like this ``` As you can see, the new menu is identical to the `history_menu` previously -described. The only huge difference is the new field called [`source`](/commands/docs/source.md). The -[`source`](/commands/docs/source.md) field is a nushell definition of the values you want to display in the +described. The only huge difference is the new field called [`source`](/commands/docs/source). The +[`source`](/commands/docs/source) field is a nushell definition of the values you want to display in the menu. For this menu we are extracting the data from `$nu.scope.vars` and we are using it to create records that will be used to populate the menu. diff --git a/book/shells_in_shells.md b/src/content/docs/book/nu-as-a-shell/shells_in_shells.md similarity index 74% rename from book/shells_in_shells.md rename to src/content/docs/book/nu-as-a-shell/shells_in_shells.md index 347212d33d1..5f13768de3d 100644 --- a/book/shells_in_shells.md +++ b/src/content/docs/book/nu-as-a-shell/shells_in_shells.md @@ -1,4 +1,8 @@ -# Shells in shells +--- +title: Shells in shells +sidebar: + order: 6 +--- ## Working in multiple directories @@ -13,12 +17,12 @@ To get started, let's enter a directory: # │ name │ type │ size │ modified ────┼────────────────────┼──────┼────────┼───────────── 0 │ 404.html │ File │ 429 B │ 2 hours ago - 1 │ CONTRIBUTING.md │ File │ 955 B │ 2 hours ago + 1 │ CONTRIBUTING │ File │ 955 B │ 2 hours ago 2 │ Gemfile │ File │ 1.1 KB │ 2 hours ago 3 │ Gemfile.lock │ File │ 6.9 KB │ 2 hours ago ``` -Entering is similar to changing directories (as we saw with the [`cd`](/commands/docs/cd.md) command). This allows you to jump into a directory to work in it. Instead of changing the directory, we now are in two directories. To see this more clearly, we can use the [`shells`](/commands/docs/shells.md) command to list the current directories we have active: +Entering is similar to changing directories (as we saw with the [`cd`](/commands/docs/cd) command). This allows you to jump into a directory to work in it. Instead of changing the directory, we now are in two directories. To see this more clearly, we can use the [`shells`](/commands/docs/shells) command to list the current directories we have active: ```nu /home/jonathan/Source/book(main)> enter ../music @@ -32,9 +36,9 @@ Entering is similar to changing directories (as we saw with the [`cd`](/commands ───┴────────┴─────────────────────────────── ``` -The [`shells`](/commands/docs/shells.md) command shows us there are three shells: our original "nushell" source directory, "book" directory and "music" directory which is currently active. +The [`shells`](/commands/docs/shells) command shows us there are three shells: our original "nushell" source directory, "book" directory and "music" directory which is currently active. -We can jump between these shells with the [`n`](/commands/docs/n.md), [`p`](/commands/docs/p.md) and [`g`](/commands/docs/g.md) shortcuts, short for "next", "previous" and "goto": +We can jump between these shells with the [`n`](/commands/docs/n), [`p`](/commands/docs/p) and [`g`](/commands/docs/g) shortcuts, short for "next", "previous" and "goto": ```nu /home/jonathan/Source/music(main)> p @@ -47,6 +51,6 @@ We can see the directory changing, but we're always able to get back to a previo ## Exiting the shell -You can leave a shell you have [`enter`](/commands/docs/enter.md)ed using the `dexit` command. +You can leave a shell you have [`enter`](/commands/docs/enter)ed using the `dexit` command. You can always quit Nu, even if multiple shells are active, using `exit`. diff --git a/book/stdout_stderr_exit_codes.md b/src/content/docs/book/nu-as-a-shell/stdout_stderr_exit_codes.md similarity index 66% rename from book/stdout_stderr_exit_codes.md rename to src/content/docs/book/nu-as-a-shell/stdout_stderr_exit_codes.md index a77a0d803a7..9cae63e9b90 100644 --- a/book/stdout_stderr_exit_codes.md +++ b/src/content/docs/book/nu-as-a-shell/stdout_stderr_exit_codes.md @@ -1,4 +1,8 @@ -# Stdout, Stderr, and Exit Codes +--- +title: Stdout, Stderr, and Exit Codes +sidebar: + order: 3 +--- An important piece of interop between Nushell and external commands is working with the standard streams of data coming from the external. @@ -12,7 +16,7 @@ Stdout is the way that most external apps will send data into the pipeline or to > external | str join ``` -The above would call the external named `external` and would redirect the stdout output stream into the pipeline. With this redirection, Nushell can then pass the data to the next command in the pipeline, here [`str join`](/commands/docs/str_join.md). +The above would call the external named `external` and would redirect the stdout output stream into the pipeline. With this redirection, Nushell can then pass the data to the next command in the pipeline, here [`str join`](/commands/docs/str_join). Without the pipeline, Nushell will not do any redirection, allowing it to print directly to the screen. @@ -37,13 +41,13 @@ Nushell tracks the last exit code of the recently completed external in one of t > $env.LAST_EXIT_CODE ``` -The second uses a command called [`complete`](/commands/docs/complete.md). +The second uses a command called [`complete`](/commands/docs/complete). -## Using the [`complete`](/commands/docs/complete.md) command +## Using the [`complete`](/commands/docs/complete) command -The [`complete`](/commands/docs/complete.md) command allows you to run an external to completion, and gather the stdout, stderr, and exit code together in one record. +The [`complete`](/commands/docs/complete) command allows you to run an external to completion, and gather the stdout, stderr, and exit code together in one record. -If we try to run the external `cat` on a file that doesn't exist, we can see what [`complete`](/commands/docs/complete.md) does with the streams, including the redirected stderr: +If we try to run the external `cat` on a file that doesn't exist, we can see what [`complete`](/commands/docs/complete) does with the streams, including the redirected stderr: ```nu > do { cat unknown.txt } | complete @@ -56,15 +60,25 @@ If we try to run the external `cat` on a file that doesn't exist, we can see wha ## `echo`, `print`, and `log` commands -The [`echo`](/commands/docs/echo.md) command is mainly for _pipes_. It returns its arguments, ignoring the piped-in value. There is usually little reason to use this over just writing the values as-is. +The [`echo`](/commands/docs/echo) command is mainly for _pipes_. It returns its arguments, ignoring the piped-in value. There is usually little reason to use this over just writing the values as-is. -In contrast, the [`print`](/commands/docs/print.md) command prints the given values to stdout as plain text. It can be used to write to standard error output, as well. Unlike [`echo`](/commands/docs/echo.md), this command does not return any value (`print | describe` will return "nothing"). Since this command has no output, there is no point in piping it with other commands. +In contrast, the [`print`](/commands/docs/print) command prints the given values to stdout as plain text. It can be used to write to standard error output, as well. Unlike [`echo`](/commands/docs/echo), this command does not return any value (`print | describe` will return "nothing"). Since this command has no output, there is no point in piping it with other commands. -The [standard library](/book/standard_library.md) has commands to write out messages in different logging levels. For example: +The [standard library](/book/standard_library) has commands to write out messages in different logging levels. For example: -@[code](@snippets/book/std_log.nu) +```nu +use std log + +def main [] { + log debug "Debug message" + log info "Info message" + log warning "Warning message" + log error "Error message" + log critical "Critical message" +} +``` - + The log level for output can be set with the `NU_LOG_LEVEL` environment variable: @@ -94,7 +108,7 @@ Because streams of bytes can be difficult to work with, especially given how com Nushell attempts to convert to text using UTF-8. If at any time the conversion fails, the rest of the stream is assumed to always be bytes. -If you want more control over the decoding of the byte stream, you can use the [`decode`](/commands/docs/decode.md) command. The [`decode`](/commands/docs/decode.md) command can be inserted into the pipeline after the external, or other raw stream-creating command, and will handle decoding the bytes based on the argument you give decode. For example, you could decode shift-jis text this way: +If you want more control over the decoding of the byte stream, you can use the [`decode`](/commands/docs/decode) command. The [`decode`](/commands/docs/decode) command can be inserted into the pipeline after the external, or other raw stream-creating command, and will handle decoding the bytes based on the argument you give decode. For example, you could decode shift-jis text this way: ```nu > 0x[8a 4c] | decode shift-jis diff --git a/book/loading_data.md b/src/content/docs/book/nu-fundamentals/loading_data.md similarity index 60% rename from book/loading_data.md rename to src/content/docs/book/nu-fundamentals/loading_data.md index f2ea6e20ea6..0c610f05f19 100644 --- a/book/loading_data.md +++ b/src/content/docs/book/nu-fundamentals/loading_data.md @@ -1,19 +1,37 @@ -# Loading data +--- +title: Loading Data +sidebar: + order: 2 +--- -Earlier, we saw how you can use commands like [`ls`](/commands/docs/ls.md), [`ps`](/commands/docs/ps.md), [`date`](/commands/docs/date.md), and [`sys`](/commands/docs/sys.md) to load information about your files, processes, time of date, and the system itself. Each command gives us a table of information that we can explore. There are other ways we can load in a table of data to work with. +Earlier, we saw how you can use commands like [`ls`](/commands/docs/ls), [`ps`](/commands/docs/ps), [`date`](/commands/docs/date), and [`sys`](/commands/docs/sys) to load information about your files, processes, time of date, and the system itself. Each command gives us a table of information that we can explore. There are other ways we can load in a table of data to work with. ## Opening files -One of Nu's most powerful assets in working with data is the [`open`](/commands/docs/open.md) command. It is a multi-tool that can work with a number of different data formats. To see what this means, let's try opening a json file: +One of Nu's most powerful assets in working with data is the [`open`](/commands/docs/open) command. It is a multi-tool that can work with a number of different data formats. To see what this means, let's try opening a json file: -@[code](@snippets/loading_data/vscode.sh) +```nu +open package.json +╭─────────────────┬──────────────────────────────────╮ +│ name │ nushell.github.io │ +│ type │ module │ +│ version │ 0.0.0 │ +│ description │ The Nushell website (nushell.sh) │ +│ repository │ github:nushell/nushell.github.io │ +│ license │ MIT │ +│ engines │ {record 2 fields} │ +│ scripts │ {record 11 fields} │ +│ dependencies │ {record 5 fields} │ +│ devDependencies │ {record 3 fields} │ +╰─────────────────┴──────────────────────────────────╯ +``` -In a similar way to [`ls`](/commands/docs/ls.md), opening a file type that Nu understands will give us back something that is more than just text (or a stream of bytes). Here we open a "package.json" file from a JavaScript project. Nu can recognize the JSON text and parse it to a table of data. +In a similar way to [`ls`](/commands/docs/ls), opening a file type that Nu understands will give us back something that is more than just text (or a stream of bytes). Here we open a "package.json" file from a JavaScript project. Nu can recognize the JSON text and parse it to a table of data. -If we wanted to check the version of the project we were looking at, we can use the [`get`](/commands/docs/get.md) command. +If we wanted to check the version of the project we were looking at, we can use the [`get`](/commands/docs/get) command. ```nu -> open editors/vscode/package.json | get version +open editors/vscode/package.json | get version 1.0.0 ``` @@ -36,7 +54,7 @@ Nu currently supports the following formats for loading data directly into table - xml - yaml / yml -::: tip Did you know? +:::tip[Did you know?] Under the hood `open` will look for a `from ...` subcommand in your scope which matches the extension of your file. You can thus simply extend the set of supported file types of `open` by creating your own `from ...` subcommand. ::: @@ -44,7 +62,7 @@ You can thus simply extend the set of supported file types of `open` by creating But what happens if you load a text file that isn't one of these? Let's try it: ```nu -> open README.md +open README.md ``` We're shown the contents of the file. @@ -57,7 +75,7 @@ Nushell Object Notation (NUON) aims to be for Nushell what JavaScript Object Not That is, NUON code is a valid Nushell code that describes some data structure. For example, this is a valid NUON (example from the [default configuration file](https://github.com/nushell/nushell/blob/main/crates/nu-utils/src/sample_config/default_config.nu)): -```nu +```nu title="default_config.nu" { menus: [ # Configuration for default nushell menus @@ -88,7 +106,7 @@ That is, any JSON code is a valid NUON code, therefore a valid Nushell code. Compared to JSON, NUON is more "human-friendly". For example, comments are allowed and commas are not required. -One limitation of NUON currently is that it cannot represent all of the Nushell [data types](types_of_data.md). +One limitation of NUON currently is that it cannot represent all of the Nushell [data types](types_of_data). Most notably, NUON does not allow to serialize blocks. ## Handling Strings @@ -98,7 +116,7 @@ An important part of working with data coming from outside Nu is that it's not a Let's imagine that we're given this data file: ```nu -> open people.txt +open people.txt Octavia | Butler | Writer Bob | Ross | Painter Antonio | Vivaldi | Composer @@ -109,7 +127,7 @@ Each bit of data we want is separated by the pipe ('|') symbol, and each person The first thing we want to do when bringing in the file is to work with it a line at a time: ```nu -> open people.txt | lines +open people.txt | lines ───┬────────────────────────────── 0 │ Octavia | Butler | Writer 1 │ Bob | Ross | Painter @@ -117,10 +135,10 @@ The first thing we want to do when bringing in the file is to work with it a lin ───┴────────────────────────────── ``` -We can see that we're working with the lines because we're back into a list. Our next step is to see if we can split up the rows into something a little more useful. For that, we'll use the [`split`](/commands/docs/split.md) command. [`split`](/commands/docs/split.md), as the name implies, gives us a way to split a delimited string. We will use [`split`](/commands/docs/split.md)'s `column` subcommand to split the contents across multiple columns. We tell it what the delimiter is, and it does the rest: +We can see that we're working with the lines because we're back into a list. Our next step is to see if we can split up the rows into something a little more useful. For that, we'll use the [`split`](/commands/docs/split) command. [`split`](/commands/docs/split), as the name implies, gives us a way to split a delimited string. We will use [`split`](/commands/docs/split)'s `column` subcommand to split the contents across multiple columns. We tell it what the delimiter is, and it does the rest: ```nu -> open people.txt | lines | split column "|" +open people.txt | lines | split column "|" ───┬──────────┬───────────┬─────────── # │ column1 │ column2 │ column3 ───┼──────────┼───────────┼─────────── @@ -130,10 +148,10 @@ We can see that we're working with the lines because we're back into a list. Our ───┴──────────┴───────────┴─────────── ``` -That _almost_ looks correct. It looks like there's an extra space there. Let's [`trim`](/commands/docs/str_trim.md) that extra space: +That _almost_ looks correct. It looks like there's an extra space there. Let's [`trim`](/commands/docs/str_trim) that extra space: ```nu -> open people.txt | lines | split column "|" | str trim +open people.txt | lines | split column "|" | str trim ───┬─────────┬─────────┬────────── # │ column1 │ column2 │ column3 ───┼─────────┼─────────┼────────── @@ -143,10 +161,10 @@ That _almost_ looks correct. It looks like there's an extra space there. Let's [ ───┴─────────┴─────────┴────────── ``` -Not bad. The [`split`](/commands/docs/split.md) command gives us data we can use. It also goes ahead and gives us default column names: +Not bad. The [`split`](/commands/docs/split) command gives us data we can use. It also goes ahead and gives us default column names: ```nu -> open people.txt | lines | split column "|" | str trim | get column1 +open people.txt | lines | split column "|" | str trim | get column1 ───┬───────── 0 │ Octavia 1 │ Bob @@ -157,7 +175,7 @@ Not bad. The [`split`](/commands/docs/split.md) command gives us data we can use We can also name our columns instead of using the default names: ```nu -> open people.txt | lines | split column "|" first_name last_name job | str trim +open people.txt | lines | split column "|" first_name last_name job | str trim ───┬────────────┬───────────┬────────── # │ first_name │ last_name │ job ───┼────────────┼───────────┼────────── @@ -170,7 +188,7 @@ We can also name our columns instead of using the default names: Now that our data is in a table, we can use all the commands we've used on tables before: ```nu -> open people.txt | lines | split column "|" first_name last_name job | str trim | sort-by first_name +open people.txt | lines | split column "|" first_name last_name job | str trim | sort-by first_name ───┬────────────┬───────────┬────────── # │ first_name │ last_name │ job ───┼────────────┼───────────┼────────── @@ -182,64 +200,80 @@ Now that our data is in a table, we can use all the commands we've used on table There are other commands you can use to work with strings: -- [`str`](/commands/docs/str.md) -- [`lines`](/commands/docs/lines.md) -- [`size`](/commands/docs/size.md) +- [`str`](/commands/docs/str) +- [`lines`](/commands/docs/lines) +- [`size`](/commands/docs/size) There is also a set of helper commands we can call if we know the data has a structure that Nu should be able to understand. For example, let's open a Rust lock file: ```nu -> open Cargo.lock +open Cargo.lock # This file is automatically @generated by Cargo. # It is not intended for manual editing. [[package]] name = "adhoc_derive" -version = "0.1.2" +version = "0.7.20" ``` -The "Cargo.lock" file is actually a .toml file, but the file extension isn't .toml. That's okay, we can use the [`from`](/commands/docs/from.md) command using the `toml` subcommand: +The "Cargo.lock" file is actually a .toml file, but the file extension isn't .toml. That's okay, we can use the [`from`](/commands/docs/from) command using the `toml` subcommand: -@[code](@snippets/loading_data/cargo-toml.sh) +```nu +open Cargo.lock | from toml +╭─────────┬──────────────────╮ +│ package │ [table 102 rows] │ +│ version │ 3 │ +╰─────────┴──────────────────╯ +``` -The [`from`](/commands/docs/from.md) command can be used for each of the structured data text formats that Nu can open and understand by passing it the supported format as a subcommand. +The [`from`](/commands/docs/from) command can be used for each of the structured data text formats that Nu can open and understand by passing it the supported format as a subcommand. ## Opening in raw mode -While it's helpful to be able to open a file and immediately work with a table of its data, this is not always what you want to do. To get to the underlying text, the [`open`](/commands/docs/open.md) command can take an optional `--raw` flag: +While it's helpful to be able to open a file and immediately work with a table of its data, this is not always what you want to do. To get to the underlying text, the [`open`](/commands/docs/open) command can take an optional `--raw` flag: ```nu -> open Cargo.toml --raw -[package] name = "nu" -version = "0.1.3" -authors = ["Yehuda Katz <wycats@gmail.com>", "Jonathan Turner <jonathan.d.turner@gmail.com>"] -description = "A shell for the GitHub era" -license = "MIT" +[package] +name = "rustlings" +description = "Small exercises to get you used to reading and writing Rust code!" +version = "5.6.1" +authors = [ + "Liv <mokou@fastmail.com>", + "Carol (Nichols || Goulding) <carol.nichols@gmail.com>", +] +edition = "2021" ``` ## SQLite -SQLite databases are automatically detected by [`open`](/commands/docs/open.md), no matter what their file extension is. You can open a whole database: +SQLite databases are automatically detected by [`open`](/commands/docs/open), no matter what their file extension is. You can open a whole database: ```nu -> open foo.db +open foo.db ``` -Or [`get`](/commands/docs/get.md) a specific table: +Or [`get`](/commands/docs/get) a specific table: ```nu -> open foo.db | get some_table +open foo.db | get some_table ``` Or run any SQL query you like: ```nu -> open foo.db | query db "select * from some_table" +open foo.db | query db "select * from some_table" ``` (Note: some older versions of Nu use `into db | query` instead of `query db` ) ## Fetching URLs -In addition to loading files from your filesystem, you can also load URLs by using the [`http get`](/commands/docs/http.md) command. This will fetch the contents of the URL from the internet and return it: +In addition to loading files from your filesystem, you can also load URLs by using the [`http get`](/commands/docs/http) command. This will fetch the contents of the URL from the internet and return it: -@[code](@snippets/loading_data/rust-lang-feed.sh) +```nu +http get https://blog.rust-lang.org/feed.xml +╭────────────┬──────────────────╮ +│ tag │ feed │ +│ attributes │ {record 1 field} │ +│ content │ [table 18 rows] │ +╰────────────┴──────────────────╯ +``` diff --git a/book/pipelines.md b/src/content/docs/book/nu-fundamentals/pipelines.md similarity index 79% rename from book/pipelines.md rename to src/content/docs/book/nu-fundamentals/pipelines.md index 5483aa5a8a2..7af178caf5a 100644 --- a/book/pipelines.md +++ b/src/content/docs/book/nu-fundamentals/pipelines.md @@ -1,4 +1,8 @@ -# Pipelines +--- +title: Pipelines +sidebar: + order: 3 +--- One of the core designs of Nu is the pipeline, a design idea that traces its roots back decades to some of the original philosophy behind Unix. Just as Nu extends from the single string data type of Unix, Nu also extends the idea of the pipeline to include more than just text. @@ -7,20 +11,20 @@ One of the core designs of Nu is the pipeline, a design idea that traces its roo A pipeline is composed of three parts: the input, the filter, and the output. ```nu -> open "Cargo.toml" | inc package.version --minor | save "Cargo_new.toml" +open "Cargo.toml" | inc package.version --minor | save "Cargo_new.toml" ``` -The first command, `open "Cargo.toml"`, is an input (sometimes also called a "source" or "producer"). This creates or loads data and feeds it into a pipeline. It's from input that pipelines have values to work with. Commands like [`ls`](/commands/docs/ls.md) are also inputs, as they take data from the filesystem and send it through the pipelines so that it can be used. +The first command, `open "Cargo.toml"`, is an input (sometimes also called a "source" or "producer"). This creates or loads data and feeds it into a pipeline. It's from input that pipelines have values to work with. Commands like [`ls`](/commands/docs/ls) are also inputs, as they take data from the filesystem and send it through the pipelines so that it can be used. -The second command, `inc package.version --minor`, is a filter. Filters take the data they are given and often do something with it. They may change it (as with the [`inc`](/commands/docs/inc.md) command in our example), or they may do another operation, like logging, as the values pass through. +The second command, `inc package.version --minor`, is a filter. Filters take the data they are given and often do something with it. They may change it (as with the [`inc`](/commands/docs/inc) command in our example), or they may do another operation, like logging, as the values pass through. The last command, `save "Cargo_new.toml"`, is an output (sometimes called a "sink"). An output takes input from the pipeline and does some final operation on it. In our example, we save what comes through the pipeline to a file as the final step. Other types of output commands may take the values and view them for the user. The `$in` variable will collect the pipeline into a value for you, allowing you to access the whole stream as a parameter: ```nu -> [1 2 3] | $in.1 * $in.2 -6 +[1 2 3] | $in.1 * $in.2 +# 6 ``` ## Multi-line pipelines @@ -35,14 +39,14 @@ If a pipeline is getting a bit long for one line, you can enclose it within `(` ) ``` -Also see [Subexpressions](https://www.nushell.sh/book/variables_and_subexpressions.html#subexpressions) +Also see [Subexpressions](https://www.nushell.sh/book/variables_and_subexpressions#subexpressions) ## Semicolons Take this example: ```nu -> line1; line2 | line3 +line1; line2 | line3 ``` Here, semicolons are used in conjunction with pipelines. When a semicolon is used, no output data is produced to be piped. As such, the `$in` variable will not work when used immediately after the semicolon. @@ -52,7 +56,7 @@ Here, semicolons are used in conjunction with pipelines. When a semicolon is use ## Working with external commands -Nu commands communicate with each other using the Nu data types (see [types of data](types_of_data.md)), but what about commands outside of Nu? Let's look at some examples of working with external commands: +Nu commands communicate with each other using the Nu data types (see [types of data](types_of_data)), but what about commands outside of Nu? Let's look at some examples of working with external commands: `internal_command | external_command` @@ -60,7 +64,7 @@ Data will flow from the internal_command to the external_command. This data will `external_command | internal_command` -Data coming from an external command into Nu will come in as bytes that Nushell will try to automatically convert to UTF-8 text. If successful, a stream of text data will be sent to internal_command. If unsuccessful, a stream of binary data will be sent to internal command. Commands like [`lines`](/commands/docs/lines.md) help make it easier to bring in data from external commands, as it gives discrete lines of data to work with. +Data coming from an external command into Nu will come in as bytes that Nushell will try to automatically convert to UTF-8 text. If successful, a stream of text data will be sent to internal_command. If unsuccessful, a stream of binary data will be sent to internal command. Commands like [`lines`](/commands/docs/lines) help make it easier to bring in data from external commands, as it gives discrete lines of data to work with. `external_command_1 | external_command_2` @@ -68,32 +72,33 @@ Nu works with data piped between two external commands in the same way as other ## Behind the scenes -You may have wondered how we see a table if [`ls`](/commands/docs/ls.md) is an input and not an output. Nu adds this output for us automatically using another command called [`table`](/commands/docs/table.md). The [`table`](/commands/docs/table.md) command is appended to any pipeline that doesn't have an output. This allows us to see the result. +You may have wondered how we see a table if [`ls`](/commands/docs/ls) is an input and not an output. Nu adds this output for us automatically using another command called [`table`](/commands/docs/table). The [`table`](/commands/docs/table) command is appended to any pipeline that doesn't have an output. This allows us to see the result. In effect, the command: ```nu -> ls +ls ``` And the pipeline: ```nu -> ls | table +ls | table ``` Are one and the same. -> **Note** +> :::note > the sentence _are one and the same_ above only applies for the graphical output in the shell, > it does not mean the two data structures are them same > -> ```nushell -> > (ls) == (ls | table) -> false +> ```nu +> (ls) == (ls | table) +> # false > ``` > > `ls | table` is not even structured data! +> ::: ## Output result to external commands @@ -101,7 +106,7 @@ Sometimes you want to output Nushell structured data to an external command for For example, you want to find a file named "tutor" under "/usr/share/vim/runtime" and check its ownership ```nu -> ls /usr/share/nvim/runtime/ +ls /usr/share/nvim/runtime/ ╭────┬───────────────────────────────────────┬──────┬─────────┬───────────────╮ │ # │ name │ type │ size │ modified │ ├────┼───────────────────────────────────────┼──────┼─────────┼───────────────┤ @@ -117,17 +122,17 @@ For example, you want to find a file named "tutor" under "/usr/share/vim/runtime ╰────┴───────────────────────────────────────┴──────┴─────────┴───────────────╯ ``` -You decided to use `grep` and [pipe](https://www.nushell.sh/book/pipelines.html) the result to external `^ls` +You decided to use `grep` and [pipe](https://www.nushell.sh/book/pipelines) the result to external `^ls` ```nu -> ls /usr/share/nvim/runtime/ | get name | ^grep tutor | ^ls -la $in +ls /usr/share/nvim/runtime/ | get name | ^grep tutor | ^ls -la $in ls: cannot access ''$'\342\224\202'' 32 '$'\342\224\202'' /usr/share/nvim/runtime/tutor '$'\342\224\202\n': No such file or directory ``` -What's wrong? Nushell renders lists and tables (by adding a border with characters like `╭`,`─`,`┬`,`╮`) before piping them as text to external commands. If that's not the behavior you want, you must explicitly convert the data to a string before piping it to an external. For example, you can do so with [`to text`](/commands/docs/to_text.md): +What's wrong? Nushell renders lists and tables (by adding a border with characters like `╭`,`─`,`┬`,`╮`) before piping them as text to external commands. If that's not the behavior you want, you must explicitly convert the data to a string before piping it to an external. For example, you can do so with [`to text`](/commands/docs/to_text): ```nu -> ls /usr/share/nvim/runtime/ | get name | to text | ^grep tutor | tr -d '\n' | ^ls -la $in +ls /usr/share/nvim/runtime/ | get name | to text | ^grep tutor | tr -d '\n' | ^ls -la $in total 24 drwxr-xr-x@ 5 pengs admin 160 14 Nov 13:12 . drwxr-xr-x@ 4 pengs admin 128 14 Nov 13:42 en @@ -135,10 +140,10 @@ drwxr-xr-x@ 4 pengs admin 128 14 Nov 13:42 en -rw-r--r--@ 1 pengs admin 1191 14 Nov 13:42 tutor.tutor.json ``` -(Actually, for this simple usage you can just use [`find`](/commands/docs/find.md)) +(Actually, for this simple usage you can just use [`find`](/commands/docs/find)) ```nu -> ls /usr/share/nvim/runtime/ | get name | find tutor | ^ls -al $in +ls /usr/share/nvim/runtime/ | get name | find tutor | ^ls -al $in ``` ## Command Output in Nushell @@ -146,7 +151,7 @@ drwxr-xr-x@ 4 pengs admin 128 14 Nov 13:42 en Unlike external commands, Nushell commands are akin to functions. Most Nushell commands do not print anything to `stdout` and instead just return data. ```nu -> do { ls; ls; ls; "What?!" } +do { ls; ls; ls; "What?!" } ``` This means that the above code will not display the files under the current directory three times. @@ -155,21 +160,21 @@ In fact, running this in the shell will only display `"What?!"` because that is Knowing when data is displayed is important when using configuration variables that affect the display output of commands such as `table`. ```nu -> do { $env.config.table.mode = none; ls } +do { $env.config.table.mode = none; ls } ``` For instance, the above example sets the `$env.config.table.mode` configuration variable to `none`, which causes the `table` command to render data without additional borders. However, as it was shown earlier, the command is effectively equivalent to ```nu -> do { $env.config.table.mode = none; ls } | table +do { $env.config.table.mode = none; ls } | table ``` -Because Nushell `$env` variables are [scoped](https://www.nushell.sh/book/environment.html#scoping), this means that the `table` command in the example is not affected by the +Because Nushell `$env` variables are [scoped](https://www.nushell.sh/book/environment#scoping), this means that the `table` command in the example is not affected by the environment modification inside the `do` block and the data will not be shown with the applied configuration. When displaying data early is desired, it is possible to explicitly apply `| table` inside the scope, or use the `print` command. ```nu -> do { $env.config.table.mode = none; ls | table } -> do { $env.config.table.mode = none; print (ls) } +do { $env.config.table.mode = none; ls | table } +do { $env.config.table.mode = none; print (ls) } ``` diff --git a/book/types_of_data.md b/src/content/docs/book/nu-fundamentals/types_of_data.md similarity index 70% rename from book/types_of_data.md rename to src/content/docs/book/nu-fundamentals/types_of_data.md index f6db177f3fd..cd5d788d065 100644 --- a/book/types_of_data.md +++ b/src/content/docs/book/nu-fundamentals/types_of_data.md @@ -1,4 +1,8 @@ -# Types of Data +--- +title: Types of Data +sidebar: + order: 1 +--- Traditionally, Unix shell commands have communicated with each other using strings of text: one command would write text to standard output (often abbreviated 'stdout') and the other would read text from standard input (or 'stdin'), allowing the two commands to communicate. @@ -6,10 +10,10 @@ Nu embraces this approach, and expands it to include other types of data, in add Like many programming languages, Nu models data using a set of simple, and structured data types. Simple data types include integers, floats, strings, booleans, dates. There are also special types for filesizes and time durations. -The [`describe`](/commands/docs/describe.md) command returns the type of a data value: +The [`describe`](/commands/docs/describe) command returns the type of a data value: ```nu -> 42 | describe +42 | describe ``` ## Types at a glance @@ -35,19 +39,19 @@ The [`describe`](/commands/docs/describe.md) command returns the type of a data ## Integers Examples of integers (i.e. "round numbers") include 1, 0, -5, and 100. -You can parse a string into an integer with the [`into int`](/commands/docs/into_int.md) command +You can parse a string into an integer with the [`into int`](/commands/docs/into_int) command ```nu -> "-5" | into int +"-5" | into int ``` ## Decimals (floats) Decimal numbers are numbers with some fractional component. Examples include 1.5, 2.0, and 15.333. -You can cast a string into a Float with the [`into float`](/commands/docs/into_float.md) command +You can cast a string into a Float with the [`into float`](/commands/docs/into_float) command ```nu -> "1.2" | into float +"1.2" | into float ``` ## Strings @@ -65,19 +69,19 @@ A string of characters that represents text. There are a few ways these can be c - `print hello` - `[foo bar baz]` -See [Working with strings](working_with_strings.md) and [Handling Strings](https://www.nushell.sh/book/loading_data.html#handling-strings) for details. +See [Working with strings](working_with_strings) and [Handling Strings](https://www.nushell.sh/book/loading_data#handling-strings) for details. ## Booleans There are just two boolean values: `true` and `false`. Rather than writing the values directly, they often result from a comparison: ```nu -> let mybool = 2 > 1 -> $mybool -true -> let mybool = ($env.HOME | path exists) -> $mybool -true +let mybool = 2 > 1 +$mybool +# outputs: true +let mybool = ($env.HOME | path exists) +$mybool +# outputs: true ``` ## Dates @@ -111,15 +115,16 @@ Durations represent a length of time. This chart shows all durations currently s You can make fractional durations: ```nu -> 3.14day -3day 3hr 21min +3.14day +# outputs: 3day 3hr 21min ``` And you can do calculations with durations: ```nu -> 30day / 1sec # How many seconds in 30 days? -2592000 +# How many seconds in 30 days? +30day / 1sec +# outputs: 2592000 ``` ## File sizes @@ -145,29 +150,27 @@ The full list of filesize units are: As with durations, you can make fractional file sizes, and do calculations: ```nu -> 1Gb / 1b -1000000000 -> 1Gib / 1b -1073741824 -> (1Gib / 1b) == 2 ** 30 -true +1Gb / 1b +# 1000000000 +1Gib / 1b +# 1073741824 +(1Gib / 1b) == 2 ** 30 +# true ``` ## Ranges A range is a way of expressing a sequence of integer or float values from start to finish. They take the form \<start\>..\<end\>. For example, the range `1..3` means the numbers 1, 2, and 3. -::: tip - -You can also easily create lists of characters with a form similar to ranges with the command [`seq char`](/commands/docs/seq_char.html) as well as with dates using the [`seq date`](/commands/docs/seq_date.html) command. - +:::tip +You can also easily create lists of characters with a form similar to ranges with the command [`seq char`](/commands/docs/seq_char) as well as with dates using the [`seq date`](/commands/docs/seq_date) command. ::: ### Specifying the step You can specify the step of a range with the form \<start\>..\<second\>..\<end\>, where the step between values in the range is the distance between the \<start\> and \<second\> values, which numerically is \<second\> - \<start\>. For example, the range `2..5..11` means the numbers 2, 5, 8, and 11 because the step is \<second\> - \<first\> = 5 - 2 = 3. The third value is 5 + 3 = 8 and the fourth value is 8 + 3 = 11. -[`seq`](/commands/docs/seq.md) can also create sequences of numbers, and provides an alternate way of specifying the step with three parameters. It's called with `seq $start $step $end` where the step amount is the second parameter rather than being the second parameter minus the first parameter. So `2..5..9` would be equivalent to `seq 2 3 9`. +[`seq`](/commands/docs/seq) can also create sequences of numbers, and provides an alternate way of specifying the step with three parameters. It's called with `seq $start $step $end` where the step amount is the second parameter rather than being the second parameter minus the first parameter. So `2..5..9` would be equivalent to `seq 2 3 9`. ### Inclusive and non-inclusive ranges @@ -179,14 +182,12 @@ Sometimes, you may want a range that is limited by a number but doesn't use that Ranges can also be open-ended. You can remove the start or the end of the range to make it open-ended. -Let's say you wanted to start counting at 3, but you didn't have a specific end in mind. You could use the range `3..` to represent this. When you use a range that's open-ended on the right side, remember that this will continue counting for as long as possible, which could be a very long time! You'll often want to use open-ended ranges with commands like [`take`](/commands/docs/take.md), so you can take the number of elements you want from the range. +Let's say you wanted to start counting at 3, but you didn't have a specific end in mind. You could use the range `3..` to represent this. When you use a range that's open-ended on the right side, remember that this will continue counting for as long as possible, which could be a very long time! You'll often want to use open-ended ranges with commands like [`take`](/commands/docs/take), so you can take the number of elements you want from the range. You can also make the start of the range open. In this case, Nushell will start counting with `0`. For example, the range `..2` is the numbers 0, 1, and 2. -::: warning - +:::caution[Warning] Watch out for displaying open-ended ranges like just entering `3..` into the command line. It will keep printing out numbers very quickly until you stop it with something like Ctr + c. - ::: ## Binary data @@ -196,9 +197,12 @@ Binary data, like the data from an image file, is a group of raw bytes. You can write binary as a literal using any of the `0x[...]`, `0b[...]`, or `0o[...]` forms: ```nu -> 0x[1F FF] # Hexadecimal -> 0b[1 1010] # Binary -> 0o[377] # Octal +# Hexadecimal +0x[1F FF] +# Binary +0b[1 1010] +# Octal +0o[377] ``` Incomplete bytes will be left-padded with zeros. @@ -212,11 +216,7 @@ Structured data builds from the simple data. For example, instead of a single in Records hold key-value pairs, which associate string keys with various data values. Record syntax is very similar to objects in JSON. However, commas are _not_ required to separate values if Nushell can easily distinguish them! ```nu -> {name: sam rank: 10} -╭──────┬─────╮ -│ name │ sam │ -│ rank │ 10 │ -╰──────┴─────╯ +{name: sam rank: 10} ``` As these can sometimes have many fields, a record is printed up-down rather than left-right. @@ -224,15 +224,10 @@ As these can sometimes have many fields, a record is printed up-down rather than :::tip A record is identical to a single row of a table (see below). You can think of a record as essentially being a "one-row table", with each of its keys as a column (although a true one-row table is something distinct from a record). -This means that any command that operates on a table's rows _also_ operates on records. For instance, [`insert`](/commands/docs/insert.md), which adds data to each of a table's rows, can be used with records: +This means that any command that operates on a table's rows _also_ operates on records. For instance, [`insert`](/commands/docs/insert), which adds data to each of a table's rows, can be used with records: ```nu -> {x:3 y:1} | insert z 0 -╭───┬───╮ -│ x │ 3 │ -│ y │ 1 │ -│ z │ 0 │ -╰───┴───╯ +{x:3 y:1} | insert z 0 ``` ::: @@ -240,39 +235,26 @@ This means that any command that operates on a table's rows _also_ operates on r You can iterate over records by first transposing it into a table: ```nu -> {name: sam, rank: 10} | transpose key value -╭───┬──────┬───────╮ -│ # │ key │ value │ -├───┼──────┼───────┤ -│ 0 │ name │ sam │ -│ 1 │ rank │ 10 │ -╰───┴──────┴───────╯ +{name: sam, rank: 10} | transpose key value ``` Accessing records' data is done by placing a `.` before a string, which is usually a bare string: ```nu -> {x:12 y:4}.x -12 +{x:12 y:4}.x ``` However, if a record has a key name that can't be expressed as a bare string, or resembles an integer (see lists, below), you'll need to use more explicit string syntax, like so: ```nu -> {"1":true " ":false}." " -false +{"1":true " ":false}." " ``` To make a copy of a record with new fields, you can use the [spread operator](/book/operators#spread-operator) (`...`): ```nu -> let data = { name: alice, age: 50 } -> { ...$data, hobby: cricket } -╭───────┬─────────╮ -│ name │ alice │ -│ age │ 50 │ -│ hobby │ cricket │ -╰───────┴─────────╯ +let data = { name: alice, age: 50 } +{ ...$data, hobby: cricket } ``` ## Lists @@ -280,23 +262,14 @@ To make a copy of a record with new fields, you can use the [spread operator](/b Lists are ordered sequences of data values. List syntax is very similar to arrays in JSON. However, commas are _not_ required to separate values if Nushell can easily distinguish them! ```nu -> [sam fred george] -╭───┬────────╮ -│ 0 │ sam │ -│ 1 │ fred │ -│ 2 │ george │ -╰───┴────────╯ +[sam fred george] ``` :::tip -Lists are equivalent to the individual columns of tables. You can think of a list as essentially being a "one-column table" (with no column name). Thus, any command which operates on a column _also_ operates on a list. For instance, [`where`](/commands/docs/where.md) can be used with lists: +Lists are equivalent to the individual columns of tables. You can think of a list as essentially being a "one-column table" (with no column name). Thus, any command which operates on a column _also_ operates on a list. For instance, [`where`](/commands/docs/where) can be used with lists: ```nu -> [bell book candle] | where ($it =~ 'b') -╭───┬──────╮ -│ 0 │ bell │ -│ 1 │ book │ -╰───┴──────╯ +[bell book candle] | where ($it =~ 'b') ``` ::: @@ -304,34 +277,21 @@ Lists are equivalent to the individual columns of tables. You can think of a lis Accessing lists' data is done by placing a `.` before a bare integer: ```nu -> [a b c].1 -b +[a b c].1 ``` -To get a sub-list from a list, you can use the [`range`](/commands/docs/range.md) command: +To get a sub-list from a list, you can use the [`range`](/commands/docs/range) command: ```nu -> [a b c d e f] | range 1..3 -╭───┬───╮ -│ 0 │ b │ -│ 1 │ c │ -│ 2 │ d │ -╰───┴───╯ +[a b c d e f] | range 1..3 ``` To append one or more lists together, optionally with values interspersed in between, you can use the [spread operator](/book/operators#spread-operator) (`...`): ```nu -> let x = [1 2] -> [...$x 3 ...(4..7 | take 2)] -╭───┬───╮ -│ 0 │ 1 │ -│ 1 │ 2 │ -│ 2 │ 3 │ -│ 3 │ 4 │ -│ 4 │ 5 │ -╰───┴───╯ +let x = [1 2] +[...$x 3 ...(4..7 | take 2)] ``` ## Tables @@ -341,46 +301,26 @@ The table is a core data structure in Nushell. As you run commands, you'll see t We can create our own tables similarly to how we create a list. Because tables also contain columns and not just values, we pass in the name of the column values: ```nu -> [[column1, column2]; [Value1, Value2] [Value3, Value4]] -╭───┬─────────┬─────────╮ -│ # │ column1 │ column2 │ -├───┼─────────┼─────────┤ -│ 0 │ Value1 │ Value2 │ -│ 1 │ Value3 │ Value4 │ -╰───┴─────────┴─────────╯ +[[column1, column2]; [Value1, Value2] [Value3, Value4]] ``` You can also create a table as a list of records, JSON-style: ```nu -> [{name: sam, rank: 10}, {name: bob, rank: 7}] -╭───┬──────┬──────╮ -│ # │ name │ rank │ -├───┼──────┼──────┤ -│ 0 │ sam │ 10 │ -│ 1 │ bob │ 7 │ -╰───┴──────┴──────╯ +[{name: sam, rank: 10}, {name: bob, rank: 7}] ``` :::tip Internally, tables are simply **lists of records**. This means that any command which extracts or isolates a specific row of a table will produce a record. For example, `get 0`, when used on a list, extracts the first value. But when used on a table (a list of records), it extracts a record: ```nu -> [{x:12, y:5}, {x:3, y:6}] | get 0 -╭───┬────╮ -│ x │ 12 │ -│ y │ 5 │ -╰───┴────╯ +[{x:12, y:5}, {x:3, y:6}] | get 0 ``` This is true regardless of which table syntax you use: ```nu [[x,y];[12,5],[3,6]] | get 0 -╭───┬────╮ -│ x │ 12 │ -│ y │ 5 │ -╰───┴────╯ ``` ::: @@ -391,42 +331,27 @@ You can combine list and record data access syntax to navigate tables. When used You can access individual rows by number to obtain records: -@[code](@snippets/types_of_data/cell-paths.sh) +```nu +[{langs:[Rust JS Python], releases:60}].0 +[{langs:[Rust JS Python], releases:60}].0.langs.2 +``` Moreover, you can also access entire columns of a table by name, to obtain lists: ```nu -> [{x:12 y:5} {x:4 y:7} {x:2 y:2}].x -╭───┬────╮ -│ 0 │ 12 │ -│ 1 │ 4 │ -│ 2 │ 2 │ -╰───┴────╯ +[{x:12 y:5} {x:4 y:7} {x:2 y:2}].x ``` -Of course, these resulting lists don't have the column names of the table. To remove columns from a table while leaving it as a table, you'll commonly use the [`select`](/commands/docs/select.md) command with column names: +Of course, these resulting lists don't have the column names of the table. To remove columns from a table while leaving it as a table, you'll commonly use the [`select`](/commands/docs/select) command with column names: ```nu -> [{x:0 y:5 z:1} {x:4 y:7 z:3} {x:2 y:2 z:0}] | select y z -╭───┬───┬───╮ -│ # │ y │ z │ -├───┼───┼───┤ -│ 0 │ 5 │ 1 │ -│ 1 │ 7 │ 3 │ -│ 2 │ 2 │ 0 │ -╰───┴───┴───╯ +[{x:0 y:5 z:1} {x:4 y:7 z:3} {x:2 y:2 z:0}] | select y z ``` -To remove rows from a table, you'll commonly use the [`select`](/commands/docs/select.md) command with row numbers, as you would with a list: +To remove rows from a table, you'll commonly use the [`select`](/commands/docs/select) command with row numbers, as you would with a list: ```nu -> [{x:0 y:5 z:1} {x:4 y:7 z:3} {x:2 y:2 z:0}] | select 1 2 -╭───┬───┬───┬───╮ -│ # │ x │ y │ z │ -├───┼───┼───┼───┤ -│ 0 │ 4 │ 7 │ 3 │ -│ 1 │ 2 │ 2 │ 0 │ -╰───┴───┴───┴───╯ +[{x:0 y:5 z:1} {x:4 y:7 z:3} {x:2 y:2 z:0}] | select 1 2 ``` #### Optional cell paths @@ -434,11 +359,7 @@ To remove rows from a table, you'll commonly use the [`select`](/commands/docs/s By default, cell path access will fail if it can't access the requested row or column. To suppress these errors, you can add `?` to a cell path member to mark it as _optional_: ```nu -> [{foo: 123}, {}].foo? -╭───┬─────╮ -│ 0 │ 123 │ -│ 1 │ │ -╰───┴─────╯ +[{foo: 123}, {}].foo? ``` When using optional cell path members, missing data is replaced with `null`. @@ -452,7 +373,7 @@ Closure parameters are specified between a pair of pipe symbols (for example, `| You can also use a pipeline input as `$in` in most closures instead of providing an explicit parameter: `each { print $in }` Closures itself can be bound to a named variable and passed as a parameter. -To call a closure directly in your code use the [`do`](/commands/docs/do.md) command. +To call a closure directly in your code use the [`do`](/commands/docs/do) command. ```nu # Assign a closure to a variable @@ -461,14 +382,14 @@ do $greet "Julian" ``` Closures are a useful way to represent code that can be executed on each row of data. -It is idiomatic to use `$it` as a parameter name in [`each`](/commands/docs/each.md) blocks, but not required; +It is idiomatic to use `$it` as a parameter name in [`each`](/commands/docs/each) blocks, but not required; `each { |x| print $x }` works the same way as `each { |it| print $it }`. ## Blocks Blocks don't close over variables, don't have parameters, and can't be passed as a value. However, unlike closures, blocks can access mutable variable in the parent closure. -For example, mutating a variable inside the block used in an [`if`](/commands/docs/if.md) call is valid: +For example, mutating a variable inside the block used in an [`if`](/commands/docs/if) call is valid: ```nu mut x = 1 @@ -480,7 +401,7 @@ print $x ## Null -Finally, there is `null` which is the language's "nothing" value, similar to JSON's "null". Whenever Nushell would print the `null` value (outside of a string or data structure), it prints nothing instead. Hence, most of Nushell's file system commands (like [`save`](/commands/docs/save.md) or [`cd`](/commands/docs/cd.md)) produce `null`. +Finally, there is `null` which is the language's "nothing" value, similar to JSON's "null". Whenever Nushell would print the `null` value (outside of a string or data structure), it prints nothing instead. Hence, most of Nushell's file system commands (like [`save`](/commands/docs/save) or [`cd`](/commands/docs/cd)) produce `null`. You can place `null` at the end of a pipeline to replace the pipeline's output with it, and thus print nothing: @@ -488,31 +409,29 @@ You can place `null` at the end of a pipeline to replace the pipeline's output w git checkout featurebranch | null ``` -:::warning +:::caution[warning] +`null` is not the same as the absence of a value! It is possible for a table to be produced that has holes in some of its rows. + +```nu +[{a:1 b:2} {b:1}] +``` + +As of Nushell 0.71, the absence of a value is printed as the ❎ emoji. -`null` is not the same as the absence of a value! It is possible for a table to be produced that has holes in some of its rows. Attempting to access this value will not produce `null`, but instead cause an error: +Attempting to access this value will not produce `null`, but instead cause an error: ```nu -> [{a:1 b:2} {b:1}] -╭───┬────┬───╮ -│ # │ a │ b │ -├───┼────┼───┤ -│ 0 │ 1 │ 2 │ -│ 1 │ ❎ │ 1 │ -╰───┴────┴───╯ -> [{a:1 b:2} {b:1}].1.a +[{a:1 b:2} {b:1}].1.a Error: nu::shell::column_not_found × Cannot find column ╭─[entry #15:1:1] 1 │ [{a:1 b:2} {b:1}].1.a · ──┬── ┬ - · │ ╰── cannot find column + · │ ╰── cannot find column 'a' · ╰── value originates here ╰──── ``` If you would prefer this to return `null`, mark the cell path member as _optional_ like `.1.a?`. - -The absence of a value is (as of Nushell 0.71) printed as the ❎ emoji in interactive output. ::: diff --git a/book/working_with_lists.md b/src/content/docs/book/nu-fundamentals/working_with_lists.md similarity index 57% rename from book/working_with_lists.md rename to src/content/docs/book/nu-fundamentals/working_with_lists.md index 5361554e2e0..5f2c608223c 100644 --- a/book/working_with_lists.md +++ b/src/content/docs/book/nu-fundamentals/working_with_lists.md @@ -1,4 +1,8 @@ -# Working with lists +--- +title: Working with lists +sidebar: + order: 5 +--- ## Creating lists @@ -8,23 +12,23 @@ For example, `[foo bar baz]` or `[foo, bar, baz]`. ## Updating lists -You can [`update`](/commands/docs/update.md) and [`insert`](/commands/docs/insert.md) values into lists as they flow through the pipeline, for example let's insert the value `10` into the middle of a list: +You can [`update`](/commands/docs/update) and [`insert`](/commands/docs/insert) values into lists as they flow through the pipeline, for example let's insert the value `10` into the middle of a list: ```nu -> [1, 2, 3, 4] | insert 2 10 +[1, 2, 3, 4] | insert 2 10 # [1, 2, 10, 3, 4] ``` -We can also use [`update`](/commands/docs/update.md) to replace the 2nd element with the value `10`. +We can also use [`update`](/commands/docs/update) to replace the 2nd element with the value `10`. ```nu -> [1, 2, 3, 4] | update 1 10 +[1, 2, 3, 4] | update 1 10 # [1, 10, 3, 4] ``` ## Removing or adding items from list -In addition to [`insert`](/commands/docs/insert.md) and [`update`](/commands/docs/update.md), we also have [`prepend`](/commands/docs/prepend.md) and [`append`](/commands/docs/append.md). These let you insert to the beginning of a list or at the end of the list, respectively. +In addition to [`insert`](/commands/docs/insert) and [`update`](/commands/docs/update), we also have [`prepend`](/commands/docs/prepend) and [`append`](/commands/docs/append). These let you insert to the beginning of a list or at the end of the list, respectively. For example: @@ -34,19 +38,21 @@ let colors = ($colors | prepend red) let colors = ($colors | append purple) let colors = ($colors ++ "blue") let colors = ("black" ++ $colors) -$colors # [black red yellow green purple blue] +$colors +# [black red yellow green purple blue] ``` -In case you want to remove items from list, there are many ways. [`skip`](/commands/docs/skip.md) allows you skip first rows from input, while [`drop`](/commands/docs/drop.md) allows you to skip specific numbered rows from end of list. +In case you want to remove items from list, there are many ways. [`skip`](/commands/docs/skip) allows you skip first rows from input, while [`drop`](/commands/docs/drop) allows you to skip specific numbered rows from end of list. ```nu let colors = [red yellow green purple] let colors = ($colors | skip 1) let colors = ($colors | drop 2) -$colors # [yellow] +$colors +# [yellow] ``` -We also have [`last`](/commands/docs/last.md) and [`first`](/commands/docs/first.md) which allow you to [`take`](/commands/docs/take.md) from the end or beginning of the list, respectively. +We also have [`last`](/commands/docs/last) and [`first`](/commands/docs/first) which allow you to [`take`](/commands/docs/take) from the end or beginning of the list, respectively. ```nu let colors = [red yellow green purple black magenta] @@ -64,9 +70,9 @@ $colors # [yellow green] ## Iterating over lists -To iterate over the items in a list, use the [`each`](/commands/docs/each.md) command with a [block](types_of_data.html#blocks) +To iterate over the items in a list, use the [`each`](/commands/docs/each) command with a [block](/book/types_of_data#blocks) of Nu code that specifies what to do to each item. The block parameter (e.g. `|it|` in `{ |it| print $it }`) is the current list -item, but the [`enumerate`](/commands/docs/enumerate.md) filter can be used to provide `index` and `item` values if needed. For example: +item, but the [`enumerate`](/commands/docs/enumerate) filter can be used to provide `index` and `item` values if needed. For example: ```nu let names = [Mark Tami Amanda Jeremy] @@ -77,7 +83,7 @@ $names | enumerate | each { |it| $"($it.index + 1) - ($it.item)" } # Outputs "1 - Mark", "2 - Tami", etc. ``` -The [`where`](/commands/docs/where.md) command can be used to create a subset of a list, effectively filtering the list based on a condition. +The [`where`](/commands/docs/where) command can be used to create a subset of a list, effectively filtering the list based on a condition. The following example gets all the colors whose names end in "e". @@ -92,24 +98,28 @@ In this example, we keep only values higher than `7`. ```nu let scores = [7 10 8 6 7] -$scores | where $it > 7 # [10 8] +$scores | where $it > 7 +# [10 8] ``` -The [`reduce`](/commands/docs/reduce.md) command computes a single value from a list. +The [`reduce`](/commands/docs/reduce) command computes a single value from a list. It uses a block which takes 2 parameters: the current item (conventionally named `it`) and an accumulator (conventionally named `acc`). To specify an initial value for the accumulator, use the `--fold` (`-f`) flag. -To change `it` to have `index` and `item` values, use the [`enumerate`](/commands/docs/enumerate.md) filter. +To change `it` to have `index` and `item` values, use the [`enumerate`](/commands/docs/enumerate) filter. For example: ```nu let scores = [3 8 4] -$"total = ($scores | reduce { |it, acc| $acc + $it })" # total = 15 +$"total = ($scores | reduce { |it, acc| $acc + $it })" +# total = 15 $"total = ($scores | math sum)" # easier approach, same result -$"product = ($scores | reduce --fold 1 { |it, acc| $acc * $it })" # product = 96 +$"product = ($scores | reduce --fold 1 { |it, acc| $acc * $it })" +# product = 96 -$scores | enumerate | reduce --fold 0 { |it, acc| $acc + $it.index * $it.item } # 0*3 + 1*8 + 2*4 = 16 +$scores | enumerate | reduce --fold 0 { |it, acc| $acc + $it.index * $it.item } +# 0*3 + 1*8 + 2*4 = 16 ``` ## Accessing the list @@ -120,7 +130,8 @@ For example, the second element in the list below can be accessed with `$names.1 ```nu let names = [Mark Tami Amanda Jeremy] -$names.1 # gives Tami +$names.1 +# Tami ``` If the index is in some variable `$index` we can use the `get` command to extract the item from the list. @@ -128,86 +139,102 @@ If the index is in some variable `$index` we can use the `get` command to extrac ```nu let names = [Mark Tami Amanda Jeremy] let index = 1 -$names | get $index # gives Tami +$names | get $index +# Tami ``` -The [`length`](/commands/docs/length.md) command returns the number of items in a list. +The [`length`](/commands/docs/length) command returns the number of items in a list. For example, `[red green blue] | length` outputs `3`. -The [`is-empty`](/commands/docs/is-empty.md) command determines whether a string, list, or table is empty. +The [`is-empty`](/commands/docs/is-empty) command determines whether a string, list, or table is empty. It can be used with lists as follows: ```nu let colors = [red green blue] -$colors | is-empty # false +$colors | is-empty +# false let colors = [] -$colors | is-empty # true +$colors | is-empty +# true ``` The `in` and `not-in` operators are used to test whether a value is in a list. For example: ```nu let colors = [red green blue] -'blue' in $colors # true -'yellow' in $colors # false -'gold' not-in $colors # true +'blue' in $colors +# true +'yellow' in $colors +# false +'gold' not-in $colors +# true ``` -The [`any`](/commands/docs/any.md) command determines if any item in a list +The [`any`](/commands/docs/any) command determines if any item in a list matches a given condition. For example: ```nu let colors = [red green blue] # Do any color names end with "e"? -$colors | any {|it| $it | str ends-with "e" } # true +$colors | any {|it| $it | str ends-with "e" } +# true # Is the length of any color name less than 3? -$colors | any {|it| ($it | str length) < 3 } # false +$colors | any {|it| ($it | str length) < 3 } +# false let scores = [3 8 4] # Are any scores greater than 7? -$scores | any {|it| $it > 7 } # true +$scores | any {|it| $it > 7 } +# true # Are any scores odd? -$scores | any {|it| $it mod 2 == 1 } # true +$scores | any {|it| $it mod 2 == 1 } +# true ``` -The [`all`](/commands/docs/all.md) command determines if every item in a list +The [`all`](/commands/docs/all) command determines if every item in a list matches a given condition. For example: ```nu let colors = [red green blue] # Do all color names end with "e"? -$colors | all {|it| $it | str ends-with "e" } # false +$colors | all {|it| $it | str ends-with "e" } +# false # Is the length of all color names greater than or equal to 3? -$colors | all {|it| ($it | str length) >= 3 } # true +$colors | all {|it| ($it | str length) >= 3 } +# true let scores = [3 8 4] # Are all scores greater than 7? -$scores | all {|it| $it > 7 } # false +$scores | all {|it| $it > 7 } +# false # Are all scores even? -$scores | all {|it| $it mod 2 == 0 } # false +$scores | all {|it| $it mod 2 == 0 } +# false ``` ## Converting the list -The [`flatten`](/commands/docs/flatten.md) command creates a new list from an existing list +The [`flatten`](/commands/docs/flatten) command creates a new list from an existing list by adding items in nested lists to the top-level list. This can be called multiple times to flatten lists nested at any depth. For example: ```nu -[1 [2 3] 4 [5 6]] | flatten # [1 2 3 4 5 6] +[1 [2 3] 4 [5 6]] | flatten +# [1 2 3 4 5 6] -[[1 2] [3 [4 5 [6 7 8]]]] | flatten | flatten | flatten # [1 2 3 4 5 6 7 8] +[[1 2] [3 [4 5 [6 7 8]]]] | flatten | flatten | flatten +# [1 2 3 4 5 6 7 8] ``` -The [`wrap`](/commands/docs/wrap.md) command converts a list to a table. Each list value will +The [`wrap`](/commands/docs/wrap) command converts a list to a table. Each list value will be converted to a separate row with a single column: ```nu diff --git a/book/working_with_strings.md b/src/content/docs/book/nu-fundamentals/working_with_strings.md similarity index 79% rename from book/working_with_strings.md rename to src/content/docs/book/nu-fundamentals/working_with_strings.md index 3a2a0b192b8..e75408ab66f 100644 --- a/book/working_with_strings.md +++ b/src/content/docs/book/nu-fundamentals/working_with_strings.md @@ -1,4 +1,8 @@ -# Working with strings +--- +title: Working with strings +sidebar: + order: 4 +--- Strings in Nushell help to hold text data for later use. This can include file names, file paths, names of columns, and much more. Strings are so common that Nushell offers a couple ways to work with them, letting you pick what best @@ -20,12 +24,10 @@ matches your needs. The simplest string in Nushell is the single-quoted string. This string uses the `'` character to surround some text. Here's the text for hello world as a single-quoted string: ```nu -> 'hello world' -hello world -> 'The -end' -The -end +'hello world' +# hello world +'The end' +# The end ``` Single-quoted strings don't do anything to the text they're given, making them ideal for holding a wide range of text data. @@ -35,12 +37,10 @@ Single-quoted strings don't do anything to the text they're given, making them i Single-quoted strings, due to not supporting any escapes, cannot contain any single-quote characters themselves. As an alternative, backtick strings using the <code>`</code> character also exist: ```nu -> `no man's land` -no man's land -> `no man's -land` -no man's -land +`no man's land` +# no man's land +`no man's land` +# no man's land ``` Of course, backtick strings cannot contain any backticks themselves. Otherwise, they are identical to single-quoted strings. @@ -52,9 +52,9 @@ For more complex strings, Nushell also offers double-quoted strings. These strin For example, we could write the text hello followed by a new line and then world, using escape characters and a double-quoted string: ```nu -> "hello\nworld" -hello -world +"hello\nworld" +# hello +# world ``` Escape characters let you quickly add in a character that would otherwise be hard to type. @@ -77,16 +77,16 @@ Nushell currently supports the following escape characters: Like other shell languages (but unlike most other programming languages) strings consisting of a single 'word' can also be written without any quotes: ```nu -> print hello -hello -> [hello] | describe -list<string> +print hello +# hello +[hello] | describe +# list<string> ``` But be careful - if you use a bare word plainly on the command line (that is, not inside a data structure or used as a command parameter) or inside round brackets `(` `)`, it will be interpreted as an external command: ```nu -> hello +hello Error: nu::shell::external_command × External command failed @@ -101,13 +101,13 @@ Error: nu::shell::external_command Also, many bare words have special meaning in nu, and so will not be interpreted as a string: ```nu -> true | describe -bool -> [true] | describe -list<bool> -> [trueX] | describe -list<string> -> trueX | describe +true | describe +# bool +[true] | describe +# list<bool> +[trueX] | describe +# list<string> +trueX | describe Error: nu::shell::external_command × External command failed @@ -128,11 +128,11 @@ You can place the `^` sigil in front of any string (including a variable) to hav ```nu ^'C:\Program Files\exiftool.exe' -> let foo = 'C:\Program Files\exiftool.exe' -> ^$foo +let foo = 'C:\Program Files\exiftool.exe' +^$foo ``` -You can also use the [`run-external`](/commands/docs/run-external.md) command for this purpose, which provides additional flags and options. +You can also use the [`run-external`](/commands/docs/run-external) command for this purpose, which provides additional flags and options. ## Appending and Prepending to strings @@ -175,9 +175,9 @@ String interpolation uses `$" "` and `$' '` as ways to wrap interpolated text. For example, let's say we have a variable called `$name` and we want to greet the name of the person contained in this variable: ```nu -> let name = "Alice" -> $"greetings, ($name)" -greetings, Alice +let name = "Alice" +$"greetings, ($name)" +# greetings, Alice ``` By wrapping expressions in `()`, we can run them to completion and use the results to help build the string. @@ -187,8 +187,8 @@ String interpolation has both a single-quoted, `$' '`, and a double-quoted, `$" As of version 0.61, interpolated strings support escaping parentheses, so that the `(` and `)` characters may be used in a string without Nushell trying to evaluate what appears between them: ```nu -> $"2 + 2 is (2 + 2) \(you guessed it!)" -2 + 2 is 4 (you guessed it!) +$"2 + 2 is (2 + 2) \(you guessed it!)" +# 2 + 2 is 4 (you guessed it!) ``` Interpolated strings can be evaluated at parse time, but if they include values whose formatting depends @@ -197,15 +197,15 @@ So if you have something like this in your `config.nu`, `x` will be `"2.0 KB"` e `MB` for all file sizes (datetimes will similarly use the default config). ```nu -> const x = $"(2kb)" +const x = $"(2kb)" ``` ## Splitting strings -The [`split row`](/commands/docs/split_row.md) command creates a list from a string based on a delimiter. +The [`split row`](/commands/docs/split_row) command creates a list from a string based on a delimiter. ```nu -> "red,green,blue" | split row "," +"red,green,blue" | split row "," ╭───┬───────╮ │ 0 │ red │ │ 1 │ green │ @@ -213,10 +213,10 @@ The [`split row`](/commands/docs/split_row.md) command creates a list from a str ╰───┴───────╯ ``` -The [`split column`](/commands/docs/split_column.md) command will create a table from a string based on a delimiter. This applies generic column names to the table. +The [`split column`](/commands/docs/split_column) command will create a table from a string based on a delimiter. This applies generic column names to the table. ```nu -> "red,green,blue" | split column "," +"red,green,blue" | split column "," ╭───┬─────────┬─────────┬─────────╮ │ # │ column1 │ column2 │ column3 │ ├───┼─────────┼─────────┼─────────┤ @@ -224,10 +224,10 @@ The [`split column`](/commands/docs/split_column.md) command will create a table ╰───┴─────────┴─────────┴─────────╯ ``` -Finally, the [`split chars`](/commands/docs/split_chars.md) command will split a string into a list of characters. +Finally, the [`split chars`](/commands/docs/split_chars) command will split a string into a list of characters. ```nu -> 'aeiou' | split chars +'aeiou' | split chars ╭───┬───╮ │ 0 │ a │ │ 1 │ e │ @@ -237,26 +237,26 @@ Finally, the [`split chars`](/commands/docs/split_chars.md) command will split a ╰───┴───╯ ``` -## The [`str`](/commands/docs/str.md) command +## The [`str`](/commands/docs/str) command -Many string functions are subcommands of the [`str`](/commands/docs/str.md) command. You can get a full list using `help str`. +Many string functions are subcommands of the [`str`](/commands/docs/str) command. You can get a full list using `help str`. -For example, you can look if a string contains a particular substring using [`str contains`](/commands/docs/str_contains.md): +For example, you can look if a string contains a particular substring using [`str contains`](/commands/docs/str_contains): ```nu -> "hello world" | str contains "o wo" -true +"hello world" | str contains "o wo" +# true ``` (You might also prefer, for brevity, the `=~` operator (described below).) ### Trimming strings -You can trim the sides of a string with the [`str trim`](/commands/docs/str_trim.md) command. By default, the [`str trim`](/commands/docs/str_trim.md) commands trims whitespace from both sides of the string. For example: +You can trim the sides of a string with the [`str trim`](/commands/docs/str_trim) command. By default, the [`str trim`](/commands/docs/str_trim) commands trims whitespace from both sides of the string. For example: ```nu -> ' My string ' | str trim -My string +' My string ' | str trim +# My string ``` You can specify on which side the trimming occurs with the `--right` and `--left` options. (`-r` and `-l` being the short-form options respectively) @@ -266,8 +266,8 @@ To trim a specific character, use `--char <Character>` or `-c <Character>` to sp Here's an example of all the options in action: ```nu -> '=== Nu shell ===' | str trim -r -c '=' -=== Nu shell +'=== Nu shell ===' | str trim -r -c '=' +# === Nu shell ``` ### Substrings @@ -275,33 +275,33 @@ Here's an example of all the options in action: Substrings are slices of a string. They have a startpoint and an endpoint. Here's an example of using a substring: ```nu -> 'Hello World!' | str index-of 'o' -4 -> 'Hello World!' | str index-of 'r' -8 -> 'Hello World!' | str substring 4..8 -o Wo +'Hello World!' | str index-of 'o' +# 4 +'Hello World!' | str index-of 'r' +# 8 +'Hello World!' | str substring 4..8 +# o Wo ``` ### String padding -With the [`fill`](/commands/docs/fill.md) command you can add padding to a string. Padding adds characters to string until it's a certain length. For example: +With the [`fill`](/commands/docs/fill) command you can add padding to a string. Padding adds characters to string until it's a certain length. For example: ```nu -> '1234' | fill -a right -c '0' -w 10 -0000001234 -> '1234' | fill -a left -c '0' -w 10 | str length -10 +'1234' | fill -a right -c '0' -w 10 +# 0000001234 +'1234' | fill -a left -c '0' -w 10 | str length +# 10 ``` ### Reversing strings -This can be done easily with the [`str reverse`](/commands/docs/str_reverse.md) command. +This can be done easily with the [`str reverse`](/commands/docs/str_reverse) command. ```nu -> 'Nushell' | str reverse -llehsuN -> ['Nushell' 'is' 'cool'] | str reverse +'Nushell' | str reverse +# llehsuN +['Nushell' 'is' 'cool'] | str reverse ╭───┬─────────╮ │ 0 │ llehsuN │ │ 1 │ si │ @@ -311,16 +311,16 @@ llehsuN ## String parsing -With the [`parse`](/commands/docs/parse.md) command you can parse a string into columns. For example: +With the [`parse`](/commands/docs/parse) command you can parse a string into columns. For example: ```nu -> 'Nushell 0.80' | parse '{shell} {version}' +'Nushell 0.80' | parse '{shell} {version}' ╭───┬─────────┬─────────╮ │ # │ shell │ version │ ├───┼─────────┼─────────┤ │ 0 │ Nushell │ 0.80 │ ╰───┴─────────┴─────────╯ -> 'where all data is structured!' | parse --regex '(?P<subject>\w*\s?\w+) is (?P<adjective>\w+)' +'where all data is structured!' | parse --regex '(?P<subject>\w*\s?\w+) is (?P<adjective>\w+)' ╭───┬──────────┬────────────╮ │ # │ subject │ adjective │ ├───┼──────────┼────────────┤ @@ -328,22 +328,22 @@ With the [`parse`](/commands/docs/parse.md) command you can parse a string into ╰───┴──────────┴────────────╯ ``` -If a string is known to contain comma-separated, tab-separated or multi-space-separated data, you can use [`from csv`](/commands/docs/from_csv.md), [`from tsv`](/commands/docs/from_tsv.md) or [`from ssv`](/commands/docs/from_ssv.md): +If a string is known to contain comma-separated, tab-separated or multi-space-separated data, you can use [`from csv`](/commands/docs/from_csv), [`from tsv`](/commands/docs/from_tsv) or [`from ssv`](/commands/docs/from_ssv): ```nu -> "acronym,long\nAPL,A Programming Language" | from csv +"acronym,long\nAPL,A Programming Language" | from csv ╭───┬─────────┬────────────────────────╮ │ # │ acronym │ long │ ├───┼─────────┼────────────────────────┤ │ 0 │ APL │ A Programming Language │ ╰───┴─────────┴────────────────────────╯ -> "name duration\nonestop.mid 4:06" | from ssv +"name duration\nonestop.mid 4:06" | from ssv ╭───┬─────────────┬──────────╮ │ # │ name │ duration │ ├───┼─────────────┼──────────┤ │ 0 │ onestop.mid │ 4:06 │ ╰───┴─────────────┴──────────╯ -> "rank\tsuit\nJack\tSpades\nAce\tClubs" | from tsv +"rank\tsuit\nJack\tSpades\nAce\tClubs" | from tsv ╭───┬──────┬────────╮ │ # │ rank │ suit │ ├───┼──────┼────────┤ @@ -359,19 +359,19 @@ In addition to the standard `==` and `!=` operators, a few operators exist for s Those familiar with Bash and Perl will recognise the regex comparison operators: ```nu -> 'APL' =~ '^\w{0,3}$' -true -> 'FORTRAN' !~ '^\w{0,3}$' -true +'APL' =~ '^\w{0,3}$' +# true +'FORTRAN' !~ '^\w{0,3}$' +# true ``` Two other operators exist for simpler comparisons: ```nu -> 'JavaScript' starts-with 'Java' -true -> 'OCaml' ends-with 'Caml' -true +'JavaScript' starts-with 'Java' +# true +'OCaml' ends-with 'Caml' +# true ``` ## Converting strings @@ -380,19 +380,19 @@ There are multiple ways to convert strings to and from other types. ### To string -1. Using [`into string`](/commands/docs/into_string.md). e.g. `123 | into string` +1. Using [`into string`](/commands/docs/into_string). e.g. `123 | into string` 2. Using string interpolation. e.g. `$'(123)'` ### From string -1. Using [`into <type>`](/commands/docs/into.md). e.g. `'123' | into int` +1. Using [`into <type>`](/commands/docs/into). e.g. `'123' | into int` ## Coloring strings -You can color strings with the [`ansi`](/commands/docs/ansi.md) command. For example: +You can color strings with the [`ansi`](/commands/docs/ansi) command. For example: ```nu -> $'(ansi purple_bold)This text is a bold purple!(ansi reset)' +$'(ansi purple_bold)This text is a bold purple!(ansi reset)' ``` `ansi purple_bold` makes the text a bold purple diff --git a/book/working_with_tables.md b/src/content/docs/book/nu-fundamentals/working_with_tables.md similarity index 82% rename from book/working_with_tables.md rename to src/content/docs/book/nu-fundamentals/working_with_tables.md index 4fa678a0ade..433b3490742 100644 --- a/book/working_with_tables.md +++ b/src/content/docs/book/nu-fundamentals/working_with_tables.md @@ -1,11 +1,15 @@ -# Working with tables +--- +title: Working with tables +sidebar: + order: 6 +--- One of the common ways of seeing data in Nu is through a table. Nu comes with a number of commands for working with tables to make it convenient to find what you're looking for, and for narrowing down the data to just what you need. To start off, let's get a table that we can use: ```nu -> ls +ls ───┬───────────────┬──────┬─────────┬──────────── # │ name │ type │ size │ modified ───┼───────────────┼──────┼─────────┼──────────── @@ -19,17 +23,17 @@ To start off, let's get a table that we can use: ───┴───────────────┴──────┴─────────┴──────────── ``` -::: tip Changing how tables are displayed +:::tip[Changing how tables are displayed] Nu will try to expands all table's structure by default. You can change this behavior by changing the `display_output` hook. -See [hooks](/book/hooks.md#changing-how-output-is-displayed) for more information. +See [hooks](/book/hooks#changing-how-output-is-displayed) for more information. ::: ## Sorting the data -We can sort a table by calling the [`sort-by`](/commands/docs/sort-by.md) command and telling it which columns we want to use in the sort. Let's say we wanted to sort our table by the size of the file: +We can sort a table by calling the [`sort-by`](/commands/docs/sort-by) command and telling it which columns we want to use in the sort. Let's say we wanted to sort our table by the size of the file: ```nu -> ls | sort-by size +ls | sort-by size ───┬───────────────┬──────┬─────────┬──────────── # │ name │ type │ size │ modified ───┼───────────────┼──────┼─────────┼──────────── @@ -47,10 +51,10 @@ We can sort a table by any column that can be compared. For example, we could al ## Selecting the data you want -We can select data from a table by choosing to select specific columns or specific rows. Let's [`select`](/commands/docs/select.md) a few columns from our table to use: +We can select data from a table by choosing to select specific columns or specific rows. Let's [`select`](/commands/docs/select) a few columns from our table to use: ```nu -> ls | select name size +ls | select name size ───┬───────────────┬───────── # │ name │ size ───┼───────────────┼───────── @@ -67,7 +71,7 @@ We can select data from a table by choosing to select specific columns or specif This helps to create a table that's more focused on what we need. Next, let's say we want to only look at the 5 smallest files in this directory: ```nu -> ls | sort-by size | first 5 +ls | sort-by size | first 5 ───┬──────────────┬──────┬────────┬──────────── # │ name │ type │ size │ modified ───┼──────────────┼──────┼────────┼──────────── @@ -81,10 +85,10 @@ This helps to create a table that's more focused on what we need. Next, let's sa You'll notice we first sort the table by size to get to the smallest file, and then we use the `first 5` to return the first 5 rows of the table. -You can also [`skip`](/commands/docs/skip.md) rows that you don't want. Let's skip the first two of the 5 rows we returned above: +You can also [`skip`](/commands/docs/skip) rows that you don't want. Let's skip the first two of the 5 rows we returned above: ```nu -> ls | sort-by size | first 5 | skip 2 +ls | sort-by size | first 5 | skip 2 ───┬───────────┬──────┬────────┬──────────── # │ name │ type │ size │ modified ───┼───────────┼──────┼────────┼──────────── @@ -96,10 +100,10 @@ You can also [`skip`](/commands/docs/skip.md) rows that you don't want. Let's sk We've narrowed it to three rows we care about. -Let's look at a few other commands for selecting data. You may have wondered why the rows of the table are numbers. This acts as a handy way to get to a single row. Let's sort our table by the file name and then pick one of the rows with the [`select`](/commands/docs/select.md) command using its row number: +Let's look at a few other commands for selecting data. You may have wondered why the rows of the table are numbers. This acts as a handy way to get to a single row. Let's sort our table by the file name and then pick one of the rows with the [`select`](/commands/docs/select) command using its row number: ```nu -> ls | sort-by name +ls | sort-by name ───┬───────────────┬──────┬─────────┬──────────── # │ name │ type │ size │ modified ───┼───────────────┼──────┼─────────┼──────────── @@ -112,7 +116,7 @@ Let's look at a few other commands for selecting data. You may have wondered why 6 │ signature.rs │ File │ 1.2 KB │ 5 days ago ───┴───────────────┴──────┴─────────┴──────────── -> ls | sort-by name | select 5 +ls | sort-by name | select 5 ───┬───────────────┬──────┬─────────┬──────────── # │ name │ type │ size │ modified ───┼───────────────┼──────┼─────────┼──────────── @@ -122,10 +126,10 @@ Let's look at a few other commands for selecting data. You may have wondered why ## Getting data out of a table -So far, we've worked with tables by trimming the table down to only what we need. Sometimes we may want to go a step further and only look at the values in the cells themselves rather than taking a whole column. Let's say, for example, we wanted to only get a list of the names of the files. For this, we use the [`get`](/commands/docs/get.md) command: +So far, we've worked with tables by trimming the table down to only what we need. Sometimes we may want to go a step further and only look at the values in the cells themselves rather than taking a whole column. Let's say, for example, we wanted to only get a list of the names of the files. For this, we use the [`get`](/commands/docs/get) command: ```nu -> ls | get name +ls | get name ───┬─────────────── 0 │ files.rs 1 │ lib.rs @@ -139,10 +143,10 @@ So far, we've worked with tables by trimming the table down to only what we need We now have the values for each of the filenames. -This might look like the [`select`](/commands/docs/select.md) command we saw earlier, so let's put that here as well to compare the two: +This might look like the [`select`](/commands/docs/select) command we saw earlier, so let's put that here as well to compare the two: ```nu -> ls | select name +ls | select name ───┬─────────────── # │ name ───┼─────────────── @@ -158,12 +162,12 @@ This might look like the [`select`](/commands/docs/select.md) command we saw ear These look very similar! Let's see if we can spell out the difference between these two commands to make it clear: -- [`select`](/commands/docs/select.md) - creates a new table which includes only the columns specified -- [`get`](/commands/docs/get.md) - returns the values inside the column specified as a list +- [`select`](/commands/docs/select) - creates a new table which includes only the columns specified +- [`get`](/commands/docs/get) - returns the values inside the column specified as a list The one way to tell these apart looking at the table is that the column names are missing, which lets us know that this is going to be a list of values we can work with. -The [`get`](/commands/docs/get.md) command can go one step further and take a path to data deeper in the table. This simplifies working with more complex data, like the structures you might find in a .json file. +The [`get`](/commands/docs/get) command can go one step further and take a path to data deeper in the table. This simplifies working with more complex data, like the structures you might find in a .json file. ## Changing data in a table @@ -171,7 +175,7 @@ In addition to selecting data from a table, we can also update what the table ha ### Concatenating Tables -We can concatenate tables using [`append`](/commands/docs/append.md): +We can concatenate tables using [`append`](/commands/docs/append): ```nu let first = [[a b]; [1 2]] @@ -216,7 +220,7 @@ $first ++ $second ++ $third ### Merging Tables -We can use the [`merge`](/commands/docs/merge.md) command to merge two (or more) tables together +We can use the [`merge`](/commands/docs/merge) command to merge two (or more) tables together ```nu let first = [[a b]; [1 2]] @@ -238,7 +242,7 @@ Let's add a third table: We could join all three tables together like this: ```nu -> $first | merge $second | merge $third +$first | merge $second | merge $third ───┬───┬───┬───┬───┬───┬─── # │ a │ b │ c │ d │ e │ f ───┼───┼───┼───┼───┼───┼─── @@ -246,10 +250,10 @@ We could join all three tables together like this: ───┴───┴───┴───┴───┴───┴─── ``` -Or we could use the [`reduce`](/commands/docs/reduce.md) command to dynamically merge all tables: +Or we could use the [`reduce`](/commands/docs/reduce) command to dynamically merge all tables: ```nu -> [$first $second $third] | reduce {|it, acc| $acc | merge $it } +[$first $second $third] | reduce {|it, acc| $acc | merge $it } ───┬───┬───┬───┬───┬───┬─── # │ a │ b │ c │ d │ e │ f ───┼───┼───┼───┼───┼───┼─── @@ -259,10 +263,10 @@ Or we could use the [`reduce`](/commands/docs/reduce.md) command to dynamically ### Adding a new column -We can use the [`insert`](/commands/docs/insert.md) command to add a new column to the table. Let's look at an example: +We can use the [`insert`](/commands/docs/insert) command to add a new column to the table. Let's look at an example: ```nu -> open rustfmt.toml +open rustfmt.toml ─────────┬────── edition │ 2018 ─────────┴────── @@ -271,7 +275,7 @@ We can use the [`insert`](/commands/docs/insert.md) command to add a new column Let's add a column called "next_edition" with the value 2021: ```nu -> open rustfmt.toml | insert next_edition 2021 +open rustfmt.toml | insert next_edition 2021 ──────────────┬────── edition │ 2018 next_edition │ 2021 @@ -281,7 +285,7 @@ Let's add a column called "next_edition" with the value 2021: This visual may be slightly confusing, because it looks like what we've just done is add a row. In this case, remember: rows have numbers, columns have names. If it still is confusing, note that appending one more row will make the table render as expected: ```nu -> open rustfmt.toml | insert next_edition 2021 | append {edition: 2021 next_edition: 2024} +open rustfmt.toml | insert next_edition 2021 | append {edition: 2021 next_edition: 2024} ───┬─────────┬────────────── # │ edition │ next_edition ───┼─────────┼────────────── @@ -294,17 +298,17 @@ This visual may be slightly confusing, because it looks like what we've just don Notice that if we open the original file, the contents have stayed the same: ```nu -> open rustfmt.toml +open rustfmt.toml ─────────┬────── edition │ 2018 ─────────┴────── ``` -Changes in Nu are functional changes, meaning that they work on values themselves rather than trying to cause a permanent change. This lets us do many different types of work in our pipeline until we're ready to write out the result with any changes we'd like if we choose to. Here we could write out the result using the [`save`](/commands/docs/save.md) command: +Changes in Nu are functional changes, meaning that they work on values themselves rather than trying to cause a permanent change. This lets us do many different types of work in our pipeline until we're ready to write out the result with any changes we'd like if we choose to. Here we could write out the result using the [`save`](/commands/docs/save) command: ```nu -> open rustfmt.toml | insert next_edition 2021 | save rustfmt2.toml -> open rustfmt2.toml +>open rustfmt.toml | insert next_edition 2021 | save rustfmt2.toml +open rustfmt2.toml ──────────────┬────── edition │ 2018 next_edition │ 2021 @@ -313,10 +317,10 @@ Changes in Nu are functional changes, meaning that they work on values themselve ### Updating a column -In a similar way to the [`insert`](/commands/docs/insert.md) command, we can also use the [`update`](/commands/docs/update.md) command to change the contents of a column to a new value. To see it in action let's open the same file: +In a similar way to the [`insert`](/commands/docs/insert) command, we can also use the [`update`](/commands/docs/update) command to change the contents of a column to a new value. To see it in action let's open the same file: ```nu -> open rustfmt.toml +open rustfmt.toml ─────────┬────── edition │ 2018 ─────────┴────── @@ -325,20 +329,20 @@ In a similar way to the [`insert`](/commands/docs/insert.md) command, we can als And now, let's update the edition to point at the next edition we hope to support: ```nu -> open rustfmt.toml | update edition 2021 +open rustfmt.toml | update edition 2021 ─────────┬────── edition │ 2021 ─────────┴────── ``` -You can also use the [`upsert`](/commands/docs/upsert.md) command to insert or update depending on whether the column already exists. +You can also use the [`upsert`](/commands/docs/upsert) command to insert or update depending on whether the column already exists. ### Moving columns -You can use [`move`](/commands/docs/move.md) to move columns in the table. For example, if we wanted to move the "name" column from [`ls`](/commands/docs/ls.md) after the "size" column, we could do: +You can use [`move`](/commands/docs/move) to move columns in the table. For example, if we wanted to move the "name" column from [`ls`](/commands/docs/ls) after the "size" column, we could do: ```nu -> ls | move name --after size +ls | move name --after size ╭────┬──────┬─────────┬───────────────────┬──────────────╮ │ # │ type │ size │ name │ modified │ ├────┼──────┼─────────┼───────────────────┼──────────────┤ @@ -352,10 +356,10 @@ You can use [`move`](/commands/docs/move.md) to move columns in the table. For e ### Renaming columns -You can also [`rename`](/commands/docs/rename.md) columns in a table by passing it through the rename command. If we wanted to run [`ls`](/commands/docs/ls.md) and rename the columns, we can use this example: +You can also [`rename`](/commands/docs/rename) columns in a table by passing it through the rename command. If we wanted to run [`ls`](/commands/docs/ls) and rename the columns, we can use this example: ```nu -> ls | rename filename filetype filesize date +ls | rename filename filetype filesize date ╭────┬───────────────────┬──────────┬──────────┬──────────────╮ │ # │ filename │ filetype │ filesize │ date │ ├────┼───────────────────┼──────────┼──────────┼──────────────┤ @@ -369,10 +373,10 @@ You can also [`rename`](/commands/docs/rename.md) columns in a table by passing ### Rejecting/Deleting columns -You can also [`reject`](/commands/docs/reject.md) columns in a table by passing it through the reject command. If we wanted to run [`ls`](/commands/docs/ls.md) and delete the columns, we can use this example: +You can also [`reject`](/commands/docs/reject) columns in a table by passing it through the reject command. If we wanted to run [`ls`](/commands/docs/ls) and delete the columns, we can use this example: ```nu -> ls -l / |reject readonly num_links inode created accessed modified +ls -l / |reject readonly num_links inode created accessed modified ╭────┬────────┬─────────┬─────────┬───────────┬──────┬───────┬────────╮ │ # │ name │ type │ target │ mode │ uid │ group │ size │ ├────┼────────┼─────────┼─────────┼───────────┼──────┼───────┼────────┤ diff --git a/book/nu_as_a_shell.md b/src/content/docs/book/nu_as_a_shell.md similarity index 52% rename from book/nu_as_a_shell.md rename to src/content/docs/book/nu_as_a_shell.md index 08a7b3a8f69..8d31231eaa6 100644 --- a/book/nu_as_a_shell.md +++ b/src/content/docs/book/nu_as_a_shell.md @@ -1,28 +1,30 @@ -# Nu as a Shell +--- +title: Nu as a Shell +--- -The [Nu Fundamentals](nu_fundamentals.md) and [Programming in Nu](programming_in_nu.md) chapter focused mostly on the language aspects of Nushell. +The [Nu Fundamentals](nu_fundamentals) and [Programming in Nu](programming_in_nu) chapter focused mostly on the language aspects of Nushell. This chapter sheds the light on the parts of Nushell that are related to the Nushell interpreter (the Nushell [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop)). Some of the concepts are directly a part of the Nushell programming language (such as environment variables) while others are implemented purely to enhance the interactive experience (such as hooks) and thus are not present when, for example, running a script. -Many parameters of Nushell can be [configured](configuration.md). +Many parameters of Nushell can be [configured](configuration). The config itself is stored as an environment variable. Furthermore, Nushell has several different configuration files that are run on startup where you can put custom commands, aliases, etc. -A big feature of any shell are [environment variables](environment.md). +A big feature of any shell are [environment variables](environment). In Nushell, environment variables are scoped and can have any type supported by Nushell. This brings in some additional design considerations so please refer to the linked section for more details. -The other sections explain how to work with [stdout, stderr and exit codes](stdout_stderr_exit_codes.md), how to [escape a command call to the external command call](escaping.md), and how to [configure 3rd party prompts](3rdpartyprompts.md) to work with Nushell. +The other sections explain how to work with [stdout, stderr and exit codes](stdout_stderr_exit_codes), how to [escape a command call to the external command call](escaping), and how to [configure 3rd party prompts](3rdpartyprompts) to work with Nushell. -An interesting feature of Nushell is [shells](shells_in_shells.md) which let you work in multiple directories simultaneously. +An interesting feature of Nushell is [shells](shells_in_shells) which let you work in multiple directories simultaneously. -Nushell also has its own line editor [Reedline](line_editor.md). +Nushell also has its own line editor [Reedline](line_editor). With Nushell's config, it is possible to configure some of the Reedline's features, such as the prompt, keybindings, history, or menus. -It is also possible to define [custom signatures for external commands](externs.md) which lets you define [custom completions](custom_completions.md) for them (the custom completions work also for Nushell custom commands). +It is also possible to define [custom signatures for external commands](externs) which lets you define [custom completions](custom_completions) for them (the custom completions work also for Nushell custom commands). -[Coloring and Theming in Nu](coloring_and_theming.md) goes into more detail about how to configure Nushell's appearance. +[Coloring and Theming in Nu](coloring_and_theming) goes into more detail about how to configure Nushell's appearance. -If you want to schedule some commands to run in the background, [Background task in Nu](background_task.md) provide a simple guideline for you to follow. +If you want to schedule some commands to run in the background, [Background task in Nu](background_task) provide a simple guideline for you to follow. -And finally, [hooks](hooks.md) allow you to insert fragments of Nushell code to run at certain events. +And finally, [hooks](hooks) allow you to insert fragments of Nushell code to run at certain events. diff --git a/book/nu_fundamentals.md b/src/content/docs/book/nu_fundamentals.md similarity index 69% rename from book/nu_fundamentals.md rename to src/content/docs/book/nu_fundamentals.md index 667cd9deb67..039bd9ed62f 100644 --- a/book/nu_fundamentals.md +++ b/src/content/docs/book/nu_fundamentals.md @@ -1,4 +1,6 @@ -# Nu Fundamentals +--- +title: Nu Fundamentals +--- This chapter explains some of the fundamentals of the Nushell programming language. After going through it, you should have an idea how to write simple Nushell programs. @@ -7,14 +9,14 @@ Nushell has a rich type system. You will find typical data types such as strings or integers and less typical data types, such as cell paths. Furthermore, one of the defining features of Nushell is the notion of _structured data_ which means that you can organize types into collections: lists, records, or tables. Contrary to the traditional Unix approach where commands communicate via plain text, Nushell commands communicate via these data types. -All of the above is explained in [Types of Data](types_of_data.md). +All of the above is explained in [Types of Data](types_of_data). -[Loading Data](loading_data.md) explains how to read common data formats, such as JSON, into _structured data_. This includes our own "NUON" data format. +[Loading Data](loading_data) explains how to read common data formats, such as JSON, into _structured data_. This includes our own "NUON" data format. -Just like Unix shells, Nushell commands can be composed into [pipelines](pipelines.md) to pass and modify a stream of data. +Just like Unix shells, Nushell commands can be composed into [pipelines](pipelines) to pass and modify a stream of data. -Some data types have interesting features that deserve their own sections: [strings](working_with_strings.md), [lists](working_with_lists.md), and [tables](working_with_tables.md). +Some data types have interesting features that deserve their own sections: [strings](working_with_strings), [lists](working_with_lists), and [tables](working_with_tables). Apart from explaining the features, these sections also show how to do some common operations, such as composing strings or updating values in a list. Finally, [Command Reference](/commands/) lists all the built-in commands with brief descriptions. -Note that you can also access this info from within Nushell using the [`help`](/commands/docs/help.md) command. +Note that you can also access this info from within Nushell using the [`help`](/commands/docs/help) command. diff --git a/book/aliases.md b/src/content/docs/book/programming-in-nu/aliases.md similarity index 94% rename from book/aliases.md rename to src/content/docs/book/programming-in-nu/aliases.md index b372d3295c2..0c09786c1b1 100644 --- a/book/aliases.md +++ b/src/content/docs/book/programming-in-nu/aliases.md @@ -1,23 +1,27 @@ -# Aliases +--- +title: Aliases +sidebar: + order: 2 +--- Aliases in Nushell offer a way of doing a simple replacement of command calls (both external and internal commands). This allows you to create a shorthand name for a longer command, including its default arguments. For example, let's create an alias called `ll` which will expand to `ls -l`. ```nu -> alias ll = ls -l +alias ll = ls -l ``` We can now call this alias: ```nu -> ll +ll ``` Once we do, it's as if we typed `ls -l`. This also allows us to pass in flags or positional parameters. For example, we can now also write: ```nu -> ll -a +ll -a ``` And get the equivalent to having typed `ls -l -a`. @@ -31,7 +35,7 @@ Your useable aliases can be seen in `scope aliases` and `help aliases`. To make your aliases persistent they must be added to your _config.nu_ file by running `config nu` to open an editor and inserting them, and then restarting nushell. e.g. with the above `ll` alias, you can add `alias ll = ls -l` anywhere in _config.nu_ -```nu +```nu title="config.nu" $env.config = { # main configuration } @@ -50,7 +54,7 @@ The solution is to define a command without parameters that calls the system pro def uuidgen [] { ^uuidgen | tr A-F a-f } ``` -See more in the [custom commands](custom_commands.md) section of this book. +See more in the [custom commands](custom_commands) section of this book. Or a more idiomatic example with nushell internal commands @@ -65,9 +69,11 @@ displaying all listed files and folders in a grid. > Caution! When replacing commands it is best to "back up" the command first and avoid recursion error. How to back up a command like `ls`: + ```nu alias core-ls = ls # This will create a new alias core-ls for ls ``` + Now you can use `core-ls` as `ls` in your nu-programming. You will see further down how to use `core-ls`. The reason you need to use alias is because, unlike `def`, aliases are position-dependent. So, you need to "back up" the old command first with an alias, before re-defining it. @@ -109,4 +115,3 @@ def ls [path?] { } } ``` - diff --git a/book/style_guide.md b/src/content/docs/book/programming-in-nu/best_practices.md similarity index 99% rename from book/style_guide.md rename to src/content/docs/book/programming-in-nu/best_practices.md index 87a12c6745a..6202430bacb 100644 --- a/book/style_guide.md +++ b/src/content/docs/book/programming-in-nu/best_practices.md @@ -1,4 +1,6 @@ -# Best practices +--- +title: Best practices +--- This page is a working document collecting syntax guidelines and best practices we have discovered so far. The goal of this document is to eventually land on a canonical Nushell code style, but as for now it is still work in diff --git a/book/command_signature.md b/src/content/docs/book/programming-in-nu/command_signature.md similarity index 62% rename from book/command_signature.md rename to src/content/docs/book/programming-in-nu/command_signature.md index f2ba856c2cd..9e3af6027d9 100644 --- a/book/command_signature.md +++ b/src/content/docs/book/programming-in-nu/command_signature.md @@ -1,21 +1,25 @@ -# Command signature +--- +title: Command signature +sidebar: + order: 9 +--- -nu commands can be given explicit signatures; take [`str stats`](/commands/docs/str_stats.md) as an example, the signature is like this: +nu commands can be given explicit signatures; take [`str stats`](/commands/docs/str_stats) as an example, the signature is like this: ```nu def "str stats" []: string -> record { } ``` -The type names between the `:` and the opening curly brace `{` describe the command's input/output pipeline types. The input type for a given pipeline, in this case `string`, is given before the `->`; and the output type `record` is given after `->`. There can be multiple input/output types. If there are multiple input/output types, they can be placed within brackets and separated with commas, as in [`str join`](/commands/docs/str_join.md): +The type names between the `:` and the opening curly brace `{` describe the command's input/output pipeline types. The input type for a given pipeline, in this case `string`, is given before the `->`; and the output type `record` is given after `->`. There can be multiple input/output types. If there are multiple input/output types, they can be placed within brackets and separated with commas, as in [`str join`](/commands/docs/str_join): ```nu def "str join" [separator?: string]: [list -> string, string -> string] { } ``` -It says that the [`str join`](/commands/docs/str_join.md) command takes an optional `string` type argument, and an input pipeline of either a `list` (implying `list<any>`) with output type of `string`, or a single `string`, again with output type of `string`. +It says that the [`str join`](/commands/docs/str_join) command takes an optional `string` type argument, and an input pipeline of either a `list` (implying `list<any>`) with output type of `string`, or a single `string`, again with output type of `string`. Some commands don't accept or require data through the input pipeline, thus the input type will be `<nothing>`. -The same is true for the output type if the command returns `null` (e.g. [`rm`](/commands/docs/rm.md) or [`hide`](/commands/docs/hide.md)): +The same is true for the output type if the command returns `null` (e.g. [`rm`](/commands/docs/rm) or [`hide`](/commands/docs/hide)): ```nu def hide [module: string, members?]: nothing -> nothing { } diff --git a/src/content/docs/book/programming-in-nu/control_flow.md b/src/content/docs/book/programming-in-nu/control_flow.md new file mode 100644 index 00000000000..6e879c913d5 --- /dev/null +++ b/src/content/docs/book/programming-in-nu/control_flow.md @@ -0,0 +1,365 @@ +--- +title: Control Flow +sidebar: + order: 5 +--- + +Nushell provides several commands that help determine how different groups of code are executed. In programming languages this functionality is often referred to as _control flow_. + +:::tip +One thing to note is that all of the commands discussed on this page use [blocks](/book/types_of_data#blocks). This means you can mutate [environmental variables](/book/environment) and other [mutable variables](/book/variables_and_subexpressions#mutable-variables) in them. +::: + +## Already covered + +Below we cover some commands related to control flow, but before we get to them, it's worthwhile to note there are several pieces of functionality and concepts that have already been covered in other sections that are also related to control flow or that can be used in the same situations. These include: + +- Pipes on the [pipelines](/book/pipelines) page. +- Closures on the [types of data](/book/types_of_data) page. +- Iteration commands on the [working with lists](/book/working_with_lists) page. Such as: + - [`each`](/commands/docs/each) + - [`where`](/commands/docs/where) + - [`reduce`](/commands/docs/reduce) + +## Choice (Conditionals) + +The following commands execute code based on some given condition. + +:::tip +The choice/conditional commands are expressions so they return values, unlike the other commands on this page. This means the following works. + +```nu +'foo' | if $in == 'foo' { 1 } else { 0 } | $in + 2 +# 3 +``` + +::: + +### `if` + +[`if`](/commands/docs/if) evaluates branching [blocks](/book/types_of_data#blocks) of code based on the results of one or more conditions similar to the "if" functionality in other programming languages. For example: + +```nu +if $x > 0 { 'positive' } +``` + +Returns `'positive`' when the condition is `true` (`$x` is greater than zero) and `null` when the condition is `false` (`$x` is less than or equal to zero). + +We can add an `else` branch to the `if` after the first block which executes and returns the resulting value from the `else` block when the condition is `false`. For example: + +```nu +if $x > 0 { 'positive' } else { 'non-positive' } +``` + +This time it returns `'positive'` when the condition is `true` (`$x` is greater than zero) and `'non-positive`' when the condition is `false` (`$x` is less than or equal to zero). + +We can also chain multiple `if`s together like the following: + +```nu +if $x > 0 { 'positive' } else if $x == 0 { 'zero' } else { "negative" } +``` + +When the first condition is `true` (`$x` is greater than zero) it will return `'positive'`, when the first condition is `false` and the next condition is `true` (`$x` equals zero) it will return `'zero'`, otherwise it will return `'negative'` (when `$x` is less than zero). + +### `match` + +[`match`](/commands/docs/match) executes one of several conditional branches based on the value given to match. You can also do some [pattern matching](/cookbook/pattern_matching) to unpack values in composite types like lists and records. + +Basic usage of [`match`](/commands/docs/match) can conditionally run different code like a "switch" statement common in other languages. [`match`](/commands/docs/match) checks if the value after the word [`match`](/commands/docs/match) is equal to the value at the start of each branch before the `=>` and if it does, it executes the code after that branch's `=>`. + +```nu +match 3 { + 1 => 'one', + 2 => { + let w = 'w' + 't' + $w + 'o' + }, + 3 => 'three', + 4 => 'four' +} +# three +``` + +The branches can either return a single value or, as shown in the second branch, can return the results of a [block](/book/types_of_data#blocks). + +#### Catch all branch + +You can have also have a catch all condition for if the given value doesn't match any of the other conditions by having a branch whose matching value is `_`. + +```nu +let foo = match 7 { + 1 => 'one', + 2 => 'two', + 3 => 'three', + _ => 'other number' +} +$foo +# other number +``` + +(Reminder, [`match`](/commands/docs/match) is an expression which is why we can assign the result to `$foo` here). + +#### Pattern Matching + +You can "unpack" values from types like lists and records with [pattern matching](/cookbook/pattern_matching). You can then assign variables to the parts you want to unpack and use them in the matched expressions. + +```nu +let foo = { name: 'bar', count: 7 } +match $foo { + { name: 'bar', count: $it } => ($it + 3), + { name: _, count: $it } => ($it + 7), + _ => 1 +} +# 10 +``` + +The `_` in the second branch means it matches any record with field `name` and `count`, not just ones where `name` is `'bar'`. + +#### Guards + +You can also add an additional condition to each branch called a "guard" to determine if the branch should be matched. To do so, after the matched pattern put `if` and then the condition before the `=>`. + +```nu +let foo = { name: 'bar', count: 7 } +match $foo { + { name: 'bar', count: $it } if $it < 5 => ($it + 3), + { name: 'bar', count: $it } if $it >= 5 => ($it + 7), + _ => 1 +} +# 14 +``` + +--- + +You can find more details about [`match`](/commands/docs/match) in the [pattern matching cookbook page](/cookbook/pattern_matching). + +## Loops + +The loop commands allow you to repeat a block of code multiple times. + +### Loops and other iterating commands + +The functionality of the loop commands is similar to commands that apply a closure over elements in a list or table like [`each`](/commands/docs/each) or [`where`](/commands/docs/where) and many times you can accomplish the same thing with either. For example: + +```nu +mut result = [] +for $it in [1 2 3] { $result = ($result | append ($it + 1)) } +$result +╭───┬───╮ +│ 0 │ 2 │ +│ 1 │ 3 │ +│ 2 │ 4 │ +╰───┴───╯ + + +[1 2 3] | each { $in + 1 } +╭───┬───╮ +│ 0 │ 2 │ +│ 1 │ 3 │ +│ 2 │ 4 │ +╰───┴───╯ +``` + +While it may be tempting to use loops if you're familiar with them in other languages, it is considered more in the [Nushell-style](/book/thinking_in_nu) (idiomatic) to use commands that apply closures when you can solve a problem either way. The reason for this is because of a pretty big downside with using loops. + +#### Loop disadvantages + +The biggest downside of loops is that they are statements, unlike [`each`](/commands/docs/each) which is an expression. Expressions, like [`each`](/commands/docs/each) always result in some output value, however statements do not. + +This means that they don't work well with immutable variables and using immutable variables is considered a more [Nushell-style](/book/thinking_in_nu#variables-are-immutable). Without a mutable variable declared beforehand in the example in the previous section, it would be impossible to use [`for`](/commands/docs/each) to get the list of numbers with incremented numbers, or any value at all. + +Statements also don't work in Nushell pipelines which require some output. In fact Nushell will give an error if you try: + +```nu +[1 2 3] | for x in $in { $x + 1 } | $in ++ [5 6 7] +Error: nu::parser::unexpected_keyword + + × Statement used in pipeline. + ╭─[entry #5:1:1] + 1 │ [1 2 3] | for x in $in { $x + 1 } | $in ++ [5 6 7] + · ─┬─ + · ╰── not allowed in pipeline + ╰──── + help: 'for' keyword is not allowed in pipeline. Use 'for' by itself, outside of a pipeline. +``` + +Because Nushell is very pipeline oriented, this means using expression commands like [`each`](/commands/docs/each) is typically more natural than loop statements. + +#### Loop advantages + +If loops have such a big disadvantage, why do they exist? Well, one reason is that closures, like [`each`](/commands/docs/each) uses, can't modify mutable variables in the surrounding environment. If you try to modify a mutable variable in a closure you will get an error: + +```nu +mut foo = [] +[1 2 3] | each { $foo = ($foo | append ($in + 1)) } +Error: nu::parser::expected_keyword + + × Capture of mutable variable. + ╭─[entry #8:1:1] + 1 │ [1 2 3] | each { $foo = ($foo | append ($in + 1)) } + · ──┬─ + · ╰── capture of mutable variable + ╰──── +``` + +If you modify an environmental variable in a closure, you can, but it will only modify it within the scope of the closure, leaving it unchanged everywhere else. Loops, however, use [blocks](/book/types_of_data#blocks) which means they can modify a regular mutable variable or an environmental variable within the larger scope. + +```nu +mut result = [] +for $it in [1 2 3] { $result = ($result | append ($it + 1)) } +$result +╭───┬───╮ +│ 0 │ 2 │ +│ 1 │ 3 │ +│ 2 │ 4 │ +╰───┴───╯ +``` + +### `for` + +[`for`](/commands/docs/for) loops over a range or collection like a list or a table. + +```nu +for x in [1 2 3] { $x * $x | print } +# 1 +# 4 +# 9 +``` + +#### Expression command alternatives + +- [`each`](/commands/docs/each) +- [`par-each`](/commands/docs/par-each) +- [`where`](/commands/docs/where)/[`filter`](/commands/docs/filter) +- [`reduce`](/commands/docs/reduce) + +### `while` + +[`while`](/commands/docs/while) loops the same block of code until the given condition is `false`. + +```nu +mut x = 0; while $x < 10 { $x = $x + 1 }; $x +# 10 +``` + +#### Expression command alternatives + +The "until" and other "while" commands + +- [`take until`](/commands/docs/take_until) +- [`take while`](/commands/docs/take_while) +- [`skip until`](/commands/docs/skip_until) +- [`skip while`](/commands/docs/skip_while) + +### `loop` + +[`loop`](/commands/docs/loop) loops a block infinitely. You can use [`break`](/commands/docs/break) (as described in the next section) to limit how many times it loops. It can also be handy for continuously running scripts, like an interactive prompt. + +```nu +mut x = 0; loop { if $x > 10 { break }; $x = $x + 1 }; $x +# 11 +``` + +### `break` + +[`break`](/commands/docs/break) will stop executing the code in a loop and resume execution after the loop. Effectively "break"ing out of the loop. + +```nu +for x in 1..10 { if $x > 3 { break }; print $x } +# 1 +# 2 +# 3 +``` + +### `continue` + +[`continue`](/commands/docs/continue) will stop execution of the current loop, skipping the rest of the code in the loop, and will go to the next loop. If the loop would normally end, like if [`for`](/commands/docs/for) has iterated through all the given elements, or if [`while`](/commands/docs/while)'s condition is now false, it won't loop again and execution will continue after the loop block. + +```nu +mut x = -1; while $x <= 6 { $x = $x + 1; if $x mod 3 == 0 { continue }; print $x } +# 1 +# 2 +# 4 +# 5 +# 7 +``` + +## Errors + +### `error make` + +[`error make`](/commands/docs/error_make) creates an error that stops execution of the code and any code that called it, until either it is handled by a [`try`](/commands/docs/try) block, or it ends the script and outputs the error message. This functionality is the same as "exceptions" in other languages. + +```nu +print 'printed'; error make { msg: 'Some error info' }; print 'unprinted' +printed +Error: × Some error info + ╭─[entry #9:1:1] + 1 │ print 'printed'; error make { msg: 'Some error info' }; print 'unprinted' + · ─────┬──── + · ╰── originates from here + ╰──── +``` + +The record passed to it provides some information to the code that catches it or the resulting error message. + +You can find more information about [`error make`](/commands/docs/error_make) and error concepts on the [Creating your own errors page](/book/creating_errors). + +### `try` + +[`try`](/commands/docs/try) will catch errors created anywhere in the [`try`](/commands/docs/try)'s code block and resume execution of the code after the block. + +```nu +try { error make { msg: 'Some error info' }}; print 'Resuming' +# Resuming +``` + +This includes catching built in errors. + +```nu +try { 1 / 0 }; print 'Resuming' +# Resuming +``` + +The resulting value will be `nothing` if an error occurs and the returned value of the block if an error did not occur. + +If you include a `catch` block after the [`try`](/commands/docs/try) block, it will execute the code in the `catch` block if an error occurred in the [`try`](/commands/docs/try) block. + +```nu +try { 1 / 0 } catch { 'An error happened!' } | $in ++ ' And now I am resuming.' +# An error happened! And now I am resuming. +``` + +It will not execute the `catch` block if an error did not occur. + +## Other + +### `return` + +[`return`](/commands/docs/return) Ends a closure or command early where it is called, without running the rest of the command/closure, and returns the given value. Not often necessary since the last value in a closure or command is also returned, but it can sometimes be convenient. + +```nu +def 'positive-check' [it] { + if $it > 0 { + return 'positive' + }; + + 'non-positive' +} +``` + +```nu +positive-check 3 +# positive + +# positive-check (-3) +non-positive + +let positive_check = {|it| if $it > 0 { return 'positive' }; 'non-positive' } + +do $positive_check 3 +# positive + +do $positive_check (-3) +# non-positive +``` diff --git a/book/custom_commands.md b/src/content/docs/book/programming-in-nu/custom_commands.md similarity index 85% rename from book/custom_commands.md rename to src/content/docs/book/programming-in-nu/custom_commands.md index bd2de80b71f..2b66f551044 100644 --- a/book/custom_commands.md +++ b/src/content/docs/book/programming-in-nu/custom_commands.md @@ -1,4 +1,8 @@ -# Custom commands +--- +title: Custom commands +sidebar: + order: 1 +--- Nu's ability to compose long pipelines allows you a lot of control over your data and system, but it comes at the price of a lot of typing. Ideally, you'd be able to save your well-crafted pipelines to use again and again. @@ -12,8 +16,8 @@ def greet [name] { } ``` -::: tip -The value produced by the last line of a command becomes the command's returned value. In this case, a list containing the string `'hello'` and `$name` is returned. To prevent this, you can place `null` (or the [`ignore`](/commands/docs/ignore.md) command) at the end of the pipeline, like so: `['hello' $name] | null`. Also note that most file system commands, such as [`save`](/commands/docs/save.md) or [`cd`](/commands/docs/cd.md), always output `null`. +:::tip +The value produced by the last line of a command becomes the command's returned value. In this case, a list containing the string `'hello'` and `$name` is returned. To prevent this, you can place `null` (or the [`ignore`](/commands/docs/ignore) command) at the end of the pipeline, like so: `['hello' $name] | null`. Also note that most file system commands, such as [`save`](/commands/docs/save) or [`cd`](/commands/docs/cd), always output `null`. ::: In this definition, we define the `greet` command, which takes a single parameter `name`. Following this parameter is the block that represents what will happen when the custom command runs. When called, the custom command will set the value passed for `name` as the `$name` variable, which will be available to the block. @@ -21,19 +25,19 @@ In this definition, we define the `greet` command, which takes a single paramete To run the above, we can call it like we would call built-in commands: ```nu -> greet "world" +greet "world" ``` As we do, we also get output just as we would with built-in commands: -``` +```nu ───┬─────── 0 │ hello 1 │ world ───┴─────── ``` -::: tip +:::tip If you want to generate a single string, you can use the string interpolation syntax to embed $name in it: ```nu @@ -55,7 +59,7 @@ _Note: It's common practice in Nushell to separate the words of the command with ## Sub-commands -You can also define subcommands to commands using a space. For example, if we wanted to add a new subcommand to [`str`](/commands/docs/str.md), we can create it by naming our subcommand to start with "str ". For example: +You can also define subcommands to commands using a space. For example, if we wanted to add a new subcommand to [`str`](/commands/docs/str), we can create it by naming our subcommand to start with "str ". For example: ```nu def "str mycommand" [] { @@ -63,10 +67,10 @@ def "str mycommand" [] { } ``` -Now we can call our custom command as if it were a built-in subcommand of [`str`](/commands/docs/str.md): +Now we can call our custom command as if it were a built-in subcommand of [`str`](/commands/docs/str): ```nu -> str mycommand +str mycommand ``` Of course, commands with spaces in their names are defined in the same way: @@ -101,7 +105,7 @@ greet world If we try to run the above, Nushell will tell us that the types don't match: -``` +```nu error: Type Error ┌─ shell:6:7 │ @@ -148,10 +152,10 @@ def greet [name = "nushell"] { You can call this command either without the parameter or with a value to override the default value: ```nu -> greet -hello nushell -> greet world -hello world +greet +# hello nushell +greet world +# hello world ``` You can also combine a default value with a [type requirement](#parameter-types): @@ -228,19 +232,19 @@ In the `greet` definition above, we define the `name` positional parameter as we You can call the above using: ```nu -> greet world --age 10 +greet world --age 10 ``` Or: ```nu -> greet --age 10 world +greet --age 10 world ``` Or even leave the flag off altogether: ```nu -> greet world +greet world ``` Flags can also be defined to have a shorthand version. This allows you to pass a simpler flag as well as a longhand, easier-to-read flag. @@ -261,7 +265,7 @@ _Note:_ Flags are named by their longhand name, so the above example would need Now, we can call this updated definition using the shorthand flag: ```nu -> greet -a 10 hello +greet -a 10 hello ``` Flags can also be used as basic switches. This means that their presence or absence is taken as an argument for the definition. Extending the previous example: @@ -283,20 +287,20 @@ def greet [ And the definition can be either called as: ```nu -> greet -a 10 --twice hello +greet -a 10 --twice hello ``` Or just without the switch flag: ```nu -> greet -a 10 hello +greet -a 10 hello ``` You can also assign it to true/false to enable/disable the flag too: ```nu -> greet -a 10 --switch=false -> greet -a 10 --switch=true +greet -a 10 --switch=false +greet -a 10 --switch=true ``` But note that this is not the behavior you want: `> greet -a 10 --switch false`, here the value `false` will pass as a positional argument. @@ -363,8 +367,8 @@ greet moon earth mars jupiter venus To pass a list to a rest parameter, you can use the [spread operator](/book/operators#spread-operator) (`...`): ```nu -> let planets = [earth mars jupiter venus] # This is equivalent to the previous example -> greet moon ...$planets +let planets = [earth mars jupiter venus] # This is equivalent to the previous example +greet moon ...$planets ``` ## Documenting your command @@ -386,14 +390,21 @@ Once defined, we can run `help greet` to get the help information for the comman ```nu Usage: - > greet <name> {flags} + > greet {flags} <name> + +Flags: + -a, --age <Int> - + -h, --help - Display the help message for this command Parameters: - <name> + name <string>: -Flags: - -h, --help: Display this help message - -a, --age <integer> +Input/output types: + ╭───┬───────┬────────╮ + │ # │ input │ output │ + ├───┼───────┼────────┤ + │ 0 │ any │ any │ + ╰───┴───────┴────────╯ ``` You can see the parameter and flag that we defined, as well as the `-h` help flag that all commands get. @@ -410,26 +421,31 @@ def greet [ } ``` -The comments that we put on the definition and its parameters then appear as descriptions inside the [`help`](/commands/docs/help.md) of the command. +The comments that we put on the definition and its parameters then appear as descriptions inside the [`help`](/commands/docs/help) of the command. -::: warning Note +:::caution[Note] A Nushell comment that continues on the same line for argument documentation purposes requires a space before the ` #` pound sign. ::: Now, if we run `help greet`, we're given a more helpful help text: -``` -A greeting command that can greet the caller - +```nu Usage: - > greet <name> {flags} + > greet {flags} <name> + +Flags: + -a, --age <Int> - The age of the person + -h, --help - Display the help message for this command Parameters: - <name> The name of the person to greet + name <string>: The name of the person to greet -Flags: - -h, --help: Display this help message - -a, --age <integer>: The age of the person +Input/output types: + ╭───┬───────┬────────╮ + │ # │ input │ output │ + ├───┼───────┼────────┤ + │ 0 │ any │ any │ + ╰───┴───────┴────────╯ ``` ## Pipeline Output @@ -437,19 +453,19 @@ Flags: Custom commands stream their output just like built-in commands. For example, let's say we wanted to refactor this pipeline: ```nu -> ls | get name +ls | get name ``` -Let's move [`ls`](/commands/docs/ls.md) into a command that we've written: +Let's move [`ls`](/commands/docs/ls) into a command that we've written: ```nu def my-ls [] { ls } ``` -We can use the output from this command just as we would [`ls`](/commands/docs/ls.md). +We can use the output from this command just as we would [`ls`](/commands/docs/ls). ```nu -> my-ls | get name +my-ls | get name ───┬─────────────────────── 0 │ myscript.nu 1 │ myscript2.nu @@ -474,7 +490,7 @@ def double [] { Now, if we call the above command later in a pipeline, we can see what it does with the input: ```nu -> [1 2 3] | double +[1 2 3] | double ───┬───── 0 │ 2 1 │ 4 @@ -495,4 +511,4 @@ def nullify [...cols] { ## Persisting -For information about how to persist custom commands so that they're visible when you start up Nushell, see the [configuration chapter](configuration.md) and add your startup script. +For information about how to persist custom commands so that they're visible when you start up Nushell, see the [configuration chapter](configuration) and add your startup script. diff --git a/book/modules.md b/src/content/docs/book/programming-in-nu/modules.md similarity index 78% rename from book/modules.md rename to src/content/docs/book/programming-in-nu/modules.md index 38993a05448..ba9d52662c1 100644 --- a/book/modules.md +++ b/src/content/docs/book/programming-in-nu/modules.md @@ -1,4 +1,8 @@ -# Modules +--- +title: Modules +sidebar: + order: 7 +--- Similar to many other programming languages, Nushell also has modules to organize your code. Each module is a "bag" containing a bunch of definitions (typically commands) that you can export (take out of the bag) and use in your current scope. Since Nushell is also a shell, modules allow you to modify environment variables when importing them. @@ -32,7 +36,7 @@ _\*These definitions can also be named `main` (see below)._ The simplest (and probably least useful) way to define a module is an "inline" module can be defined like this: -```nu +```nu title="greetings.nu" module greetings { export def hello [name: string] { $"hello ($name)!" @@ -56,8 +60,7 @@ First, we create a module (put `hello` and `hi` commands into a "bag" called `gr A .nu file can be a module. Just take the contents of the module block from the example above and save it to a file `greetings.nu`. The module name is automatically inferred as the stem of the file ("greetings"). -```nu -# greetings.nu +```nu title="greetings.nu" export def hello [name: string] { $"hello ($name)!" @@ -71,18 +74,19 @@ export def hi [where: string] { then ```nu -> use greetings.nu hello +use greetings.nu hello -> hello +hello ``` The result should be similar as in the previous section. -> **Note** -> that the `use greetings.nu hello` call here first implicitly creates the `greetings` module, -> then takes `hello` from it. You could also write it as `module greetings.nu`, `use greetings hello`. -> Using `module` can be useful if you're not interested in any definitions from the module but want to, -> e.g., re-export the module (`export module greetings.nu`). +:::note +that the `use greetings.nu hello` call here first implicitly creates the `greetings` module, +then takes `hello` from it. You could also write it as `module greetings.nu`, `use greetings hello`. +Using `module` can be useful if you're not interested in any definitions from the module but want to, +e.g., re-export the module (`export module greetings.nu`). +::: ## Modules from directories @@ -90,8 +94,7 @@ Finally, a directory can be imported as a module. The only condition is that it _In the following examples, `/` is used at the end to denote that we're importing a directory but it is not required._ -```nu -# greetings/mod.nu +```nu title="greetings/mod.nu" export def hello [name: string] { $"hello ($name)!" @@ -105,20 +108,20 @@ export def hi [where: string] { then ```nu -> use greetings/ hello +use greetings/ hello -> hello +hello ``` The name of the module follows the same rule as module created from a file: Stem of the directory name, i.e., the directory name, is used as the module name. Again, you could do this as a two-step action using `module` and `use` separately, as explained in the previous section. -::: tip +:::tip You can define `main` command inside `mod.nu` to create a command named after the module directory. ::: ## Import Pattern -Anything after the [`use`](/commands/docs/use.md) keyword forms an **import pattern** which controls how the definitions are imported. +Anything after the [`use`](/commands/docs/use) keyword forms an **import pattern** which controls how the definitions are imported. The import pattern has the following structure `use head members...` where `head` defines the module (name of an existing module, file, or directory). The members are optional and specify what exactly should be imported from the module. Using our `greetings` example: @@ -151,8 +154,7 @@ will import all names directly without any prefix. Exporting a command called `main` from a module defines a command named as the module. Let's extend our `greetings` example: -```nu -# greetings.nu +```nu title="greetings.nu" export def hello [name: string] { $"hello ($name)!" @@ -170,13 +172,13 @@ export def main [] { then ```nu -> use greetings.nu +use greetings.nu -> greetings -greetings and salutations! +greetings +# greetings and salutations! -> greetings hello world -hello world! +greetings hello world +# hello world! ``` The `main` is exported only when @@ -197,13 +199,13 @@ Submodules are modules inside modules. They are automatically created when you c The difference is that `export module some-module` _only_ adds the module as a submodule, while `export use some-module` _also_ re-exports the submodule's definitions. Since definitions of submodules are available when importing from a module, `export use some-module` is typically redundant, unless you want to re-export its definitions without the namespace prefix. -> **Note** -> `module` without `export` defines only a local module, it does not export a submodule. +:::note +`module` without `export` defines only a local module, it does not export a submodule. +::: Let's illustrate this with an example. Assume three files: -```nu -# greetings.nu +```nu title="greetings.nu" export def hello [name: string] { $"hello ($name)!" @@ -218,8 +220,7 @@ export def main [] { } ``` -```nu -# animals.nu +```nu title="animals.nu" export def dog [] { "haf" @@ -230,8 +231,7 @@ export def cat [] { } ``` -```nu -# voice.nu +```nu title="voice.nu" export use greetings.nu * @@ -242,22 +242,22 @@ export module animals.nu Then: ```nu -> use voice.nu +use voice.nu -> voice animals dog -haf +voice animals dog +# haf -> voice animals cat -meow +voice animals cat +# meow -> voice hello world -hello world +voice hello world +# hello world -> voice hi there -hi there! +voice hi there +# hi there! -> voice greetings -greetings and salutations! +voice greetings +# greetings and salutations! ``` @@ -265,10 +265,9 @@ As you can see, defining the submodule structure also shapes the command line AP ## Environment Variables -Modules can also define an environment using [`export-env`](/commands/docs/export-env.md): +Modules can also define an environment using [`export-env`](/commands/docs/export-env): -```nu -# greetings.nu +```nu title="greetings.nu" export-env { $env.MYNAME = "Arthur, King of the Britons" @@ -279,19 +278,19 @@ export def hello [] { } ``` -When [`use`](/commands/docs/use.md) is evaluated, it will run the code inside the [`export-env`](/commands/docs/export-env.md) block and merge its environment into the current scope: +When [`use`](/commands/docs/use) is evaluated, it will run the code inside the [`export-env`](/commands/docs/export-env) block and merge its environment into the current scope: ```nu -> use greetings.nu +use greetings.nu -> $env.MYNAME -Arthur, King of the Britons +$env.MYNAME +# Arthur, King of the Britons -> greetings hello -hello Arthur, King of the Britons! +greetings hello +# hello Arthur, King of the Britons! ``` -::: tip +:::tip You can put a complex code defining your environment without polluting the namespace of the module, for example: ```nu @@ -316,10 +315,9 @@ Like any programming language, Nushell is also a product of a tradeoff and there ### `export-env` runs only when the `use` call is _evaluated_ -If you also want to keep your variables in separate modules and export their environment, you could try to [`export use`](/commands/docs/export_use.md) it: +If you also want to keep your variables in separate modules and export their environment, you could try to [`export use`](/commands/docs/export_use) it: -```nu -# purpose.nu +```nu title="purpose.nu" export-env { $env.MYPURPOSE = "to build an empire." } @@ -332,15 +330,14 @@ export def greeting_purpose [] { and then use it ```nu -> use purpose.nu +use purpose.nu -> purpose greeting_purpose +purpose greeting_purpose ``` However, this won't work, because the code inside the module is not _evaluated_, only _parsed_ (only the `export-env` block is evaluated when you call `use purpose.nu`). To export the environment of `greetings.nu`, you need to add it to the `export-env` module: -```nu -# purpose.nu +```nu title="purpose.nu" export-env { use greetings.nu $env.MYPURPOSE = "to build an empire." @@ -354,10 +351,10 @@ export def greeting_purpose [] { then ```nu -> use purpose.nu +use purpose.nu -> purpose greeting_purpose -Hello Arthur, King of the Britons. My purpose is to build an empire. +purpose greeting_purpose +# Hello Arthur, King of the Britons. My purpose is to build an empire. ``` Calling `use purpose.nu` ran the `export-env` block inside `purpose.nu` which in turn ran `use greetings.nu` which in turn ran the `export-env` block inside `greetings.nu`, preserving the environment changes. @@ -375,10 +372,9 @@ This section describes some useful patterns using modules. ### Local Definitions -Anything defined in a module without the [`export`](/commands/docs/export.md) keyword will work only in the module's scope. +Anything defined in a module without the [`export`](/commands/docs/export) keyword will work only in the module's scope. -```nu -# greetings.nu +```nu title="greetings.nu" use tools/utils.nu generate-prefix # visible only locally (we assume the file exists) @@ -398,18 +394,18 @@ def greetings-helper [greeting: string, subject: string] { then ```nu -> use greetings.nu * +use greetings.nu * -> hello "world" -hello world! + hello "world" +# hello world! -> hi "there" -hi there! +hi "there" +# hi there! -> greetings-helper "foo" "bar" # fails because 'greetings-helper' is not exported +greetings-helper "foo" "bar" # fails because 'greetings-helper' is not exported -> generate-prefix # fails because the command is imported only locally inside the module +generate-prefix # fails because the command is imported only locally inside the module ``` ### Dumping files into directory @@ -419,11 +415,12 @@ A common pattern in traditional shells is dumping and auto-sourcing files from a Here we'll create a simple completion module with a submodule dedicated to some Git completions: 1. Create the completion directory -`mkdir ($nu.default-config-dir | path join completions)` + `mkdir ($nu.default-config-dir | path join completions)` 2. Create an empty `mod.nu` for it -`touch ($nu.default-config-dir | path join completions mod.nu)` + `touch ($nu.default-config-dir | path join completions mod.nu)` 3. Put the following snippet in `git.nu` under the `completions` directory -```nu + +```nu title="completions/git.nu" export extern main [ --version(-v) -C: string @@ -444,22 +441,26 @@ def complete-git-branch [] { # ... code to list git branches } ``` + 4. Add `export module git.nu` to `mod.nu` 5. Add the parent of the `completions` directory to your NU_LIB_DIRS inside `env.nu` -```nu + +```nu title="env.nu" $env.NU_LIB_DIRS = [ ... $nu.default-config-dir ] ``` + 6. import the completions to Nushell in your `config.nu` -`use completions *` -Now you've set up a directory where you can put your completion files and you should have some Git completions the next time you start Nushell + `use completions *` + Now you've set up a directory where you can put your completion files and you should have some Git completions the next time you start Nushell -> **Note** -> This will use the file name (in our example `git` from `git.nu`) as the module name. This means some completions might not work if the definition has the base command in it's name. -> For example, if you defined our known externals in our `git.nu` as `export extern 'git push' []`, etc. and followed the rest of the steps, you would get subcommands like `git git push`, etc. -> You would need to call `use completions git *` to get the desired subcommands. For this reason, using `main` as outlined in the step above is the preferred way to define subcommands. +:::note +This will use the file name (in our example `git` from `git.nu`) as the module name. This means some completions might not work if the definition has the base command in it's name. +For example, if you defined our known externals in our `git.nu` as `export extern 'git push' []`, etc. and followed the rest of the steps, you would get subcommands like `git git push`, etc. +You would need to call `use completions git *` to get the desired subcommands. For this reason, using `main` as outlined in the step above is the preferred way to define subcommands. +::: ### Setting environment + aliases (conda style) @@ -475,20 +476,21 @@ Another example could be our unofficial Conda module: https://github.com/nushell ## Hiding Any custom command or alias, imported from a module or not, can be "hidden", restoring the previous definition. -We do this with the [`hide`](/commands/docs/hide.md) command: +We do this with the [`hide`](/commands/docs/hide) command: ```nu -> def foo [] { "foo" } +def foo [] { "foo" } -> foo foo +# foo -> hide foo +hide foo -> foo # error! command not found! +# foo +# error! command not found! ``` -The [`hide`](/commands/docs/hide.md) command also accepts import patterns, just like [`use`](/commands/docs/use.md). +The [`hide`](/commands/docs/hide) command also accepts import patterns, just like [`use`](/commands/docs/use). The import pattern is interpreted slightly differently, though. It can be one of the following: @@ -509,5 +511,6 @@ It can be one of the following: - Hides all of the module's exports, without the prefix -> **Note** -> `hide` is not a supported keyword at the root of a module (unlike `def` etc.) +:::note +`hide` is not a supported keyword at the root of a module (unlike `def` etc.) +::: diff --git a/book/operators.md b/src/content/docs/book/programming-in-nu/operators.md similarity index 83% rename from book/operators.md rename to src/content/docs/book/programming-in-nu/operators.md index f113a8e197f..f2ed2b7474f 100644 --- a/book/operators.md +++ b/src/content/docs/book/programming-in-nu/operators.md @@ -1,4 +1,8 @@ -# Operators +--- +title: Operators +sidebar: + order: 3 +--- Nushell supports the following operators for common math, logic, and string operations: @@ -18,7 +22,7 @@ Nushell supports the following operators for common math, logic, and string oper | `>` | greater than | | `>=` | greater than or equal | | `=~` | regex match / string contains another | -| `!~` | inverse regex match / string does *not* contain another | +| `!~` | inverse regex match / string does _not_ contain another | | `in` | value in list | | `not-in` | value not in list | | `not` | logical not | @@ -34,7 +38,6 @@ Nushell supports the following operators for common math, logic, and string oper | `ends-with` | string ends with | | `++` | append lists | - Parentheses can be used for grouping to specify evaluation order or for calling commands and using the results in an expression. ## Order of Operations @@ -55,17 +58,18 @@ Operations are evaluated in the following order (from highest precedence to lowe - Logical or (`||`, `or`) - Assignment operations -``` -> 3 * (1 + 2) -9 +```nu +3 * (1 + 2) +# 9 ``` ## Types Not all operations make sense for all data types. If you attempt to perform an operation on non-compatible data types, you will be met with an error message that should explain what went wrong: + ```nu -> "spam" - 1 +"spam" - 1 Error: nu::parser::unsupported_operation (link) × Types mismatched for operation. @@ -96,7 +100,7 @@ foobarbaz !~ bar # returns false ls | where name =~ ^nu # returns all files whose names start with "nu" ``` -Both operators use [the Rust regex crate's `is_match()` function](https://docs.rs/regex/latest/regex/struct.Regex.html#method.is_match). +Both operators use [the Rust regex crate's `is_match()` function](https://docs.rs/regex/latest/regex/struct.Regex#method.is_match). ## Case Sensitivity @@ -109,13 +113,13 @@ Operators are usually case-sensitive when operating on strings. There are a few "FOO" =~ "(?i)foo" # returns true ``` -2. Use the [`str contains`](/commands/docs/str_contains.md) command's `--insensitive` flag: +2. Use the [`str contains`](/commands/docs/str_contains) command's `--insensitive` flag: ```nu "FOO" | str contains --insensitive "foo" ``` -3. Convert strings to lowercase with [`str downcase`](/commands/docs/str_downcase.md) before comparing: +3. Convert strings to lowercase with [`str downcase`](/commands/docs/str_downcase) before comparing: ```nu ("FOO" | str downcase) == ("Foo" | str downcase) @@ -139,10 +143,10 @@ Suppose you have multiple lists you want to concatenate together, but you also w some individual values. This can be done with `append` and `prepend`, but the spread operator can let you do it more easily. -```nushell -> let dogs = [Spot, Teddy, Tommy] -> let cats = ["Mr. Humphrey Montgomery", Kitten] -> [ +```nu +let dogs = [Spot, Teddy, Tommy] +let cats = ["Mr. Humphrey Montgomery", Kitten] +[ ...$dogs Polly ...($cats | each { |it| $"($it) \(cat\)" }) @@ -163,8 +167,9 @@ operator can let you do it more easily. ``` The below code is an equivalent version using `append`: -```nushell -> $dogs | + +```nu +$dogs | append Polly | append ($cats | each { |it| $"($it) \(cat\)" }) | append [Porky Bessie] | @@ -183,8 +188,8 @@ only be used before variables (`...$foo`), subexpressions (`...(foo)`), and list The `...` also won't be recognized as the spread operator if there's any whitespace between it and the next expression: -```nushell -> [ ... [] ] +```nu +[ ... [] ] ╭───┬────────────────╮ │ 0 │ ... │ │ 1 │ [list 0 items] │ @@ -198,36 +203,33 @@ This is mainly so that `...` won't be confused for the spread operator in comman Let's say you have a record with some configuration information and you want to add more fields to this record: -```nushell -> let config = { path: /tmp, limit: 5 } +```nu +let config = { path: /tmp, limit: 5 } ``` You can make a new record with all the fields of `$config` and some new additions using the spread operator. You can use the spread multiple records inside a single record literal. -```nushell -> { +```nu +{ ...$config, users: [alice bob], ...{ url: example.com }, ...(sys | get mem) } -╭────────────┬───────────────╮ -│ path │ /tmp │ -│ limit │ 5 │ -│ │ ╭───┬───────╮ │ -│ users │ │ 0 │ alice │ │ -│ │ │ 1 │ bob │ │ -│ │ ╰───┴───────╯ │ -│ url │ example.com │ -│ total │ 8.3 GB │ -│ free │ 2.6 GB │ -│ used │ 5.7 GB │ -│ available │ 2.6 GB │ -│ swap total │ 2.1 GB │ -│ swap free │ 18.0 MB │ -│ swap used │ 2.1 GB │ -╰────────────┴───────────────╯ +╭────────────┬────────────────╮ +│ path │ /tmp │ +│ limit │ 5 │ +│ users │ [list 2 items] │ +│ url │ example.com │ +│ total │ 16.0 GiB │ +│ free │ 360.9 MiB │ +│ used │ 9.3 GiB │ +│ available │ 4.4 GiB │ +│ swap total │ 0 B │ +│ swap free │ 0 B │ +│ swap used │ 0 B │ +╰────────────┴────────────────╯ ``` Similarly to lists, inside record literals, the spread operator can only be used before variables (`...$foo`), @@ -241,8 +243,8 @@ external command. Here is an example custom command that has a rest parameter: -```nushell -> def foo [ --flag req opt? ...args ] { [$flag, $req, $opt, $args] | to nuon } +```nu +def foo [ --flag req opt? ...args ] { [$flag, $req, $opt, $args] | to nuon } ``` It has one flag (`--flag`), one required positional parameter (`req`), one optional positional parameter @@ -252,40 +254,43 @@ If you have a list of arguments to pass to `args`, you can spread it the same wa [inside a list literal](#in-list-literals). The same rules apply: the spread operator is only recognized before variables, subexpressions, and list literals, and no whitespace is allowed in between. -```nushell -> foo "bar" "baz" ...[1 2 3] # With ..., the numbers are treated as separate arguments -[false, bar, baz, [1, 2, 3]] -> foo "bar" "baz" [1 2 3] # Without ..., [1 2 3] is treated as a single argument -[false, bar, baz, [[1, 2, 3]]] +```nu +# With ..., the numbers are treated as separate arguments +foo "bar" "baz" ...[1 2 3] +# [false, bar, baz, [1, 2, 3]] + +# Without ..., [1 2 3] is treated as a single argument +foo "bar" "baz" [1 2 3] +# [false, bar, baz, [[1, 2, 3]]] ``` A more useful way to use the spread operator is if you have another command with a rest parameter and you want it to forward its arguments to `foo`: -```nushell -> def bar [ ...args ] { foo --flag "bar" "baz" ...$args } -> bar 1 2 3 -[true, bar, baz, [1, 2, 3]] +```nu +def bar [ ...args ] { foo --flag "bar" "baz" ...$args } +bar 1 2 3 +# [true, bar, baz, [1, 2, 3]] ``` You can spread multiple lists in a single call, and also intersperse individual arguments: -```nushell -> foo "bar" "baz" 1 ...[2 3] 4 5 ...(6..9 | take 2) last -[false, bar, baz, [1, 2, 3, 4, 5, 6, 7, last]] +```nu +foo "bar" "baz" 1 ...[2 3] 4 5 ...(6..9 | take 2) last +# [false, bar, baz, [1, 2, 3, 4, 5, 6, 7, last]] ``` Flags/named arguments can go after a spread argument, just like they can go after regular rest arguments: -```nushell -> foo "bar" "baz" 1 ...[2 3] --flag 4 -[true, bar, baz, [1, 2, 3, 4]] +```nu +foo "bar" "baz" 1 ...[2 3] --flag 4 +# [true, bar, baz, [1, 2, 3, 4]] ``` If a spread argument comes before an optional positional parameter, that optional parameter is treated as being omitted: -```nushell -> foo "bar" ...[1 2] "not opt" # The null means no argument was given for opt -[false, bar, null, [1, 2, "not opt"]] +```nu +foo "bar" ...[1 2] "not opt" # The null means no argument was given for opt +# [false, bar, null, [1, 2, "not opt"]] ``` diff --git a/book/overlays.md b/src/content/docs/book/programming-in-nu/overlays.md similarity index 86% rename from book/overlays.md rename to src/content/docs/book/programming-in-nu/overlays.md index 9a80742ca56..f05973b8ef8 100644 --- a/book/overlays.md +++ b/src/content/docs/book/programming-in-nu/overlays.md @@ -1,20 +1,24 @@ -# Overlays +--- +title: Overlays +sidebar: + order: 8 +--- Overlays act as "layers" of definitions (custom commands, aliases, environment variables) that can be activated and deactivated on demand. They resemble virtual environments found in some languages, such as Python. -_Note: To understand overlays, make sure to check [Modules](modules.md) first as overlays build on top of modules._ +_Note: To understand overlays, make sure to check [Modules](modules) first as overlays build on top of modules._ ## Basics First, Nushell comes with one default overlay called `zero`. -You can inspect which overlays are active with the [`overlay list`](/commands/docs/overlay_list.md) command. +You can inspect which overlays are active with the [`overlay list`](/commands/docs/overlay_list) command. You should see the default overlay listed there. To create a new overlay, you first need a module: ```nu -> module spam { +module spam { export def foo [] { "foo" } @@ -29,45 +33,45 @@ To create a new overlay, you first need a module: We'll use this module throughout the chapter, so whenever you see `overlay use spam`, assume `spam` is referring to this module. -::: tip -The module can be created by any of the three methods described in [Modules](modules.md): +:::tip +The module can be created by any of the three methods described in [Modules](modules): - "inline" modules (used in this example) - file - directory -::: + ::: -To create the overlay, call [`overlay use`](/commands/docs/overlay_use.md): +To create the overlay, call [`overlay use`](/commands/docs/overlay_use): ```nu -> overlay use spam +overlay use spam -> foo foo +# foo -> bar bar +# bar -> $env.BAZ -baz +$env.BAZ +# baz -> overlay list +overlay list ───┬────── 0 │ zero 1 │ spam ───┴────── ``` -It brought the module's definitions into the current scope and evaluated the [`export-env`](/commands/docs/export-env.md) block the same way as [`use`](/commands/docs/use.md) command would (see [Modules](modules.md#environment-variables) chapter). +It brought the module's definitions into the current scope and evaluated the [`export-env`](/commands/docs/export-env) block the same way as [`use`](/commands/docs/use) command would (see [Modules](modules#environment-variables) chapter). -::: tip +:::tip In the following sections, the `>` prompt will be preceded by the name of the last active overlay. `(spam)> some-command` means the `spam` overlay is the last active overlay when the command was typed. ::: ## Removing an Overlay -If you don't need the overlay definitions anymore, call [`overlay hide`](/commands/docs/overlay_remove.md): +If you don't need the overlay definitions anymore, call [`overlay hide`](/commands/docs/overlay_remove): ```nu (spam)> overlay hide spam @@ -94,7 +98,7 @@ foo ───┴────── ``` -The last way to remove an overlay is to call [`overlay hide`](/commands/docs/overlay_remove.md) without an argument which will remove the last active overlay. +The last way to remove an overlay is to call [`overlay hide`](/commands/docs/overlay_remove) without an argument which will remove the last active overlay. ## Overlays Are Recordable @@ -128,7 +132,7 @@ eggs Overlays remember what you add to them and store that information even if you remove them. This can let you repeatedly swap between different contexts. -::: tip +:::tip Sometimes, after adding an overlay, you might not want custom definitions to be added into it. The solution can be to create a new empty overlay that would be used just for recording the custom changes: @@ -144,7 +148,7 @@ The solution can be to create a new empty overlay that would be used just for re The `eggs` command is added into `scratchpad` while keeping `spam` intact. -To make it less verbose, you can use the [`overlay new`](/commands/docs/overlay_new.md) command: +To make it less verbose, you can use the [`overlay new`](/commands/docs/overlay_new) command: ```nu (zero)> overlay use spam @@ -158,7 +162,7 @@ To make it less verbose, you can use the [`overlay new`](/commands/docs/overlay_ ## Prefixed Overlays -The [`overlay use`](/commands/docs/overlay_use.md) command would take all commands and aliases from the module and put them directly into the current namespace. +The [`overlay use`](/commands/docs/overlay_use) command would take all commands and aliases from the module and put them directly into the current namespace. However, you might want to keep them as subcommands behind the module's name. That's what `--prefix` is for: @@ -234,7 +238,7 @@ foo The overlays are arranged as a stack. If multiple overlays contain the same definition, say `foo`, the one from the last active one would take precedence. -To bring an overlay to the top of the stack, you can call [`overlay use`](/commands/docs/overlay_use.md) again: +To bring an overlay to the top of the stack, you can call [`overlay use`](/commands/docs/overlay_use) again: ```nu (zero)> def foo [] { "foo-in-zero" } diff --git a/book/scripts.md b/src/content/docs/book/programming-in-nu/scripts.md similarity index 78% rename from book/scripts.md rename to src/content/docs/book/programming-in-nu/scripts.md index ae86e7217fa..f65d840b75c 100644 --- a/book/scripts.md +++ b/src/content/docs/book/programming-in-nu/scripts.md @@ -1,21 +1,24 @@ -# Scripts +--- +title: Scripts +sidebar: + order: 6 +--- In Nushell, you can write and run scripts in the Nushell language. To run a script, you can pass it as an argument to the `nu` commandline application: ```nu -> nu myscript.nu +nu myscript.nu ``` -This will run the script to completion in a new instance of Nu. You can also run scripts inside the _current_ instance of Nu using [`source`](/commands/docs/source.md): +This will run the script to completion in a new instance of Nu. You can also run scripts inside the _current_ instance of Nu using [`source`](/commands/docs/source): ```nu -> source myscript.nu +source myscript.nu ``` Let's look at an example script file: -```nu -# myscript.nu +```nu title="myscript.nu" def greet [name] { ["hello" $name] } @@ -27,7 +30,7 @@ A script file defines the definitions for custom commands as well as the main sc In the above, first `greet` is defined by the Nushell interpreter. This allows us to later call this definition. We could have written the above as: -```nu +```nu title="myscript.nu" greet "world" def greet [name] { @@ -47,12 +50,12 @@ After the definitions run, we start at the top of the script file and run each g To better understand how Nushell sees lines of code, let's take a look at an example script: -```nu +```nu title="myscript.nu" a b; c | d ``` -When this script is run, Nushell will first run the `a` command to completion and view its results. Next, Nushell will run `b; c | d` following the rules in the ["Semicolons" section](pipelines.html#semicolons). +When this script is run, Nushell will first run the `a` command to completion and view its results. Next, Nushell will run `b; c | d` following the rules in the ["Semicolons" section](/book/pipelines#semicolons). ## Parameterizing Scripts @@ -60,8 +63,7 @@ Script files can optionally contain a special "main" command. `main` will be run For example: -```nu -# myscript.nu +```nu title="myscript.nu" def main [x: int] { $x + 10 @@ -69,46 +71,45 @@ def main [x: int] { ``` ```nu -> nu myscript.nu 100 -110 +nu myscript.nu 100 +# 110 ``` ## Argument Type Interpretation -By default, arguments provided to a script are interpreted with the type `Type::Any`, implying that they are not constrained to a specific data type and can be dynamically interpreted as fitting any of the available data types during script execution. +By default, arguments provided to a script are interpreted with the type `Type::Any`, implying that they are not constrained to a specific data type and can be dynamically interpreted as fitting any of the available data types during script execution. -In the previous example, `main [x: int]` denotes that the argument x should possess an integer data type. However, if arguments are not explicitly typed, they will be parsed according to their apparent data type. +In the previous example, `main [x: int]` denotes that the argument x should possess an integer data type. However, if arguments are not explicitly typed, they will be parsed according to their apparent data type. For example: -```nu -# implicit_type.nu +```nu title="implicit_type.nu" def main [x] { $"Hello ($x | describe) ($x)" } +``` -# explicit_type.nu +```nu title="explicit_type.nu" def main [x: string] { $"Hello ($x | describe) ($x)" } ``` ```nu -> nu implicit_type.nu +1 -Hello int 1 +nu implicit_type.nu +1 +# Hello int 1 -> nu explicit_type.nu +1 -Hello string +1 +nu explicit_type.nu +1 +# Hello string +1 ``` ## Subcommands -A script can have multiple sub-commands like `run`, `build`, etc. which allows to execute a specific main sub-function. The important part is to expose them correctly with `def main [] {}`. See more details in the [Custom Command](custom_commands.html#sub-commands) section. +A script can have multiple sub-commands like `run`, `build`, etc. which allows to execute a specific main sub-function. The important part is to expose them correctly with `def main [] {}`. See more details in the [Custom Command](/book/custom_commands#sub-commands) section. For example: -```nu -# myscript.nu +```nu title="myscript.nu" def "main run" [] { print "running" } @@ -122,32 +123,34 @@ def main [] {} ``` ```nu -> nu myscript.nu build -building -> nu myscript.nu run -running +nu myscript.nu build +# building +nu myscript.nu run +# running ``` ## Shebangs (`#!`) On Linux and macOS you can optionally use a [shebang](<https://en.wikipedia.org/wiki/Shebang_(Unix)>) to tell the OS that a file should be interpreted by Nu. For example, with the following in a file named `myscript`: -```nu +```nu title="myscript" #!/usr/bin/env nu "Hello World!" ``` ```nu -> ./myscript -Hello World! +./myscript +# Hello World! ``` + For script to have access to standard input, `nu` should be invoked with `--stdin` flag: -```nu + +```nu title="myscript" #!/usr/bin/env -S nu --stdin echo $"stdin: ($in)" ``` ```nu -> echo "Hello World!" | ./myscript -stdin: Hello World! +echo "Hello World!" | ./myscript +# stdin: Hello World! ``` diff --git a/book/testing.md b/src/content/docs/book/programming-in-nu/testing.md similarity index 85% rename from book/testing.md rename to src/content/docs/book/programming-in-nu/testing.md index 49de01ab63e..5c362ea0053 100644 --- a/book/testing.md +++ b/src/content/docs/book/programming-in-nu/testing.md @@ -1,12 +1,16 @@ -# Testing your Nushell code +--- +title: Testing +sidebar: + order: 10 +--- -The [standard library](standard_library.md) has a unit testing framework to ensure that your code works as expected. +The [standard library](standard_library) has a unit testing framework to ensure that your code works as expected. ## Quick start Have a file, called `test_math.nu`: -```nu +```nu title="test_math.nu" use std assert #[test] @@ -52,12 +56,10 @@ Error: │ ``` - ## Assert commands The foundation for every assertion is the `std assert` command. If the condition is not true, it makes an error. For example: - ```nu ❯ std assert (1 == 2) Error: @@ -110,7 +112,7 @@ Error: ╰──── ``` -In general for base `assert` command it is encouraged to always provide the additional message to show what went wrong. If you cannot use any built-in assert command, you can create a custom one with passing the label for [`error make`](/commands/docs/error_make.md) for the `assert` command: +In general for base `assert` command it is encouraged to always provide the additional message to show what went wrong. If you cannot use any built-in assert command, you can create a custom one with passing the label for [`error make`](/commands/docs/error_make) for the `assert` command: ```nu def "assert even" [number: int] { @@ -144,12 +146,12 @@ In order for a function to be recognized as a test by the test runner it needs t The following annotations are supported by the test runner: -* test - test case to be executed during test run -* test-skip - test case to be skipped during test run -* before-all - function to run at the beginning of test run. Returns a global context record that is piped into every test function -* before-each - function to run before every test case. Returns a per-test context record that is merged with global context and piped into test functions -* after-each - function to run after every test case. Receives the context record just like the test cases -* after-all - function to run after all test cases have been executed. Receives the global context record +- test - test case to be executed during test run +- test-skip - test case to be skipped during test run +- before-all - function to run at the beginning of test run. Returns a global context record that is piped into every test function +- before-each - function to run before every test case. Returns a per-test context record that is merged with global context and piped into test functions +- after-each - function to run after every test case. Receives the context record just like the test cases +- after-all - function to run after all test cases have been executed. Receives the global context record The standard library itself is tested with this framework, so you can find many examples in the [Nushell repository](https://github.com/nushell/nushell/blob/main/crates/nu-std/tests/). diff --git a/book/variables_and_subexpressions.md b/src/content/docs/book/programming-in-nu/variables_and_subexpressions.md similarity index 73% rename from book/variables_and_subexpressions.md rename to src/content/docs/book/programming-in-nu/variables_and_subexpressions.md index 18bc21eaf3b..889f9b74c0b 100644 --- a/book/variables_and_subexpressions.md +++ b/src/content/docs/book/programming-in-nu/variables_and_subexpressions.md @@ -1,4 +1,8 @@ -# Variables and Subexpressions +--- +title: Variables and Subexpressions +sidebar: + order: 4 +--- There are two types of evaluation expressions in Nushell: variables and subexpressions. You know that you're looking at an evaluation expression because it begins with a dollar sign (`$`). This indicates that when Nushell gets the value in this position, it will need to run an evaluation step to process the expression and then use the resulting value. Both evaluation expression forms support a simple form and a 'path' form for working with more complex data. @@ -13,19 +17,19 @@ The simpler of the two evaluation expressions is the variable. During evaluation An immutable variable cannot change its value after declaration. They are declared using the `let` keyword, ```nu -> let val = 42 -> print $val -42 +let val = 42 +print $val +# 42 ``` However, they can be 'shadowed'. Shadowing means that they are redeclared and their initial value cannot be used anymore within the same scope. ```nu -> let val = 42 # declare a variable -> do { let val = 101; $val } # in an inner scope, shadow the variable -101 -> $val # in the outer scope the variable remains unchanged -42 +let val = 42 +do { let val = 101; $val } +# 101 +$val +# 42 ``` #### Mutable Variables @@ -33,10 +37,10 @@ However, they can be 'shadowed'. Shadowing means that they are redeclared and th A mutable variable is allowed to change its value by assignment. These are declared using the `mut` keyword. ```nu -> mut val = 42 -> $val += 27 -> $val -69 +mut val = 42 +$val += 27 +$val +# 69 ``` There are a couple of assignment operators used with mutable variables @@ -50,13 +54,12 @@ There are a couple of assignment operators used with mutable variables | `/=` | Divides the variable by a value and makes the quotient its new value | | `++=` | Appends a list or a value to a variable | -> **Note** -> -> 1. `+=`, `-=`, `*=` and `/=` are only valid in the contexts where their root operations -> are expected to work. For example, `+=` uses addition, so it can not be used for contexts -> where addition would normally fail -> 2. `++=` requires that either the variable **or** the argument is a -> list. +:::note + +1. `+=`, `-=`, `*=` and `/=` are only valid in the contexts where their root operations are expected to work. For example, `+=` uses addition, so it can not be used for contexts where addition would normally fail +2. `++=` requires that either the variable **or** the argument is a list. + +::: ##### More on Mutability @@ -66,14 +69,15 @@ Closures and nested `def`s cannot capture mutable variables from their environme # naive method to count number of elements in a list mut x = 0 -[1 2 3] | each { $x += 1 } # error: $x is captured in a closure +[1 2 3] | each { $x += 1 } +# error: $x is captured in a closure ``` -To use mutable variables for such behaviour, you are encouraged to use the loops +To use mutable variables for such behavior, you are encouraged to use the loops #### Constant Variables -A constant variable is an immutable variable that can be fully evaluated at parse-time. These are useful with commands that need to know the value of an argument at parse time, like [`source`](/commands/docs/source.md), [`use`](/commands/docs/use.md) and [`register`](/commands/docs/register.md). See [how nushell code gets run](how_nushell_code_gets_run.md) for a deeper explanation. They are declared using the `const` keyword +A constant variable is an immutable variable that can be fully evaluated at parse-time. These are useful with commands that need to know the value of an argument at parse time, like [`source`](/commands/docs/source), [`use`](/commands/docs/use) and [`register`](/commands/docs/register). See [how nushell code gets run](how_nushell_code_gets_run) for a deeper explanation. They are declared using the `const` keyword ```nu const plugin = 'path/to/plugin' @@ -84,14 +88,14 @@ register $plugin Variable names in Nushell come with a few restrictions as to what characters they can contain. In particular, they cannot contain these characters: -``` +```nu . [ ( { + - * ^ / = ! < > & | ``` It is common for some scripts to declare variables that start with `$`. This is allowed, and it is equivalent to the `$` not being there at all. ```nu -> let $var = 42 +let $var = 42 # identical to `let var = 42` ``` @@ -100,14 +104,14 @@ It is common for some scripts to declare variables that start with `$`. This is A variable path works by reaching inside of the contents of a variable, navigating columns inside of it, to reach a final value. Let's say instead of `4`, we had assigned a table value: ```nu -> let my_value = [[name]; [testuser]] +let my_value = [[name]; [testuser]] ``` We can use a variable path to evaluate the variable `$my_value` and get the value from the `name` column in a single step: ```nu -> $my_value.name.0 -testuser +$my_value.name.0 +# testuser ``` Sometimes, we don't really know the contents of a variable. Accessing values as shown above can result in errors if the path used does not exist. To more robustly handle this, we can use the question mark operator to return `null` in case the path does not exist, instead of an error, then we would write custom logic to handle the `null`. @@ -115,33 +119,33 @@ Sometimes, we don't really know the contents of a variable. Accessing values as For example, here, if row `0` does not exist on `name`, then `null` is returned. Without the question mark operator, an error would have been raised instead ```nu -> let files = (ls) -> $files.name.0? +let files = (ls) +$files.name.0? ``` The question mark operator can be used to 'guard' any path ```nu -> let files = (ls) -> $files.name?.0? +let files = (ls) +$files.name?.0? ``` ## Subexpressions You can always evaluate a subexpression and use its result by wrapping the expression with parentheses `()`. Note that previous versions of Nushell (prior to 0.32) used `$()`. -The parentheses contain a pipeline that will run to completion, and the resulting value will then be used. For example, `(ls)` would run the [`ls`](/commands/docs/ls.md) command and give back the resulting table and `(git branch --show-current)` runs the external git command and returns a string with the name of the current branch. You can also use parentheses to run math expressions like `(2 + 3)`. +The parentheses contain a pipeline that will run to completion, and the resulting value will then be used. For example, `(ls)` would run the [`ls`](/commands/docs/ls) command and give back the resulting table and `(git branch --show-current)` runs the external git command and returns a string with the name of the current branch. You can also use parentheses to run math expressions like `(2 + 3)`. Subexpressions can also be pipelines and not just single commands. If we wanted to get a table of files larger than ten kilobytes, we could use a subexpression to run a pipeline and assign its result to a variable: ```nu -> let big_files = (ls | where size > 10kb) -> $big_files +let big_files = (ls | where size > 10kb) +$big_files ───┬────────────┬──────┬──────────┬────────────── # │ name │ type │ size │ modified ───┼────────────┼──────┼──────────┼────────────── 0 │ Cargo.lock │ File │ 155.3 KB │ 17 hours ago - 1 │ README.md │ File │ 15.9 KB │ 17 hours ago + 1 │ README │ File │ 15.9 KB │ 17 hours ago ───┴────────────┴──────┴──────────┴────────────── ``` @@ -150,31 +154,31 @@ Subexpressions can also be pipelines and not just single commands. If we wanted Subexpressions also support paths. For example, let's say we wanted to get a list of the filenames in the current directory. One way to do this is to use a pipeline: ```nu -> ls | get name +ls | get name ``` We can do a very similar action in a single step using a subexpression path: ```nu -> (ls).name +(ls).name ``` It depends on the needs of the code and your particular style which form works best for you. ## Short-hand subexpressions (row conditions) -Nushell supports accessing columns in a subexpression using a simple short-hand. You may have already used this functionality before. If, for example, we wanted to only see rows from [`ls`](/commands/docs/ls.md) where the entry is at least ten kilobytes we could write: +Nushell supports accessing columns in a subexpression using a simple short-hand. You may have already used this functionality before. If, for example, we wanted to only see rows from [`ls`](/commands/docs/ls) where the entry is at least ten kilobytes we could write: ```nu -> ls | where size > 10kb +ls | where size > 10kb ``` -The `where size > 10kb` is a command with two parts: the command name [`where`](/commands/docs/where.md) and the short-hand expression `size > 10kb`. We say short-hand because `size` here is the shortened version of writing `$it.size`. This could also be written in any of the following ways: +The `where size > 10kb` is a command with two parts: the command name [`where`](/commands/docs/where) and the short-hand expression `size > 10kb`. We say short-hand because `size` here is the shortened version of writing `$it.size`. This could also be written in any of the following ways: ```nu -> ls | where $it.size > 10kb -> ls | where ($it.size > 10kb) -> ls | where {|$x| $x.size > 10kb } +ls | where $it.size > 10kb +ls | where ($it.size > 10kb) +ls | where {|$x| $x.size > 10kb } ``` For the short-hand syntax to work, the column name must appear on the left-hand side of the operation (like `size` in `size > 10kb`). diff --git a/book/programming_in_nu.md b/src/content/docs/book/programming_in_nu.md similarity index 51% rename from book/programming_in_nu.md rename to src/content/docs/book/programming_in_nu.md index 0ebd7afb300..5aac36c7664 100644 --- a/book/programming_in_nu.md +++ b/src/content/docs/book/programming_in_nu.md @@ -1,30 +1,32 @@ -# Programming in Nu +--- +title: Programming in Nu +--- This chapter goes into more detail of Nushell as a programming language. Each major language feature has its own section. -Just like most programming languages allow you to define functions, Nushell uses [custom commands](custom_commands.md) for this purpose. +Just like most programming languages allow you to define functions, Nushell uses [custom commands](/book/custom_commands) for this purpose. -From other shells you might be used to [aliases](aliases.md). +From other shells you might be used to [aliases](/book/aliases). Nushell's aliases work in a similar way and are a part of the programming language, not just a shell feature. -Common operations can, such as addition or regex search, be done with [operators](operators.md). +Common operations can, such as addition or regex search, be done with [operators](/book/operators). Not all operations are supported for all data types and Nushell will make sure to let you know. -You can store intermediate results to [variables](variables_and_subexpressions.md) and immediately evaluate subroutines with [subexpressions](variables_and_subexpressions.html#subexpressions). +You can store intermediate results to [variables](/book/variables_and_subexpressions) and immediately evaluate subroutines with [subexpressions](/book/variables_and_subexpressions#subexpressions). The last three sections are aimed at organizing your code: -[Scripts](scripts.md) are the simplest form of code organization: You just put the code into a file and source it. +[Scripts](/book/scripts) are the simplest form of code organization: You just put the code into a file and source it. However, you can also run scripts as standalone programs with command line signatures using the "special" `main` command. -With [modules](modules.md), just like in many other programming languages, it is possible to compose your code from smaller pieces. +With [modules](/book/modules), just like in many other programming languages, it is possible to compose your code from smaller pieces. Modules let you define a public interface vs. private commands and you can import custom commands, aliases, and environment variables from them. -[Overlays](overlays.md) build on top of modules. +[Overlays](/book/overlays) build on top of modules. By defining an overlay, you bring in module's definitions into its own swappable "layer" that gets applied on top of other overlays. This enables features like activating virtual environments or overriding sets of default commands with custom variants. -The help message of some built-in commands shows a [signature](command_signature.md). You can take a look at it to get general rules how the command can be used. +The help message of some built-in commands shows a [signature](/book/command_signature). You can take a look at it to get general rules how the command can be used. -The standard library also has a [testing framework](testing.md) if you want to prove your reusable code works perfectly. +The standard library also has a [testing framework](/book/testing) if you want to prove your reusable code works perfectly. diff --git a/book/regular_expressions.md b/src/content/docs/book/regular_expressions.md similarity index 84% rename from book/regular_expressions.md rename to src/content/docs/book/regular_expressions.md index c96fb141633..799f4fbe9ff 100644 --- a/book/regular_expressions.md +++ b/src/content/docs/book/regular_expressions.md @@ -1,3 +1,5 @@ -# Regular expressions +--- +title: Regular expressions +--- Regular expressions in Nushell's commands are handled by the `rust-lang/regex` crate. If you want to know more, check the crate documentation: "[regex](https://github.com/rust-lang/regex)". diff --git a/src/content/docs/commands.mdx b/src/content/docs/commands.mdx new file mode 100644 index 00000000000..ee0f15b181d --- /dev/null +++ b/src/content/docs/commands.mdx @@ -0,0 +1,15 @@ +--- +title: Command Reference +author: Jonathan Turner +author_site: https://twitter.com/jntrnr +author_image: https://www.nushell.sh/blog/images/jonathandturner.jpg +description: Today, we're introducing a new shell, written in Rust. It draws inspiration from the classic Unix philosophy of pipelines, the structured data approach of PowerShell, functional programming, systems programming, and more. +--- + +If you're new to Nushell, [the quick tour](/book/quick_tour) can show you the most important commands. You don't need to know them all! + +To see all commands from inside Nushell, run [`help commands`](/commands/docs/help). + +import GetCommands from "../../components/GetCommands.astro"; + +<GetCommands /> diff --git a/commands/categories/bits.md b/src/content/docs/commands/categories/bits.md similarity index 96% rename from commands/categories/bits.md rename to src/content/docs/commands/categories/bits.md index a06f8010741..125e8a305fb 100644 --- a/commands/categories/bits.md +++ b/src/content/docs/commands/categories/bits.md @@ -1,4 +1,6 @@ -# Bits +--- +title: Bits +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/bytes.md b/src/content/docs/commands/categories/bytes.md similarity index 96% rename from commands/categories/bytes.md rename to src/content/docs/commands/categories/bytes.md index 1376a23642d..ae8c477c527 100644 --- a/commands/categories/bytes.md +++ b/src/content/docs/commands/categories/bytes.md @@ -1,4 +1,6 @@ -# Bytes +--- +title: Bytes +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/chart.md b/src/content/docs/commands/categories/chart.md similarity index 96% rename from commands/categories/chart.md rename to src/content/docs/commands/categories/chart.md index 3e7cd914ec2..abdb367c8f5 100644 --- a/commands/categories/chart.md +++ b/src/content/docs/commands/categories/chart.md @@ -1,4 +1,6 @@ -# Chart +--- +title: Chart +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/conversions.md b/src/content/docs/commands/categories/conversions.md similarity index 95% rename from commands/categories/conversions.md rename to src/content/docs/commands/categories/conversions.md index c74936edce1..aa404e9c9aa 100644 --- a/commands/categories/conversions.md +++ b/src/content/docs/commands/categories/conversions.md @@ -1,4 +1,6 @@ -# Conversions +--- +title: Conversions +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/core.md b/src/content/docs/commands/categories/core.md similarity index 96% rename from commands/categories/core.md rename to src/content/docs/commands/categories/core.md index 79a38ddb1ab..fc37fbe058c 100644 --- a/commands/categories/core.md +++ b/src/content/docs/commands/categories/core.md @@ -1,4 +1,6 @@ -# Core +--- +title: Core +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/database.md b/src/content/docs/commands/categories/database.md similarity index 96% rename from commands/categories/database.md rename to src/content/docs/commands/categories/database.md index cdb858219d1..5b7b7823600 100644 --- a/commands/categories/database.md +++ b/src/content/docs/commands/categories/database.md @@ -1,4 +1,6 @@ -# Database +--- +title: Database +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/dataframe.md b/src/content/docs/commands/categories/dataframe.md similarity index 96% rename from commands/categories/dataframe.md rename to src/content/docs/commands/categories/dataframe.md index 2944ec4da3b..24cdffc5cf7 100644 --- a/commands/categories/dataframe.md +++ b/src/content/docs/commands/categories/dataframe.md @@ -1,4 +1,6 @@ -# Dataframe +--- +title: DataFrame +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/dataframe_or_lazyframe.md b/src/content/docs/commands/categories/dataframe_or_lazyframe.md similarity index 94% rename from commands/categories/dataframe_or_lazyframe.md rename to src/content/docs/commands/categories/dataframe_or_lazyframe.md index 26efecdb7bd..1b554e849a2 100644 --- a/commands/categories/dataframe_or_lazyframe.md +++ b/src/content/docs/commands/categories/dataframe_or_lazyframe.md @@ -1,4 +1,6 @@ -# Dataframe Or Lazyframe +--- +title: Dataframe Or Lazyframe +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/date.md b/src/content/docs/commands/categories/date.md similarity index 96% rename from commands/categories/date.md rename to src/content/docs/commands/categories/date.md index d3459271a3d..bf55cc6f020 100644 --- a/commands/categories/date.md +++ b/src/content/docs/commands/categories/date.md @@ -1,4 +1,6 @@ -# Date +--- +title: Date +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/debug.md b/src/content/docs/commands/categories/debug.md similarity index 96% rename from commands/categories/debug.md rename to src/content/docs/commands/categories/debug.md index 0769590e1dd..14e16860823 100644 --- a/commands/categories/debug.md +++ b/src/content/docs/commands/categories/debug.md @@ -1,4 +1,6 @@ -# Debug +--- +title: Debug +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/default.md b/src/content/docs/commands/categories/default.md similarity index 96% rename from commands/categories/default.md rename to src/content/docs/commands/categories/default.md index 0be364cddb9..6f3e9fd0180 100644 --- a/commands/categories/default.md +++ b/src/content/docs/commands/categories/default.md @@ -1,4 +1,6 @@ -# Default +--- +title: Default +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/deprecated.md b/src/content/docs/commands/categories/deprecated.md similarity index 95% rename from commands/categories/deprecated.md rename to src/content/docs/commands/categories/deprecated.md index 4b84bb96793..e714fba5a4d 100644 --- a/commands/categories/deprecated.md +++ b/src/content/docs/commands/categories/deprecated.md @@ -1,4 +1,6 @@ -# Deprecated +--- +title: Deprecated +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/env.md b/src/content/docs/commands/categories/env.md similarity index 96% rename from commands/categories/env.md rename to src/content/docs/commands/categories/env.md index 50d84c1210c..a43925d567d 100644 --- a/commands/categories/env.md +++ b/src/content/docs/commands/categories/env.md @@ -1,4 +1,6 @@ -# Env +--- +title: Env +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/experimental.md b/src/content/docs/commands/categories/experimental.md similarity index 95% rename from commands/categories/experimental.md rename to src/content/docs/commands/categories/experimental.md index 28ee38f3876..0e7b067859e 100644 --- a/commands/categories/experimental.md +++ b/src/content/docs/commands/categories/experimental.md @@ -1,4 +1,6 @@ -# Experimental +--- +title: Experimental +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/expression.md b/src/content/docs/commands/categories/expression.md similarity index 95% rename from commands/categories/expression.md rename to src/content/docs/commands/categories/expression.md index b40dd3d0459..a8e7c701a2f 100644 --- a/commands/categories/expression.md +++ b/src/content/docs/commands/categories/expression.md @@ -1,4 +1,6 @@ -# Expression +--- +title: Expression +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/filesystem.md b/src/content/docs/commands/categories/filesystem.md similarity index 95% rename from commands/categories/filesystem.md rename to src/content/docs/commands/categories/filesystem.md index 58863466e76..6ebde9c80c8 100644 --- a/commands/categories/filesystem.md +++ b/src/content/docs/commands/categories/filesystem.md @@ -1,4 +1,6 @@ -# Filesystem +--- +title: Filesystem +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/filters.md b/src/content/docs/commands/categories/filters.md similarity index 96% rename from commands/categories/filters.md rename to src/content/docs/commands/categories/filters.md index 0eb06ff55ab..78d78d54230 100644 --- a/commands/categories/filters.md +++ b/src/content/docs/commands/categories/filters.md @@ -1,4 +1,6 @@ -# Filters +--- +title: Filters +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/formats.md b/src/content/docs/commands/categories/formats.md similarity index 96% rename from commands/categories/formats.md rename to src/content/docs/commands/categories/formats.md index eb343707654..c4e8c2f0283 100644 --- a/commands/categories/formats.md +++ b/src/content/docs/commands/categories/formats.md @@ -1,4 +1,6 @@ -# Formats +--- +title: Formats +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/generators.md b/src/content/docs/commands/categories/generators.md similarity index 95% rename from commands/categories/generators.md rename to src/content/docs/commands/categories/generators.md index 6d122a2cd8e..84e0323dc8d 100644 --- a/commands/categories/generators.md +++ b/src/content/docs/commands/categories/generators.md @@ -1,4 +1,6 @@ -# Generators +--- +title: Generators +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/hash.md b/src/content/docs/commands/categories/hash.md similarity index 96% rename from commands/categories/hash.md rename to src/content/docs/commands/categories/hash.md index c9c1a6c159f..06e2521e18d 100644 --- a/commands/categories/hash.md +++ b/src/content/docs/commands/categories/hash.md @@ -1,4 +1,6 @@ -# Hash +--- +title: Hash +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/history.md b/src/content/docs/commands/categories/history.md similarity index 96% rename from commands/categories/history.md rename to src/content/docs/commands/categories/history.md index 18d0c43208c..61672a782cc 100644 --- a/commands/categories/history.md +++ b/src/content/docs/commands/categories/history.md @@ -1,4 +1,6 @@ -# History +--- +title: History +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/lazyframe.md b/src/content/docs/commands/categories/lazyframe.md similarity index 96% rename from commands/categories/lazyframe.md rename to src/content/docs/commands/categories/lazyframe.md index d51e759c00a..112b4eb1e38 100644 --- a/commands/categories/lazyframe.md +++ b/src/content/docs/commands/categories/lazyframe.md @@ -1,4 +1,6 @@ -# Lazyframe +--- +title: Lazyframe +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/math.md b/src/content/docs/commands/categories/math.md similarity index 96% rename from commands/categories/math.md rename to src/content/docs/commands/categories/math.md index f60245a0aec..bab15682c46 100644 --- a/commands/categories/math.md +++ b/src/content/docs/commands/categories/math.md @@ -1,4 +1,6 @@ -# Math +--- +title: Math +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/misc.md b/src/content/docs/commands/categories/misc.md similarity index 96% rename from commands/categories/misc.md rename to src/content/docs/commands/categories/misc.md index 40262dfffe3..2abb4f7cc74 100644 --- a/commands/categories/misc.md +++ b/src/content/docs/commands/categories/misc.md @@ -1,4 +1,6 @@ -# Misc +--- +title: Misc +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/network.md b/src/content/docs/commands/categories/network.md similarity index 96% rename from commands/categories/network.md rename to src/content/docs/commands/categories/network.md index 85662d2cc57..1e522926ec7 100644 --- a/commands/categories/network.md +++ b/src/content/docs/commands/categories/network.md @@ -1,4 +1,6 @@ -# Network +--- +title: Network +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/path.md b/src/content/docs/commands/categories/path.md similarity index 96% rename from commands/categories/path.md rename to src/content/docs/commands/categories/path.md index d96e2f29721..65053b0f9ab 100644 --- a/commands/categories/path.md +++ b/src/content/docs/commands/categories/path.md @@ -1,4 +1,6 @@ -# Path +--- +title: Path +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/platform.md b/src/content/docs/commands/categories/platform.md similarity index 96% rename from commands/categories/platform.md rename to src/content/docs/commands/categories/platform.md index 4361ce7310a..371e69da5e6 100644 --- a/commands/categories/platform.md +++ b/src/content/docs/commands/categories/platform.md @@ -1,4 +1,6 @@ -# Platform +--- +title: Platform +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/prompt.md b/src/content/docs/commands/categories/prompt.md similarity index 96% rename from commands/categories/prompt.md rename to src/content/docs/commands/categories/prompt.md index c0a79510981..3129dfd8ad8 100644 --- a/commands/categories/prompt.md +++ b/src/content/docs/commands/categories/prompt.md @@ -1,4 +1,6 @@ -# Prompt +--- +title: Prompt +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/random.md b/src/content/docs/commands/categories/random.md similarity index 96% rename from commands/categories/random.md rename to src/content/docs/commands/categories/random.md index d63021c12b3..3b1a0da950c 100644 --- a/commands/categories/random.md +++ b/src/content/docs/commands/categories/random.md @@ -1,4 +1,6 @@ -# Random +--- +title: Random +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/removed.md b/src/content/docs/commands/categories/removed.md similarity index 96% rename from commands/categories/removed.md rename to src/content/docs/commands/categories/removed.md index bbb0c9095ba..143119919a7 100644 --- a/commands/categories/removed.md +++ b/src/content/docs/commands/categories/removed.md @@ -1,4 +1,6 @@ -# Removed +--- +title: Removed +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/shells.md b/src/content/docs/commands/categories/shells.md similarity index 96% rename from commands/categories/shells.md rename to src/content/docs/commands/categories/shells.md index 35c0de1b29b..54b430a4a56 100644 --- a/commands/categories/shells.md +++ b/src/content/docs/commands/categories/shells.md @@ -1,4 +1,6 @@ -# Shells +--- +title: Shells +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/strings.md b/src/content/docs/commands/categories/strings.md similarity index 96% rename from commands/categories/strings.md rename to src/content/docs/commands/categories/strings.md index 767219418f4..038c195ea51 100644 --- a/commands/categories/strings.md +++ b/src/content/docs/commands/categories/strings.md @@ -1,4 +1,6 @@ -# Strings +--- +title: Strings +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/system.md b/src/content/docs/commands/categories/system.md similarity index 96% rename from commands/categories/system.md rename to src/content/docs/commands/categories/system.md index 0e3c94ef8cd..48f7953d782 100644 --- a/commands/categories/system.md +++ b/src/content/docs/commands/categories/system.md @@ -1,4 +1,6 @@ -# System +--- +title: System +--- <script> import pages from '@temp/pages' diff --git a/commands/categories/viewers.md b/src/content/docs/commands/categories/viewers.md similarity index 96% rename from commands/categories/viewers.md rename to src/content/docs/commands/categories/viewers.md index 3791046aa3d..9190ecacc2c 100644 --- a/commands/categories/viewers.md +++ b/src/content/docs/commands/categories/viewers.md @@ -1,4 +1,6 @@ -# Viewers +--- +title: Viewers +--- <script> import pages from '@temp/pages' diff --git a/commands/docs/alias.md b/src/content/docs/commands/docs/alias.md similarity index 79% rename from commands/docs/alias.md rename to src/content/docs/commands/docs/alias.md index 40ad1f17cab..a4a689f8c86 100644 --- a/commands/docs/alias.md +++ b/src/content/docs/commands/docs/alias.md @@ -9,6 +9,7 @@ usage: | Alias a command (with optional flags) to a new name. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,13 +18,12 @@ feature: default ## Signature -```> alias {flags} (name) (initial_value)``` +`> alias {flags} (name) (initial_value)` ## Parameters - - `name`: Name of the alias. - - `initial_value`: Equals sign followed by value. - +- `name`: Name of the alias. +- `initial_value`: Equals sign followed by value. ## Input/output types: @@ -34,11 +34,13 @@ feature: default ## Examples Alias ll to ls -l + ```nu > alias ll = ls -l ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/all.md b/src/content/docs/commands/docs/all.md similarity index 88% rename from commands/docs/all.md rename to src/content/docs/commands/docs/all.md index 0ca3b08d125..5b97feb9c9a 100644 --- a/commands/docs/all.md +++ b/src/content/docs/commands/docs/all.md @@ -9,6 +9,7 @@ usage: | Test if every element of the input fulfills a predicate expression. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,40 +18,43 @@ feature: default ## Signature -```> all {flags} (predicate)``` +`> all {flags} (predicate)` ## Parameters - - `predicate`: A closure that must evaluate to a boolean. - +- `predicate`: A closure that must evaluate to a boolean. ## Input/output types: -| input | output | -| --------- | ------ | +| input | output | +| ----------- | ------ | | list\<any\> | bool | ## Examples Check if each row's status is the string 'UP' + ```nu > [[status]; [UP] [UP]] | all {|el| $el.status == UP } true ``` Check that each item is a string + ```nu > [foo bar 2 baz] | all {|| ($in | describe) == 'string' } false ``` Check that all values are equal to twice their index + ```nu > [0 2 4 6] | enumerate | all {|i| $i.item == $i.index * 2 } true ``` Check that all of the values are even, using a stored closure + ```nu > let cond = {|el| ($el mod 2) == 0 }; [2 4 6 8] | all $cond true diff --git a/commands/docs/ansi.md b/src/content/docs/commands/docs/ansi.md similarity index 84% rename from commands/docs/ansi.md rename to src/content/docs/commands/docs/ansi.md index 2bd5d726ee3..29d0dcbd545 100644 --- a/commands/docs/ansi.md +++ b/src/content/docs/commands/docs/ansi.md @@ -9,6 +9,7 @@ usage: | Output ANSI codes to change color and style of text. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for platform @@ -17,18 +18,17 @@ feature: default ## Signature -```> ansi {flags} (code)``` +`> ansi {flags} (code)` ## Flags - - `--escape, -e`: escape sequence without the escape character(s) ('\x1b[' is not required) - - `--osc, -o`: operating system command (osc) escape sequence without the escape character(s) ('\x1b]' is not required) - - `--list, -l`: list available ansi code names +- `--escape, -e`: escape sequence without the escape character(s) ('\x1b[' is not required) +- `--osc, -o`: operating system command (osc) escape sequence without the escape character(s) ('\x1b]' is not required) +- `--list, -l`: list available ansi code names ## Parameters - - `code`: The name of the code to use (from `ansi -l`). - +- `code`: The name of the code to use (from `ansi -l`). ## Input/output types: @@ -39,36 +39,42 @@ feature: default ## Examples Change color to green (see how the next example text will be green!) + ```nu > ansi green ``` Reset the color + ```nu > ansi reset ``` Use different colors and styles in the same text + ```nu > $'(ansi red_bold)Hello(ansi reset) (ansi green_dimmed)Nu(ansi reset) (ansi purple_italic)World(ansi reset)' Hello Nu World ``` The same example as above with short names + ```nu > $'(ansi rb)Hello(ansi reset) (ansi gd)Nu(ansi reset) (ansi pi)World(ansi reset)' Hello Nu World ``` Use escape codes, without the '\x1b[' + ```nu > $"(ansi --escape '3;93;41m')Hello(ansi reset)" # italic bright yellow on red background Hello ``` Use structured escape codes + ```nu > let bold_blue_on_red = { # `fg`, `bg`, `attr` are the acceptable keys, all other keys are considered invalid and will throw errors. fg: '#0000ff' @@ -80,6 +86,7 @@ Hello, Nu World! ``` ## Notes + ```text An introduction to what ANSI escape sequences are can be found in the ]8;;https://en.wikipedia.org/wiki/ANSI_escape_code\ANSI escape code]8;;\ Wikipedia page. @@ -143,8 +150,8 @@ Operating system commands: ## Subcommands: -| name | type | usage | -| -------------------------------------------------- | ------- | ------------------------------------------------------------------ | -| [`ansi gradient`](/commands/docs/ansi_gradient.md) | Builtin | Add a color gradient (using ANSI color codes) to the given string. | -| [`ansi link`](/commands/docs/ansi_link.md) | Builtin | Add a link (using OSC 8 escape sequence) to the given string. | -| [`ansi strip`](/commands/docs/ansi_strip.md) | Builtin | Strip ANSI escape sequences from a string. | \ No newline at end of file +| name | type | usage | +| ----------------------------------------------- | ------- | ------------------------------------------------------------------ | +| [`ansi gradient`](/commands/docs/ansi_gradient) | Builtin | Add a color gradient (using ANSI color codes) to the given string. | +| [`ansi link`](/commands/docs/ansi_link) | Builtin | Add a link (using OSC 8 escape sequence) to the given string. | +| [`ansi strip`](/commands/docs/ansi_strip) | Builtin | Strip ANSI escape sequences from a string. | diff --git a/commands/docs/ansi_gradient.md b/src/content/docs/commands/docs/ansi_gradient.md similarity index 65% rename from commands/docs/ansi_gradient.md rename to src/content/docs/commands/docs/ansi_gradient.md index 5141fe177ae..4d5250d06fa 100644 --- a/commands/docs/ansi_gradient.md +++ b/src/content/docs/commands/docs/ansi_gradient.md @@ -9,61 +9,66 @@ usage: | Add a color gradient (using ANSI color codes) to the given string. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for platform <div class='command-title'>{{ $frontmatter.platform }}</div> - -::: warning - Command `ansi gradient` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `ansi gradient` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> ansi gradient {flags} ...rest``` +`> ansi gradient {flags} ...rest` ## Flags - - `--fgstart, -a {string}`: foreground gradient start color in hex (0x123456) - - `--fgend, -b {string}`: foreground gradient end color in hex - - `--bgstart, -c {string}`: background gradient start color in hex - - `--bgend, -d {string}`: background gradient end color in hex +- `--fgstart, -a {string}`: foreground gradient start color in hex (0x123456) +- `--fgend, -b {string}`: foreground gradient end color in hex +- `--bgstart, -c {string}`: background gradient start color in hex +- `--bgend, -d {string}`: background gradient end color in hex ## Parameters - - `...rest`: for a data structure input, add a gradient to strings at the given cell paths - +- `...rest`: for a data structure input, add a gradient to strings at the given cell paths ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples draw text in a gradient with foreground start and end colors + ```nu > 'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart '0x40c9ff' --fgend '0xe81cff' ``` draw text in a gradient with foreground start and end colors and background start and end colors + ```nu > 'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart '0x40c9ff' --fgend '0xe81cff' --bgstart '0xe81cff' --bgend '0x40c9ff' ``` draw text in a gradient by specifying foreground start color - end color is assumed to be black + ```nu > 'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart '0x40c9ff' ``` draw text in a gradient by specifying foreground end color - start color is assumed to be black + ```nu > 'Hello, Nushell! This is a gradient.' | ansi gradient --fgend '0xe81cff' diff --git a/commands/docs/ansi_link.md b/src/content/docs/commands/docs/ansi_link.md similarity index 66% rename from commands/docs/ansi_link.md rename to src/content/docs/commands/docs/ansi_link.md index 2fcac80ad88..0aa5a6e5e25 100644 --- a/commands/docs/ansi_link.md +++ b/src/content/docs/commands/docs/ansi_link.md @@ -9,6 +9,7 @@ usage: | Add a link (using OSC 8 escape sequence) to the given string. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for platform @@ -17,41 +18,44 @@ feature: default ## Signature -```> ansi link {flags} ...rest``` +`> ansi link {flags} ...rest` ## Flags - - `--text, -t {string}`: Link text. Uses uri as text if absent. In case of - tables, records and lists applies this text to all elements +- `--text, -t {string}`: Link text. Uses uri as text if absent. In case of + tables, records and lists applies this text to all elements ## Parameters - - `...rest`: For a data structure input, add links to all strings at the given cell paths. - +- `...rest`: For a data structure input, add links to all strings at the given cell paths. ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples Create a link to open some file + ```nu > 'file:///file.txt' | ansi link --text 'Open Me!' Open Me! ``` Create a link without text + ```nu > 'https://www.nushell.sh/' | ansi link https://www.nushell.sh/ ``` Format a table column into links + ```nu > [[url text]; [https://example.com Text]] | ansi link url diff --git a/commands/docs/ansi_strip.md b/src/content/docs/commands/docs/ansi_strip.md similarity index 67% rename from commands/docs/ansi_strip.md rename to src/content/docs/commands/docs/ansi_strip.md index f5c8c50c9a1..b5d135f2638 100644 --- a/commands/docs/ansi_strip.md +++ b/src/content/docs/commands/docs/ansi_strip.md @@ -9,6 +9,7 @@ usage: | Strip ANSI escape sequences from a string. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for platform @@ -17,24 +18,25 @@ feature: default ## Signature -```> ansi strip {flags} ...rest``` +`> ansi strip {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, remove ANSI sequences from strings at the given cell paths. - +- `...rest`: For a data structure input, remove ANSI sequences from strings at the given cell paths. ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples Strip ANSI escape sequences from a string + ```nu > $'(ansi green)(ansi cursor_on)hello' | ansi strip hello diff --git a/commands/docs/any.md b/src/content/docs/commands/docs/any.md similarity index 88% rename from commands/docs/any.md rename to src/content/docs/commands/docs/any.md index 70640398710..29cab8d8493 100644 --- a/commands/docs/any.md +++ b/src/content/docs/commands/docs/any.md @@ -9,6 +9,7 @@ usage: | Tests if any element of the input fulfills a predicate expression. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,40 +18,43 @@ feature: default ## Signature -```> any {flags} (predicate)``` +`> any {flags} (predicate)` ## Parameters - - `predicate`: A closure that must evaluate to a boolean. - +- `predicate`: A closure that must evaluate to a boolean. ## Input/output types: -| input | output | -| --------- | ------ | +| input | output | +| ----------- | ------ | | list\<any\> | bool | ## Examples Check if any row's status is the string 'DOWN' + ```nu > [[status]; [UP] [DOWN] [UP]] | any {|el| $el.status == DOWN } true ``` Check that any item is a string + ```nu > [1 2 3 4] | any {|| ($in | describe) == 'string' } false ``` Check if any value is equal to twice its own index + ```nu > [9 8 7 6] | enumerate | any {|i| $i.item == $i.index * 2 } true ``` Check if any of the values are odd, using a stored closure + ```nu > let cond = {|e| $e mod 2 == 1 }; [2 4 1 6 8] | any $cond true diff --git a/commands/docs/append.md b/src/content/docs/commands/docs/append.md similarity index 93% rename from commands/docs/append.md rename to src/content/docs/commands/docs/append.md index 42b49f64a7a..d04e4d6efc0 100644 --- a/commands/docs/append.md +++ b/src/content/docs/commands/docs/append.md @@ -9,6 +9,7 @@ usage: | Append any number of rows to a table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,22 +18,22 @@ feature: default ## Signature -```> append {flags} (row)``` +`> append {flags} (row)` ## Parameters - - `row`: The row, list, or table to append. - +- `row`: The row, list, or table to append. ## Input/output types: -| input | output | -| ----- | --------- | +| input | output | +| ----- | ----------- | | any | list\<any\> | ## Examples Append one int to a list + ```nu > [0 1 2 3] | append 4 ╭───┬───╮ @@ -46,6 +47,7 @@ Append one int to a list ``` Append a list to an item + ```nu > 0 | append [1 2 3] ╭───┬───╮ @@ -58,6 +60,7 @@ Append a list to an item ``` Append a list of string to a string + ```nu > "a" | append ["b"] ╭───┬───╮ @@ -68,6 +71,7 @@ Append a list of string to a string ``` Append three int items + ```nu > [0 1] | append [2 3 4] ╭───┬───╮ @@ -81,6 +85,7 @@ Append three int items ``` Append ints and strings + ```nu > [0 1] | append [2 nu 4 shell] ╭───┬───────╮ @@ -95,6 +100,7 @@ Append ints and strings ``` Append a range of ints to a list + ```nu > [0 1] | append 2..4 ╭───┬───╮ @@ -108,7 +114,8 @@ Append a range of ints to a list ``` ## Notes + Be aware that this command 'unwraps' lists passed to it. So, if you pass a variable to it, and you want the variable's contents to be appended without being unwrapped, it's wise to pre-emptively wrap the variable in a list, like so: `append [$val]`. This way, `append` will -only unwrap the outer list, and leave the variable's contents untouched. \ No newline at end of file +only unwrap the outer list, and leave the variable's contents untouched. diff --git a/commands/docs/ast.md b/src/content/docs/commands/docs/ast.md similarity index 86% rename from commands/docs/ast.md rename to src/content/docs/commands/docs/ast.md index 0607b213685..1c8e7fa7990 100644 --- a/commands/docs/ast.md +++ b/src/content/docs/commands/docs/ast.md @@ -9,6 +9,7 @@ usage: | Print the abstract syntax tree (ast) for a pipeline. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for debug @@ -17,17 +18,16 @@ feature: default ## Signature -```> ast {flags} (pipeline)``` +`> ast {flags} (pipeline)` ## Flags - - `--json, -j`: serialize to json - - `--minify, -m`: minify the nuon or json output +- `--json, -j`: serialize to json +- `--minify, -m`: minify the nuon or json output ## Parameters - - `pipeline`: The pipeline to print the ast for. - +- `pipeline`: The pipeline to print the ast for. ## Input/output types: @@ -38,30 +38,35 @@ feature: default ## Examples Print the ast of a string + ```nu > ast 'hello' ``` Print the ast of a pipeline + ```nu > ast 'ls | where name =~ README' ``` Print the ast of a pipeline with an error + ```nu > ast 'for x in 1..10 { echo $x ' ``` Print the ast of a pipeline with an error, as json, in a nushell table + ```nu > ast 'for x in 1..10 { echo $x ' --json | get block | from json ``` Print the ast of a pipeline with an error, as json, minified + ```nu > ast 'for x in 1..10 { echo $x ' --json --minify diff --git a/src/content/docs/commands/docs/bits.md b/src/content/docs/commands/docs/bits.md new file mode 100644 index 00000000000..3a2856d43d8 --- /dev/null +++ b/src/content/docs/commands/docs/bits.md @@ -0,0 +1,48 @@ +--- +title: bits +categories: | + bits +version: 0.90.0 +bits: | + Various commands for working with bits. +usage: | + Various commands for working with bits. +feature: extra +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for bits + +<div class='command-title'>{{ $frontmatter.bits }}</div> + +:::caution[warning] +Command `bits` was not included in the official binaries by default, you have to build it with `--features=extra` flag +::: + +## Signature + +`> bits {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | type | usage | +| ------------------------------------- | ------- | -------------------------------------- | +| [`bits and`](/commands/docs/bits_and) | Builtin | Performs bitwise and for ints. | +| [`bits not`](/commands/docs/bits_not) | Builtin | Performs logical negation on each bit. | +| [`bits or`](/commands/docs/bits_or) | Builtin | Performs bitwise or for ints. | +| [`bits rol`](/commands/docs/bits_rol) | Builtin | Bitwise rotate left for ints. | +| [`bits ror`](/commands/docs/bits_ror) | Builtin | Bitwise rotate right for ints. | +| [`bits shl`](/commands/docs/bits_shl) | Builtin | Bitwise shift left for ints. | +| [`bits shr`](/commands/docs/bits_shr) | Builtin | Bitwise shift right for ints. | +| [`bits xor`](/commands/docs/bits_xor) | Builtin | Performs bitwise xor for ints. | diff --git a/commands/docs/bits_and.md b/src/content/docs/commands/docs/bits_and.md similarity index 70% rename from commands/docs/bits_and.md rename to src/content/docs/commands/docs/bits_and.md index 42e99df6bf0..c2ce335c408 100644 --- a/commands/docs/bits_and.md +++ b/src/content/docs/commands/docs/bits_and.md @@ -9,40 +9,43 @@ usage: | Performs bitwise and for ints. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bits <div class='command-title'>{{ $frontmatter.bits }}</div> - -::: warning - Command `bits and` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `bits and` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> bits and {flags} (target)``` +`> bits and {flags} (target)` ## Parameters - - `target`: target int to perform bit and - +- `target`: target int to perform bit and ## Input/output types: -| input | output | -| --------- | --------- | -| int | int | +| input | output | +| ----------- | ----------- | +| int | int | | list\<int\> | list\<int\> | + ## Examples Apply bits and to two numbers + ```nu > 2 | bits and 2 2 ``` Apply logical and to a list of numbers + ```nu > [4 3 2] | bits and 2 ╭───┬───╮ diff --git a/commands/docs/bits_not.md b/src/content/docs/commands/docs/bits_not.md similarity index 75% rename from commands/docs/bits_not.md rename to src/content/docs/commands/docs/bits_not.md index 7bc17062d0c..d317e80eb8b 100644 --- a/commands/docs/bits_not.md +++ b/src/content/docs/commands/docs/bits_not.md @@ -9,35 +9,37 @@ usage: | Performs logical negation on each bit. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bits <div class='command-title'>{{ $frontmatter.bits }}</div> - -::: warning - Command `bits not` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `bits not` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> bits not {flags} ``` +`> bits not {flags} ` ## Flags - - `--signed, -s`: always treat input number as a signed number - - `--number-bytes, -n {string}`: the size of unsigned number in bytes, it can be 1, 2, 4, 8, auto - +- `--signed, -s`: always treat input number as a signed number +- `--number-bytes, -n {string}`: the size of unsigned number in bytes, it can be 1, 2, 4, 8, auto ## Input/output types: -| input | output | -| --------- | --------- | -| int | int | +| input | output | +| ----------- | ----------- | +| int | int | | list\<int\> | list\<int\> | + ## Examples Apply logical negation to a list of numbers + ```nu > [4 3 2] | bits not ╭───┬─────────────────╮ @@ -49,6 +51,7 @@ Apply logical negation to a list of numbers ``` Apply logical negation to a list of numbers, treat input as 2 bytes number + ```nu > [4 3 2] | bits not --number-bytes '2' ╭───┬───────╮ @@ -60,6 +63,7 @@ Apply logical negation to a list of numbers, treat input as 2 bytes number ``` Apply logical negation to a list of numbers, treat input as signed number + ```nu > [4 3 2] | bits not --signed ╭───┬────╮ diff --git a/commands/docs/bits_or.md b/src/content/docs/commands/docs/bits_or.md similarity index 70% rename from commands/docs/bits_or.md rename to src/content/docs/commands/docs/bits_or.md index 15a54ac82a5..723154b5ee0 100644 --- a/commands/docs/bits_or.md +++ b/src/content/docs/commands/docs/bits_or.md @@ -9,40 +9,43 @@ usage: | Performs bitwise or for ints. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bits <div class='command-title'>{{ $frontmatter.bits }}</div> - -::: warning - Command `bits or` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `bits or` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> bits or {flags} (target)``` +`> bits or {flags} (target)` ## Parameters - - `target`: target int to perform bit or - +- `target`: target int to perform bit or ## Input/output types: -| input | output | -| --------- | --------- | -| int | int | +| input | output | +| ----------- | ----------- | +| int | int | | list\<int\> | list\<int\> | + ## Examples Apply bits or to two numbers + ```nu > 2 | bits or 6 6 ``` Apply logical or to a list of numbers + ```nu > [8 3 2] | bits or 2 ╭───┬────╮ diff --git a/commands/docs/bits_rol.md b/src/content/docs/commands/docs/bits_rol.md similarity index 61% rename from commands/docs/bits_rol.md rename to src/content/docs/commands/docs/bits_rol.md index 07d73af648b..90b0db6fd18 100644 --- a/commands/docs/bits_rol.md +++ b/src/content/docs/commands/docs/bits_rol.md @@ -9,45 +9,48 @@ usage: | Bitwise rotate left for ints. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bits <div class='command-title'>{{ $frontmatter.bits }}</div> - -::: warning - Command `bits rol` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `bits rol` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> bits rol {flags} (bits)``` +`> bits rol {flags} (bits)` ## Flags - - `--signed, -s`: always treat input number as a signed number - - `--number-bytes, -n {string}`: the word size in number of bytes, it can be 1, 2, 4, 8, auto, default value `8` +- `--signed, -s`: always treat input number as a signed number +- `--number-bytes, -n {string}`: the word size in number of bytes, it can be 1, 2, 4, 8, auto, default value `8` ## Parameters - - `bits`: number of bits to rotate left - +- `bits`: number of bits to rotate left ## Input/output types: -| input | output | -| --------- | --------- | -| int | int | +| input | output | +| ----------- | ----------- | +| int | int | | list\<int\> | list\<int\> | + ## Examples Rotate left a number with 2 bits + ```nu > 17 | bits rol 2 68 ``` Rotate left a list of numbers with 2 bits + ```nu > [5 3 2] | bits rol 2 ╭───┬────╮ diff --git a/commands/docs/bits_ror.md b/src/content/docs/commands/docs/bits_ror.md similarity index 62% rename from commands/docs/bits_ror.md rename to src/content/docs/commands/docs/bits_ror.md index 1a6e518d827..6714c381822 100644 --- a/commands/docs/bits_ror.md +++ b/src/content/docs/commands/docs/bits_ror.md @@ -9,45 +9,48 @@ usage: | Bitwise rotate right for ints. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bits <div class='command-title'>{{ $frontmatter.bits }}</div> - -::: warning - Command `bits ror` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `bits ror` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> bits ror {flags} (bits)``` +`> bits ror {flags} (bits)` ## Flags - - `--signed, -s`: always treat input number as a signed number - - `--number-bytes, -n {string}`: the word size in number of bytes, it can be 1, 2, 4, 8, auto, default value `8` +- `--signed, -s`: always treat input number as a signed number +- `--number-bytes, -n {string}`: the word size in number of bytes, it can be 1, 2, 4, 8, auto, default value `8` ## Parameters - - `bits`: number of bits to rotate right - +- `bits`: number of bits to rotate right ## Input/output types: -| input | output | -| --------- | --------- | -| int | int | +| input | output | +| ----------- | ----------- | +| int | int | | list\<int\> | list\<int\> | + ## Examples Rotate right a number with 60 bits + ```nu > 17 | bits ror 60 272 ``` Rotate right a list of numbers of one byte + ```nu > [15 33 92] | bits ror 2 --number-bytes '1' ╭───┬─────╮ diff --git a/commands/docs/bits_shl.md b/src/content/docs/commands/docs/bits_shl.md similarity index 65% rename from commands/docs/bits_shl.md rename to src/content/docs/commands/docs/bits_shl.md index 58fa43877ba..818ae691271 100644 --- a/commands/docs/bits_shl.md +++ b/src/content/docs/commands/docs/bits_shl.md @@ -9,57 +9,62 @@ usage: | Bitwise shift left for ints. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bits <div class='command-title'>{{ $frontmatter.bits }}</div> - -::: warning - Command `bits shl` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `bits shl` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> bits shl {flags} (bits)``` +`> bits shl {flags} (bits)` ## Flags - - `--signed, -s`: always treat input number as a signed number - - `--number-bytes, -n {string}`: the word size in number of bytes, it can be 1, 2, 4, 8, auto, default value `8` +- `--signed, -s`: always treat input number as a signed number +- `--number-bytes, -n {string}`: the word size in number of bytes, it can be 1, 2, 4, 8, auto, default value `8` ## Parameters - - `bits`: number of bits to shift left - +- `bits`: number of bits to shift left ## Input/output types: -| input | output | -| --------- | --------- | -| int | int | +| input | output | +| ----------- | ----------- | +| int | int | | list\<int\> | list\<int\> | + ## Examples Shift left a number by 7 bits + ```nu > 2 | bits shl 7 256 ``` Shift left a number with 1 byte by 7 bits + ```nu > 2 | bits shl 7 --number-bytes '1' 0 ``` Shift left a signed number by 1 bit + ```nu > 0x7F | bits shl 1 --signed 254 ``` Shift left a list of numbers + ```nu > [5 3 2] | bits shl 2 ╭───┬────╮ diff --git a/commands/docs/bits_shr.md b/src/content/docs/commands/docs/bits_shr.md similarity index 60% rename from commands/docs/bits_shr.md rename to src/content/docs/commands/docs/bits_shr.md index aab27d2066e..e6acc41d625 100644 --- a/commands/docs/bits_shr.md +++ b/src/content/docs/commands/docs/bits_shr.md @@ -9,45 +9,48 @@ usage: | Bitwise shift right for ints. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bits <div class='command-title'>{{ $frontmatter.bits }}</div> - -::: warning - Command `bits shr` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `bits shr` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> bits shr {flags} (bits)``` +`> bits shr {flags} (bits)` ## Flags - - `--signed, -s`: always treat input number as a signed number - - `--number-bytes, -n {string}`: the word size in number of bytes, it can be 1, 2, 4, 8, auto, default value `8` +- `--signed, -s`: always treat input number as a signed number +- `--number-bytes, -n {string}`: the word size in number of bytes, it can be 1, 2, 4, 8, auto, default value `8` ## Parameters - - `bits`: number of bits to shift right - +- `bits`: number of bits to shift right ## Input/output types: -| input | output | -| --------- | --------- | -| int | int | +| input | output | +| ----------- | ----------- | +| int | int | | list\<int\> | list\<int\> | + ## Examples Shift right a number with 2 bits + ```nu > 8 | bits shr 2 2 ``` Shift right a list of numbers + ```nu > [15 35 2] | bits shr 2 ╭───┬───╮ diff --git a/commands/docs/bits_xor.md b/src/content/docs/commands/docs/bits_xor.md similarity index 70% rename from commands/docs/bits_xor.md rename to src/content/docs/commands/docs/bits_xor.md index da62c8b4e2f..a23143b4bda 100644 --- a/commands/docs/bits_xor.md +++ b/src/content/docs/commands/docs/bits_xor.md @@ -9,40 +9,43 @@ usage: | Performs bitwise xor for ints. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bits <div class='command-title'>{{ $frontmatter.bits }}</div> - -::: warning - Command `bits xor` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `bits xor` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> bits xor {flags} (target)``` +`> bits xor {flags} (target)` ## Parameters - - `target`: target int to perform bit xor - +- `target`: target int to perform bit xor ## Input/output types: -| input | output | -| --------- | --------- | -| int | int | +| input | output | +| ----------- | ----------- | +| int | int | | list\<int\> | list\<int\> | + ## Examples Apply bits xor to two numbers + ```nu > 2 | bits xor 2 0 ``` Apply logical xor to a list of numbers + ```nu > [8 3 2] | bits xor 2 ╭───┬────╮ diff --git a/commands/docs/break.md b/src/content/docs/commands/docs/break.md similarity index 95% rename from commands/docs/break.md rename to src/content/docs/commands/docs/break.md index 7ff07ba49bb..63adb3124a7 100644 --- a/commands/docs/break.md +++ b/src/content/docs/commands/docs/break.md @@ -9,6 +9,7 @@ usage: | Break a loop. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,8 +18,7 @@ feature: default ## Signature -```> break {flags} ``` - +`> break {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Break out of a loop + ```nu > loop { break } diff --git a/src/content/docs/commands/docs/bytes.md b/src/content/docs/commands/docs/bytes.md new file mode 100644 index 00000000000..91bc20aed12 --- /dev/null +++ b/src/content/docs/commands/docs/bytes.md @@ -0,0 +1,47 @@ +--- +title: bytes +categories: | + bytes +version: 0.90.0 +bytes: | + Various commands for working with byte data. +usage: | + Various commands for working with byte data. +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for bytes + +<div class='command-title'>{{ $frontmatter.bytes }}</div> + +## Signature + +`> bytes {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | type | usage | +| ------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------ | +| [`bytes add`](/commands/docs/bytes_add) | Builtin | Add specified bytes to the input. | +| [`bytes at`](/commands/docs/bytes_at) | Builtin | Get bytes defined by a range. | +| [`bytes build`](/commands/docs/bytes_build) | Builtin | Create bytes from the arguments. | +| [`bytes collect`](/commands/docs/bytes_collect) | Builtin | Concatenate multiple binary into a single binary, with an optional separator between each. | +| [`bytes ends-with`](/commands/docs/bytes_ends-with) | Builtin | Check if bytes ends with a pattern. | +| [`bytes index-of`](/commands/docs/bytes_index-of) | Builtin | Returns start index of first occurrence of pattern in bytes, or -1 if no match. | +| [`bytes length`](/commands/docs/bytes_length) | Builtin | Output the length of any bytes in the pipeline. | +| [`bytes remove`](/commands/docs/bytes_remove) | Builtin | Remove bytes. | +| [`bytes replace`](/commands/docs/bytes_replace) | Builtin | Find and replace binary. | +| [`bytes reverse`](/commands/docs/bytes_reverse) | Builtin | Reverse the bytes in the pipeline. | +| [`bytes starts-with`](/commands/docs/bytes_starts-with) | Builtin | Check if bytes starts with a pattern. | diff --git a/commands/docs/bytes_add.md b/src/content/docs/commands/docs/bytes_add.md similarity index 78% rename from commands/docs/bytes_add.md rename to src/content/docs/commands/docs/bytes_add.md index 231fbc748d6..dc3ac7c345e 100644 --- a/commands/docs/bytes_add.md +++ b/src/content/docs/commands/docs/bytes_add.md @@ -9,6 +9,7 @@ usage: | Add specified bytes to the input. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bytes @@ -17,30 +18,31 @@ feature: default ## Signature -```> bytes add {flags} (data) ...rest``` +`> bytes add {flags} (data) ...rest` ## Flags - - `--index, -i {int}`: index to insert binary data - - `--end, -e`: add to the end of binary +- `--index, -i {int}`: index to insert binary data +- `--end, -e`: add to the end of binary ## Parameters - - `data`: The binary to add. - - `...rest`: For a data structure input, add bytes to the data at the given cell paths. - +- `data`: The binary to add. +- `...rest`: For a data structure input, add bytes to the data at the given cell paths. ## Input/output types: -| input | output | -| ------------ | ------------ | -| binary | binary | +| input | output | +| -------------- | -------------- | +| binary | binary | | list\<binary\> | list\<binary\> | -| record | record | -| table | table | +| record | record | +| table | table | + ## Examples Add bytes `0x[AA]` to `0x[1F FF AA AA]` + ```nu > 0x[1F FF AA AA] | bytes add 0x[AA] Length: 5 (0x5) bytes | printable whitespace ascii_other non_ascii @@ -49,6 +51,7 @@ Length: 5 (0x5) bytes | printable whitespace ascii_other non_ascii ``` Add bytes `0x[AA BB]` to `0x[1F FF AA AA]` at index 1 + ```nu > 0x[1F FF AA AA] | bytes add 0x[AA BB] --index 1 Length: 6 (0x6) bytes | printable whitespace ascii_other non_ascii @@ -57,6 +60,7 @@ Length: 6 (0x6) bytes | printable whitespace ascii_other non_ascii ``` Add bytes `0x[11]` to `0x[FF AA AA]` at the end + ```nu > 0x[FF AA AA] | bytes add 0x[11] --end Length: 4 (0x4) bytes | printable whitespace ascii_other non_ascii @@ -65,6 +69,7 @@ Length: 4 (0x4) bytes | printable whitespace ascii_other non_ascii ``` Add bytes `0x[11 22 33]` to `0x[FF AA AA]` at the end, at index 1(the index is start from end) + ```nu > 0x[FF AA BB] | bytes add 0x[11 22 33] --end --index 1 Length: 6 (0x6) bytes | printable whitespace ascii_other non_ascii diff --git a/commands/docs/bytes_at.md b/src/content/docs/commands/docs/bytes_at.md similarity index 86% rename from commands/docs/bytes_at.md rename to src/content/docs/commands/docs/bytes_at.md index c9a201faaa6..5c2ed54baec 100644 --- a/commands/docs/bytes_at.md +++ b/src/content/docs/commands/docs/bytes_at.md @@ -9,6 +9,7 @@ usage: | Get bytes defined by a range. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bytes @@ -17,25 +18,26 @@ feature: default ## Signature -```> bytes at {flags} (range) ...rest``` +`> bytes at {flags} (range) ...rest` ## Parameters - - `range`: The range to get bytes. - - `...rest`: For a data structure input, get bytes from data at the given cell paths. - +- `range`: The range to get bytes. +- `...rest`: For a data structure input, get bytes from data at the given cell paths. ## Input/output types: -| input | output | -| ------------ | ------------ | -| binary | binary | +| input | output | +| -------------- | -------------- | +| binary | binary | | list\<binary\> | list\<binary\> | -| record | record | -| table | table | +| record | record | +| table | table | + ## Examples Get a subbytes `0x[10 01]` from the bytes `0x[33 44 55 10 01 13]` + ```nu > 0x[33 44 55 10 01 13] | bytes at 3..<4 Length: 1 (0x1) bytes | printable whitespace ascii_other non_ascii @@ -44,6 +46,7 @@ Length: 1 (0x1) bytes | printable whitespace ascii_other non_ascii ``` Get a subbytes `0x[10 01 13]` from the bytes `0x[33 44 55 10 01 13]` + ```nu > 0x[33 44 55 10 01 13] | bytes at 3..6 Length: 3 (0x3) bytes | printable whitespace ascii_other non_ascii @@ -52,6 +55,7 @@ Length: 3 (0x3) bytes | printable whitespace ascii_other non_ascii ``` Get the remaining characters from a starting index + ```nu > { data: 0x[33 44 55 10 01 13] } | bytes at 3.. data ╭──────┬─────────────╮ @@ -60,6 +64,7 @@ Get the remaining characters from a starting index ``` Get the characters from the beginning until ending index + ```nu > 0x[33 44 55 10 01 13] | bytes at ..<4 Length: 4 (0x4) bytes | printable whitespace ascii_other non_ascii @@ -68,6 +73,7 @@ Length: 4 (0x4) bytes | printable whitespace ascii_other non_ascii ``` Or the characters from the beginning until ending index inside a table + ```nu > [[ColA ColB ColC]; [0x[11 12 13] 0x[14 15 16] 0x[17 18 19]]] | bytes at 1.. ColB ColC ╭───┬──────────────┬──────────┬──────────╮ diff --git a/commands/docs/bytes_build.md b/src/content/docs/commands/docs/bytes_build.md similarity index 92% rename from commands/docs/bytes_build.md rename to src/content/docs/commands/docs/bytes_build.md index 56ab9015fbb..e0fdf9197d1 100644 --- a/commands/docs/bytes_build.md +++ b/src/content/docs/commands/docs/bytes_build.md @@ -9,6 +9,7 @@ usage: | Create bytes from the arguments. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bytes @@ -17,12 +18,11 @@ feature: default ## Signature -```> bytes build {flags} ...rest``` +`> bytes build {flags} ...rest` ## Parameters - - `...rest`: List of bytes. - +- `...rest`: List of bytes. ## Input/output types: @@ -33,6 +33,7 @@ feature: default ## Examples Builds binary data from 0x[01 02], 0x[03], 0x[04] + ```nu > bytes build 0x[01 02] 0x[03] 0x[04] Length: 4 (0x4) bytes | printable whitespace ascii_other non_ascii diff --git a/commands/docs/bytes_collect.md b/src/content/docs/commands/docs/bytes_collect.md similarity index 87% rename from commands/docs/bytes_collect.md rename to src/content/docs/commands/docs/bytes_collect.md index aebd06f1a78..e398091ed70 100644 --- a/commands/docs/bytes_collect.md +++ b/src/content/docs/commands/docs/bytes_collect.md @@ -9,6 +9,7 @@ usage: | Concatenate multiple binary into a single binary, with an optional separator between each. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bytes @@ -17,22 +18,22 @@ feature: default ## Signature -```> bytes collect {flags} (separator)``` +`> bytes collect {flags} (separator)` ## Parameters - - `separator`: Optional separator to use when creating binary. - +- `separator`: Optional separator to use when creating binary. ## Input/output types: -| input | output | -| ------------ | ------ | +| input | output | +| -------------- | ------ | | list\<binary\> | binary | ## Examples Create a byte array from input + ```nu > [0x[11] 0x[13 15]] | bytes collect Length: 3 (0x3) bytes | printable whitespace ascii_other non_ascii @@ -41,6 +42,7 @@ Length: 3 (0x3) bytes | printable whitespace ascii_other non_ascii ``` Create a byte array from input with a separator + ```nu > [0x[11] 0x[33] 0x[44]] | bytes collect 0x[01] Length: 5 (0x5) bytes | printable whitespace ascii_other non_ascii diff --git a/commands/docs/bytes_ends-with.md b/src/content/docs/commands/docs/bytes_ends-with.md similarity index 82% rename from commands/docs/bytes_ends-with.md rename to src/content/docs/commands/docs/bytes_ends-with.md index 191bac84725..eca14b9cb91 100644 --- a/commands/docs/bytes_ends-with.md +++ b/src/content/docs/commands/docs/bytes_ends-with.md @@ -9,6 +9,7 @@ usage: | Check if bytes ends with a pattern. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bytes @@ -17,13 +18,12 @@ feature: default ## Signature -```> bytes ends-with {flags} (pattern) ...rest``` +`> bytes ends-with {flags} (pattern) ...rest` ## Parameters - - `pattern`: The pattern to match. - - `...rest`: For a data structure input, check if bytes at the given cell paths end with the pattern. - +- `pattern`: The pattern to match. +- `...rest`: For a data structure input, check if bytes at the given cell paths end with the pattern. ## Input/output types: @@ -32,21 +32,25 @@ feature: default | binary | bool | | record | record | | table | table | + ## Examples Checks if binary ends with `0x[AA]` + ```nu > 0x[1F FF AA AA] | bytes ends-with 0x[AA] true ``` Checks if binary ends with `0x[FF AA AA]` + ```nu > 0x[1F FF AA AA] | bytes ends-with 0x[FF AA AA] true ``` Checks if binary ends with `0x[11]` + ```nu > 0x[1F FF AA AA] | bytes ends-with 0x[11] false diff --git a/commands/docs/bytes_index-of.md b/src/content/docs/commands/docs/bytes_index-of.md similarity index 87% rename from commands/docs/bytes_index-of.md rename to src/content/docs/commands/docs/bytes_index-of.md index 6e924df2c55..7f16be2eca4 100644 --- a/commands/docs/bytes_index-of.md +++ b/src/content/docs/commands/docs/bytes_index-of.md @@ -9,6 +9,7 @@ usage: | Returns start index of first occurrence of pattern in bytes, or -1 if no match. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bytes @@ -17,18 +18,17 @@ feature: default ## Signature -```> bytes index-of {flags} (pattern) ...rest``` +`> bytes index-of {flags} (pattern) ...rest` ## Flags - - `--all, -a`: returns all matched index - - `--end, -e`: search from the end of the binary +- `--all, -a`: returns all matched index +- `--end, -e`: search from the end of the binary ## Parameters - - `pattern`: The pattern to find index of. - - `...rest`: For a data structure input, find the indexes at the given cell paths. - +- `pattern`: The pattern to find index of. +- `...rest`: For a data structure input, find the indexes at the given cell paths. ## Input/output types: @@ -37,21 +37,25 @@ feature: default | binary | any | | record | record | | table | table | + ## Examples Returns index of pattern in bytes + ```nu > 0x[33 44 55 10 01 13 44 55] | bytes index-of 0x[44 55] 1 ``` Returns index of pattern, search from end + ```nu > 0x[33 44 55 10 01 13 44 55] | bytes index-of --end 0x[44 55] 6 ``` Returns all matched index + ```nu > 0x[33 44 55 10 01 33 44 33 44] | bytes index-of --all 0x[33 44] ╭───┬───╮ @@ -63,6 +67,7 @@ Returns all matched index ``` Returns all matched index, searching from end + ```nu > 0x[33 44 55 10 01 33 44 33 44] | bytes index-of --all --end 0x[33 44] ╭───┬───╮ @@ -74,6 +79,7 @@ Returns all matched index, searching from end ``` Returns index of pattern for specific column + ```nu > [[ColA ColB ColC]; [0x[11 12 13] 0x[14 15 16] 0x[17 18 19]]] | bytes index-of 0x[11] ColA ColC ╭───┬──────┬──────────────┬──────╮ diff --git a/commands/docs/bytes_length.md b/src/content/docs/commands/docs/bytes_length.md similarity index 73% rename from commands/docs/bytes_length.md rename to src/content/docs/commands/docs/bytes_length.md index c8f84c92ecd..8d3bfa6ac0a 100644 --- a/commands/docs/bytes_length.md +++ b/src/content/docs/commands/docs/bytes_length.md @@ -9,6 +9,7 @@ usage: | Output the length of any bytes in the pipeline. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bytes @@ -17,30 +18,32 @@ feature: default ## Signature -```> bytes length {flags} ...rest``` +`> bytes length {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, find the length of data at the given cell paths. - +- `...rest`: For a data structure input, find the length of data at the given cell paths. ## Input/output types: -| input | output | -| ------------ | --------- | -| binary | int | +| input | output | +| -------------- | ----------- | +| binary | int | | list\<binary\> | list\<int\> | -| record | record | -| table | table | +| record | record | +| table | table | + ## Examples Return the length of a binary + ```nu > 0x[1F FF AA AB] | bytes length 4 ``` Return the lengths of multiple binaries + ```nu > [0x[1F FF AA AB] 0x[1F]] | bytes length ╭───┬───╮ diff --git a/commands/docs/bytes_remove.md b/src/content/docs/commands/docs/bytes_remove.md similarity index 89% rename from commands/docs/bytes_remove.md rename to src/content/docs/commands/docs/bytes_remove.md index fadd7fddec1..f501d7d4386 100644 --- a/commands/docs/bytes_remove.md +++ b/src/content/docs/commands/docs/bytes_remove.md @@ -9,6 +9,7 @@ usage: | Remove bytes. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bytes @@ -17,18 +18,17 @@ feature: default ## Signature -```> bytes remove {flags} (pattern) ...rest``` +`> bytes remove {flags} (pattern) ...rest` ## Flags - - `--end, -e`: remove from end of binary - - `--all, -a`: remove occurrences of finding binary +- `--end, -e`: remove from end of binary +- `--all, -a`: remove occurrences of finding binary ## Parameters - - `pattern`: The pattern to find. - - `...rest`: For a data structure input, remove bytes from data at the given cell paths. - +- `pattern`: The pattern to find. +- `...rest`: For a data structure input, remove bytes from data at the given cell paths. ## Input/output types: @@ -37,9 +37,11 @@ feature: default | binary | binary | | record | record | | table | table | + ## Examples Remove contents + ```nu > 0x[10 AA FF AA FF] | bytes remove 0x[10 AA] Length: 3 (0x3) bytes | printable whitespace ascii_other non_ascii @@ -48,6 +50,7 @@ Length: 3 (0x3) bytes | printable whitespace ascii_other non_ascii ``` Remove all occurrences of find binary in record field + ```nu > { data: 0x[10 AA 10 BB 10] } | bytes remove --all 0x[10] data ╭──────┬────────────╮ @@ -56,6 +59,7 @@ Remove all occurrences of find binary in record field ``` Remove occurrences of find binary from end + ```nu > 0x[10 AA 10 BB CC AA 10] | bytes remove --end 0x[10] Length: 6 (0x6) bytes | printable whitespace ascii_other non_ascii @@ -64,6 +68,7 @@ Length: 6 (0x6) bytes | printable whitespace ascii_other non_ascii ``` Remove find binary from end not found + ```nu > 0x[10 AA 10 BB CC AA 10] | bytes remove --end 0x[11] Length: 7 (0x7) bytes | printable whitespace ascii_other non_ascii @@ -72,6 +77,7 @@ Length: 7 (0x7) bytes | printable whitespace ascii_other non_ascii ``` Remove all occurrences of find binary in table + ```nu > [[ColA ColB ColC]; [0x[11 12 13] 0x[14 15 16] 0x[17 18 19]]] | bytes remove 0x[11] ColA ColC ╭───┬──────────┬──────────────┬──────────────╮ diff --git a/commands/docs/bytes_replace.md b/src/content/docs/commands/docs/bytes_replace.md similarity index 86% rename from commands/docs/bytes_replace.md rename to src/content/docs/commands/docs/bytes_replace.md index d35906f897a..27bd492bacc 100644 --- a/commands/docs/bytes_replace.md +++ b/src/content/docs/commands/docs/bytes_replace.md @@ -9,6 +9,7 @@ usage: | Find and replace binary. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bytes @@ -17,18 +18,17 @@ feature: default ## Signature -```> bytes replace {flags} (find) (replace) ...rest``` +`> bytes replace {flags} (find) (replace) ...rest` ## Flags - - `--all, -a`: replace all occurrences of find binary +- `--all, -a`: replace all occurrences of find binary ## Parameters - - `find`: The pattern to find. - - `replace`: The replacement pattern. - - `...rest`: For a data structure input, replace bytes in data at the given cell paths. - +- `find`: The pattern to find. +- `replace`: The replacement pattern. +- `...rest`: For a data structure input, replace bytes in data at the given cell paths. ## Input/output types: @@ -37,9 +37,11 @@ feature: default | binary | binary | | record | record | | table | table | + ## Examples Find and replace contents + ```nu > 0x[10 AA FF AA FF] | bytes replace 0x[10 AA] 0x[FF] Length: 4 (0x4) bytes | printable whitespace ascii_other non_ascii @@ -48,6 +50,7 @@ Length: 4 (0x4) bytes | printable whitespace ascii_other non_ascii ``` Find and replace all occurrences of find binary + ```nu > 0x[10 AA 10 BB 10] | bytes replace --all 0x[10] 0x[A0] Length: 5 (0x5) bytes | printable whitespace ascii_other non_ascii @@ -56,6 +59,7 @@ Length: 5 (0x5) bytes | printable whitespace ascii_other non_ascii ``` Find and replace all occurrences of find binary in table + ```nu > [[ColA ColB ColC]; [0x[11 12 13] 0x[14 15 16] 0x[17 18 19]]] | bytes replace --all 0x[11] 0x[13] ColA ColC ╭───┬──────────────┬──────────────┬──────────────╮ diff --git a/commands/docs/bytes_reverse.md b/src/content/docs/commands/docs/bytes_reverse.md similarity index 89% rename from commands/docs/bytes_reverse.md rename to src/content/docs/commands/docs/bytes_reverse.md index ef076c5be6f..393e6c08f44 100644 --- a/commands/docs/bytes_reverse.md +++ b/src/content/docs/commands/docs/bytes_reverse.md @@ -9,6 +9,7 @@ usage: | Reverse the bytes in the pipeline. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bytes @@ -17,12 +18,11 @@ feature: default ## Signature -```> bytes reverse {flags} ...rest``` +`> bytes reverse {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, reverse data at the given cell paths. - +- `...rest`: For a data structure input, reverse data at the given cell paths. ## Input/output types: @@ -31,9 +31,11 @@ feature: default | binary | binary | | record | record | | table | table | + ## Examples Reverse bytes `0x[1F FF AA AA]` + ```nu > 0x[1F FF AA AA] | bytes reverse Length: 4 (0x4) bytes | printable whitespace ascii_other non_ascii @@ -42,6 +44,7 @@ Length: 4 (0x4) bytes | printable whitespace ascii_other non_ascii ``` Reverse bytes `0x[FF AA AA]` + ```nu > 0x[FF AA AA] | bytes reverse Length: 3 (0x3) bytes | printable whitespace ascii_other non_ascii diff --git a/commands/docs/bytes_starts-with.md b/src/content/docs/commands/docs/bytes_starts-with.md similarity index 82% rename from commands/docs/bytes_starts-with.md rename to src/content/docs/commands/docs/bytes_starts-with.md index 1a14fdbec80..386c2d259d2 100644 --- a/commands/docs/bytes_starts-with.md +++ b/src/content/docs/commands/docs/bytes_starts-with.md @@ -9,6 +9,7 @@ usage: | Check if bytes starts with a pattern. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for bytes @@ -17,13 +18,12 @@ feature: default ## Signature -```> bytes starts-with {flags} (pattern) ...rest``` +`> bytes starts-with {flags} (pattern) ...rest` ## Parameters - - `pattern`: The pattern to match. - - `...rest`: For a data structure input, check if bytes at the given cell paths start with the pattern. - +- `pattern`: The pattern to match. +- `...rest`: For a data structure input, check if bytes at the given cell paths start with the pattern. ## Input/output types: @@ -32,21 +32,25 @@ feature: default | binary | bool | | record | record | | table | table | + ## Examples Checks if binary starts with `0x[1F FF AA]` + ```nu > 0x[1F FF AA AA] | bytes starts-with 0x[1F FF AA] true ``` Checks if binary starts with `0x[1F]` + ```nu > 0x[1F FF AA AA] | bytes starts-with 0x[1F] true ``` Checks if binary starts with `0x[1F]` + ```nu > 0x[1F FF AA AA] | bytes starts-with 0x[11] false diff --git a/commands/docs/cal.md b/src/content/docs/commands/docs/cal.md similarity index 63% rename from commands/docs/cal.md rename to src/content/docs/commands/docs/cal.md index 772d70ee388..3676caa4e59 100644 --- a/commands/docs/cal.md +++ b/src/content/docs/commands/docs/cal.md @@ -9,6 +9,7 @@ usage: | Display a calendar. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for generators @@ -17,17 +18,16 @@ feature: default ## Signature -```> cal {flags} ``` +`> cal {flags} ` ## Flags - - `--year, -y`: Display the year column - - `--quarter, -q`: Display the quarter column - - `--month, -m`: Display the month column - - `--full-year, - {int}`: Display a year-long calendar for the specified year - - `--week-start, - {string}`: Display the calendar with the specified day as the first day of the week - - `--month-names, -`: Display the month names instead of integers - +- `--year, -y`: Display the year column +- `--quarter, -q`: Display the quarter column +- `--month, -m`: Display the month column +- `--full-year, - {int}`: Display a year-long calendar for the specified year +- `--week-start, - {string}`: Display the calendar with the specified day as the first day of the week +- `--month-names, -`: Display the month names instead of integers ## Input/output types: @@ -38,18 +38,21 @@ feature: default ## Examples This month's calendar + ```nu > cal ``` The calendar for all of 2012 + ```nu > cal --full-year 2012 ``` This month's calendar with the week starting on monday + ```nu > cal --week-start monday diff --git a/commands/docs/cd.md b/src/content/docs/commands/docs/cd.md similarity index 91% rename from commands/docs/cd.md rename to src/content/docs/commands/docs/cd.md index 340a6afd2ce..b41360c619e 100644 --- a/commands/docs/cd.md +++ b/src/content/docs/commands/docs/cd.md @@ -9,6 +9,7 @@ usage: | Change directory. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filesystem @@ -17,12 +18,11 @@ feature: default ## Signature -```> cd {flags} (path)``` +`> cd {flags} (path)` ## Parameters - - `path`: The path to change to. - +- `path`: The path to change to. ## Input/output types: @@ -30,15 +30,18 @@ feature: default | ------- | ------- | | nothing | nothing | | string | nothing | + ## Examples Change to your home directory + ```nu > cd ~ ``` Change to the previous working directory ($OLDPWD) + ```nu > cd - diff --git a/commands/docs/char.md b/src/content/docs/commands/docs/char.md similarity index 78% rename from commands/docs/char.md rename to src/content/docs/commands/docs/char.md index 6494ba05f85..fa76a12ef0e 100644 --- a/commands/docs/char.md +++ b/src/content/docs/commands/docs/char.md @@ -9,6 +9,7 @@ usage: | Output special characters (e.g., 'newline'). feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,19 +18,18 @@ feature: default ## Signature -```> char {flags} (character) ...rest``` +`> char {flags} (character) ...rest` ## Flags - - `--list, -l`: List all supported character names - - `--unicode, -u`: Unicode string i.e. 1f378 - - `--integer, -i`: Create a codepoint from an integer +- `--list, -l`: List all supported character names +- `--unicode, -u`: Unicode string i.e. 1f378 +- `--integer, -i`: Create a codepoint from an integer ## Parameters - - `character`: The name of the character to output. - - `...rest`: Multiple Unicode bytes. - +- `character`: The name of the character to output. +- `...rest`: Multiple Unicode bytes. ## Input/output types: @@ -40,6 +40,7 @@ feature: default ## Examples Output newline + ```nu > char newline @@ -47,12 +48,14 @@ Output newline ``` List available characters + ```nu > char --list ``` Output prompt character, newline and a hamburger menu character + ```nu > (char prompt) + (char newline) + (char hamburger) ▶ @@ -60,18 +63,21 @@ Output prompt character, newline and a hamburger menu character ``` Output Unicode character + ```nu > char --unicode 1f378 🍸 ``` Create Unicode from integer codepoint values + ```nu > char --integer (0x60 + 1) (0x60 + 2) ab ``` Output multi-byte Unicode character + ```nu > char --unicode 1F468 200D 1F466 200D 1F466 👨👦👦 diff --git a/commands/docs/clear.md b/src/content/docs/commands/docs/clear.md similarity index 95% rename from commands/docs/clear.md rename to src/content/docs/commands/docs/clear.md index 3d5a4c69d15..edeb74b6f48 100644 --- a/commands/docs/clear.md +++ b/src/content/docs/commands/docs/clear.md @@ -9,6 +9,7 @@ usage: | Clear the terminal. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for platform @@ -17,8 +18,7 @@ feature: default ## Signature -```> clear {flags} ``` - +`> clear {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Clear the terminal + ```nu > clear diff --git a/commands/docs/collect.md b/src/content/docs/commands/docs/collect.md similarity index 79% rename from commands/docs/collect.md rename to src/content/docs/commands/docs/collect.md index e2f52439d60..b733a03526a 100644 --- a/commands/docs/collect.md +++ b/src/content/docs/commands/docs/collect.md @@ -9,6 +9,7 @@ usage: | Collect the stream and pass it to a block. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,16 +18,15 @@ feature: default ## Signature -```> collect {flags} (closure)``` +`> collect {flags} (closure)` ## Flags - - `--keep-env, -`: let the block affect environment variables +- `--keep-env, -`: let the block affect environment variables ## Parameters - - `closure`: The closure to run once the stream is collected. - +- `closure`: The closure to run once the stream is collected. ## Input/output types: @@ -37,6 +37,7 @@ feature: default ## Examples Use the second value in the stream + ```nu > [1 2 3] | collect { |x| $x.1 } 2 diff --git a/commands/docs/columns.md b/src/content/docs/commands/docs/columns.md similarity index 93% rename from commands/docs/columns.md rename to src/content/docs/commands/docs/columns.md index d81ffb3c271..083486f8442 100644 --- a/commands/docs/columns.md +++ b/src/content/docs/commands/docs/columns.md @@ -9,6 +9,7 @@ usage: | Given a record or table, produce a list of its columns' names. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,18 +18,19 @@ feature: default ## Signature -```> columns {flags} ``` - +`> columns {flags} ` ## Input/output types: -| input | output | -| ------ | ------------ | +| input | output | +| ------ | -------------- | | record | list\<string\> | | table | list\<string\> | + ## Examples Get the columns from the record + ```nu > { acronym:PWD, meaning:'Print Working Directory' } | columns ╭───┬─────────╮ @@ -39,6 +41,7 @@ Get the columns from the record ``` Get the columns from the table + ```nu > [[name,age,grade]; [bill,20,a]] | columns ╭───┬───────╮ @@ -50,16 +53,19 @@ Get the columns from the table ``` Get the first column from the table + ```nu > [[name,age,grade]; [bill,20,a]] | columns | first ``` Get the second column from the table + ```nu > [[name,age,grade]; [bill,20,a]] | columns | select 1 ``` ## Notes -This is a counterpart to `values`, which produces a list of columns' values. \ No newline at end of file + +This is a counterpart to `values`, which produces a list of columns' values. diff --git a/commands/docs/commandline.md b/src/content/docs/commands/docs/commandline.md similarity index 55% rename from commands/docs/commandline.md rename to src/content/docs/commands/docs/commandline.md index 8994ea3b427..ebb9093a4ed 100644 --- a/commands/docs/commandline.md +++ b/src/content/docs/commands/docs/commandline.md @@ -9,6 +9,7 @@ usage: | View or modify the current command line input buffer. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,24 +18,23 @@ feature: default ## Signature -```> commandline {flags} (cmd)``` +`> commandline {flags} (cmd)` ## Flags - - `--cursor, -c`: Set or get the current cursor position - - `--cursor-end, -e`: Set the current cursor position to the end of the buffer - - `--append, -a`: appends the string to the end of the buffer - - `--insert, -i`: inserts the string into the buffer at the cursor position - - `--replace, -r`: replaces the current contents of the buffer (default) +- `--cursor, -c`: Set or get the current cursor position +- `--cursor-end, -e`: Set the current cursor position to the end of the buffer +- `--append, -a`: appends the string to the end of the buffer +- `--insert, -i`: inserts the string into the buffer at the cursor position +- `--replace, -r`: replaces the current contents of the buffer (default) ## Parameters - - `cmd`: the string to perform the operation with - +- `cmd`: the string to perform the operation with ## Input/output types: | input | output | | ------- | ------- | | nothing | nothing | -| string | string | \ No newline at end of file +| string | string | diff --git a/commands/docs/compact.md b/src/content/docs/commands/docs/compact.md similarity index 88% rename from commands/docs/compact.md rename to src/content/docs/commands/docs/compact.md index 98f5fd00a30..6e00e4d6539 100644 --- a/commands/docs/compact.md +++ b/src/content/docs/commands/docs/compact.md @@ -9,6 +9,7 @@ usage: | Creates a table with non-empty rows. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,26 +18,26 @@ feature: default ## Signature -```> compact {flags} ...rest``` +`> compact {flags} ...rest` ## Flags - - `--empty, -e`: also compact empty items like "", {}, and [] +- `--empty, -e`: also compact empty items like "", {}, and [] ## Parameters - - `...rest`: The columns to compact from the table. - +- `...rest`: The columns to compact from the table. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | ## Examples Filter out all records where 'Hello' is null + ```nu > [["Hello" "World"]; [null 3]] | compact Hello ╭────────────╮ @@ -45,6 +46,7 @@ Filter out all records where 'Hello' is null ``` Filter out all records where 'World' is null + ```nu > [["Hello" "World"]; [null 3]] | compact World ╭───┬───────┬───────╮ @@ -56,6 +58,7 @@ Filter out all records where 'World' is null ``` Filter out all instances of null from a list + ```nu > [1, null, 2] | compact ╭───┬───╮ @@ -66,6 +69,7 @@ Filter out all instances of null from a list ``` Filter out all instances of null and empty items from a list + ```nu > [1, null, 2, "", 3, [], 4, {}, 5] | compact --empty ╭───┬───╮ diff --git a/commands/docs/complete.md b/src/content/docs/commands/docs/complete.md similarity index 92% rename from commands/docs/complete.md rename to src/content/docs/commands/docs/complete.md index a1278b94cb9..8bcd8839314 100644 --- a/commands/docs/complete.md +++ b/src/content/docs/commands/docs/complete.md @@ -9,6 +9,7 @@ usage: | Capture the outputs and exit code from an external piped in command in a nushell table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for system @@ -17,8 +18,7 @@ feature: default ## Signature -```> complete {flags} ``` - +`> complete {flags} ` ## Input/output types: @@ -29,16 +29,19 @@ feature: default ## Examples Run the external command to completion, capturing stdout and exit_code + ```nu > ^external arg1 | complete ``` Run external command to completion, capturing, stdout, stderr and exit_code + ```nu > do { ^external arg1 } | complete ``` ## Notes -In order to capture stdout, stderr, and exit_code, externally piped in commands need to be wrapped with `do` \ No newline at end of file + +In order to capture stdout, stderr, and exit_code, externally piped in commands need to be wrapped with `do` diff --git a/commands/docs/config.md b/src/content/docs/commands/docs/config.md similarity index 57% rename from commands/docs/config.md rename to src/content/docs/commands/docs/config.md index 46354a9a887..d5a1081fa7f 100644 --- a/commands/docs/config.md +++ b/src/content/docs/commands/docs/config.md @@ -9,6 +9,7 @@ usage: | Edit nushell configuration files. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for env @@ -17,8 +18,7 @@ feature: default ## Signature -```> config {flags} ``` - +`> config {flags} ` ## Input/output types: @@ -27,12 +27,13 @@ feature: default | nothing | string | ## Notes + You must use one of the following subcommands. Using this command as-is will only produce this help message. ## Subcommands: -| name | type | usage | -| ------------------------------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------- | -| [`config env`](/commands/docs/config_env.md) | Builtin | Edit nu environment configurations. | -| [`config nu`](/commands/docs/config_nu.md) | Builtin | Edit nu configurations. | -| [`config reset`](/commands/docs/config_reset.md) | Builtin | Reset nushell environment configurations to default, and saves old config files in the config location as oldconfig.nu and oldenv.nu. | \ No newline at end of file +| name | type | usage | +| --------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| [`config env`](/commands/docs/config_env) | Builtin | Edit nu environment configurations. | +| [`config nu`](/commands/docs/config_nu) | Builtin | Edit nu configurations. | +| [`config reset`](/commands/docs/config_reset) | Builtin | Reset nushell environment configurations to default, and saves old config files in the config location as oldconfig.nu and oldenv.nu. | diff --git a/commands/docs/config_env.md b/src/content/docs/commands/docs/config_env.md similarity index 90% rename from commands/docs/config_env.md rename to src/content/docs/commands/docs/config_env.md index 48db2a93069..8c66c926706 100644 --- a/commands/docs/config_env.md +++ b/src/content/docs/commands/docs/config_env.md @@ -9,6 +9,7 @@ usage: | Edit nu environment configurations. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for env @@ -17,12 +18,11 @@ feature: default ## Signature -```> config env {flags} ``` +`> config env {flags} ` ## Flags - - `--default, -d`: Print default `env.nu` file instead. - +- `--default, -d`: Print default `env.nu` file instead. ## Input/output types: @@ -33,18 +33,21 @@ feature: default ## Examples allow user to open and update nu env + ```nu > config env ``` allow user to print default `env.nu` file + ```nu > config env --default, ``` allow saving the default `env.nu` locally + ```nu > config env --default | save -f ~/.config/nushell/default_env.nu diff --git a/commands/docs/config_nu.md b/src/content/docs/commands/docs/config_nu.md similarity index 89% rename from commands/docs/config_nu.md rename to src/content/docs/commands/docs/config_nu.md index 52e1d026fc8..268fa718fa7 100644 --- a/commands/docs/config_nu.md +++ b/src/content/docs/commands/docs/config_nu.md @@ -9,6 +9,7 @@ usage: | Edit nu configurations. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for env @@ -17,12 +18,11 @@ feature: default ## Signature -```> config nu {flags} ``` +`> config nu {flags} ` ## Flags - - `--default, -d`: Print default `config.nu` file instead. - +- `--default, -d`: Print default `config.nu` file instead. ## Input/output types: @@ -33,18 +33,21 @@ feature: default ## Examples allow user to open and update nu config + ```nu > config nu ``` allow user to print default `config.nu` file + ```nu > config nu --default, ``` allow saving the default `config.nu` locally + ```nu > config nu --default | save -f ~/.config/nushell/default_config.nu diff --git a/commands/docs/config_reset.md b/src/content/docs/commands/docs/config_reset.md similarity index 81% rename from commands/docs/config_reset.md rename to src/content/docs/commands/docs/config_reset.md index 0402831170e..5b711712f68 100644 --- a/commands/docs/config_reset.md +++ b/src/content/docs/commands/docs/config_reset.md @@ -9,6 +9,7 @@ usage: | Reset nushell environment configurations to default, and saves old config files in the config location as oldconfig.nu and oldenv.nu. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for env @@ -17,14 +18,13 @@ feature: default ## Signature -```> config reset {flags} ``` +`> config reset {flags} ` ## Flags - - `--nu, -n`: reset only nu config, config.nu - - `--env, -e`: reset only env config, env.nu - - `--without-backup, -w`: do not make a backup - +- `--nu, -n`: reset only nu config, config.nu +- `--env, -e`: reset only env config, env.nu +- `--without-backup, -w`: do not make a backup ## Input/output types: @@ -35,6 +35,7 @@ feature: default ## Examples reset nushell configuration files + ```nu > config reset diff --git a/commands/docs/const.md b/src/content/docs/commands/docs/const.md similarity index 78% rename from commands/docs/const.md rename to src/content/docs/commands/docs/const.md index 9ed1c805a14..acac405b07e 100644 --- a/commands/docs/const.md +++ b/src/content/docs/commands/docs/const.md @@ -9,6 +9,7 @@ usage: | Create a parse-time constant. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,13 +18,12 @@ feature: default ## Signature -```> const {flags} (const_name) (initial_value)``` +`> const {flags} (const_name) (initial_value)` ## Parameters - - `const_name`: Constant name. - - `initial_value`: Equals sign followed by constant value. - +- `const_name`: Constant name. +- `initial_value`: Equals sign followed by constant value. ## Input/output types: @@ -34,17 +34,20 @@ feature: default ## Examples Create a new parse-time constant. + ```nu > const x = 10 ``` Create a composite constant value + ```nu > const x = { a: 10, b: 20 } ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/continue.md b/src/content/docs/commands/docs/continue.md similarity index 96% rename from commands/docs/continue.md rename to src/content/docs/commands/docs/continue.md index 44301220867..73092105940 100644 --- a/commands/docs/continue.md +++ b/src/content/docs/commands/docs/continue.md @@ -9,6 +9,7 @@ usage: | Continue a loop from the next iteration. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,8 +18,7 @@ feature: default ## Signature -```> continue {flags} ``` - +`> continue {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Continue a loop from the next iteration + ```nu > for i in 1..10 { if $i == 5 { continue }; print $i } diff --git a/commands/docs/cp.md b/src/content/docs/commands/docs/cp.md similarity index 51% rename from commands/docs/cp.md rename to src/content/docs/commands/docs/cp.md index 573eed3f663..016293a471b 100644 --- a/commands/docs/cp.md +++ b/src/content/docs/commands/docs/cp.md @@ -9,6 +9,7 @@ usage: | Copy files using uutils/coreutils cp. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filesystem @@ -17,28 +18,27 @@ feature: default ## Signature -```> cp {flags} ...rest``` +`> cp {flags} ...rest` ## Flags - - `--recursive, -r`: copy directories recursively - - `--verbose, -v`: explicitly state what is being done - - `--force, -f`: if an existing destination file cannot be opened, remove it and try - again (this option is ignored when the -n option is also used). - currently not implemented for windows - - `--interactive, -i`: ask before overwriting files - - `--update, -u`: copy only when the SOURCE file is newer than the destination file or when the destination file is missing - - `--progress, -p`: display a progress bar - - `--no-clobber, -n`: do not overwrite an existing file - - `--preserve, - {list<string>}`: preserve only the specified attributes (empty list means no attributes preserved) - if not specified only mode is preserved - possible values: mode, ownership (unix only), timestamps, context, link, links, xattr - - `--debug, -`: explain how a file is copied. Implies -v +- `--recursive, -r`: copy directories recursively +- `--verbose, -v`: explicitly state what is being done +- `--force, -f`: if an existing destination file cannot be opened, remove it and try + again (this option is ignored when the -n option is also used). + currently not implemented for windows +- `--interactive, -i`: ask before overwriting files +- `--update, -u`: copy only when the SOURCE file is newer than the destination file or when the destination file is missing +- `--progress, -p`: display a progress bar +- `--no-clobber, -n`: do not overwrite an existing file +- `--preserve, - {list<string>}`: preserve only the specified attributes (empty list means no attributes preserved) + if not specified only mode is preserved + possible values: mode, ownership (unix only), timestamps, context, link, links, xattr +- `--debug, -`: explain how a file is copied. Implies -v ## Parameters - - `...rest`: Copy SRC file/s to DEST. - +- `...rest`: Copy SRC file/s to DEST. ## Input/output types: @@ -49,42 +49,49 @@ feature: default ## Examples Copy myfile to dir_b + ```nu > cp myfile dir_b ``` Recursively copy dir_a to dir_b + ```nu > cp -r dir_a dir_b ``` Recursively copy dir_a to dir_b, and print the feedbacks + ```nu > cp -r -v dir_a dir_b ``` Move many files into a directory + ```nu > cp *.txt dir_a ``` Copy only if source file is newer than target file + ```nu > cp -u a b ``` Copy file preserving mode and timestamps attributes + ```nu > cp --preserve [ mode timestamps ] a b ``` Copy file erasing all attributes + ```nu > cp --preserve [] a b diff --git a/src/content/docs/commands/docs/date.md b/src/content/docs/commands/docs/date.md new file mode 100644 index 00000000000..b34c849b3ad --- /dev/null +++ b/src/content/docs/commands/docs/date.md @@ -0,0 +1,43 @@ +--- +title: date +categories: | + date +version: 0.90.0 +date: | + Date-related commands. +usage: | + Date-related commands. +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for date + +<div class='command-title'>{{ $frontmatter.date }}</div> + +## Signature + +`> date {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | type | usage | +| --------------------------------------------------------- | ------- | --------------------------------------------------------- | +| [`date format`](/commands/docs/date_format) | Builtin | Removed command: use `format date` instead. | +| [`date humanize`](/commands/docs/date_humanize) | Builtin | Print a 'humanized' format for the date, relative to now. | +| [`date list-timezone`](/commands/docs/date_list-timezone) | Builtin | List supported time zones. | +| [`date now`](/commands/docs/date_now) | Builtin | Get the current date. | +| [`date to-record`](/commands/docs/date_to-record) | Builtin | Convert the date into a record. | +| [`date to-table`](/commands/docs/date_to-table) | Builtin | Convert the date into a structured table. | +| [`date to-timezone`](/commands/docs/date_to-timezone) | Builtin | Convert a date to a given time zone. | diff --git a/commands/docs/date_format.md b/src/content/docs/commands/docs/date_format.md similarity index 78% rename from commands/docs/date_format.md rename to src/content/docs/commands/docs/date_format.md index b7f5fae9201..2b326044c37 100644 --- a/commands/docs/date_format.md +++ b/src/content/docs/commands/docs/date_format.md @@ -9,6 +9,7 @@ usage: | Removed command: use `format date` instead. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for removed @@ -17,20 +18,19 @@ feature: default ## Signature -```> date format {flags} (format string)``` +`> date format {flags} (format string)` ## Flags - - `--list, -l`: lists strftime cheatsheet +- `--list, -l`: lists strftime cheatsheet ## Parameters - - `format string`: The desired date format. - +- `format string`: The desired date format. ## Input/output types: | input | output | | -------- | ------ | | datetime | string | -| string | string | \ No newline at end of file +| string | string | diff --git a/commands/docs/date_humanize.md b/src/content/docs/commands/docs/date_humanize.md similarity index 95% rename from commands/docs/date_humanize.md rename to src/content/docs/commands/docs/date_humanize.md index 196d96a99d1..94401c98854 100644 --- a/commands/docs/date_humanize.md +++ b/src/content/docs/commands/docs/date_humanize.md @@ -9,6 +9,7 @@ usage: | Print a 'humanized' format for the date, relative to now. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for date @@ -17,8 +18,7 @@ feature: default ## Signature -```> date humanize {flags} ``` - +`> date humanize {flags} ` ## Input/output types: @@ -26,9 +26,11 @@ feature: default | -------- | ------ | | datetime | string | | string | string | + ## Examples Print a 'humanized' format for the date, relative to now. + ```nu > "2021-10-22 20:00:12 +01:00" | date humanize diff --git a/commands/docs/date_list-timezone.md b/src/content/docs/commands/docs/date_list-timezone.md similarity index 95% rename from commands/docs/date_list-timezone.md rename to src/content/docs/commands/docs/date_list-timezone.md index 7e09b2f7fa0..71df576c174 100644 --- a/commands/docs/date_list-timezone.md +++ b/src/content/docs/commands/docs/date_list-timezone.md @@ -9,6 +9,7 @@ usage: | List supported time zones. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for date @@ -17,8 +18,7 @@ feature: default ## Signature -```> date list-timezone {flags} ``` - +`> date list-timezone {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Show timezone(s) that contains 'Shanghai' + ```nu > date list-timezone | where timezone =~ Shanghai ╭───┬───────────────╮ diff --git a/commands/docs/date_now.md b/src/content/docs/commands/docs/date_now.md similarity index 97% rename from commands/docs/date_now.md rename to src/content/docs/commands/docs/date_now.md index bce0881bcbf..485084b9df7 100644 --- a/commands/docs/date_now.md +++ b/src/content/docs/commands/docs/date_now.md @@ -9,6 +9,7 @@ usage: | Get the current date. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for date @@ -17,8 +18,7 @@ feature: default ## Signature -```> date now {flags} ``` - +`> date now {flags} ` ## Input/output types: @@ -29,24 +29,28 @@ feature: default ## Examples Get the current date and display it in a given format string. + ```nu > date now | format date "%Y-%m-%d %H:%M:%S" ``` Get the time duration from 2019-04-30 to now + ```nu > (date now) - 2019-05-01 ``` Get the time duration since a more accurate time + ```nu > (date now) - 2019-05-01T04:12:05.20+08:00 ``` Get current time in full RFC3339 format with timezone + ```nu > date now | debug diff --git a/commands/docs/date_to-record.md b/src/content/docs/commands/docs/date_to-record.md similarity index 98% rename from commands/docs/date_to-record.md rename to src/content/docs/commands/docs/date_to-record.md index b839b7c67f6..ea327c1b4b8 100644 --- a/commands/docs/date_to-record.md +++ b/src/content/docs/commands/docs/date_to-record.md @@ -9,6 +9,7 @@ usage: | Convert the date into a record. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for date @@ -17,8 +18,7 @@ feature: default ## Signature -```> date to-record {flags} ``` - +`> date to-record {flags} ` ## Input/output types: @@ -26,21 +26,25 @@ feature: default | -------- | ------ | | datetime | record | | string | record | + ## Examples Convert the current date into a record. + ```nu > date to-record ``` Convert the current date into a record. + ```nu > date now | date to-record ``` Convert a date string into a record. + ```nu > '2020-04-12T22:10:57.123+02:00' | date to-record ╭────────────┬───────────╮ @@ -56,6 +60,7 @@ Convert a date string into a record. ``` Convert a date into a record. + ```nu > '2020-04-12 22:10:57 +0200' | into datetime | date to-record ╭────────────┬────────╮ diff --git a/commands/docs/date_to-table.md b/src/content/docs/commands/docs/date_to-table.md similarity index 98% rename from commands/docs/date_to-table.md rename to src/content/docs/commands/docs/date_to-table.md index d6a951cef36..3ec04df17be 100644 --- a/commands/docs/date_to-table.md +++ b/src/content/docs/commands/docs/date_to-table.md @@ -9,6 +9,7 @@ usage: | Convert the date into a structured table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for date @@ -17,8 +18,7 @@ feature: default ## Signature -```> date to-table {flags} ``` - +`> date to-table {flags} ` ## Input/output types: @@ -26,21 +26,25 @@ feature: default | -------- | ------ | | datetime | table | | string | table | + ## Examples Convert the current date into a table. + ```nu > date to-table ``` Convert the date into a table. + ```nu > date now | date to-table ``` Convert a given date into a table. + ```nu > 2020-04-12T22:10:57.000000789+02:00 | date to-table ╭───┬──────┬───────┬─────┬──────┬────────┬────────┬────────────┬──────────╮ @@ -52,6 +56,7 @@ Convert a given date into a table. ``` Convert a given date into a table. + ```nu > '2020-04-12 22:10:57 +0200' | into datetime | date to-table ╭───┬──────┬───────┬─────┬──────┬────────┬────────┬────────────┬──────────╮ diff --git a/commands/docs/date_to-timezone.md b/src/content/docs/commands/docs/date_to-timezone.md similarity index 88% rename from commands/docs/date_to-timezone.md rename to src/content/docs/commands/docs/date_to-timezone.md index 2452b3c25a8..a29a8a63557 100644 --- a/commands/docs/date_to-timezone.md +++ b/src/content/docs/commands/docs/date_to-timezone.md @@ -9,6 +9,7 @@ usage: | Convert a date to a given time zone. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for date @@ -17,12 +18,11 @@ feature: default ## Signature -```> date to-timezone {flags} (time zone)``` +`> date to-timezone {flags} (time zone)` ## Parameters - - `time zone`: Time zone description. - +- `time zone`: Time zone description. ## Input/output types: @@ -30,37 +30,44 @@ feature: default | -------- | -------- | | datetime | datetime | | string | datetime | + ## Examples Get the current date in UTC+05:00 + ```nu > date now | date to-timezone '+0500' ``` Get the current local date + ```nu > date now | date to-timezone local ``` Get the current date in Hawaii + ```nu > date now | date to-timezone US/Hawaii ``` Get the current date in Hawaii + ```nu > "2020-10-10 10:00:00 +02:00" | date to-timezone "+0500" Sat, 10 Oct 2020 13:00:00 +0500 (3 years ago) ``` Get the current date in Hawaii, from a datetime object + ```nu > "2020-10-10 10:00:00 +02:00" | into datetime | date to-timezone "+0500" Sat, 10 Oct 2020 13:00:00 +0500 (3 years ago) ``` ## Notes -Use 'date list-timezone' to list all supported time zones. \ No newline at end of file + +Use 'date list-timezone' to list all supported time zones. diff --git a/commands/docs/debug.md b/src/content/docs/commands/docs/debug.md similarity index 73% rename from commands/docs/debug.md rename to src/content/docs/commands/docs/debug.md index c07d55c1be1..096899332cf 100644 --- a/commands/docs/debug.md +++ b/src/content/docs/commands/docs/debug.md @@ -9,6 +9,7 @@ usage: | Debug print the value(s) piped in. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for debug @@ -17,28 +18,30 @@ feature: default ## Signature -```> debug {flags} ``` +`> debug {flags} ` ## Flags - - `--raw, -r`: Prints the raw value representation - +- `--raw, -r`: Prints the raw value representation ## Input/output types: -| input | output | -| --------- | ------------ | -| any | string | +| input | output | +| ----------- | -------------- | +| any | string | | list\<any\> | list\<string\> | + ## Examples Debug print a string + ```nu > 'hello' | debug hello ``` Debug print a list + ```nu > ['hello'] | debug ╭───┬───────╮ @@ -48,6 +51,7 @@ Debug print a list ``` Debug print a table + ```nu > [[version patch]; ['0.1.0' false] ['0.1.1' true] ['0.2.0' false]] | debug ╭───┬────────────────────────────────╮ @@ -58,9 +62,8 @@ Debug print a table ``` - ## Subcommands: -| name | type | usage | -| -------------------------------------------- | ------- | ------------------------- | -| [`debug info`](/commands/docs/debug_info.md) | Builtin | View process memory info. | +| name | type | usage | +| ----------------------------------------- | ------- | ------------------------- | +| [`debug info`](/commands/docs/debug_info) | Builtin | View process memory info. | diff --git a/commands/docs/debug_info.md b/src/content/docs/commands/docs/debug_info.md similarity index 95% rename from commands/docs/debug_info.md rename to src/content/docs/commands/docs/debug_info.md index 64d547a8ffc..6bc0bb5e017 100644 --- a/commands/docs/debug_info.md +++ b/src/content/docs/commands/docs/debug_info.md @@ -9,6 +9,7 @@ usage: | View process memory info. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for debug @@ -17,8 +18,7 @@ feature: default ## Signature -```> debug info {flags} ``` - +`> debug info {flags} ` ## Input/output types: @@ -29,11 +29,13 @@ feature: default ## Examples View process information + ```nu > debug info ``` ## Notes + This command is meant for debugging purposes. -It shows you the process information and system memory information. \ No newline at end of file +It shows you the process information and system memory information. diff --git a/commands/docs/decode.md b/src/content/docs/commands/docs/decode.md similarity index 70% rename from commands/docs/decode.md rename to src/content/docs/commands/docs/decode.md index 4c208cc8a80..ede190f3163 100644 --- a/commands/docs/decode.md +++ b/src/content/docs/commands/docs/decode.md @@ -9,6 +9,7 @@ usage: | Decode bytes into a string. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,12 +18,11 @@ feature: default ## Signature -```> decode {flags} (encoding)``` +`> decode {flags} (encoding)` ## Parameters - - `encoding`: The text encoding to use. - +- `encoding`: The text encoding to use. ## Input/output types: @@ -33,18 +33,21 @@ feature: default ## Examples Decode the output of an external command + ```nu > ^cat myfile.q | decode utf-8 ``` Decode an UTF-16 string into nushell UTF-8 string + ```nu > 0x[00 53 00 6F 00 6D 00 65 00 20 00 44 00 61 00 74 00 61] | decode utf-16be Some Data ``` ## Notes + Multiple encodings are supported; here are a few: big5, euc-jp, euc-kr, gbk, iso-8859-1, utf-16, cp1252, latin5 @@ -53,7 +56,7 @@ documentation link at https://docs.rs/encoding_rs/latest/encoding_rs/#statics ## Subcommands: -| name | type | usage | -| -------------------------------------------------- | ------- | ---------------------- | -| [`decode base64`](/commands/docs/decode_base64.md) | Builtin | Base64 decode a value. | -| [`decode hex`](/commands/docs/decode_hex.md) | Builtin | Hex decode a value. | \ No newline at end of file +| name | type | usage | +| ----------------------------------------------- | ------- | ---------------------- | +| [`decode base64`](/commands/docs/decode_base64) | Builtin | Base64 decode a value. | +| [`decode hex`](/commands/docs/decode_hex) | Builtin | Hex decode a value. | diff --git a/commands/docs/decode_base64.md b/src/content/docs/commands/docs/decode_base64.md similarity index 58% rename from commands/docs/decode_base64.md rename to src/content/docs/commands/docs/decode_base64.md index abe0ce060f7..b07f500f2aa 100644 --- a/commands/docs/decode_base64.md +++ b/src/content/docs/commands/docs/decode_base64.md @@ -9,6 +9,7 @@ usage: | Base64 decode a value. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for hash @@ -17,36 +18,38 @@ feature: default ## Signature -```> decode base64 {flags} ...rest``` +`> decode base64 {flags} ...rest` ## Flags - - `--character-set, -c {string}`: specify the character rules for encoding the input. - Valid values are 'standard', 'standard-no-padding', 'url-safe', 'url-safe-no-padding','binhex', 'bcrypt', 'crypt', 'mutf7' - - `--binary, -b`: Output a binary value instead of decoding payload as UTF-8 +- `--character-set, -c {string}`: specify the character rules for encoding the input. + Valid values are 'standard', 'standard-no-padding', 'url-safe', 'url-safe-no-padding','binhex', 'bcrypt', 'crypt', 'mutf7' +- `--binary, -b`: Output a binary value instead of decoding payload as UTF-8 ## Parameters - - `...rest`: For a data structure input, decode data at the given cell paths. - +- `...rest`: For a data structure input, decode data at the given cell paths. ## Input/output types: -| input | output | -| ------------ | --------- | +| input | output | +| -------------- | ----------- | | list\<string\> | list\<any\> | -| record | record | -| string | any | -| table | table | +| record | record | +| string | any | +| table | table | + ## Examples Base64 decode a value and output as UTF-8 string + ```nu > 'U29tZSBEYXRh' | decode base64 Some Data ``` Base64 decode a value and output as binary + ```nu > 'U29tZSBEYXRh' | decode base64 --binary Length: 9 (0x9) bytes | printable whitespace ascii_other non_ascii @@ -55,4 +58,5 @@ Length: 9 (0x9) bytes | printable whitespace ascii_other non_ascii ``` ## Notes -Will attempt to decode binary payload as an UTF-8 string by default. Use the `--binary(-b)` argument to force binary output. \ No newline at end of file + +Will attempt to decode binary payload as an UTF-8 string by default. Use the `--binary(-b)` argument to force binary output. diff --git a/commands/docs/decode_hex.md b/src/content/docs/commands/docs/decode_hex.md similarity index 68% rename from commands/docs/decode_hex.md rename to src/content/docs/commands/docs/decode_hex.md index ea786ade98e..3a25d8ac816 100644 --- a/commands/docs/decode_hex.md +++ b/src/content/docs/commands/docs/decode_hex.md @@ -9,36 +9,38 @@ usage: | Hex decode a value. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats <div class='command-title'>{{ $frontmatter.formats }}</div> - -::: warning - Command `decode hex` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `decode hex` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> decode hex {flags} ...rest``` +`> decode hex {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, decode data at the given cell paths - +- `...rest`: For a data structure input, decode data at the given cell paths ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<binary\> | -| record | record | -| string | binary | -| table | table | +| record | record | +| string | binary | +| table | table | + ## Examples Hex decode a value and output as binary + ```nu > '0102030A0a0B' | decode hex Length: 6 (0x6) bytes | printable whitespace ascii_other non_ascii @@ -47,6 +49,7 @@ Length: 6 (0x6) bytes | printable whitespace ascii_other non_ascii ``` Whitespaces are allowed to be between hex digits + ```nu > '01 02 03 0A 0a 0B' | decode hex Length: 6 (0x6) bytes | printable whitespace ascii_other non_ascii diff --git a/commands/docs/def.md b/src/content/docs/commands/docs/def.md similarity index 75% rename from commands/docs/def.md rename to src/content/docs/commands/docs/def.md index f8021eee727..a5920c885c6 100644 --- a/commands/docs/def.md +++ b/src/content/docs/commands/docs/def.md @@ -9,6 +9,7 @@ usage: | Define a custom command. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,19 +18,18 @@ feature: default ## Signature -```> def {flags} (def_name) (params) (block)``` +`> def {flags} (def_name) (params) (block)` ## Flags - - `--env, -`: keep the environment defined inside the command - - `--wrapped, -`: treat unknown flags and arguments as strings (requires ...rest-like parameter in signature) +- `--env, -`: keep the environment defined inside the command +- `--wrapped, -`: treat unknown flags and arguments as strings (requires ...rest-like parameter in signature) ## Parameters - - `def_name`: Command name. - - `params`: Parameters. - - `block`: Body of the definition. - +- `def_name`: Command name. +- `params`: Parameters. +- `block`: Body of the definition. ## Input/output types: @@ -40,24 +40,28 @@ feature: default ## Examples Define a command and run it + ```nu > def say-hi [] { echo 'hi' }; say-hi hi ``` Define a command and run it with parameter(s) + ```nu > def say-sth [sth: string] { echo $sth }; say-sth hi hi ``` Set environment variable by call a custom command + ```nu > def --env foo [] { $env.BAR = "BAZ" }; foo; $env.BAR BAZ ``` Define a custom wrapper for an external command + ```nu > def --wrapped my-echo [...rest] { echo $rest }; my-echo spam ╭───┬──────╮ @@ -67,5 +71,6 @@ Define a custom wrapper for an external command ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/default.md b/src/content/docs/commands/docs/default.md similarity index 86% rename from commands/docs/default.md rename to src/content/docs/commands/docs/default.md index ec6fd4f5e45..33cfeb8f70d 100644 --- a/commands/docs/default.md +++ b/src/content/docs/commands/docs/default.md @@ -9,6 +9,7 @@ usage: | Sets a default row's column if missing. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,13 +18,12 @@ feature: default ## Signature -```> default {flags} (default value) (column name)``` +`> default {flags} (default value) (column name)` ## Parameters - - `default value`: The value to use as a default. - - `column name`: The name of the column. - +- `default value`: The value to use as a default. +- `column name`: The name of the column. ## Input/output types: @@ -34,18 +34,21 @@ feature: default ## Examples Give a default 'target' column to all file entries + ```nu > ls -la | default 'nothing' target ``` Get the env value of `MY_ENV` with a default value 'abc' if not present + ```nu > $env | get --ignore-errors MY_ENV | default 'abc' ``` Replace the `null` value in a list + ```nu > [1, 2, null, 4] | default 3 ╭───┬───╮ diff --git a/commands/docs/describe.md b/src/content/docs/commands/docs/describe.md similarity index 96% rename from commands/docs/describe.md rename to src/content/docs/commands/docs/describe.md index c7c52d9e7ec..9d91f8262c0 100644 --- a/commands/docs/describe.md +++ b/src/content/docs/commands/docs/describe.md @@ -9,6 +9,7 @@ usage: | Describe the type and structure of the value(s) piped in. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,14 +18,13 @@ feature: default ## Signature -```> describe {flags} ``` +`> describe {flags} ` ## Flags - - `--no-collect, -n`: do not collect streams of structured data - - `--detailed, -d`: show detailed information about the value - - `--collect-lazyrecords, -l`: collect lazy records - +- `--no-collect, -n`: do not collect streams of structured data +- `--detailed, -d`: show detailed information about the value +- `--collect-lazyrecords, -l`: collect lazy records ## Input/output types: @@ -35,12 +35,14 @@ feature: default ## Examples Describe the type of a string + ```nu > 'hello' | describe string ``` Describe the type of a record in a detailed way + ```nu > {shell:'true', uwu:true, features: {bugs:false, multiplatform:true, speed: 10}, fib: [1 1 2 3 5 8], on_save: {|x| print $'Saving ($x)'}, first_commit: 2019-05-10, my_duration: (4min + 20sec)} | describe -d ╭─────────┬───────────────────────────────────────────────────────────╮ @@ -84,18 +86,21 @@ Describe the type of a record in a detailed way ``` Describe the type of a stream with detailed information + ```nu > [1 2 3] | each {|i| echo $i} | describe -d ``` Describe a stream of data, collecting it first + ```nu > [1 2 3] | each {|i| echo $i} | describe ``` Describe the input but do not collect streams + ```nu > [1 2 3] | each {|i| echo $i} | describe --no-collect diff --git a/commands/docs/detect_columns.md b/src/content/docs/commands/docs/detect_columns.md similarity index 88% rename from commands/docs/detect_columns.md rename to src/content/docs/commands/docs/detect_columns.md index 7c10d76bf3f..a3826219e5a 100644 --- a/commands/docs/detect_columns.md +++ b/src/content/docs/commands/docs/detect_columns.md @@ -9,6 +9,7 @@ usage: | Attempt to automatically split text into multiple columns. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,14 +18,13 @@ feature: default ## Signature -```> detect columns {flags} ``` +`> detect columns {flags} ` ## Flags - - `--skip, -s {int}`: number of rows to skip before detecting - - `--no-headers, -n`: don't detect headers - - `--combine-columns, -c {range}`: columns to be combined; listed as a range - +- `--skip, -s {int}`: number of rows to skip before detecting +- `--no-headers, -n`: don't detect headers +- `--combine-columns, -c {range}`: columns to be combined; listed as a range ## Input/output types: @@ -35,6 +35,7 @@ feature: default ## Examples Splits string across multiple columns + ```nu > 'a b c' | detect columns --no-headers ╭───┬─────────┬─────────┬─────────╮ @@ -45,25 +46,27 @@ Splits string across multiple columns ``` - ```nu > $'c1 c2 c3 c4 c5(char nl)a b c d e' | detect columns --combine-columns 0..1 ``` Splits a multi-line string into columns with headers detected + ```nu > $'c1 c2 c3 c4 c5(char nl)a b c d e' | detect columns --combine-columns -2..-1 ``` Splits a multi-line string into columns with headers detected + ```nu > $'c1 c2 c3 c4 c5(char nl)a b c d e' | detect columns --combine-columns 2.. ``` Parse external ls command and combine columns for datetime + ```nu > ^ls -lh | detect columns --no-headers --skip 1 --combine-columns 5..7 diff --git a/src/content/docs/commands/docs/dfr.md b/src/content/docs/commands/docs/dfr.md new file mode 100644 index 00000000000..fb6bff73322 --- /dev/null +++ b/src/content/docs/commands/docs/dfr.md @@ -0,0 +1,148 @@ +--- +title: dfr +categories: | + dataframe +version: 0.90.0 +dataframe: | + Operate with data in a dataframe format. +usage: | + Operate with data in a dataframe format. +feature: dataframe +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for dataframe + +<div class='command-title'>{{ $frontmatter.dataframe }}</div> + +:::caution[warning] +Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag +::: + +## Signature + +`> dfr {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | type | usage | +| ----------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------ | +| [`dfr agg`](/commands/docs/dfr_agg) | Builtin | Performs a series of aggregations from a group-by. | +| [`dfr agg-groups`](/commands/docs/dfr_agg-groups) | Builtin | Creates an agg_groups expression. | +| [`dfr all-false`](/commands/docs/dfr_all-false) | Builtin | Returns true if all values are false. | +| [`dfr all-true`](/commands/docs/dfr_all-true) | Builtin | Returns true if all values are true. | +| [`dfr append`](/commands/docs/dfr_append) | Builtin | Appends a new dataframe. | +| [`dfr arg-max`](/commands/docs/dfr_arg-max) | Builtin | Return index for max value in series. | +| [`dfr arg-min`](/commands/docs/dfr_arg-min) | Builtin | Return index for min value in series. | +| [`dfr arg-sort`](/commands/docs/dfr_arg-sort) | Builtin | Returns indexes for a sorted series. | +| [`dfr arg-true`](/commands/docs/dfr_arg-true) | Builtin | Returns indexes where values are true. | +| [`dfr arg-unique`](/commands/docs/dfr_arg-unique) | Builtin | Returns indexes for unique values. | +| [`dfr arg-where`](/commands/docs/dfr_arg-where) | Builtin | Creates an expression that returns the arguments where expression is true. | +| [`dfr as`](/commands/docs/dfr_as) | Builtin | Creates an alias expression. | +| [`dfr as-date`](/commands/docs/dfr_as-date) | Builtin | Converts string to date. | +| [`dfr as-datetime`](/commands/docs/dfr_as-datetime) | Builtin | Converts string to datetime. | +| [`dfr cache`](/commands/docs/dfr_cache) | Builtin | Caches operations in a new LazyFrame. | +| [`dfr col`](/commands/docs/dfr_col) | Builtin | Creates a named column expression. | +| [`dfr collect`](/commands/docs/dfr_collect) | Builtin | Collect lazy dataframe into eager dataframe. | +| [`dfr columns`](/commands/docs/dfr_columns) | Builtin | Show dataframe columns. | +| [`dfr concat-str`](/commands/docs/dfr_concat-str) | Builtin | Creates a concat string expression. | +| [`dfr concatenate`](/commands/docs/dfr_concatenate) | Builtin | Concatenates strings with other array. | +| [`dfr contains`](/commands/docs/dfr_contains) | Builtin | Checks if a pattern is contained in a string. | +| [`dfr count`](/commands/docs/dfr_count) | Builtin | Creates a count expression. | +| [`dfr count-null`](/commands/docs/dfr_count-null) | Builtin | Counts null values. | +| [`dfr cumulative`](/commands/docs/dfr_cumulative) | Builtin | Cumulative calculation for a series. | +| [`dfr datepart`](/commands/docs/dfr_datepart) | Builtin | Creates an expression for capturing the specified datepart in a column. | +| [`dfr drop`](/commands/docs/dfr_drop) | Builtin | Creates a new dataframe by dropping the selected columns. | +| [`dfr drop-duplicates`](/commands/docs/dfr_drop-duplicates) | Builtin | Drops duplicate values in dataframe. | +| [`dfr drop-nulls`](/commands/docs/dfr_drop-nulls) | Builtin | Drops null values in dataframe. | +| [`dfr dtypes`](/commands/docs/dfr_dtypes) | Builtin | Show dataframe data types. | +| [`dfr dummies`](/commands/docs/dfr_dummies) | Builtin | Creates a new dataframe with dummy variables. | +| [`dfr explode`](/commands/docs/dfr_explode) | Builtin | Explodes a dataframe or creates a explode expression. | +| [`dfr expr-not`](/commands/docs/dfr_expr-not) | Builtin | Creates a not expression. | +| [`dfr fetch`](/commands/docs/dfr_fetch) | Builtin | Collects the lazyframe to the selected rows. | +| [`dfr fill-nan`](/commands/docs/dfr_fill-nan) | Builtin | Replaces NaN values with the given expression. | +| [`dfr fill-null`](/commands/docs/dfr_fill-null) | Builtin | Replaces NULL values with the given expression. | +| [`dfr filter`](/commands/docs/dfr_filter) | Builtin | Filter dataframe based in expression. | +| [`dfr filter-with`](/commands/docs/dfr_filter-with) | Builtin | Filters dataframe using a mask or expression as reference. | +| [`dfr first`](/commands/docs/dfr_first) | Builtin | Show only the first number of rows or create a first expression | +| [`dfr flatten`](/commands/docs/dfr_flatten) | Builtin | An alias for dfr explode. | +| [`dfr get`](/commands/docs/dfr_get) | Builtin | Creates dataframe with the selected columns. | +| [`dfr get-day`](/commands/docs/dfr_get-day) | Builtin | Gets day from date. | +| [`dfr get-hour`](/commands/docs/dfr_get-hour) | Builtin | Gets hour from date. | +| [`dfr get-minute`](/commands/docs/dfr_get-minute) | Builtin | Gets minute from date. | +| [`dfr get-month`](/commands/docs/dfr_get-month) | Builtin | Gets month from date. | +| [`dfr get-nanosecond`](/commands/docs/dfr_get-nanosecond) | Builtin | Gets nanosecond from date. | +| [`dfr get-ordinal`](/commands/docs/dfr_get-ordinal) | Builtin | Gets ordinal from date. | +| [`dfr get-second`](/commands/docs/dfr_get-second) | Builtin | Gets second from date. | +| [`dfr get-week`](/commands/docs/dfr_get-week) | Builtin | Gets week from date. | +| [`dfr get-weekday`](/commands/docs/dfr_get-weekday) | Builtin | Gets weekday from date. | +| [`dfr get-year`](/commands/docs/dfr_get-year) | Builtin | Gets year from date. | +| [`dfr group-by`](/commands/docs/dfr_group-by) | Builtin | Creates a group-by object that can be used for other aggregations. | +| [`dfr implode`](/commands/docs/dfr_implode) | Builtin | Aggregates a group to a Series. | +| [`dfr into-df`](/commands/docs/dfr_into-df) | Builtin | Converts a list, table or record into a dataframe. | +| [`dfr into-lazy`](/commands/docs/dfr_into-lazy) | Builtin | Converts a dataframe into a lazy dataframe. | +| [`dfr into-nu`](/commands/docs/dfr_into-nu) | Builtin | Converts a dataframe or an expression into into nushell value for access and exploration. | +| [`dfr is-duplicated`](/commands/docs/dfr_is-duplicated) | Builtin | Creates mask indicating duplicated values. | +| [`dfr is-in`](/commands/docs/dfr_is-in) | Builtin | Creates an is-in expression. | +| [`dfr is-not-null`](/commands/docs/dfr_is-not-null) | Builtin | Creates mask where value is not null. | +| [`dfr is-null`](/commands/docs/dfr_is-null) | Builtin | Creates mask where value is null. | +| [`dfr is-unique`](/commands/docs/dfr_is-unique) | Builtin | Creates mask indicating unique values. | +| [`dfr join`](/commands/docs/dfr_join) | Builtin | Joins a lazy frame with other lazy frame. | +| [`dfr last`](/commands/docs/dfr_last) | Builtin | Creates new dataframe with tail rows or creates a last expression. | +| [`dfr lit`](/commands/docs/dfr_lit) | Builtin | Creates a literal expression. | +| [`dfr lowercase`](/commands/docs/dfr_lowercase) | Builtin | Lowercase the strings in the column. | +| [`dfr ls`](/commands/docs/dfr_ls) | Builtin | Lists stored dataframes. | +| [`dfr max`](/commands/docs/dfr_max) | Builtin | Creates a max expression or aggregates columns to their max value. | +| [`dfr mean`](/commands/docs/dfr_mean) | Builtin | Creates a mean expression for an aggregation or aggregates columns to their mean value. | +| [`dfr median`](/commands/docs/dfr_median) | Builtin | Aggregates columns to their median value | +| [`dfr melt`](/commands/docs/dfr_melt) | Builtin | Unpivot a DataFrame from wide to long format. | +| [`dfr min`](/commands/docs/dfr_min) | Builtin | Creates a min expression or aggregates columns to their min value. | +| [`dfr n-unique`](/commands/docs/dfr_n-unique) | Builtin | Counts unique values. | +| [`dfr not`](/commands/docs/dfr_not) | Builtin | Inverts boolean mask. | +| [`dfr open`](/commands/docs/dfr_open) | Builtin | Opens CSV, JSON, JSON lines, arrow, avro, or parquet file to create dataframe. | +| [`dfr otherwise`](/commands/docs/dfr_otherwise) | Builtin | Completes a when expression. | +| [`dfr quantile`](/commands/docs/dfr_quantile) | Builtin | Aggregates the columns to the selected quantile. | +| [`dfr query`](/commands/docs/dfr_query) | Builtin | Query dataframe using SQL. Note: The dataframe is always named 'df' in your query's from clause. | +| [`dfr rename`](/commands/docs/dfr_rename) | Builtin | Rename a dataframe column. | +| [`dfr replace`](/commands/docs/dfr_replace) | Builtin | Replace the leftmost (sub)string by a regex pattern. | +| [`dfr replace-all`](/commands/docs/dfr_replace-all) | Builtin | Replace all (sub)strings by a regex pattern. | +| [`dfr reverse`](/commands/docs/dfr_reverse) | Builtin | Reverses the LazyFrame | +| [`dfr rolling`](/commands/docs/dfr_rolling) | Builtin | Rolling calculation for a series. | +| [`dfr sample`](/commands/docs/dfr_sample) | Builtin | Create sample dataframe. | +| [`dfr schema`](/commands/docs/dfr_schema) | Builtin | Show schema for a dataframe. | +| [`dfr select`](/commands/docs/dfr_select) | Builtin | Selects columns from lazyframe. | +| [`dfr set`](/commands/docs/dfr_set) | Builtin | Sets value where given mask is true. | +| [`dfr set-with-idx`](/commands/docs/dfr_set-with-idx) | Builtin | Sets value in the given index. | +| [`dfr shape`](/commands/docs/dfr_shape) | Builtin | Shows column and row size for a dataframe. | +| [`dfr shift`](/commands/docs/dfr_shift) | Builtin | Shifts the values by a given period. | +| [`dfr slice`](/commands/docs/dfr_slice) | Builtin | Creates new dataframe from a slice of rows. | +| [`dfr sort-by`](/commands/docs/dfr_sort-by) | Builtin | Sorts a lazy dataframe based on expression(s). | +| [`dfr std`](/commands/docs/dfr_std) | Builtin | Creates a std expression for an aggregation of std value from columns in a dataframe. | +| [`dfr str-lengths`](/commands/docs/dfr_str-lengths) | Builtin | Get lengths of all strings. | +| [`dfr str-slice`](/commands/docs/dfr_str-slice) | Builtin | Slices the string from the start position until the selected length. | +| [`dfr strftime`](/commands/docs/dfr_strftime) | Builtin | Formats date based on string rule. | +| [`dfr sum`](/commands/docs/dfr_sum) | Builtin | Creates a sum expression for an aggregation or aggregates columns to their sum value. | +| [`dfr summary`](/commands/docs/dfr_summary) | Builtin | For a dataframe, produces descriptive statistics (summary statistics) for its numeric columns. | +| [`dfr take`](/commands/docs/dfr_take) | Builtin | Creates new dataframe using the given indices. | +| [`dfr to-arrow`](/commands/docs/dfr_to-arrow) | Builtin | Saves dataframe to arrow file. | +| [`dfr to-avro`](/commands/docs/dfr_to-avro) | Builtin | Saves dataframe to avro file. | +| [`dfr to-csv`](/commands/docs/dfr_to-csv) | Builtin | Saves dataframe to CSV file. | +| [`dfr to-jsonl`](/commands/docs/dfr_to-jsonl) | Builtin | Saves dataframe to a JSON lines file. | +| [`dfr to-parquet`](/commands/docs/dfr_to-parquet) | Builtin | Saves dataframe to parquet file. | +| [`dfr unique`](/commands/docs/dfr_unique) | Builtin | Returns unique values from a dataframe. | +| [`dfr uppercase`](/commands/docs/dfr_uppercase) | Builtin | Uppercase the strings in the column. | +| [`dfr value-counts`](/commands/docs/dfr_value-counts) | Builtin | Returns a dataframe with the counts for unique values in series. | +| [`dfr var`](/commands/docs/dfr_var) | Builtin | Create a var expression for an aggregation. | +| [`dfr when`](/commands/docs/dfr_when) | Builtin | Creates and modifies a when expression. | +| [`dfr with-column`](/commands/docs/dfr_with-column) | Builtin | Adds a series to the dataframe. | diff --git a/commands/docs/dfr_agg-groups.md b/src/content/docs/commands/docs/dfr_agg-groups.md similarity index 93% rename from commands/docs/dfr_agg-groups.md rename to src/content/docs/commands/docs/dfr_agg-groups.md index fcc838b685b..ef9ae11010e 100644 --- a/commands/docs/dfr_agg-groups.md +++ b/src/content/docs/commands/docs/dfr_agg-groups.md @@ -9,20 +9,20 @@ usage: | Creates an agg_groups expression. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr agg-groups {flags} ``` +## Signature +`> dfr agg-groups {flags} ` ## Input/output types: @@ -32,7 +32,6 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples - ```nu > diff --git a/commands/docs/dfr_agg.md b/src/content/docs/commands/docs/dfr_agg.md similarity index 94% rename from commands/docs/dfr_agg.md rename to src/content/docs/commands/docs/dfr_agg.md index d848cb2b42c..197a5f7f687 100644 --- a/commands/docs/dfr_agg.md +++ b/src/content/docs/commands/docs/dfr_agg.md @@ -9,24 +9,24 @@ usage: | Performs a series of aggregations from a group-by. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for lazyframe <div class='command-title'>{{ $frontmatter.lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr agg {flags} ...rest``` +`> dfr agg {flags} ...rest` ## Parameters - - `...rest`: Expression(s) that define the aggregations to be applied - +- `...rest`: Expression(s) that define the aggregations to be applied ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Group by and perform an aggregation + ```nu > [[a b]; [1 2] [1 4] [2 6] [2 4]] | dfr into-df @@ -56,6 +57,7 @@ Group by and perform an aggregation ``` Group by and perform an aggregation + ```nu > [[a b]; [1 2] [1 4] [2 6] [2 4]] | dfr into-lazy diff --git a/commands/docs/dfr_all-false.md b/src/content/docs/commands/docs/dfr_all-false.md similarity index 96% rename from commands/docs/dfr_all-false.md rename to src/content/docs/commands/docs/dfr_all-false.md index 6fdda24f5b5..e147b49a7e9 100644 --- a/commands/docs/dfr_all-false.md +++ b/src/content/docs/commands/docs/dfr_all-false.md @@ -9,20 +9,20 @@ usage: | Returns true if all values are false. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr all-false {flags} ``` +## Signature +`> dfr all-false {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns true if all values are false + ```nu > [false false false] | dfr into-df | dfr all-false ╭───┬───────────╮ @@ -44,6 +45,7 @@ Returns true if all values are false ``` Checks the result from a comparison + ```nu > let s = ([5 6 2 10] | dfr into-df); let res = ($s > 9); diff --git a/commands/docs/dfr_all-true.md b/src/content/docs/commands/docs/dfr_all-true.md similarity index 96% rename from commands/docs/dfr_all-true.md rename to src/content/docs/commands/docs/dfr_all-true.md index 24a49c32aa4..140811156c1 100644 --- a/commands/docs/dfr_all-true.md +++ b/src/content/docs/commands/docs/dfr_all-true.md @@ -9,20 +9,20 @@ usage: | Returns true if all values are true. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr all-true {flags} ``` +## Signature +`> dfr all-true {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns true if all values are true + ```nu > [true true true] | dfr into-df | dfr all-true ╭───┬──────────╮ @@ -44,6 +45,7 @@ Returns true if all values are true ``` Checks the result from a comparison + ```nu > let s = ([5 6 2 8] | dfr into-df); let res = ($s > 9); diff --git a/commands/docs/dfr_append.md b/src/content/docs/commands/docs/dfr_append.md similarity index 91% rename from commands/docs/dfr_append.md rename to src/content/docs/commands/docs/dfr_append.md index f695b32a273..dc8b45510c5 100644 --- a/commands/docs/dfr_append.md +++ b/src/content/docs/commands/docs/dfr_append.md @@ -9,28 +9,28 @@ usage: | Appends a new dataframe. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr append {flags} (other)``` +`> dfr append {flags} (other)` ## Flags - - `--col, -c`: appends in col orientation +- `--col, -c`: appends in col orientation ## Parameters - - `other`: dataframe to be appended - +- `other`: dataframe to be appended ## Input/output types: @@ -41,6 +41,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Appends a dataframe as new columns + ```nu > let a = ([[a b]; [1 2] [3 4]] | dfr into-df); $a | dfr append $a @@ -54,6 +55,7 @@ Appends a dataframe as new columns ``` Appends a dataframe merging at the end of columns + ```nu > let a = ([[a b]; [1 2] [3 4]] | dfr into-df); $a | dfr append $a --col diff --git a/commands/docs/dfr_arg-max.md b/src/content/docs/commands/docs/dfr_arg-max.md similarity index 95% rename from commands/docs/dfr_arg-max.md rename to src/content/docs/commands/docs/dfr_arg-max.md index 5cb54741570..38b8f4a857d 100644 --- a/commands/docs/dfr_arg-max.md +++ b/src/content/docs/commands/docs/dfr_arg-max.md @@ -9,20 +9,20 @@ usage: | Return index for max value in series. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr arg-max {flags} ``` +## Signature +`> dfr arg-max {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns index for max value + ```nu > [1 3 2] | dfr into-df | dfr arg-max ╭───┬─────────╮ diff --git a/commands/docs/dfr_arg-min.md b/src/content/docs/commands/docs/dfr_arg-min.md similarity index 95% rename from commands/docs/dfr_arg-min.md rename to src/content/docs/commands/docs/dfr_arg-min.md index 6b8968efeb5..81c9515b4d6 100644 --- a/commands/docs/dfr_arg-min.md +++ b/src/content/docs/commands/docs/dfr_arg-min.md @@ -9,20 +9,20 @@ usage: | Return index for min value in series. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr arg-min {flags} ``` +## Signature +`> dfr arg-min {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns index for min value + ```nu > [1 3 2] | dfr into-df | dfr arg-min ╭───┬─────────╮ diff --git a/commands/docs/dfr_arg-sort.md b/src/content/docs/commands/docs/dfr_arg-sort.md similarity index 88% rename from commands/docs/dfr_arg-sort.md rename to src/content/docs/commands/docs/dfr_arg-sort.md index 410f84fe113..21a257f03bf 100644 --- a/commands/docs/dfr_arg-sort.md +++ b/src/content/docs/commands/docs/dfr_arg-sort.md @@ -9,26 +9,26 @@ usage: | Returns indexes for a sorted series. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr arg-sort {flags} ``` +`> dfr arg-sort {flags} ` ## Flags - - `--reverse, -r`: reverse order - - `--nulls-last, -n`: nulls ordered last - - `--maintain-order, -m`: maintain order on sorted items - +- `--reverse, -r`: reverse order +- `--nulls-last, -n`: nulls ordered last +- `--maintain-order, -m`: maintain order on sorted items ## Input/output types: @@ -39,6 +39,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns indexes for a sorted series + ```nu > [1 2 2 3 3] | dfr into-df | dfr arg-sort ╭───┬──────────╮ @@ -54,6 +55,7 @@ Returns indexes for a sorted series ``` Returns indexes for a sorted series + ```nu > [1 2 2 3 3] | dfr into-df | dfr arg-sort --reverse ╭───┬──────────╮ diff --git a/commands/docs/dfr_arg-true.md b/src/content/docs/commands/docs/dfr_arg-true.md similarity index 95% rename from commands/docs/dfr_arg-true.md rename to src/content/docs/commands/docs/dfr_arg-true.md index ee4e066f355..8961da4f4d8 100644 --- a/commands/docs/dfr_arg-true.md +++ b/src/content/docs/commands/docs/dfr_arg-true.md @@ -9,20 +9,20 @@ usage: | Returns indexes where values are true. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr arg-true {flags} ``` +## Signature +`> dfr arg-true {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns indexes where values are true + ```nu > [false true false] | dfr into-df | dfr arg-true ╭───┬──────────╮ diff --git a/commands/docs/dfr_arg-unique.md b/src/content/docs/commands/docs/dfr_arg-unique.md similarity index 95% rename from commands/docs/dfr_arg-unique.md rename to src/content/docs/commands/docs/dfr_arg-unique.md index 3ebb13c63e9..5c7f6b5a47f 100644 --- a/commands/docs/dfr_arg-unique.md +++ b/src/content/docs/commands/docs/dfr_arg-unique.md @@ -9,20 +9,20 @@ usage: | Returns indexes for unique values. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr arg-unique {flags} ``` +## Signature +`> dfr arg-unique {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns indexes for unique values + ```nu > [1 2 2 3 3] | dfr into-df | dfr arg-unique ╭───┬────────────╮ diff --git a/commands/docs/dfr_arg-where.md b/src/content/docs/commands/docs/dfr_arg-where.md similarity index 91% rename from commands/docs/dfr_arg-where.md rename to src/content/docs/commands/docs/dfr_arg-where.md index bb0bbb333f8..c3e44a42015 100644 --- a/commands/docs/dfr_arg-where.md +++ b/src/content/docs/commands/docs/dfr_arg-where.md @@ -9,24 +9,24 @@ usage: | Creates an expression that returns the arguments where expression is true. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr arg-where {flags} (column name)``` +`> dfr arg-where {flags} (column name)` ## Parameters - - `column name`: Expression to evaluate - +- `column name`: Expression to evaluate ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Return a dataframe where the value match the expression + ```nu > let df = ([[a b]; [one 1] [two 2] [three 3]] | dfr into-df); $df | dfr select (dfr arg-where ((dfr col b) >= 2) | dfr as b_arg) diff --git a/commands/docs/dfr_as-date.md b/src/content/docs/commands/docs/dfr_as-date.md similarity index 71% rename from commands/docs/dfr_as-date.md rename to src/content/docs/commands/docs/dfr_as-date.md index a8a568ecb9a..5e2385082f7 100644 --- a/commands/docs/dfr_as-date.md +++ b/src/content/docs/commands/docs/dfr_as-date.md @@ -9,28 +9,28 @@ usage: | Converts string to date. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr as-date {flags} (format)``` +`> dfr as-date {flags} (format)` ## Flags - - `--not-exact, -n`: the format string may be contained in the date (e.g. foo-2021-01-01-bar could match 2021-01-01) +- `--not-exact, -n`: the format string may be contained in the date (e.g. foo-2021-01-01-bar could match 2021-01-01) ## Parameters - - `format`: formatting date string - +- `format`: formatting date string ## Input/output types: @@ -41,13 +41,15 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Converts string to date + ```nu > ["2021-12-30" "2021-12-31"] | dfr into-df | dfr as-datetime "%Y-%m-%d" ``` ## Notes + Format example: - "%Y-%m-%d" => 2021-12-31 - "%d-%m-%Y" => 31-12-2021 - "%Y%m%d" => 2021319 (2021-03-19) \ No newline at end of file +"%Y-%m-%d" => 2021-12-31 +"%d-%m-%Y" => 31-12-2021 +"%Y%m%d" => 2021319 (2021-03-19) diff --git a/commands/docs/dfr_as-datetime.md b/src/content/docs/commands/docs/dfr_as-datetime.md similarity index 66% rename from commands/docs/dfr_as-datetime.md rename to src/content/docs/commands/docs/dfr_as-datetime.md index ec94406d674..3fa7e8b0290 100644 --- a/commands/docs/dfr_as-datetime.md +++ b/src/content/docs/commands/docs/dfr_as-datetime.md @@ -9,28 +9,28 @@ usage: | Converts string to datetime. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr as-datetime {flags} (format)``` +`> dfr as-datetime {flags} (format)` ## Flags - - `--not-exact, -n`: the format string may be contained in the date (e.g. foo-2021-01-01-bar could match 2021-01-01) +- `--not-exact, -n`: the format string may be contained in the date (e.g. foo-2021-01-01-bar could match 2021-01-01) ## Parameters - - `format`: formatting date time string - +- `format`: formatting date time string ## Input/output types: @@ -41,6 +41,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Converts string to datetime + ```nu > ["2021-12-30 00:00:00" "2021-12-31 00:00:00"] | dfr into-df | dfr as-datetime "%Y-%m-%d %H:%M:%S" ╭───┬─────────────╮ @@ -53,6 +54,7 @@ Converts string to datetime ``` Converts string to datetime with high resolutions + ```nu > ["2021-12-30 00:00:00.123456789" "2021-12-31 00:00:00.123456789"] | dfr into-df | dfr as-datetime "%Y-%m-%d %H:%M:%S.%9f" ╭───┬─────────────╮ @@ -65,15 +67,16 @@ Converts string to datetime with high resolutions ``` ## Notes + Format example: - "%y/%m/%d %H:%M:%S" => 21/12/31 12:54:98 - "%y-%m-%d %H:%M:%S" => 2021-12-31 24:58:01 - "%y/%m/%d %H:%M:%S" => 21/12/31 24:58:01 - "%y%m%d %H:%M:%S" => 210319 23:58:50 - "%Y/%m/%d %H:%M:%S" => 2021/12/31 12:54:98 - "%Y-%m-%d %H:%M:%S" => 2021-12-31 24:58:01 - "%Y/%m/%d %H:%M:%S" => 2021/12/31 24:58:01 - "%Y%m%d %H:%M:%S" => 20210319 23:58:50 - "%FT%H:%M:%S" => 2019-04-18T02:45:55 - "%FT%H:%M:%S.%6f" => microseconds - "%FT%H:%M:%S.%9f" => nanoseconds \ No newline at end of file +"%y/%m/%d %H:%M:%S" => 21/12/31 12:54:98 +"%y-%m-%d %H:%M:%S" => 2021-12-31 24:58:01 +"%y/%m/%d %H:%M:%S" => 21/12/31 24:58:01 +"%y%m%d %H:%M:%S" => 210319 23:58:50 +"%Y/%m/%d %H:%M:%S" => 2021/12/31 12:54:98 +"%Y-%m-%d %H:%M:%S" => 2021-12-31 24:58:01 +"%Y/%m/%d %H:%M:%S" => 2021/12/31 24:58:01 +"%Y%m%d %H:%M:%S" => 20210319 23:58:50 +"%FT%H:%M:%S" => 2019-04-18T02:45:55 +"%FT%H:%M:%S.%6f" => microseconds +"%FT%H:%M:%S.%9f" => nanoseconds diff --git a/commands/docs/dfr_as.md b/src/content/docs/commands/docs/dfr_as.md similarity index 92% rename from commands/docs/dfr_as.md rename to src/content/docs/commands/docs/dfr_as.md index 0f709570a26..cb3606184eb 100644 --- a/commands/docs/dfr_as.md +++ b/src/content/docs/commands/docs/dfr_as.md @@ -9,24 +9,24 @@ usage: | Creates an alias expression. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr as {flags} (Alias name)``` +`> dfr as {flags} (Alias name)` ## Parameters - - `Alias name`: Alias name for the expression - +- `Alias name`: Alias name for the expression ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Creates and alias expression + ```nu > dfr col a | dfr as new_a | dfr into-nu ╭───────┬────────────────────╮ diff --git a/commands/docs/dfr_cache.md b/src/content/docs/commands/docs/dfr_cache.md similarity index 94% rename from commands/docs/dfr_cache.md rename to src/content/docs/commands/docs/dfr_cache.md index 016b80337ff..1180ceaffa7 100644 --- a/commands/docs/dfr_cache.md +++ b/src/content/docs/commands/docs/dfr_cache.md @@ -9,20 +9,20 @@ usage: | Caches operations in a new LazyFrame. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for lazyframe <div class='command-title'>{{ $frontmatter.lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr cache {flags} ``` +## Signature +`> dfr cache {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Caches the result into a new LazyFrame + ```nu > [[a b]; [6 2] [4 2] [2 2]] | dfr into-df | dfr reverse | dfr cache diff --git a/commands/docs/dfr_col.md b/src/content/docs/commands/docs/dfr_col.md similarity index 90% rename from commands/docs/dfr_col.md rename to src/content/docs/commands/docs/dfr_col.md index a39e3389a89..0c1ecea0101 100644 --- a/commands/docs/dfr_col.md +++ b/src/content/docs/commands/docs/dfr_col.md @@ -9,24 +9,24 @@ usage: | Creates a named column expression. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr col {flags} (column name)``` +`> dfr col {flags} (column name)` ## Parameters - - `column name`: Name of column to be used - +- `column name`: Name of column to be used ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Creates a named column expression and converts it to a nu object + ```nu > dfr col a | dfr into-nu ╭───────┬────────╮ diff --git a/commands/docs/dfr_collect.md b/src/content/docs/commands/docs/dfr_collect.md similarity index 95% rename from commands/docs/dfr_collect.md rename to src/content/docs/commands/docs/dfr_collect.md index 57ba4653926..aae97da9a20 100644 --- a/commands/docs/dfr_collect.md +++ b/src/content/docs/commands/docs/dfr_collect.md @@ -9,20 +9,20 @@ usage: | Collect lazy dataframe into eager dataframe. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for lazyframe <div class='command-title'>{{ $frontmatter.lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr collect {flags} ``` +## Signature +`> dfr collect {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples drop duplicates + ```nu > [[a b]; [1 2] [3 4]] | dfr into-lazy | dfr collect ╭───┬───┬───╮ diff --git a/commands/docs/dfr_columns.md b/src/content/docs/commands/docs/dfr_columns.md similarity index 94% rename from commands/docs/dfr_columns.md rename to src/content/docs/commands/docs/dfr_columns.md index 2d814401b03..7810656fb8d 100644 --- a/commands/docs/dfr_columns.md +++ b/src/content/docs/commands/docs/dfr_columns.md @@ -9,20 +9,20 @@ usage: | Show dataframe columns. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr columns {flags} ``` +## Signature +`> dfr columns {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Dataframe columns + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr columns ╭───┬───╮ diff --git a/commands/docs/dfr_concat-str.md b/src/content/docs/commands/docs/dfr_concat-str.md similarity index 87% rename from commands/docs/dfr_concat-str.md rename to src/content/docs/commands/docs/dfr_concat-str.md index 57dde699bde..fb617d61679 100644 --- a/commands/docs/dfr_concat-str.md +++ b/src/content/docs/commands/docs/dfr_concat-str.md @@ -9,25 +9,25 @@ usage: | Creates a concat string expression. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr concat-str {flags} (separator) (concat expressions)``` +`> dfr concat-str {flags} (separator) (concat expressions)` ## Parameters - - `separator`: Separator used during the concatenation - - `concat expressions`: Expression(s) that define the string concatenation - +- `separator`: Separator used during the concatenation +- `concat expressions`: Expression(s) that define the string concatenation ## Input/output types: @@ -38,6 +38,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Creates a concat string expression + ```nu > let df = ([[a b c]; [one two 1] [three four 2]] | dfr into-df); $df | dfr with-column ((dfr concat-str "-" [(dfr col a) (dfr col b) ((dfr col c) * 2)]) | dfr as concat) diff --git a/commands/docs/dfr_concatenate.md b/src/content/docs/commands/docs/dfr_concatenate.md similarity index 90% rename from commands/docs/dfr_concatenate.md rename to src/content/docs/commands/docs/dfr_concatenate.md index 06742cc2a4a..3baed23ff8d 100644 --- a/commands/docs/dfr_concatenate.md +++ b/src/content/docs/commands/docs/dfr_concatenate.md @@ -9,24 +9,24 @@ usage: | Concatenates strings with other array. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr concatenate {flags} (other)``` +`> dfr concatenate {flags} (other)` ## Parameters - - `other`: Other array with string to be concatenated - +- `other`: Other array with string to be concatenated ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Concatenate string + ```nu > let other = ([za xs cd] | dfr into-df); [abc abc abc] | dfr into-df | dfr concatenate $other diff --git a/commands/docs/dfr_contains.md b/src/content/docs/commands/docs/dfr_contains.md similarity index 91% rename from commands/docs/dfr_contains.md rename to src/content/docs/commands/docs/dfr_contains.md index 78564bcbbfb..20754ca6089 100644 --- a/commands/docs/dfr_contains.md +++ b/src/content/docs/commands/docs/dfr_contains.md @@ -9,24 +9,24 @@ usage: | Checks if a pattern is contained in a string. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr contains {flags} (pattern)``` +`> dfr contains {flags} (pattern)` ## Parameters - - `pattern`: Regex pattern to be searched - +- `pattern`: Regex pattern to be searched ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns boolean indicating if pattern was found + ```nu > [abc acb acb] | dfr into-df | dfr contains ab ╭───┬───────╮ diff --git a/commands/docs/dfr_count-null.md b/src/content/docs/commands/docs/dfr_count-null.md similarity index 95% rename from commands/docs/dfr_count-null.md rename to src/content/docs/commands/docs/dfr_count-null.md index 53e5fef455b..32ef89de99c 100644 --- a/commands/docs/dfr_count-null.md +++ b/src/content/docs/commands/docs/dfr_count-null.md @@ -9,20 +9,20 @@ usage: | Counts null values. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr count-null {flags} ``` +## Signature +`> dfr count-null {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Counts null values + ```nu > let s = ([1 1 0 0 3 3 4] | dfr into-df); ($s / $s) | dfr count-null diff --git a/commands/docs/dfr_count.md b/src/content/docs/commands/docs/dfr_count.md similarity index 93% rename from commands/docs/dfr_count.md rename to src/content/docs/commands/docs/dfr_count.md index 6658d63ca02..4f033dd19da 100644 --- a/commands/docs/dfr_count.md +++ b/src/content/docs/commands/docs/dfr_count.md @@ -9,20 +9,20 @@ usage: | Creates a count expression. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr count {flags} ``` +## Signature +`> dfr count {flags} ` ## Input/output types: @@ -32,7 +32,6 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples - ```nu > diff --git a/commands/docs/dfr_cumulative.md b/src/content/docs/commands/docs/dfr_cumulative.md similarity index 89% rename from commands/docs/dfr_cumulative.md rename to src/content/docs/commands/docs/dfr_cumulative.md index 71f2dd1cf27..e6a335973ab 100644 --- a/commands/docs/dfr_cumulative.md +++ b/src/content/docs/commands/docs/dfr_cumulative.md @@ -9,28 +9,28 @@ usage: | Cumulative calculation for a series. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr cumulative {flags} (type)``` +`> dfr cumulative {flags} (type)` ## Flags - - `--reverse, -r`: Reverse cumulative calculation +- `--reverse, -r`: Reverse cumulative calculation ## Parameters - - `type`: rolling operation - +- `type`: rolling operation ## Input/output types: @@ -41,6 +41,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Cumulative sum for a series + ```nu > [1 2 3 4 5] | dfr into-df | dfr cumulative sum ╭───┬──────────────────╮ diff --git a/commands/docs/dfr_datepart.md b/src/content/docs/commands/docs/dfr_datepart.md similarity index 94% rename from commands/docs/dfr_datepart.md rename to src/content/docs/commands/docs/dfr_datepart.md index 06e840195e2..dd5db1eec10 100644 --- a/commands/docs/dfr_datepart.md +++ b/src/content/docs/commands/docs/dfr_datepart.md @@ -9,24 +9,24 @@ usage: | Creates an expression for capturing the specified datepart in a column. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr datepart {flags} (Datepart name)``` +`> dfr datepart {flags} (Datepart name)` ## Parameters - - `Datepart name`: Part of the date to capture. Possible values are year, quarter, month, week, weekday, day, hour, minute, second, millisecond, microsecond, nanosecond - +- `Datepart name`: Part of the date to capture. Possible values are year, quarter, month, week, weekday, day, hour, minute, second, millisecond, microsecond, nanosecond ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Creates an expression to capture the year date part + ```nu > [["2021-12-30T01:02:03.123456789"]] | dfr into-df | dfr as-datetime "%Y-%m-%dT%H:%M:%S.%9f" | dfr with-column [(dfr col datetime | dfr datepart year | dfr as datetime_year )] ╭───┬─────────────┬───────────────╮ @@ -48,6 +49,7 @@ Creates an expression to capture the year date part ``` Creates an expression to capture multiple date parts + ```nu > [["2021-12-30T01:02:03.123456789"]] | dfr into-df | dfr as-datetime "%Y-%m-%dT%H:%M:%S.%9f" | dfr with-column [ (dfr col datetime | dfr datepart year | dfr as datetime_year ), diff --git a/commands/docs/dfr_drop-duplicates.md b/src/content/docs/commands/docs/dfr_drop-duplicates.md similarity index 82% rename from commands/docs/dfr_drop-duplicates.md rename to src/content/docs/commands/docs/dfr_drop-duplicates.md index b50305fc089..f79dec8c2f9 100644 --- a/commands/docs/dfr_drop-duplicates.md +++ b/src/content/docs/commands/docs/dfr_drop-duplicates.md @@ -9,29 +9,29 @@ usage: | Drops duplicate values in dataframe. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr drop-duplicates {flags} (subset)``` +`> dfr drop-duplicates {flags} (subset)` ## Flags - - `--maintain, -m`: maintain order - - `--last, -l`: keeps last duplicate value (by default keeps first) +- `--maintain, -m`: maintain order +- `--last, -l`: keeps last duplicate value (by default keeps first) ## Parameters - - `subset`: subset of columns to drop duplicates - +- `subset`: subset of columns to drop duplicates ## Input/output types: @@ -42,6 +42,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples drop duplicates + ```nu > [[a b]; [1 2] [3 4] [1 2]] | dfr into-df | dfr drop-duplicates ╭───┬───┬───╮ diff --git a/commands/docs/dfr_drop-nulls.md b/src/content/docs/commands/docs/dfr_drop-nulls.md similarity index 93% rename from commands/docs/dfr_drop-nulls.md rename to src/content/docs/commands/docs/dfr_drop-nulls.md index 01d045060b0..5fdd47e0d74 100644 --- a/commands/docs/dfr_drop-nulls.md +++ b/src/content/docs/commands/docs/dfr_drop-nulls.md @@ -9,24 +9,24 @@ usage: | Drops null values in dataframe. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr drop-nulls {flags} (subset)``` +`> dfr drop-nulls {flags} (subset)` ## Parameters - - `subset`: subset of columns to drop nulls - +- `subset`: subset of columns to drop nulls ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples drop null values in dataframe + ```nu > let df = ([[a b]; [1 2] [3 0] [1 2]] | dfr into-df); let res = ($df.b / $df.b); @@ -52,6 +53,7 @@ drop null values in dataframe ``` drop null values in dataframe + ```nu > let s = ([1 2 0 0 3 4] | dfr into-df); ($s / $s) | dfr drop-nulls diff --git a/commands/docs/dfr_drop.md b/src/content/docs/commands/docs/dfr_drop.md similarity index 91% rename from commands/docs/dfr_drop.md rename to src/content/docs/commands/docs/dfr_drop.md index c4bd5b748d8..043954e70dd 100644 --- a/commands/docs/dfr_drop.md +++ b/src/content/docs/commands/docs/dfr_drop.md @@ -9,24 +9,24 @@ usage: | Creates a new dataframe by dropping the selected columns. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr drop {flags} ...rest``` +`> dfr drop {flags} ...rest` ## Parameters - - `...rest`: column names to be dropped - +- `...rest`: column names to be dropped ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples drop column a + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr drop a ╭───┬───╮ diff --git a/commands/docs/dfr_dtypes.md b/src/content/docs/commands/docs/dfr_dtypes.md similarity index 95% rename from commands/docs/dfr_dtypes.md rename to src/content/docs/commands/docs/dfr_dtypes.md index fca9c6a59c3..394fae2aac5 100644 --- a/commands/docs/dfr_dtypes.md +++ b/src/content/docs/commands/docs/dfr_dtypes.md @@ -9,20 +9,20 @@ usage: | Show dataframe data types. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr dtypes {flags} ``` +## Signature +`> dfr dtypes {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Dataframe dtypes + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr dtypes ╭───┬────────┬───────╮ diff --git a/commands/docs/dfr_dummies.md b/src/content/docs/commands/docs/dfr_dummies.md similarity index 95% rename from commands/docs/dfr_dummies.md rename to src/content/docs/commands/docs/dfr_dummies.md index 824c1ba42c4..6b4e71ec921 100644 --- a/commands/docs/dfr_dummies.md +++ b/src/content/docs/commands/docs/dfr_dummies.md @@ -9,24 +9,24 @@ usage: | Creates a new dataframe with dummy variables. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr dummies {flags} ``` +`> dfr dummies {flags} ` ## Flags - - `--drop-first, -d`: Drop first row - +- `--drop-first, -d`: Drop first row ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Create new dataframe with dummy variables from a dataframe + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr dummies ╭───┬─────┬─────┬─────┬─────╮ @@ -49,6 +50,7 @@ Create new dataframe with dummy variables from a dataframe ``` Create new dataframe with dummy variables from a series + ```nu > [1 2 2 3 3] | dfr into-df | dfr dummies ╭───┬─────┬─────┬─────╮ diff --git a/commands/docs/dfr_explode.md b/src/content/docs/commands/docs/dfr_explode.md similarity index 93% rename from commands/docs/dfr_explode.md rename to src/content/docs/commands/docs/dfr_explode.md index 7c148832af4..e7fe19101f4 100644 --- a/commands/docs/dfr_explode.md +++ b/src/content/docs/commands/docs/dfr_explode.md @@ -9,24 +9,24 @@ usage: | Explodes a dataframe or creates a explode expression. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for lazyframe <div class='command-title'>{{ $frontmatter.lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr explode {flags} ...rest``` +`> dfr explode {flags} ...rest` ## Parameters - - `...rest`: columns to explode, only applicable for dataframes - +- `...rest`: columns to explode, only applicable for dataframes ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Explode the specified dataframe + ```nu > [[id name hobbies]; [1 Mercy [Cycling Knitting]] [2 Bob [Skiing Football]]] | dfr into-df | dfr explode hobbies | dfr collect ╭───┬────┬───────┬──────────╮ @@ -51,6 +52,7 @@ Explode the specified dataframe ``` Select a column and explode the values + ```nu > [[id name hobbies]; [1 Mercy [Cycling Knitting]] [2 Bob [Skiing Football]]] | dfr into-df | dfr select (dfr col hobbies | dfr explode) ╭───┬──────────╮ diff --git a/commands/docs/dfr_expr-not.md b/src/content/docs/commands/docs/dfr_expr-not.md similarity index 93% rename from commands/docs/dfr_expr-not.md rename to src/content/docs/commands/docs/dfr_expr-not.md index 08fd292f655..ce0f9914be5 100644 --- a/commands/docs/dfr_expr-not.md +++ b/src/content/docs/commands/docs/dfr_expr-not.md @@ -9,20 +9,20 @@ usage: | Creates a not expression. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr expr-not {flags} ``` +## Signature +`> dfr expr-not {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Creates a not expression + ```nu > (dfr col a) > 2) | dfr expr-not diff --git a/commands/docs/dfr_fetch.md b/src/content/docs/commands/docs/dfr_fetch.md similarity index 90% rename from commands/docs/dfr_fetch.md rename to src/content/docs/commands/docs/dfr_fetch.md index 6d254952b26..115b7b7a3b1 100644 --- a/commands/docs/dfr_fetch.md +++ b/src/content/docs/commands/docs/dfr_fetch.md @@ -9,24 +9,24 @@ usage: | Collects the lazyframe to the selected rows. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for lazyframe <div class='command-title'>{{ $frontmatter.lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr fetch {flags} (rows)``` +`> dfr fetch {flags} (rows)` ## Parameters - - `rows`: number of rows to be fetched from lazyframe - +- `rows`: number of rows to be fetched from lazyframe ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Fetch a rows from the dataframe + ```nu > [[a b]; [6 2] [4 2] [2 2]] | dfr into-df | dfr fetch 2 ╭───┬───┬───╮ diff --git a/commands/docs/dfr_fill-nan.md b/src/content/docs/commands/docs/dfr_fill-nan.md similarity index 92% rename from commands/docs/dfr_fill-nan.md rename to src/content/docs/commands/docs/dfr_fill-nan.md index 1cd24158c06..8ef7093be63 100644 --- a/commands/docs/dfr_fill-nan.md +++ b/src/content/docs/commands/docs/dfr_fill-nan.md @@ -9,24 +9,24 @@ usage: | Replaces NaN values with the given expression. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for lazyframe <div class='command-title'>{{ $frontmatter.lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr fill-nan {flags} (fill)``` +`> dfr fill-nan {flags} (fill)` ## Parameters - - `fill`: Expression to use to fill the NAN values - +- `fill`: Expression to use to fill the NAN values ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Fills the NaN values with 0 + ```nu > [1 2 NaN 3 NaN] | dfr into-df | dfr fill-nan 0 ╭───┬───╮ @@ -52,6 +53,7 @@ Fills the NaN values with 0 ``` Fills the NaN values of a whole dataframe + ```nu > [[a b]; [0.2 1] [0.1 NaN]] | dfr into-df | dfr fill-nan 0 ╭───┬──────┬───╮ diff --git a/commands/docs/dfr_fill-null.md b/src/content/docs/commands/docs/dfr_fill-null.md similarity index 90% rename from commands/docs/dfr_fill-null.md rename to src/content/docs/commands/docs/dfr_fill-null.md index 4fdeacccf18..b8a27b0e45a 100644 --- a/commands/docs/dfr_fill-null.md +++ b/src/content/docs/commands/docs/dfr_fill-null.md @@ -9,24 +9,24 @@ usage: | Replaces NULL values with the given expression. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for lazyframe <div class='command-title'>{{ $frontmatter.lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr fill-null {flags} (fill)``` +`> dfr fill-null {flags} (fill)` ## Parameters - - `fill`: Expression to use to fill the null values - +- `fill`: Expression to use to fill the null values ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Fills the null values by 0 + ```nu > [1 2 2 3 3] | dfr into-df | dfr shift 2 | dfr fill-null 0 ╭───┬───╮ diff --git a/commands/docs/dfr_filter-with.md b/src/content/docs/commands/docs/dfr_filter-with.md similarity index 91% rename from commands/docs/dfr_filter-with.md rename to src/content/docs/commands/docs/dfr_filter-with.md index 8c5634344a5..c40bbe5ed8a 100644 --- a/commands/docs/dfr_filter-with.md +++ b/src/content/docs/commands/docs/dfr_filter-with.md @@ -9,24 +9,24 @@ usage: | Filters dataframe using a mask or expression as reference. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe or lazyframe <div class='command-title'>{{ $frontmatter.dataframe_or_lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr filter-with {flags} (mask or expression)``` +`> dfr filter-with {flags} (mask or expression)` ## Parameters - - `mask or expression`: boolean mask used to filter data - +- `mask or expression`: boolean mask used to filter data ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Filter dataframe using a bool mask + ```nu > let mask = ([true false] | dfr into-df); [[a b]; [1 2] [3 4]] | dfr into-df | dfr filter-with $mask @@ -49,6 +50,7 @@ Filter dataframe using a bool mask ``` Filter dataframe using an expression + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr filter-with ((dfr col a) > 1) ╭───┬───┬───╮ diff --git a/commands/docs/dfr_filter.md b/src/content/docs/commands/docs/dfr_filter.md similarity index 88% rename from commands/docs/dfr_filter.md rename to src/content/docs/commands/docs/dfr_filter.md index afb50d83d9d..3236c820cc1 100644 --- a/commands/docs/dfr_filter.md +++ b/src/content/docs/commands/docs/dfr_filter.md @@ -9,24 +9,24 @@ usage: | Filter dataframe based in expression. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for lazyframe <div class='command-title'>{{ $frontmatter.lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr filter {flags} (filter expression)``` +`> dfr filter {flags} (filter expression)` ## Parameters - - `filter expression`: Expression that define the column selection - +- `filter expression`: Expression that define the column selection ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Filter dataframe using an expression + ```nu > [[a b]; [6 2] [4 2] [2 2]] | dfr into-df | dfr filter ((dfr col a) >= 4) ╭───┬───┬───╮ diff --git a/commands/docs/dfr_first.md b/src/content/docs/commands/docs/dfr_first.md similarity index 92% rename from commands/docs/dfr_first.md rename to src/content/docs/commands/docs/dfr_first.md index 6ff32af55db..d647f19c380 100644 --- a/commands/docs/dfr_first.md +++ b/src/content/docs/commands/docs/dfr_first.md @@ -9,24 +9,24 @@ usage: | Show only the first number of rows or create a first expression feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr first {flags} (rows)``` +`> dfr first {flags} (rows)` ## Parameters - - `rows`: starting from the front, the number of rows to return - +- `rows`: starting from the front, the number of rows to return ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Return the first row of a dataframe + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr first ╭───┬───┬───╮ @@ -48,6 +49,7 @@ Return the first row of a dataframe ``` Return the first two rows of a dataframe + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr first 2 ╭───┬───┬───╮ @@ -60,6 +62,7 @@ Return the first two rows of a dataframe ``` Creates a first expression from a column + ```nu > dfr col a | dfr first diff --git a/commands/docs/dfr_flatten.md b/src/content/docs/commands/docs/dfr_flatten.md similarity index 93% rename from commands/docs/dfr_flatten.md rename to src/content/docs/commands/docs/dfr_flatten.md index 68f763afb07..56f626a3473 100644 --- a/commands/docs/dfr_flatten.md +++ b/src/content/docs/commands/docs/dfr_flatten.md @@ -9,24 +9,24 @@ usage: | An alias for dfr explode. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for lazyframe <div class='command-title'>{{ $frontmatter.lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr flatten {flags} ...rest``` +`> dfr flatten {flags} ...rest` ## Parameters - - `...rest`: columns to flatten, only applicable for dataframes - +- `...rest`: columns to flatten, only applicable for dataframes ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Flatten the specified dataframe + ```nu > [[id name hobbies]; [1 Mercy [Cycling Knitting]] [2 Bob [Skiing Football]]] | dfr into-df | dfr flatten hobbies | dfr collect ╭───┬────┬───────┬──────────╮ @@ -51,6 +52,7 @@ Flatten the specified dataframe ``` Select a column and flatten the values + ```nu > [[id name hobbies]; [1 Mercy [Cycling Knitting]] [2 Bob [Skiing Football]]] | dfr into-df | dfr select (dfr col hobbies | dfr flatten) ╭───┬──────────╮ diff --git a/commands/docs/dfr_get-day.md b/src/content/docs/commands/docs/dfr_get-day.md similarity index 95% rename from commands/docs/dfr_get-day.md rename to src/content/docs/commands/docs/dfr_get-day.md index 558696b9639..3e0e20d51ea 100644 --- a/commands/docs/dfr_get-day.md +++ b/src/content/docs/commands/docs/dfr_get-day.md @@ -9,20 +9,20 @@ usage: | Gets day from date. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr get-day {flags} ``` +## Signature +`> dfr get-day {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns day from a date + ```nu > let dt = ('2020-08-04T16:39:18+00:00' | into datetime --timezone 'UTC'); let df = ([$dt $dt] | dfr into-df); diff --git a/commands/docs/dfr_get-hour.md b/src/content/docs/commands/docs/dfr_get-hour.md similarity index 95% rename from commands/docs/dfr_get-hour.md rename to src/content/docs/commands/docs/dfr_get-hour.md index acedf540e10..3c177ce6c86 100644 --- a/commands/docs/dfr_get-hour.md +++ b/src/content/docs/commands/docs/dfr_get-hour.md @@ -9,20 +9,20 @@ usage: | Gets hour from date. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr get-hour {flags} ``` +## Signature +`> dfr get-hour {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns hour from a date + ```nu > let dt = ('2020-08-04T16:39:18+00:00' | into datetime --timezone 'UTC'); let df = ([$dt $dt] | dfr into-df); diff --git a/commands/docs/dfr_get-minute.md b/src/content/docs/commands/docs/dfr_get-minute.md similarity index 95% rename from commands/docs/dfr_get-minute.md rename to src/content/docs/commands/docs/dfr_get-minute.md index 67068fb8c6b..e37c5982173 100644 --- a/commands/docs/dfr_get-minute.md +++ b/src/content/docs/commands/docs/dfr_get-minute.md @@ -9,20 +9,20 @@ usage: | Gets minute from date. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr get-minute {flags} ``` +## Signature +`> dfr get-minute {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns minute from a date + ```nu > let dt = ('2020-08-04T16:39:18+00:00' | into datetime --timezone 'UTC'); let df = ([$dt $dt] | dfr into-df); diff --git a/commands/docs/dfr_get-month.md b/src/content/docs/commands/docs/dfr_get-month.md similarity index 95% rename from commands/docs/dfr_get-month.md rename to src/content/docs/commands/docs/dfr_get-month.md index 4a56bff1f8a..f91c03379f5 100644 --- a/commands/docs/dfr_get-month.md +++ b/src/content/docs/commands/docs/dfr_get-month.md @@ -9,20 +9,20 @@ usage: | Gets month from date. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr get-month {flags} ``` +## Signature +`> dfr get-month {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns month from a date + ```nu > let dt = ('2020-08-04T16:39:18+00:00' | into datetime --timezone 'UTC'); let df = ([$dt $dt] | dfr into-df); diff --git a/commands/docs/dfr_get-nanosecond.md b/src/content/docs/commands/docs/dfr_get-nanosecond.md similarity index 94% rename from commands/docs/dfr_get-nanosecond.md rename to src/content/docs/commands/docs/dfr_get-nanosecond.md index d2fa35eb51c..4f8efecd315 100644 --- a/commands/docs/dfr_get-nanosecond.md +++ b/src/content/docs/commands/docs/dfr_get-nanosecond.md @@ -9,20 +9,20 @@ usage: | Gets nanosecond from date. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr get-nanosecond {flags} ``` +## Signature +`> dfr get-nanosecond {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns nanosecond from a date + ```nu > let dt = ('2020-08-04T16:39:18+00:00' | into datetime --timezone 'UTC'); let df = ([$dt $dt] | dfr into-df); diff --git a/commands/docs/dfr_get-ordinal.md b/src/content/docs/commands/docs/dfr_get-ordinal.md similarity index 95% rename from commands/docs/dfr_get-ordinal.md rename to src/content/docs/commands/docs/dfr_get-ordinal.md index f3f52bdfb76..2864c7a58ec 100644 --- a/commands/docs/dfr_get-ordinal.md +++ b/src/content/docs/commands/docs/dfr_get-ordinal.md @@ -9,20 +9,20 @@ usage: | Gets ordinal from date. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr get-ordinal {flags} ``` +## Signature +`> dfr get-ordinal {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns ordinal from a date + ```nu > let dt = ('2020-08-04T16:39:18+00:00' | into datetime --timezone 'UTC'); let df = ([$dt $dt] | dfr into-df); diff --git a/commands/docs/dfr_get-second.md b/src/content/docs/commands/docs/dfr_get-second.md similarity index 95% rename from commands/docs/dfr_get-second.md rename to src/content/docs/commands/docs/dfr_get-second.md index 066f3844afa..25f23aee391 100644 --- a/commands/docs/dfr_get-second.md +++ b/src/content/docs/commands/docs/dfr_get-second.md @@ -9,20 +9,20 @@ usage: | Gets second from date. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr get-second {flags} ``` +## Signature +`> dfr get-second {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns second from a date + ```nu > let dt = ('2020-08-04T16:39:18+00:00' | into datetime --timezone 'UTC'); let df = ([$dt $dt] | dfr into-df); diff --git a/commands/docs/dfr_get-week.md b/src/content/docs/commands/docs/dfr_get-week.md similarity index 95% rename from commands/docs/dfr_get-week.md rename to src/content/docs/commands/docs/dfr_get-week.md index dd041cbd935..f40b81fb626 100644 --- a/commands/docs/dfr_get-week.md +++ b/src/content/docs/commands/docs/dfr_get-week.md @@ -9,20 +9,20 @@ usage: | Gets week from date. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr get-week {flags} ``` +## Signature +`> dfr get-week {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns week from a date + ```nu > let dt = ('2020-08-04T16:39:18+00:00' | into datetime --timezone 'UTC'); let df = ([$dt $dt] | dfr into-df); diff --git a/commands/docs/dfr_get-weekday.md b/src/content/docs/commands/docs/dfr_get-weekday.md similarity index 95% rename from commands/docs/dfr_get-weekday.md rename to src/content/docs/commands/docs/dfr_get-weekday.md index cc76b9ad681..627d8e26e4f 100644 --- a/commands/docs/dfr_get-weekday.md +++ b/src/content/docs/commands/docs/dfr_get-weekday.md @@ -9,20 +9,20 @@ usage: | Gets weekday from date. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr get-weekday {flags} ``` +## Signature +`> dfr get-weekday {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns weekday from a date + ```nu > let dt = ('2020-08-04T16:39:18+00:00' | into datetime --timezone 'UTC'); let df = ([$dt $dt] | dfr into-df); diff --git a/commands/docs/dfr_get-year.md b/src/content/docs/commands/docs/dfr_get-year.md similarity index 95% rename from commands/docs/dfr_get-year.md rename to src/content/docs/commands/docs/dfr_get-year.md index 3d5ebfac362..4dd4835675d 100644 --- a/commands/docs/dfr_get-year.md +++ b/src/content/docs/commands/docs/dfr_get-year.md @@ -9,20 +9,20 @@ usage: | Gets year from date. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr get-year {flags} ``` +## Signature +`> dfr get-year {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns year from a date + ```nu > let dt = ('2020-08-04T16:39:18+00:00' | into datetime --timezone 'UTC'); let df = ([$dt $dt] | dfr into-df); diff --git a/commands/docs/dfr_get.md b/src/content/docs/commands/docs/dfr_get.md similarity index 90% rename from commands/docs/dfr_get.md rename to src/content/docs/commands/docs/dfr_get.md index 4aa223a9096..eb086742260 100644 --- a/commands/docs/dfr_get.md +++ b/src/content/docs/commands/docs/dfr_get.md @@ -9,24 +9,24 @@ usage: | Creates dataframe with the selected columns. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr get {flags} ...rest``` +`> dfr get {flags} ...rest` ## Parameters - - `...rest`: column names to sort dataframe - +- `...rest`: column names to sort dataframe ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns the selected column + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr get a ╭───┬───╮ diff --git a/commands/docs/dfr_group-by.md b/src/content/docs/commands/docs/dfr_group-by.md similarity index 95% rename from commands/docs/dfr_group-by.md rename to src/content/docs/commands/docs/dfr_group-by.md index 317de9c9660..acb3a825593 100644 --- a/commands/docs/dfr_group-by.md +++ b/src/content/docs/commands/docs/dfr_group-by.md @@ -9,24 +9,24 @@ usage: | Creates a group-by object that can be used for other aggregations. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for lazyframe <div class='command-title'>{{ $frontmatter.lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr group-by {flags} ...rest``` +`> dfr group-by {flags} ...rest` ## Parameters - - `...rest`: Expression(s) that define the lazy group-by - +- `...rest`: Expression(s) that define the lazy group-by ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Group by and perform an aggregation + ```nu > [[a b]; [1 2] [1 4] [2 6] [2 4]] | dfr into-df @@ -56,6 +57,7 @@ Group by and perform an aggregation ``` Group by and perform an aggregation + ```nu > [[a b]; [1 2] [1 4] [2 6] [2 4]] | dfr into-lazy diff --git a/commands/docs/dfr_implode.md b/src/content/docs/commands/docs/dfr_implode.md similarity index 93% rename from commands/docs/dfr_implode.md rename to src/content/docs/commands/docs/dfr_implode.md index a67e0424856..d71fb01a33e 100644 --- a/commands/docs/dfr_implode.md +++ b/src/content/docs/commands/docs/dfr_implode.md @@ -9,20 +9,20 @@ usage: | Aggregates a group to a Series. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr implode {flags} ``` +## Signature +`> dfr implode {flags} ` ## Input/output types: @@ -32,7 +32,6 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples - ```nu > diff --git a/commands/docs/dfr_into-df.md b/src/content/docs/commands/docs/dfr_into-df.md similarity index 95% rename from commands/docs/dfr_into-df.md rename to src/content/docs/commands/docs/dfr_into-df.md index 1541aaaf933..ffd5486f360 100644 --- a/commands/docs/dfr_into-df.md +++ b/src/content/docs/commands/docs/dfr_into-df.md @@ -9,24 +9,24 @@ usage: | Converts a list, table or record into a dataframe. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr into-df {flags} ``` +`> dfr into-df {flags} ` ## Flags - - `--schema, -s {record}`: Polars Schema in format [{name: str}]. CSV, JSON, and JSONL files - +- `--schema, -s {record}`: Polars Schema in format [{name: str}]. CSV, JSON, and JSONL files ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Takes a dictionary and creates a dataframe + ```nu > [[a b];[1 2] [3 4]] | dfr into-df ╭───┬───┬───╮ @@ -49,6 +50,7 @@ Takes a dictionary and creates a dataframe ``` Takes a list of tables and creates a dataframe + ```nu > [[1 2 a] [3 4 b] [5 6 c]] | dfr into-df ╭───┬───┬───┬───╮ @@ -62,6 +64,7 @@ Takes a list of tables and creates a dataframe ``` Takes a list and creates a dataframe + ```nu > [a b c] | dfr into-df ╭───┬───╮ @@ -75,6 +78,7 @@ Takes a list and creates a dataframe ``` Takes a list of booleans and creates a dataframe + ```nu > [true true false] | dfr into-df ╭───┬───────╮ @@ -88,6 +92,7 @@ Takes a list of booleans and creates a dataframe ``` Convert to a dataframe and provide a schema + ```nu > {a: 1, b: {a: [1 2 3]}, c: [a b c]}| dfr into-df -s {a: u8, b: {a: list<u64>}, c: list<str>} ╭───┬───┬───────────────────┬───────────╮ diff --git a/commands/docs/dfr_into-lazy.md b/src/content/docs/commands/docs/dfr_into-lazy.md similarity index 84% rename from commands/docs/dfr_into-lazy.md rename to src/content/docs/commands/docs/dfr_into-lazy.md index 5be56dab85f..8d6dad337fc 100644 --- a/commands/docs/dfr_into-lazy.md +++ b/src/content/docs/commands/docs/dfr_into-lazy.md @@ -9,24 +9,24 @@ usage: | Converts a dataframe into a lazy dataframe. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for lazyframe <div class='command-title'>{{ $frontmatter.lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr into-lazy {flags} ``` +`> dfr into-lazy {flags} ` ## Flags - - `--schema, -s {record}`: Polars Schema in format [{name: str}]. CSV, JSON, and JSONL files - +- `--schema, -s {record}`: Polars Schema in format [{name: str}]. CSV, JSON, and JSONL files ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Takes a dictionary and creates a lazy dataframe + ```nu > [[a b];[1 2] [3 4]] | dfr into-lazy diff --git a/commands/docs/dfr_into-nu.md b/src/content/docs/commands/docs/dfr_into-nu.md similarity index 92% rename from commands/docs/dfr_into-nu.md rename to src/content/docs/commands/docs/dfr_into-nu.md index 432bde5606e..a1ca9692c60 100644 --- a/commands/docs/dfr_into-nu.md +++ b/src/content/docs/commands/docs/dfr_into-nu.md @@ -9,25 +9,25 @@ usage: | Converts a dataframe or an expression into into nushell value for access and exploration. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr into-nu {flags} ``` +`> dfr into-nu {flags} ` ## Flags - - `--rows, -n {number}`: number of rows to be shown - - `--tail, -t`: shows tail rows - +- `--rows, -n {number}`: number of rows to be shown +- `--tail, -t`: shows tail rows ## Input/output types: @@ -38,6 +38,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Shows head rows from dataframe + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr into-nu ╭───┬───┬───╮ @@ -50,6 +51,7 @@ Shows head rows from dataframe ``` Shows tail rows from dataframe + ```nu > [[a b]; [1 2] [5 6] [3 4]] | dfr into-df | dfr into-nu --tail --rows 1 ╭───┬───┬───╮ @@ -61,6 +63,7 @@ Shows tail rows from dataframe ``` Convert a col expression into a nushell value + ```nu > dfr col a | dfr into-nu ╭───────┬────────╮ diff --git a/commands/docs/dfr_is-duplicated.md b/src/content/docs/commands/docs/dfr_is-duplicated.md similarity index 96% rename from commands/docs/dfr_is-duplicated.md rename to src/content/docs/commands/docs/dfr_is-duplicated.md index 5c308a5cd14..8c121f56c6e 100644 --- a/commands/docs/dfr_is-duplicated.md +++ b/src/content/docs/commands/docs/dfr_is-duplicated.md @@ -9,20 +9,20 @@ usage: | Creates mask indicating duplicated values. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr is-duplicated {flags} ``` +## Signature +`> dfr is-duplicated {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Create mask indicating duplicated values + ```nu > [5 6 6 6 8 8 8] | dfr into-df | dfr is-duplicated ╭───┬───────────────╮ @@ -50,6 +51,7 @@ Create mask indicating duplicated values ``` Create mask indicating duplicated rows in a dataframe + ```nu > [[a, b]; [1 2] [1 2] [3 3] [3 3] [1 1]] | dfr into-df | dfr is-duplicated ╭───┬───────────────╮ diff --git a/commands/docs/dfr_is-in.md b/src/content/docs/commands/docs/dfr_is-in.md similarity index 93% rename from commands/docs/dfr_is-in.md rename to src/content/docs/commands/docs/dfr_is-in.md index a15e7b6f484..24093e2c44e 100644 --- a/commands/docs/dfr_is-in.md +++ b/src/content/docs/commands/docs/dfr_is-in.md @@ -9,24 +9,24 @@ usage: | Creates an is-in expression. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr is-in {flags} (list)``` +`> dfr is-in {flags} (list)` ## Parameters - - `list`: List to check if values are in - +- `list`: List to check if values are in ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Creates a is-in expression + ```nu > let df = ([[a b]; [one 1] [two 2] [three 3]] | dfr into-df); $df | dfr with-column (dfr col a | dfr is-in [one two] | dfr as a_in) diff --git a/commands/docs/dfr_is-not-null.md b/src/content/docs/commands/docs/dfr_is-not-null.md similarity index 95% rename from commands/docs/dfr_is-not-null.md rename to src/content/docs/commands/docs/dfr_is-not-null.md index 471745641cc..483ca2f4c62 100644 --- a/commands/docs/dfr_is-not-null.md +++ b/src/content/docs/commands/docs/dfr_is-not-null.md @@ -9,20 +9,20 @@ usage: | Creates mask where value is not null. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr is-not-null {flags} ``` +## Signature +`> dfr is-not-null {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Create mask where values are not null + ```nu > let s = ([5 6 0 8] | dfr into-df); let res = ($s / $s); @@ -49,6 +50,7 @@ Create mask where values are not null ``` Creates a is not null expression from a column + ```nu > dfr col a | dfr is-not-null diff --git a/commands/docs/dfr_is-null.md b/src/content/docs/commands/docs/dfr_is-null.md similarity index 95% rename from commands/docs/dfr_is-null.md rename to src/content/docs/commands/docs/dfr_is-null.md index 4576bffa89f..7897950297f 100644 --- a/commands/docs/dfr_is-null.md +++ b/src/content/docs/commands/docs/dfr_is-null.md @@ -9,20 +9,20 @@ usage: | Creates mask where value is null. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr is-null {flags} ``` +## Signature +`> dfr is-null {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Create mask where values are null + ```nu > let s = ([5 6 0 8] | dfr into-df); let res = ($s / $s); @@ -49,6 +50,7 @@ Create mask where values are null ``` Creates a is null expression from a column + ```nu > dfr col a | dfr is-null diff --git a/commands/docs/dfr_is-unique.md b/src/content/docs/commands/docs/dfr_is-unique.md similarity index 96% rename from commands/docs/dfr_is-unique.md rename to src/content/docs/commands/docs/dfr_is-unique.md index 9a47eac2c15..0b0820dc84c 100644 --- a/commands/docs/dfr_is-unique.md +++ b/src/content/docs/commands/docs/dfr_is-unique.md @@ -9,20 +9,20 @@ usage: | Creates mask indicating unique values. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr is-unique {flags} ``` +## Signature +`> dfr is-unique {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Create mask indicating unique values + ```nu > [5 6 6 6 8 8 8] | dfr into-df | dfr is-unique ╭───┬───────────╮ @@ -50,6 +51,7 @@ Create mask indicating unique values ``` Create mask indicating duplicated rows in a dataframe + ```nu > [[a, b]; [1 2] [1 2] [3 3] [3 3] [1 1]] | dfr into-df | dfr is-unique ╭───┬───────────╮ diff --git a/commands/docs/dfr_join.md b/src/content/docs/commands/docs/dfr_join.md similarity index 82% rename from commands/docs/dfr_join.md rename to src/content/docs/commands/docs/dfr_join.md index 9a60e272d57..776a4975195 100644 --- a/commands/docs/dfr_join.md +++ b/src/content/docs/commands/docs/dfr_join.md @@ -9,34 +9,34 @@ usage: | Joins a lazy frame with other lazy frame. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for lazyframe <div class='command-title'>{{ $frontmatter.lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr join {flags} (other) (left_on) (right_on)``` +`> dfr join {flags} (other) (left_on) (right_on)` ## Flags - - `--inner, -i`: inner joing between lazyframes (default) - - `--left, -l`: left join between lazyframes - - `--outer, -o`: outer join between lazyframes - - `--cross, -c`: cross join between lazyframes - - `--suffix, -s {string}`: Suffix to use on columns with same name +- `--inner, -i`: inner joing between lazyframes (default) +- `--left, -l`: left join between lazyframes +- `--outer, -o`: outer join between lazyframes +- `--cross, -c`: cross join between lazyframes +- `--suffix, -s {string}`: Suffix to use on columns with same name ## Parameters - - `other`: LazyFrame to join with - - `left_on`: Left column(s) to join on - - `right_on`: Right column(s) to join on - +- `other`: LazyFrame to join with +- `left_on`: Left column(s) to join on +- `right_on`: Right column(s) to join on ## Input/output types: @@ -47,6 +47,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Join two lazy dataframes + ```nu > let df_a = ([[a b c];[1 "a" 0] [2 "b" 1] [1 "c" 2] [1 "c" 3]] | dfr into-lazy); let df_b = ([["foo" "bar" "ham"];[1 "a" "let"] [2 "c" "var"] [3 "c" "const"]] | dfr into-lazy); @@ -63,6 +64,7 @@ Join two lazy dataframes ``` Join one eager dataframe with a lazy dataframe + ```nu > let df_a = ([[a b c];[1 "a" 0] [2 "b" 1] [1 "c" 2] [1 "c" 3]] | dfr into-df); let df_b = ([["foo" "bar" "ham"];[1 "a" "let"] [2 "c" "var"] [3 "c" "const"]] | dfr into-lazy); diff --git a/commands/docs/dfr_last.md b/src/content/docs/commands/docs/dfr_last.md similarity index 92% rename from commands/docs/dfr_last.md rename to src/content/docs/commands/docs/dfr_last.md index 1eb6d7733ba..05a2bb27bb7 100644 --- a/commands/docs/dfr_last.md +++ b/src/content/docs/commands/docs/dfr_last.md @@ -9,24 +9,24 @@ usage: | Creates new dataframe with tail rows or creates a last expression. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr last {flags} (rows)``` +`> dfr last {flags} (rows)` ## Parameters - - `rows`: Number of rows for tail - +- `rows`: Number of rows for tail ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Create new dataframe with last rows + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr last 1 ╭───┬───┬───╮ @@ -48,6 +49,7 @@ Create new dataframe with last rows ``` Creates a last expression from a column + ```nu > dfr col a | dfr last diff --git a/commands/docs/dfr_lit.md b/src/content/docs/commands/docs/dfr_lit.md similarity index 90% rename from commands/docs/dfr_lit.md rename to src/content/docs/commands/docs/dfr_lit.md index 7826902e5ee..a54c1c9f769 100644 --- a/commands/docs/dfr_lit.md +++ b/src/content/docs/commands/docs/dfr_lit.md @@ -9,24 +9,24 @@ usage: | Creates a literal expression. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr lit {flags} (literal)``` +`> dfr lit {flags} (literal)` ## Parameters - - `literal`: literal to construct the expression - +- `literal`: literal to construct the expression ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Created a literal expression and converts it to a nu object + ```nu > dfr lit 2 | dfr into-nu ╭───────┬─────────╮ diff --git a/commands/docs/dfr_lowercase.md b/src/content/docs/commands/docs/dfr_lowercase.md similarity index 95% rename from commands/docs/dfr_lowercase.md rename to src/content/docs/commands/docs/dfr_lowercase.md index 3b9442fc5f7..332b2e081d9 100644 --- a/commands/docs/dfr_lowercase.md +++ b/src/content/docs/commands/docs/dfr_lowercase.md @@ -9,20 +9,20 @@ usage: | Lowercase the strings in the column. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr lowercase {flags} ``` +## Signature +`> dfr lowercase {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Modifies strings to lowercase + ```nu > [Abc aBc abC] | dfr into-df | dfr lowercase ╭───┬─────╮ diff --git a/commands/docs/dfr_ls.md b/src/content/docs/commands/docs/dfr_ls.md similarity index 94% rename from commands/docs/dfr_ls.md rename to src/content/docs/commands/docs/dfr_ls.md index e8312460d0a..ad4741db16c 100644 --- a/commands/docs/dfr_ls.md +++ b/src/content/docs/commands/docs/dfr_ls.md @@ -9,20 +9,20 @@ usage: | Lists stored dataframes. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr ls {flags} ``` +## Signature +`> dfr ls {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Creates a new dataframe and shows it in the dataframe list + ```nu > let test = ([[a b];[1 2] [3 4]] | dfr into-df); ls diff --git a/commands/docs/dfr_max.md b/src/content/docs/commands/docs/dfr_max.md similarity index 96% rename from commands/docs/dfr_max.md rename to src/content/docs/commands/docs/dfr_max.md index 05b487ae2fb..69ff01c338d 100644 --- a/commands/docs/dfr_max.md +++ b/src/content/docs/commands/docs/dfr_max.md @@ -9,20 +9,20 @@ usage: | Creates a max expression or aggregates columns to their max value. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr max {flags} ``` +## Signature +`> dfr max {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Max value from columns in a dataframe + ```nu > [[a b]; [6 2] [1 4] [4 1]] | dfr into-df | dfr max ╭───┬───┬───╮ @@ -44,6 +45,7 @@ Max value from columns in a dataframe ``` Max aggregation for a group-by + ```nu > [[a b]; [one 2] [one 4] [two 1]] | dfr into-df diff --git a/commands/docs/dfr_mean.md b/src/content/docs/commands/docs/dfr_mean.md similarity index 97% rename from commands/docs/dfr_mean.md rename to src/content/docs/commands/docs/dfr_mean.md index d5f37e678cf..18b3ee8361a 100644 --- a/commands/docs/dfr_mean.md +++ b/src/content/docs/commands/docs/dfr_mean.md @@ -9,20 +9,20 @@ usage: | Creates a mean expression for an aggregation or aggregates columns to their mean value. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr mean {flags} ``` +## Signature +`> dfr mean {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Mean value from columns in a dataframe + ```nu > [[a b]; [6 2] [4 2] [2 2]] | dfr into-df | dfr mean ╭───┬──────┬──────╮ @@ -44,6 +45,7 @@ Mean value from columns in a dataframe ``` Mean aggregation for a group-by + ```nu > [[a b]; [one 2] [one 4] [two 1]] | dfr into-df diff --git a/commands/docs/dfr_median.md b/src/content/docs/commands/docs/dfr_median.md similarity index 95% rename from commands/docs/dfr_median.md rename to src/content/docs/commands/docs/dfr_median.md index 4ea3639a548..bc9bec27301 100644 --- a/commands/docs/dfr_median.md +++ b/src/content/docs/commands/docs/dfr_median.md @@ -9,20 +9,20 @@ usage: | Aggregates columns to their median value feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for lazyframe <div class='command-title'>{{ $frontmatter.lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr median {flags} ``` +## Signature +`> dfr median {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Median value from columns in a dataframe + ```nu > [[a b]; [6 2] [4 2] [2 2]] | dfr into-df | dfr median ╭───┬──────┬──────╮ diff --git a/commands/docs/dfr_melt.md b/src/content/docs/commands/docs/dfr_melt.md similarity index 83% rename from commands/docs/dfr_melt.md rename to src/content/docs/commands/docs/dfr_melt.md index c4fce8cb040..9daf220bc8f 100644 --- a/commands/docs/dfr_melt.md +++ b/src/content/docs/commands/docs/dfr_melt.md @@ -9,27 +9,27 @@ usage: | Unpivot a DataFrame from wide to long format. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr melt {flags} ``` +`> dfr melt {flags} ` ## Flags - - `--columns, -c {table}`: column names for melting - - `--values, -v {table}`: column names used as value columns - - `--variable-name, -r {string}`: optional name for variable column - - `--value-name, -l {string}`: optional name for value column - +- `--columns, -c {table}`: column names for melting +- `--values, -v {table}`: column names used as value columns +- `--variable-name, -r {string}`: optional name for variable column +- `--value-name, -l {string}`: optional name for value column ## Input/output types: @@ -40,6 +40,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples melt dataframe + ```nu > [[a b c d]; [x 1 4 a] [y 2 5 b] [z 3 6 c]] | dfr into-df | dfr melt -c [b c] -v [a d] ╭───┬───┬───┬──────────┬───────╮ diff --git a/commands/docs/dfr_min.md b/src/content/docs/commands/docs/dfr_min.md similarity index 96% rename from commands/docs/dfr_min.md rename to src/content/docs/commands/docs/dfr_min.md index 5d915e125eb..dfb6123a2bd 100644 --- a/commands/docs/dfr_min.md +++ b/src/content/docs/commands/docs/dfr_min.md @@ -9,20 +9,20 @@ usage: | Creates a min expression or aggregates columns to their min value. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr min {flags} ``` +## Signature +`> dfr min {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Min value from columns in a dataframe + ```nu > [[a b]; [6 2] [1 4] [4 1]] | dfr into-df | dfr min ╭───┬───┬───╮ @@ -44,6 +45,7 @@ Min value from columns in a dataframe ``` Min aggregation for a group-by + ```nu > [[a b]; [one 2] [one 4] [two 1]] | dfr into-df diff --git a/commands/docs/dfr_n-unique.md b/src/content/docs/commands/docs/dfr_n-unique.md similarity index 95% rename from commands/docs/dfr_n-unique.md rename to src/content/docs/commands/docs/dfr_n-unique.md index 6c6b06c4bf2..1e2de75fcfe 100644 --- a/commands/docs/dfr_n-unique.md +++ b/src/content/docs/commands/docs/dfr_n-unique.md @@ -9,20 +9,20 @@ usage: | Counts unique values. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr n-unique {flags} ``` +## Signature +`> dfr n-unique {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Counts unique values + ```nu > [1 1 2 2 3 3 4] | dfr into-df | dfr n-unique ╭───┬──────────────╮ @@ -44,6 +45,7 @@ Counts unique values ``` Creates a is n-unique expression from a column + ```nu > dfr col a | dfr n-unique diff --git a/commands/docs/dfr_not.md b/src/content/docs/commands/docs/dfr_not.md similarity index 95% rename from commands/docs/dfr_not.md rename to src/content/docs/commands/docs/dfr_not.md index f297f247617..94d60cc947d 100644 --- a/commands/docs/dfr_not.md +++ b/src/content/docs/commands/docs/dfr_not.md @@ -9,20 +9,20 @@ usage: | Inverts boolean mask. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr not {flags} ``` +## Signature +`> dfr not {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Inverts boolean mask + ```nu > [true false true] | dfr into-df | dfr not ╭───┬───────╮ diff --git a/commands/docs/dfr_open.md b/src/content/docs/commands/docs/dfr_open.md similarity index 53% rename from commands/docs/dfr_open.md rename to src/content/docs/commands/docs/dfr_open.md index 7c45026ff6b..945f41fb6f4 100644 --- a/commands/docs/dfr_open.md +++ b/src/content/docs/commands/docs/dfr_open.md @@ -9,35 +9,35 @@ usage: | Opens CSV, JSON, JSON lines, arrow, avro, or parquet file to create dataframe. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr open {flags} (file)``` +`> dfr open {flags} (file)` ## Flags - - `--lazy, -l`: creates a lazy dataframe - - `--type, -t {string}`: File type: csv, tsv, json, parquet, arrow, avro. If omitted, derive from file extension - - `--delimiter, -d {string}`: file delimiter character. CSV file - - `--no-header, -`: Indicates if file doesn't have header. CSV file - - `--infer-schema, - {number}`: Number of rows to infer the schema of the file. CSV file - - `--skip-rows, - {number}`: Number of rows to skip from file. CSV file - - `--columns, - {list<string>}`: Columns to be selected from csv file. CSV and Parquet file - - `--schema, -s {record}`: Polars Schema in format [{name: str}]. CSV, JSON, and JSONL files +- `--lazy, -l`: creates a lazy dataframe +- `--type, -t {string}`: File type: csv, tsv, json, parquet, arrow, avro. If omitted, derive from file extension +- `--delimiter, -d {string}`: file delimiter character. CSV file +- `--no-header, -`: Indicates if file doesn't have header. CSV file +- `--infer-schema, - {number}`: Number of rows to infer the schema of the file. CSV file +- `--skip-rows, - {number}`: Number of rows to skip from file. CSV file +- `--columns, - {list<string>}`: Columns to be selected from csv file. CSV and Parquet file +- `--schema, -s {record}`: Polars Schema in format [{name: str}]. CSV, JSON, and JSONL files ## Parameters - - `file`: file path to load values from - +- `file`: file path to load values from ## Input/output types: @@ -48,6 +48,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Takes a file name and creates a dataframe + ```nu > dfr open test.csv diff --git a/commands/docs/dfr_otherwise.md b/src/content/docs/commands/docs/dfr_otherwise.md similarity index 91% rename from commands/docs/dfr_otherwise.md rename to src/content/docs/commands/docs/dfr_otherwise.md index ceebc704ee7..06a888f319b 100644 --- a/commands/docs/dfr_otherwise.md +++ b/src/content/docs/commands/docs/dfr_otherwise.md @@ -9,24 +9,24 @@ usage: | Completes a when expression. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr otherwise {flags} (otherwise expression)``` +`> dfr otherwise {flags} (otherwise expression)` ## Parameters - - `otherwise expression`: expression to apply when no when predicate matches - +- `otherwise expression`: expression to apply when no when predicate matches ## Input/output types: @@ -37,18 +37,21 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Create a when conditions + ```nu > dfr when ((dfr col a) > 2) 4 | dfr otherwise 5 ``` Create a when conditions + ```nu > dfr when ((dfr col a) > 2) 4 | dfr when ((dfr col a) < 0) 6 | dfr otherwise 0 ``` Create a new column for the dataframe + ```nu > [[a b]; [6 2] [1 4] [4 1]] | dfr into-lazy diff --git a/commands/docs/dfr_quantile.md b/src/content/docs/commands/docs/dfr_quantile.md similarity index 90% rename from commands/docs/dfr_quantile.md rename to src/content/docs/commands/docs/dfr_quantile.md index 2332378c94b..c9755a38b00 100644 --- a/commands/docs/dfr_quantile.md +++ b/src/content/docs/commands/docs/dfr_quantile.md @@ -9,24 +9,24 @@ usage: | Aggregates the columns to the selected quantile. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for lazyframe <div class='command-title'>{{ $frontmatter.lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr quantile {flags} (quantile)``` +`> dfr quantile {flags} (quantile)` ## Parameters - - `quantile`: quantile value for quantile operation - +- `quantile`: quantile value for quantile operation ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples quantile value from columns in a dataframe + ```nu > [[a b]; [6 2] [1 4] [4 1]] | dfr into-df | dfr quantile 0.5 ╭───┬──────┬──────╮ diff --git a/commands/docs/dfr_query.md b/src/content/docs/commands/docs/dfr_query.md similarity index 93% rename from commands/docs/dfr_query.md rename to src/content/docs/commands/docs/dfr_query.md index 7ab4c0a5413..9bb0bcdc68e 100644 --- a/commands/docs/dfr_query.md +++ b/src/content/docs/commands/docs/dfr_query.md @@ -9,24 +9,24 @@ usage: | Query dataframe using SQL. Note: The dataframe is always named 'df' in your query's from clause. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr query {flags} (sql)``` +`> dfr query {flags} (sql)` ## Parameters - - `sql`: sql query - +- `sql`: sql query ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Query dataframe using SQL + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr query 'select a from df' ╭───┬───╮ diff --git a/commands/docs/dfr_rename.md b/src/content/docs/commands/docs/dfr_rename.md similarity index 89% rename from commands/docs/dfr_rename.md rename to src/content/docs/commands/docs/dfr_rename.md index 8ae564c74c9..3c223b10bc3 100644 --- a/commands/docs/dfr_rename.md +++ b/src/content/docs/commands/docs/dfr_rename.md @@ -9,25 +9,25 @@ usage: | Rename a dataframe column. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe or lazyframe <div class='command-title'>{{ $frontmatter.dataframe_or_lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr rename {flags} (columns) (new names)``` +`> dfr rename {flags} (columns) (new names)` ## Parameters - - `columns`: Column(s) to be renamed. A string or list of strings - - `new names`: New names for the selected column(s). A string or list of strings - +- `columns`: Column(s) to be renamed. A string or list of strings +- `new names`: New names for the selected column(s). A string or list of strings ## Input/output types: @@ -38,6 +38,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Renames a series + ```nu > [5 6 7 8] | dfr into-df | dfr rename '0' new_name ╭───┬──────────╮ @@ -52,6 +53,7 @@ Renames a series ``` Renames a dataframe column + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr rename a a_new ╭───┬───────┬───╮ @@ -64,6 +66,7 @@ Renames a dataframe column ``` Renames two dataframe columns + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr rename [a b] [a_new b_new] ╭───┬───────┬───────╮ diff --git a/commands/docs/dfr_replace-all.md b/src/content/docs/commands/docs/dfr_replace-all.md similarity index 86% rename from commands/docs/dfr_replace-all.md rename to src/content/docs/commands/docs/dfr_replace-all.md index 7ea5827425f..52c9f04f85f 100644 --- a/commands/docs/dfr_replace-all.md +++ b/src/content/docs/commands/docs/dfr_replace-all.md @@ -9,25 +9,25 @@ usage: | Replace all (sub)strings by a regex pattern. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr replace-all {flags} ``` +`> dfr replace-all {flags} ` ## Flags - - `--pattern, -p {string}`: Regex pattern to be matched - - `--replace, -r {string}`: replacing string - +- `--pattern, -p {string}`: Regex pattern to be matched +- `--replace, -r {string}`: replacing string ## Input/output types: @@ -38,6 +38,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Replaces string + ```nu > [abac abac abac] | dfr into-df | dfr replace-all --pattern a --replace A ╭───┬──────╮ diff --git a/commands/docs/dfr_replace.md b/src/content/docs/commands/docs/dfr_replace.md similarity index 86% rename from commands/docs/dfr_replace.md rename to src/content/docs/commands/docs/dfr_replace.md index a15bb098990..ec3ec7c125d 100644 --- a/commands/docs/dfr_replace.md +++ b/src/content/docs/commands/docs/dfr_replace.md @@ -9,25 +9,25 @@ usage: | Replace the leftmost (sub)string by a regex pattern. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr replace {flags} ``` +`> dfr replace {flags} ` ## Flags - - `--pattern, -p {string}`: Regex pattern to be matched - - `--replace, -r {string}`: replacing string - +- `--pattern, -p {string}`: Regex pattern to be matched +- `--replace, -r {string}`: replacing string ## Input/output types: @@ -38,6 +38,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Replaces string + ```nu > [abc abc abc] | dfr into-df | dfr replace --pattern ab --replace AB ╭───┬─────╮ diff --git a/commands/docs/dfr_reverse.md b/src/content/docs/commands/docs/dfr_reverse.md similarity index 95% rename from commands/docs/dfr_reverse.md rename to src/content/docs/commands/docs/dfr_reverse.md index 0ebc094196a..b096ad00d66 100644 --- a/commands/docs/dfr_reverse.md +++ b/src/content/docs/commands/docs/dfr_reverse.md @@ -9,20 +9,20 @@ usage: | Reverses the LazyFrame feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for lazyframe <div class='command-title'>{{ $frontmatter.lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr reverse {flags} ``` +## Signature +`> dfr reverse {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Reverses the dataframe. + ```nu > [[a b]; [6 2] [4 2] [2 2]] | dfr into-df | dfr reverse ╭───┬───┬───╮ diff --git a/commands/docs/dfr_rolling.md b/src/content/docs/commands/docs/dfr_rolling.md similarity index 92% rename from commands/docs/dfr_rolling.md rename to src/content/docs/commands/docs/dfr_rolling.md index f8679c1ca01..672717b6c4d 100644 --- a/commands/docs/dfr_rolling.md +++ b/src/content/docs/commands/docs/dfr_rolling.md @@ -9,25 +9,25 @@ usage: | Rolling calculation for a series. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr rolling {flags} (type) (window)``` +`> dfr rolling {flags} (type) (window)` ## Parameters - - `type`: rolling operation - - `window`: Window size for rolling - +- `type`: rolling operation +- `window`: Window size for rolling ## Input/output types: @@ -38,6 +38,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Rolling sum for a series + ```nu > [1 2 3 4 5] | dfr into-df | dfr rolling sum 2 | dfr drop-nulls ╭───┬───────────────╮ @@ -52,6 +53,7 @@ Rolling sum for a series ``` Rolling max for a series + ```nu > [1 2 3 4 5] | dfr into-df | dfr rolling max 2 | dfr drop-nulls ╭───┬───────────────╮ diff --git a/commands/docs/dfr_sample.md b/src/content/docs/commands/docs/dfr_sample.md similarity index 74% rename from commands/docs/dfr_sample.md rename to src/content/docs/commands/docs/dfr_sample.md index b3d895ccc57..5da8c4b4fc8 100644 --- a/commands/docs/dfr_sample.md +++ b/src/content/docs/commands/docs/dfr_sample.md @@ -9,28 +9,28 @@ usage: | Create sample dataframe. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr sample {flags} ``` +`> dfr sample {flags} ` ## Flags - - `--n-rows, -n {int}`: number of rows to be taken from dataframe - - `--fraction, -f {number}`: fraction of dataframe to be taken - - `--seed, -s {number}`: seed for the selection - - `--replace, -e`: sample with replace - - `--shuffle, -u`: shuffle sample - +- `--n-rows, -n {int}`: number of rows to be taken from dataframe +- `--fraction, -f {number}`: fraction of dataframe to be taken +- `--seed, -s {number}`: seed for the selection +- `--replace, -e`: sample with replace +- `--shuffle, -u`: shuffle sample ## Input/output types: @@ -41,12 +41,14 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Sample rows from dataframe + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr sample --n-rows 1 ``` Shows sample row using fraction and replace + ```nu > [[a b]; [1 2] [3 4] [5 6]] | dfr into-df | dfr sample --fraction 0.5 --replace diff --git a/commands/docs/dfr_schema.md b/src/content/docs/commands/docs/dfr_schema.md similarity index 89% rename from commands/docs/dfr_schema.md rename to src/content/docs/commands/docs/dfr_schema.md index 7dc906a5178..8db00683c0c 100644 --- a/commands/docs/dfr_schema.md +++ b/src/content/docs/commands/docs/dfr_schema.md @@ -9,24 +9,24 @@ usage: | Show schema for a dataframe. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr schema {flags} ``` +`> dfr schema {flags} ` ## Flags - - `--datatype-list, -l`: creates a lazy dataframe - +- `--datatype-list, -l`: creates a lazy dataframe ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Dataframe schema + ```nu > [[a b]; [1 "foo"] [3 "bar"]] | dfr into-df | dfr schema ╭───┬─────╮ diff --git a/commands/docs/dfr_select.md b/src/content/docs/commands/docs/dfr_select.md similarity index 89% rename from commands/docs/dfr_select.md rename to src/content/docs/commands/docs/dfr_select.md index d3953e9cdef..3019a491705 100644 --- a/commands/docs/dfr_select.md +++ b/src/content/docs/commands/docs/dfr_select.md @@ -9,24 +9,24 @@ usage: | Selects columns from lazyframe. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for lazyframe <div class='command-title'>{{ $frontmatter.lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr select {flags} ...rest``` +`> dfr select {flags} ...rest` ## Parameters - - `...rest`: Expression(s) that define the column selection - +- `...rest`: Expression(s) that define the column selection ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Select a column from the dataframe + ```nu > [[a b]; [6 2] [4 2] [2 2]] | dfr into-df | dfr select a ╭───┬───╮ diff --git a/commands/docs/dfr_set-with-idx.md b/src/content/docs/commands/docs/dfr_set-with-idx.md similarity index 85% rename from commands/docs/dfr_set-with-idx.md rename to src/content/docs/commands/docs/dfr_set-with-idx.md index f9ebba15c32..636355e92b8 100644 --- a/commands/docs/dfr_set-with-idx.md +++ b/src/content/docs/commands/docs/dfr_set-with-idx.md @@ -9,28 +9,28 @@ usage: | Sets value in the given index. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr set-with-idx {flags} (value)``` +`> dfr set-with-idx {flags} (value)` ## Flags - - `--indices, -i {any}`: list of indices indicating where to set the value +- `--indices, -i {any}`: list of indices indicating where to set the value ## Parameters - - `value`: value to be inserted in series - +- `value`: value to be inserted in series ## Input/output types: @@ -41,6 +41,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Set value in selected rows from series + ```nu > let series = ([4 1 5 2 4 3] | dfr into-df); let indices = ([0 2] | dfr into-df); diff --git a/commands/docs/dfr_set.md b/src/content/docs/commands/docs/dfr_set.md similarity index 88% rename from commands/docs/dfr_set.md rename to src/content/docs/commands/docs/dfr_set.md index bb4a9f8d810..780e84565b6 100644 --- a/commands/docs/dfr_set.md +++ b/src/content/docs/commands/docs/dfr_set.md @@ -9,28 +9,28 @@ usage: | Sets value where given mask is true. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr set {flags} (value)``` +`> dfr set {flags} (value)` ## Flags - - `--mask, -m {any}`: mask indicating insertions +- `--mask, -m {any}`: mask indicating insertions ## Parameters - - `value`: value to be inserted in series - +- `value`: value to be inserted in series ## Input/output types: @@ -41,6 +41,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Shifts the values by a given period + ```nu > let s = ([1 2 2 3 3] | dfr into-df | dfr shift 2); let mask = ($s | dfr is-null); diff --git a/commands/docs/dfr_shape.md b/src/content/docs/commands/docs/dfr_shape.md similarity index 95% rename from commands/docs/dfr_shape.md rename to src/content/docs/commands/docs/dfr_shape.md index 331adee1443..a696c033904 100644 --- a/commands/docs/dfr_shape.md +++ b/src/content/docs/commands/docs/dfr_shape.md @@ -9,20 +9,20 @@ usage: | Shows column and row size for a dataframe. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr shape {flags} ``` +## Signature +`> dfr shape {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Shows row and column shape + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr shape ╭───┬──────┬─────────╮ diff --git a/commands/docs/dfr_shift.md b/src/content/docs/commands/docs/dfr_shift.md similarity index 87% rename from commands/docs/dfr_shift.md rename to src/content/docs/commands/docs/dfr_shift.md index fe61ed70787..92b862517da 100644 --- a/commands/docs/dfr_shift.md +++ b/src/content/docs/commands/docs/dfr_shift.md @@ -9,28 +9,28 @@ usage: | Shifts the values by a given period. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe or lazyframe <div class='command-title'>{{ $frontmatter.dataframe_or_lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr shift {flags} (period)``` +`> dfr shift {flags} (period)` ## Flags - - `--fill, -f {any}`: Expression used to fill the null values (lazy df) +- `--fill, -f {any}`: Expression used to fill the null values (lazy df) ## Parameters - - `period`: shift period - +- `period`: shift period ## Input/output types: @@ -41,6 +41,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Shifts the values by a given period + ```nu > [1 2 2 3 3] | dfr into-df | dfr shift 2 | dfr drop-nulls ╭───┬───╮ diff --git a/commands/docs/dfr_slice.md b/src/content/docs/commands/docs/dfr_slice.md similarity index 89% rename from commands/docs/dfr_slice.md rename to src/content/docs/commands/docs/dfr_slice.md index 8a260dc57bb..5b94f7443af 100644 --- a/commands/docs/dfr_slice.md +++ b/src/content/docs/commands/docs/dfr_slice.md @@ -9,25 +9,25 @@ usage: | Creates new dataframe from a slice of rows. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr slice {flags} (offset) (size)``` +`> dfr slice {flags} (offset) (size)` ## Parameters - - `offset`: start of slice - - `size`: size of slice - +- `offset`: start of slice +- `size`: size of slice ## Input/output types: @@ -38,6 +38,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Create new dataframe from a slice of the rows + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr slice 0 1 ╭───┬───┬───╮ diff --git a/commands/docs/dfr_sort-by.md b/src/content/docs/commands/docs/dfr_sort-by.md similarity index 82% rename from commands/docs/dfr_sort-by.md rename to src/content/docs/commands/docs/dfr_sort-by.md index 8056a777cc2..6c0b86facff 100644 --- a/commands/docs/dfr_sort-by.md +++ b/src/content/docs/commands/docs/dfr_sort-by.md @@ -9,30 +9,30 @@ usage: | Sorts a lazy dataframe based on expression(s). feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for lazyframe <div class='command-title'>{{ $frontmatter.lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr sort-by {flags} ...rest``` +`> dfr sort-by {flags} ...rest` ## Flags - - `--reverse, -r {list<bool>}`: Reverse sorting. Default is false - - `--nulls-last, -n`: nulls are shown last in the dataframe - - `--maintain-order, -m`: Maintains order during sort +- `--reverse, -r {list<bool>}`: Reverse sorting. Default is false +- `--nulls-last, -n`: nulls are shown last in the dataframe +- `--maintain-order, -m`: Maintains order during sort ## Parameters - - `...rest`: sort expression for the dataframe - +- `...rest`: sort expression for the dataframe ## Input/output types: @@ -43,6 +43,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Sort dataframe by one column + ```nu > [[a b]; [6 2] [1 4] [4 1]] | dfr into-df | dfr sort-by a ╭───┬───┬───╮ @@ -56,6 +57,7 @@ Sort dataframe by one column ``` Sort column using two columns + ```nu > [[a b]; [6 2] [1 1] [1 4] [2 4]] | dfr into-df | dfr sort-by [a b] -r [false true] ╭───┬───┬───╮ diff --git a/commands/docs/dfr_std.md b/src/content/docs/commands/docs/dfr_std.md similarity index 97% rename from commands/docs/dfr_std.md rename to src/content/docs/commands/docs/dfr_std.md index 218c2ce5fb1..d78f07d9b9f 100644 --- a/commands/docs/dfr_std.md +++ b/src/content/docs/commands/docs/dfr_std.md @@ -9,20 +9,20 @@ usage: | Creates a std expression for an aggregation of std value from columns in a dataframe. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr std {flags} ``` +## Signature +`> dfr std {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Std value from columns in a dataframe + ```nu > [[a b]; [6 2] [4 2] [2 2]] | dfr into-df | dfr std ╭───┬──────┬──────╮ @@ -44,6 +45,7 @@ Std value from columns in a dataframe ``` Std aggregation for a group-by + ```nu > [[a b]; [one 2] [one 2] [two 1] [two 1]] | dfr into-df diff --git a/commands/docs/dfr_str-lengths.md b/src/content/docs/commands/docs/dfr_str-lengths.md similarity index 94% rename from commands/docs/dfr_str-lengths.md rename to src/content/docs/commands/docs/dfr_str-lengths.md index b2d5ace375b..7b21a9528ff 100644 --- a/commands/docs/dfr_str-lengths.md +++ b/src/content/docs/commands/docs/dfr_str-lengths.md @@ -9,20 +9,20 @@ usage: | Get lengths of all strings. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr str-lengths {flags} ``` +## Signature +`> dfr str-lengths {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns string lengths + ```nu > [a ab abc] | dfr into-df | dfr str-lengths ╭───┬───╮ diff --git a/commands/docs/dfr_str-slice.md b/src/content/docs/commands/docs/dfr_str-slice.md similarity index 89% rename from commands/docs/dfr_str-slice.md rename to src/content/docs/commands/docs/dfr_str-slice.md index ef54b8f7a55..f1bea9ba2b8 100644 --- a/commands/docs/dfr_str-slice.md +++ b/src/content/docs/commands/docs/dfr_str-slice.md @@ -9,28 +9,28 @@ usage: | Slices the string from the start position until the selected length. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr str-slice {flags} (start)``` +`> dfr str-slice {flags} (start)` ## Flags - - `--length, -l {int}`: optional length +- `--length, -l {int}`: optional length ## Parameters - - `start`: start of slice - +- `start`: start of slice ## Input/output types: @@ -41,6 +41,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Creates slices from the strings + ```nu > [abcded abc321 abc123] | dfr into-df | dfr str-slice 1 --length 2 ╭───┬────╮ diff --git a/commands/docs/dfr_strftime.md b/src/content/docs/commands/docs/dfr_strftime.md similarity index 93% rename from commands/docs/dfr_strftime.md rename to src/content/docs/commands/docs/dfr_strftime.md index 895d298777f..46e94fb7bbb 100644 --- a/commands/docs/dfr_strftime.md +++ b/src/content/docs/commands/docs/dfr_strftime.md @@ -9,24 +9,24 @@ usage: | Formats date based on string rule. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr strftime {flags} (fmt)``` +`> dfr strftime {flags} (fmt)` ## Parameters - - `fmt`: Format rule - +- `fmt`: Format rule ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Formats date + ```nu > let dt = ('2020-08-04T16:39:18+00:00' | into datetime --timezone 'UTC'); let df = ([$dt $dt] | dfr into-df); diff --git a/commands/docs/dfr_sum.md b/src/content/docs/commands/docs/dfr_sum.md similarity index 97% rename from commands/docs/dfr_sum.md rename to src/content/docs/commands/docs/dfr_sum.md index da90e3bf8df..911bf90dd1e 100644 --- a/commands/docs/dfr_sum.md +++ b/src/content/docs/commands/docs/dfr_sum.md @@ -9,20 +9,20 @@ usage: | Creates a sum expression for an aggregation or aggregates columns to their sum value. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr sum {flags} ``` +## Signature +`> dfr sum {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Sums all columns in a dataframe + ```nu > [[a b]; [6 2] [1 4] [4 1]] | dfr into-df | dfr sum ╭───┬────┬───╮ @@ -44,6 +45,7 @@ Sums all columns in a dataframe ``` Sum aggregation for a group-by + ```nu > [[a b]; [one 2] [one 4] [two 1]] | dfr into-df diff --git a/commands/docs/dfr_summary.md b/src/content/docs/commands/docs/dfr_summary.md similarity index 94% rename from commands/docs/dfr_summary.md rename to src/content/docs/commands/docs/dfr_summary.md index 43536b60e3f..fa1fbe31f9e 100644 --- a/commands/docs/dfr_summary.md +++ b/src/content/docs/commands/docs/dfr_summary.md @@ -9,24 +9,24 @@ usage: | For a dataframe, produces descriptive statistics (summary statistics) for its numeric columns. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr summary {flags} ``` +`> dfr summary {flags} ` ## Flags - - `--quantiles, -q {table}`: provide optional quantiles - +- `--quantiles, -q {table}`: provide optional quantiles ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples list dataframe descriptives + ```nu > [[a b]; [1 1] [1 1]] | dfr into-df | dfr summary ╭───┬────────────┬─────────┬─────────╮ diff --git a/commands/docs/dfr_take.md b/src/content/docs/commands/docs/dfr_take.md similarity index 93% rename from commands/docs/dfr_take.md rename to src/content/docs/commands/docs/dfr_take.md index 0f8a62529e0..f5a931587b6 100644 --- a/commands/docs/dfr_take.md +++ b/src/content/docs/commands/docs/dfr_take.md @@ -9,24 +9,24 @@ usage: | Creates new dataframe using the given indices. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr take {flags} (indices)``` +`> dfr take {flags} (indices)` ## Parameters - - `indices`: list of indices used to take data - +- `indices`: list of indices used to take data ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Takes selected rows from dataframe + ```nu > let df = ([[a b]; [4 1] [5 2] [4 3]] | dfr into-df); let indices = ([0 2] | dfr into-df); @@ -51,6 +52,7 @@ Takes selected rows from dataframe ``` Takes selected rows from series + ```nu > let series = ([4 1 5 2 4 3] | dfr into-df); let indices = ([0 2] | dfr into-df); diff --git a/commands/docs/dfr_to-arrow.md b/src/content/docs/commands/docs/dfr_to-arrow.md similarity index 89% rename from commands/docs/dfr_to-arrow.md rename to src/content/docs/commands/docs/dfr_to-arrow.md index 4c0b0a3971e..40d8dd29447 100644 --- a/commands/docs/dfr_to-arrow.md +++ b/src/content/docs/commands/docs/dfr_to-arrow.md @@ -9,24 +9,24 @@ usage: | Saves dataframe to arrow file. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr to-arrow {flags} (file)``` +`> dfr to-arrow {flags} (file)` ## Parameters - - `file`: file path to save dataframe - +- `file`: file path to save dataframe ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Saves dataframe to arrow file + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr to-arrow test.arrow diff --git a/commands/docs/dfr_to-avro.md b/src/content/docs/commands/docs/dfr_to-avro.md similarity index 82% rename from commands/docs/dfr_to-avro.md rename to src/content/docs/commands/docs/dfr_to-avro.md index 5eacadbb869..dea07742c20 100644 --- a/commands/docs/dfr_to-avro.md +++ b/src/content/docs/commands/docs/dfr_to-avro.md @@ -9,28 +9,28 @@ usage: | Saves dataframe to avro file. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr to-avro {flags} (file)``` +`> dfr to-avro {flags} (file)` ## Flags - - `--compression, -c {string}`: use compression, supports deflate or snappy +- `--compression, -c {string}`: use compression, supports deflate or snappy ## Parameters - - `file`: file path to save dataframe - +- `file`: file path to save dataframe ## Input/output types: @@ -41,6 +41,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Saves dataframe to avro file + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr to-avro test.avro diff --git a/commands/docs/dfr_to-csv.md b/src/content/docs/commands/docs/dfr_to-csv.md similarity index 81% rename from commands/docs/dfr_to-csv.md rename to src/content/docs/commands/docs/dfr_to-csv.md index 0bfe204e1b2..133aa04d65c 100644 --- a/commands/docs/dfr_to-csv.md +++ b/src/content/docs/commands/docs/dfr_to-csv.md @@ -9,29 +9,29 @@ usage: | Saves dataframe to CSV file. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr to-csv {flags} (file)``` +`> dfr to-csv {flags} (file)` ## Flags - - `--delimiter, -d {string}`: file delimiter character - - `--no-header, -`: Indicates if file doesn't have header +- `--delimiter, -d {string}`: file delimiter character +- `--no-header, -`: Indicates if file doesn't have header ## Parameters - - `file`: file path to save dataframe - +- `file`: file path to save dataframe ## Input/output types: @@ -42,12 +42,14 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Saves dataframe to CSV file + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr to-csv test.csv ``` Saves dataframe to CSV file using other delimiter + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr to-csv test.csv --delimiter '|' diff --git a/commands/docs/dfr_to-jsonl.md b/src/content/docs/commands/docs/dfr_to-jsonl.md similarity index 89% rename from commands/docs/dfr_to-jsonl.md rename to src/content/docs/commands/docs/dfr_to-jsonl.md index 8671951f839..38899b2757a 100644 --- a/commands/docs/dfr_to-jsonl.md +++ b/src/content/docs/commands/docs/dfr_to-jsonl.md @@ -9,24 +9,24 @@ usage: | Saves dataframe to a JSON lines file. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr to-jsonl {flags} (file)``` +`> dfr to-jsonl {flags} (file)` ## Parameters - - `file`: file path to save dataframe - +- `file`: file path to save dataframe ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Saves dataframe to JSON lines file + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr to-jsonl test.jsonl diff --git a/commands/docs/dfr_to-parquet.md b/src/content/docs/commands/docs/dfr_to-parquet.md similarity index 89% rename from commands/docs/dfr_to-parquet.md rename to src/content/docs/commands/docs/dfr_to-parquet.md index 60feacc3050..364f8ef78a1 100644 --- a/commands/docs/dfr_to-parquet.md +++ b/src/content/docs/commands/docs/dfr_to-parquet.md @@ -9,24 +9,24 @@ usage: | Saves dataframe to parquet file. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr to-parquet {flags} (file)``` +`> dfr to-parquet {flags} (file)` ## Parameters - - `file`: file path to save dataframe - +- `file`: file path to save dataframe ## Input/output types: @@ -37,6 +37,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Saves dataframe to parquet file + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df | dfr to-parquet test.parquet diff --git a/commands/docs/dfr_unique.md b/src/content/docs/commands/docs/dfr_unique.md similarity index 78% rename from commands/docs/dfr_unique.md rename to src/content/docs/commands/docs/dfr_unique.md index 850ff3ba4e0..aa543db2042 100644 --- a/commands/docs/dfr_unique.md +++ b/src/content/docs/commands/docs/dfr_unique.md @@ -9,26 +9,26 @@ usage: | Returns unique values from a dataframe. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe or lazyframe <div class='command-title'>{{ $frontmatter.dataframe_or_lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr unique {flags} ``` +`> dfr unique {flags} ` ## Flags - - `--subset, -s {any}`: Subset of column(s) to use to maintain rows (lazy df) - - `--last, -l`: Keeps last unique value. Default keeps first value (lazy df) - - `--maintain-order, -k`: Keep the same order as the original DataFrame (lazy df) - +- `--subset, -s {any}`: Subset of column(s) to use to maintain rows (lazy df) +- `--last, -l`: Keeps last unique value. Default keeps first value (lazy df) +- `--maintain-order, -k`: Keep the same order as the original DataFrame (lazy df) ## Input/output types: @@ -39,6 +39,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Returns unique values from a series + ```nu > [2 2 2 2 2] | dfr into-df | dfr unique ╭───┬───╮ @@ -50,6 +51,7 @@ Returns unique values from a series ``` Creates a is unique expression from a column + ```nu > col a | unique diff --git a/commands/docs/dfr_uppercase.md b/src/content/docs/commands/docs/dfr_uppercase.md similarity index 95% rename from commands/docs/dfr_uppercase.md rename to src/content/docs/commands/docs/dfr_uppercase.md index ae78626a685..2ef1b1ac767 100644 --- a/commands/docs/dfr_uppercase.md +++ b/src/content/docs/commands/docs/dfr_uppercase.md @@ -9,20 +9,20 @@ usage: | Uppercase the strings in the column. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr uppercase {flags} ``` +## Signature +`> dfr uppercase {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Modifies strings to uppercase + ```nu > [Abc aBc abC] | dfr into-df | dfr uppercase ╭───┬─────╮ diff --git a/commands/docs/dfr_value-counts.md b/src/content/docs/commands/docs/dfr_value-counts.md similarity index 95% rename from commands/docs/dfr_value-counts.md rename to src/content/docs/commands/docs/dfr_value-counts.md index 2266c971114..f7c8d9dc33e 100644 --- a/commands/docs/dfr_value-counts.md +++ b/src/content/docs/commands/docs/dfr_value-counts.md @@ -9,20 +9,20 @@ usage: | Returns a dataframe with the counts for unique values in series. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe <div class='command-title'>{{ $frontmatter.dataframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr value-counts {flags} ``` +## Signature +`> dfr value-counts {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Calculates value counts + ```nu > [5 5 5 5 6 6] | dfr into-df | dfr value-counts ╭───┬───┬───────╮ diff --git a/commands/docs/dfr_var.md b/src/content/docs/commands/docs/dfr_var.md similarity index 97% rename from commands/docs/dfr_var.md rename to src/content/docs/commands/docs/dfr_var.md index 183b3297ecd..1c33e8fbf0f 100644 --- a/commands/docs/dfr_var.md +++ b/src/content/docs/commands/docs/dfr_var.md @@ -9,20 +9,20 @@ usage: | Create a var expression for an aggregation. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: -## Signature -```> dfr var {flags} ``` +## Signature +`> dfr var {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Var value from columns in a dataframe or aggregates columns to their var value + ```nu > [[a b]; [6 2] [4 2] [2 2]] | dfr into-df | dfr var ╭───┬──────┬──────╮ @@ -44,6 +45,7 @@ Var value from columns in a dataframe or aggregates columns to their var value ``` Var aggregation for a group-by + ```nu > [[a b]; [one 2] [one 2] [two 1] [two 1]] | dfr into-df diff --git a/commands/docs/dfr_when.md b/src/content/docs/commands/docs/dfr_when.md similarity index 87% rename from commands/docs/dfr_when.md rename to src/content/docs/commands/docs/dfr_when.md index 7f39cd78a74..65feaecbc64 100644 --- a/commands/docs/dfr_when.md +++ b/src/content/docs/commands/docs/dfr_when.md @@ -9,25 +9,25 @@ usage: | Creates and modifies a when expression. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for expression <div class='command-title'>{{ $frontmatter.expression }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr when {flags} (when expression) (then expression)``` +`> dfr when {flags} (when expression) (then expression)` ## Parameters - - `when expression`: when expression used for matching - - `then expression`: expression that will be applied when predicate is true - +- `when expression`: when expression used for matching +- `then expression`: expression that will be applied when predicate is true ## Input/output types: @@ -38,18 +38,21 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Create a when conditions + ```nu > dfr when ((dfr col a) > 2) 4 ``` Create a when conditions + ```nu > dfr when ((dfr col a) > 2) 4 | dfr when ((dfr col a) < 0) 6 ``` Create a new column for the dataframe + ```nu > [[a b]; [6 2] [1 4] [4 1]] | dfr into-lazy diff --git a/commands/docs/dfr_with-column.md b/src/content/docs/commands/docs/dfr_with-column.md similarity index 90% rename from commands/docs/dfr_with-column.md rename to src/content/docs/commands/docs/dfr_with-column.md index 94e66abed75..a8d5aff1121 100644 --- a/commands/docs/dfr_with-column.md +++ b/src/content/docs/commands/docs/dfr_with-column.md @@ -9,28 +9,28 @@ usage: | Adds a series to the dataframe. feature: dataframe --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for dataframe or lazyframe <div class='command-title'>{{ $frontmatter.dataframe_or_lazyframe }}</div> - -::: warning +:::caution[warning] Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag ::: + ## Signature -```> dfr with-column {flags} ...rest``` +`> dfr with-column {flags} ...rest` ## Flags - - `--name, -n {string}`: new column name +- `--name, -n {string}`: new column name ## Parameters - - `...rest`: series to be added or expressions used to define the new columns - +- `...rest`: series to be added or expressions used to define the new columns ## Input/output types: @@ -41,6 +41,7 @@ Dataframe commands were not shipped in the official binaries by default, you hav ## Examples Adds a series to the dataframe + ```nu > [[a b]; [1 2] [3 4]] | dfr into-df @@ -55,6 +56,7 @@ Adds a series to the dataframe ``` Adds a series to the dataframe + ```nu > [[a b]; [1 2] [3 4]] | dfr into-lazy diff --git a/commands/docs/do.md b/src/content/docs/commands/docs/do.md similarity index 75% rename from commands/docs/do.md rename to src/content/docs/commands/docs/do.md index 7b8f44dc6ab..bcaf43261bb 100644 --- a/commands/docs/do.md +++ b/src/content/docs/commands/docs/do.md @@ -9,6 +9,7 @@ usage: | Run a closure, providing it with the pipeline input. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,21 +18,20 @@ feature: default ## Signature -```> do {flags} (closure) ...rest``` +`> do {flags} (closure) ...rest` ## Flags - - `--ignore-errors, -i`: ignore errors as the closure runs - - `--ignore-shell-errors, -s`: ignore shell errors as the closure runs - - `--ignore-program-errors, -p`: ignore external program errors as the closure runs - - `--capture-errors, -c`: catch errors as the closure runs, and return them - - `--env, -`: keep the environment defined inside the command +- `--ignore-errors, -i`: ignore errors as the closure runs +- `--ignore-shell-errors, -s`: ignore shell errors as the closure runs +- `--ignore-program-errors, -p`: ignore external program errors as the closure runs +- `--capture-errors, -c`: catch errors as the closure runs, and return them +- `--env, -`: keep the environment defined inside the command ## Parameters - - `closure`: The closure to run. - - `...rest`: The parameter(s) for the closure. - +- `closure`: The closure to run. +- `...rest`: The parameter(s) for the closure. ## Input/output types: @@ -42,54 +42,63 @@ feature: default ## Examples Run the closure + ```nu > do { echo hello } hello ``` Run a stored first-class closure + ```nu > let text = "I am enclosed"; let hello = {|| echo $text}; do $hello I am enclosed ``` Run the closure and ignore both shell and external program errors + ```nu > do --ignore-errors { thisisnotarealcommand } ``` Run the closure and ignore shell errors + ```nu > do --ignore-shell-errors { thisisnotarealcommand } ``` Run the closure and ignore external program errors + ```nu > do --ignore-program-errors { nu --commands 'exit 1' }; echo "I'll still run" ``` Abort the pipeline if a program returns a non-zero exit code + ```nu > do --capture-errors { nu --commands 'exit 1' } | myscarycommand ``` Run the closure, with a positional parameter + ```nu > do {|x| 100 + $x } 77 177 ``` Run the closure, with input + ```nu > 77 | do {|x| 100 + $in } ``` Run the closure and keep changes to the environment + ```nu > do --env { $env.foo = 'bar' }; $env.foo bar diff --git a/commands/docs/drop.md b/src/content/docs/commands/docs/drop.md similarity index 66% rename from commands/docs/drop.md rename to src/content/docs/commands/docs/drop.md index 5fce36a505c..5c081ac682a 100644 --- a/commands/docs/drop.md +++ b/src/content/docs/commands/docs/drop.md @@ -9,6 +9,7 @@ usage: | Remove items/rows from the end of the input list/table. Counterpart of `skip`. Opposite of `last`. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,22 +18,23 @@ feature: default ## Signature -```> drop {flags} (rows)``` +`> drop {flags} (rows)` ## Parameters - - `rows`: The number of items to remove. - +- `rows`: The number of items to remove. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | -| table | table | +| table | table | + ## Examples Remove the last item of a list + ```nu > [0,1,2,3] | drop ╭───┬───╮ @@ -44,6 +46,7 @@ Remove the last item of a list ``` Remove zero item of a list + ```nu > [0,1,2,3] | drop 0 ╭───┬───╮ @@ -56,6 +59,7 @@ Remove zero item of a list ``` Remove the last two items of a list + ```nu > [0,1,2,3] | drop 2 ╭───┬───╮ @@ -66,6 +70,7 @@ Remove the last two items of a list ``` Remove the last row in a table + ```nu > [[a, b]; [1, 2] [3, 4]] | drop 1 ╭───┬───┬───╮ @@ -76,10 +81,9 @@ Remove the last row in a table ``` - ## Subcommands: -| name | type | usage | -| ---------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------- | -| [`drop column`](/commands/docs/drop_column.md) | Builtin | Remove N columns at the right-hand end of the input table. To remove columns by name, use `reject`. | -| [`drop nth`](/commands/docs/drop_nth.md) | Builtin | Drop the selected rows. | \ No newline at end of file +| name | type | usage | +| ------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------- | +| [`drop column`](/commands/docs/drop_column) | Builtin | Remove N columns at the right-hand end of the input table. To remove columns by name, use `reject`. | +| [`drop nth`](/commands/docs/drop_nth) | Builtin | Drop the selected rows. | diff --git a/commands/docs/drop_column.md b/src/content/docs/commands/docs/drop_column.md similarity index 91% rename from commands/docs/drop_column.md rename to src/content/docs/commands/docs/drop_column.md index 67f0705bef5..c64aa99a23f 100644 --- a/commands/docs/drop_column.md +++ b/src/content/docs/commands/docs/drop_column.md @@ -9,6 +9,7 @@ usage: | Remove N columns at the right-hand end of the input table. To remove columns by name, use `reject`. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,12 +18,11 @@ feature: default ## Signature -```> drop column {flags} (columns)``` +`> drop column {flags} (columns)` ## Parameters - - `columns`: Starting from the end, the number of columns to remove. - +- `columns`: Starting from the end, the number of columns to remove. ## Input/output types: @@ -30,9 +30,11 @@ feature: default | ------ | ------ | | record | record | | table | table | + ## Examples Remove the last column of a table + ```nu > [[lib, extension]; [nu-lib, rs] [nu-core, rb]] | drop column ╭───┬─────────╮ @@ -45,6 +47,7 @@ Remove the last column of a table ``` Remove the last column of a record + ```nu > {lib: nu-lib, extension: rs} | drop column ╭─────┬────────╮ diff --git a/commands/docs/drop_nth.md b/src/content/docs/commands/docs/drop_nth.md similarity index 86% rename from commands/docs/drop_nth.md rename to src/content/docs/commands/docs/drop_nth.md index 3a967769426..cfa4ca4bcaf 100644 --- a/commands/docs/drop_nth.md +++ b/src/content/docs/commands/docs/drop_nth.md @@ -9,6 +9,7 @@ usage: | Drop the selected rows. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,23 +18,23 @@ feature: default ## Signature -```> drop nth {flags} (row number or row range) ...rest``` +`> drop nth {flags} (row number or row range) ...rest` ## Parameters - - `row number or row range`: The number of the row to drop or a range to drop consecutive rows. - - `...rest`: The number of the row to drop. - +- `row number or row range`: The number of the row to drop or a range to drop consecutive rows. +- `...rest`: The number of the row to drop. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | ## Examples Drop the first, second, and third row + ```nu > [sam,sarah,2,3,4,5] | drop nth 0 1 2 ╭───┬───╮ @@ -45,6 +46,7 @@ Drop the first, second, and third row ``` Drop the first, second, and third row + ```nu > [0,1,2,3,4,5] | drop nth 0 1 2 ╭───┬───╮ @@ -56,6 +58,7 @@ Drop the first, second, and third row ``` Drop rows 0 2 4 + ```nu > [0,1,2,3,4,5] | drop nth 0 2 4 ╭───┬───╮ @@ -67,6 +70,7 @@ Drop rows 0 2 4 ``` Drop rows 2 0 4 + ```nu > [0,1,2,3,4,5] | drop nth 2 0 4 ╭───┬───╮ @@ -78,6 +82,7 @@ Drop rows 2 0 4 ``` Drop range rows from second to fourth + ```nu > [first second third fourth fifth] | drop nth (1..3) ╭───┬───────╮ @@ -88,6 +93,7 @@ Drop range rows from second to fourth ``` Drop all rows except first row + ```nu > [0,1,2,3,4,5] | drop nth 1.. ╭───┬───╮ @@ -97,6 +103,7 @@ Drop all rows except first row ``` Drop rows 3,4,5 + ```nu > [0,1,2,3,4,5] | drop nth 3.. ╭───┬───╮ diff --git a/commands/docs/du.md b/src/content/docs/commands/docs/du.md similarity index 63% rename from commands/docs/du.md rename to src/content/docs/commands/docs/du.md index 65125dbcaad..49c2d62b9d0 100644 --- a/commands/docs/du.md +++ b/src/content/docs/commands/docs/du.md @@ -9,6 +9,7 @@ usage: | Find disk usage sizes of specified items. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,20 +18,19 @@ feature: default ## Signature -```> du {flags} (path)``` +`> du {flags} (path)` ## Flags - - `--all, -a`: Output file sizes as well as directory sizes - - `--deref, -r`: Dereference symlinks to their targets for size - - `--exclude, -x {glob}`: Exclude these file names - - `--max-depth, -d {int}`: Directory recursion limit - - `--min-size, -m {int}`: Exclude files below this size +- `--all, -a`: Output file sizes as well as directory sizes +- `--deref, -r`: Dereference symlinks to their targets for size +- `--exclude, -x {glob}`: Exclude these file names +- `--max-depth, -d {int}`: Directory recursion limit +- `--min-size, -m {int}`: Exclude files below this size ## Parameters - - `path`: Starting directory. - +- `path`: Starting directory. ## Input/output types: @@ -41,6 +41,7 @@ feature: default ## Examples Disk usage of the current directory + ```nu > du diff --git a/commands/docs/each.md b/src/content/docs/commands/docs/each.md similarity index 79% rename from commands/docs/each.md rename to src/content/docs/commands/docs/each.md index 320018eb56c..af957eafffd 100644 --- a/commands/docs/each.md +++ b/src/content/docs/commands/docs/each.md @@ -9,6 +9,7 @@ usage: | Run a closure on each row of the input list, creating a new list with the results. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,27 +18,28 @@ feature: default ## Signature -```> each {flags} (closure)``` +`> each {flags} (closure)` ## Flags - - `--keep-empty, -k`: keep empty result cells +- `--keep-empty, -k`: keep empty result cells ## Parameters - - `closure`: The closure to run. - +- `closure`: The closure to run. ## Input/output types: -| input | output | -| --------- | --------- | -| any | any | +| input | output | +| ----------- | ----------- | +| any | any | | list\<any\> | list\<any\> | -| table | list\<any\> | +| table | list\<any\> | + ## Examples Multiplies elements in the list + ```nu > [1 2 3] | each {|e| 2 * $e } ╭───┬───╮ @@ -49,6 +51,7 @@ Multiplies elements in the list ``` Produce a list of values in the record, converted to string + ```nu > {major:2, minor:1, patch:4} | values | each {|| into string } ╭───┬───╮ @@ -60,6 +63,7 @@ Produce a list of values in the record, converted to string ``` Produce a list that has "two" for each 2 in the input + ```nu > [1 2 3 2] | each {|e| if $e == 2 { "two" } } ╭───┬─────╮ @@ -70,6 +74,7 @@ Produce a list that has "two" for each 2 in the input ``` Iterate over each element, producing a list showing indexes of any 2s + ```nu > [1 2 3] | enumerate | each {|e| if $e.item == 2 { $"found 2 at ($e.index)!"} } ╭───┬───────────────╮ @@ -79,6 +84,7 @@ Iterate over each element, producing a list showing indexes of any 2s ``` Iterate over each element, keeping null results + ```nu > [1 2 3] | each --keep-empty {|e| if $e == 2 { "found 2!"} } ╭───┬──────────╮ @@ -90,6 +96,7 @@ Iterate over each element, keeping null results ``` ## Notes + Since tables are lists of records, passing a table into 'each' will iterate over each record, not necessarily each cell within it. @@ -100,6 +107,6 @@ with 'transpose' first. ## Subcommands: -| name | type | usage | -| -------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------- | -| [`each while`](/commands/docs/each_while.md) | Builtin | Run a block on each row of the input list until a null is found, then create a new list with the results. | +| name | type | usage | +| ----------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------- | +| [`each while`](/commands/docs/each_while) | Builtin | Run a block on each row of the input list until a null is found, then create a new list with the results. | diff --git a/commands/docs/each_while.md b/src/content/docs/commands/docs/each_while.md similarity index 84% rename from commands/docs/each_while.md rename to src/content/docs/commands/docs/each_while.md index cf5075f598a..051140e76a0 100644 --- a/commands/docs/each_while.md +++ b/src/content/docs/commands/docs/each_while.md @@ -9,34 +9,35 @@ usage: | Run a block on each row of the input list until a null is found, then create a new list with the results. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters <div class='command-title'>{{ $frontmatter.filters }}</div> - -::: warning - Command `each while` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `each while` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> each while {flags} (closure)``` +`> each while {flags} (closure)` ## Parameters - - `closure`: the closure to run - +- `closure`: the closure to run ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | ## Examples Produces a list of each element before the 3, doubled + ```nu > [1 2 3 2 1] | each while {|e| if $e < 3 { $e * 2 } } ╭───┬───╮ @@ -47,6 +48,7 @@ Produces a list of each element before the 3, doubled ``` Output elements until reaching 'stop' + ```nu > [1 2 stop 3 4] | each while {|e| if $e != 'stop' { $"Output: ($e)" } } ╭───┬───────────╮ @@ -57,6 +59,7 @@ Output elements until reaching 'stop' ``` Iterate over each element, printing the matching value and its index + ```nu > [1 2 3] | enumerate | each while {|e| if $e.item < 2 { $"value ($e.item) at ($e.index)!"} } ╭───┬───────────────╮ diff --git a/commands/docs/echo.md b/src/content/docs/commands/docs/echo.md similarity index 89% rename from commands/docs/echo.md rename to src/content/docs/commands/docs/echo.md index 01fe1f57ae0..d9e6101f865 100644 --- a/commands/docs/echo.md +++ b/src/content/docs/commands/docs/echo.md @@ -9,6 +9,7 @@ usage: | Returns its arguments, ignoring the piped-in value. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,12 +18,11 @@ feature: default ## Signature -```> echo {flags} ...rest``` +`> echo {flags} ...rest` ## Parameters - - `...rest`: The values to echo. - +- `...rest`: The values to echo. ## Input/output types: @@ -33,6 +33,7 @@ feature: default ## Examples Put a list of numbers in the pipeline. This is the same as [1 2 3]. + ```nu > echo 1 2 3 ╭───┬───╮ @@ -44,12 +45,14 @@ Put a list of numbers in the pipeline. This is the same as [1 2 3]. ``` Returns the piped-in value, by using the special $in variable to obtain it. + ```nu > echo $in ``` ## Notes + When given no arguments, it returns an empty string. When given one argument, it returns it. Otherwise, it returns a list of the arguments. There is usually -little reason to use this over just writing the values as-is. \ No newline at end of file +little reason to use this over just writing the values as-is. diff --git a/commands/docs/encode.md b/src/content/docs/commands/docs/encode.md similarity index 72% rename from commands/docs/encode.md rename to src/content/docs/commands/docs/encode.md index 3168cf08f30..64cb1d8168b 100644 --- a/commands/docs/encode.md +++ b/src/content/docs/commands/docs/encode.md @@ -9,6 +9,7 @@ usage: | Encode a string into bytes. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,16 +18,15 @@ feature: default ## Signature -```> encode {flags} (encoding)``` +`> encode {flags} (encoding)` ## Flags - - `--ignore-errors, -i`: when a character isn't in the given encoding, replace with a HTML entity (like `🎈`) +- `--ignore-errors, -i`: when a character isn't in the given encoding, replace with a HTML entity (like `🎈`) ## Parameters - - `encoding`: The text encoding to use. - +- `encoding`: The text encoding to use. ## Input/output types: @@ -37,6 +37,7 @@ feature: default ## Examples Encode an UTF-8 string into Shift-JIS + ```nu > "負けると知って戦うのが、遥かに美しいのだ" | encode shift-jis Length: 40 (0x28) bytes | printable whitespace ascii_other non_ascii @@ -47,6 +48,7 @@ Length: 40 (0x28) bytes | printable whitespace ascii_other non_ascii ``` Replace characters with HTML entities if they can't be encoded + ```nu > "🎈" | encode --ignore-errors shift-jis Length: 9 (0x9) bytes | printable whitespace ascii_other non_ascii @@ -55,6 +57,7 @@ Length: 9 (0x9) bytes | printable whitespace ascii_other non_ascii ``` ## Notes + Multiple encodings are supported; here are a few: big5, euc-jp, euc-kr, gbk, iso-8859-1, cp1252, latin5 @@ -65,7 +68,7 @@ documentation link at https://docs.rs/encoding_rs/latest/encoding_rs/#statics ## Subcommands: -| name | type | usage | -| -------------------------------------------------- | ------- | --------------------------------------------- | -| [`encode base64`](/commands/docs/encode_base64.md) | Builtin | Encode a string or binary value using Base64. | -| [`encode hex`](/commands/docs/encode_hex.md) | Builtin | Encode a binary value using hex. | \ No newline at end of file +| name | type | usage | +| ----------------------------------------------- | ------- | --------------------------------------------- | +| [`encode base64`](/commands/docs/encode_base64) | Builtin | Encode a string or binary value using Base64. | +| [`encode hex`](/commands/docs/encode_hex) | Builtin | Encode a binary value using hex. | diff --git a/commands/docs/encode_base64.md b/src/content/docs/commands/docs/encode_base64.md similarity index 63% rename from commands/docs/encode_base64.md rename to src/content/docs/commands/docs/encode_base64.md index cb08d37fbef..602f9565356 100644 --- a/commands/docs/encode_base64.md +++ b/src/content/docs/commands/docs/encode_base64.md @@ -9,6 +9,7 @@ usage: | Encode a string or binary value using Base64. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for hash @@ -17,44 +18,47 @@ feature: default ## Signature -```> encode base64 {flags} ...rest``` +`> encode base64 {flags} ...rest` ## Flags - - `--character-set, -c {string}`: specify the character rules for encoding the input. - Valid values are 'standard', 'standard-no-padding', 'url-safe', 'url-safe-no-padding','binhex', 'bcrypt', 'crypt', 'mutf7' +- `--character-set, -c {string}`: specify the character rules for encoding the input. + Valid values are 'standard', 'standard-no-padding', 'url-safe', 'url-safe-no-padding','binhex', 'bcrypt', 'crypt', 'mutf7' ## Parameters - - `...rest`: For a data structure input, encode data at the given cell paths. - +- `...rest`: For a data structure input, encode data at the given cell paths. ## Input/output types: -| input | output | -| ------------ | ------------ | -| binary | string | +| input | output | +| -------------- | -------------- | +| binary | string | | list\<any\> | list\<string\> | | list\<binary\> | list\<string\> | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples Encode binary data + ```nu > 0x[09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0] | encode base64 CfkRAp1041vYQVbFY1aIwA== ``` Encode a string with default settings + ```nu > 'Some Data' | encode base64 U29tZSBEYXRh ``` Encode a string with the binhex character set + ```nu > 'Some Data' | encode base64 --character-set binhex 7epXB5"%A@4J diff --git a/commands/docs/encode_hex.md b/src/content/docs/commands/docs/encode_hex.md similarity index 59% rename from commands/docs/encode_hex.md rename to src/content/docs/commands/docs/encode_hex.md index ae0c2ce7170..f1bf1c2296f 100644 --- a/commands/docs/encode_hex.md +++ b/src/content/docs/commands/docs/encode_hex.md @@ -9,36 +9,38 @@ usage: | Encode a binary value using hex. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats <div class='command-title'>{{ $frontmatter.formats }}</div> - -::: warning - Command `encode hex` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `encode hex` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> encode hex {flags} ...rest``` +`> encode hex {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, encode data at the given cell paths - +- `...rest`: For a data structure input, encode data at the given cell paths ## Input/output types: -| input | output | -| ------------ | ------------ | -| binary | string | +| input | output | +| -------------- | -------------- | +| binary | string | | list\<binary\> | list\<string\> | -| record | record | -| table | table | +| record | record | +| table | table | + ## Examples Encode binary data + ```nu > 0x[09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0] | encode hex 09F911029D74E35BD84156C5635688C0 diff --git a/commands/docs/enter.md b/src/content/docs/commands/docs/enter.md similarity index 85% rename from commands/docs/enter.md rename to src/content/docs/commands/docs/enter.md index e6e4ff45976..8021447551a 100644 --- a/commands/docs/enter.md +++ b/src/content/docs/commands/docs/enter.md @@ -15,15 +15,16 @@ usage: | ## Signature -```> enter (path)``` +`> enter (path)` ## Parameters - - `path`: the path to enter as a new shell +- `path`: the path to enter as a new shell ## Examples Enter a new shell at path '../dir-foo' + ```nu > enter ../dir-foo diff --git a/commands/docs/enumerate.md b/src/content/docs/commands/docs/enumerate.md similarity index 96% rename from commands/docs/enumerate.md rename to src/content/docs/commands/docs/enumerate.md index b87f41339e1..b427a18f8b6 100644 --- a/commands/docs/enumerate.md +++ b/src/content/docs/commands/docs/enumerate.md @@ -9,6 +9,7 @@ usage: | Enumerate the elements in a stream. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,8 +18,7 @@ feature: default ## Signature -```> enumerate {flags} ``` - +`> enumerate {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Add an index to each element of a list + ```nu > [a, b, c] | enumerate ╭───┬──────╮ diff --git a/commands/docs/error_make.md b/src/content/docs/commands/docs/error_make.md similarity index 93% rename from commands/docs/error_make.md rename to src/content/docs/commands/docs/error_make.md index 98c761ca36d..ed84d5e0202 100644 --- a/commands/docs/error_make.md +++ b/src/content/docs/commands/docs/error_make.md @@ -9,6 +9,7 @@ usage: | Create an error. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,16 +18,15 @@ feature: default ## Signature -```> error make {flags} (error_struct)``` +`> error make {flags} (error_struct)` ## Flags - - `--unspanned, -u`: remove the origin label from the error +- `--unspanned, -u`: remove the origin label from the error ## Parameters - - `error_struct`: The error to create. - +- `error_struct`: The error to create. ## Input/output types: @@ -37,12 +37,14 @@ feature: default ## Examples Create a simple custom error + ```nu > error make {msg: "my custom error message"} {msg: my custom error message, debug: GenericError { error: "my custom error message", msg: "", span: None, help: None, inner: [] }, raw: GenericError { error: "my custom error message", msg: "", span: None, help: None, inner: [] }} ``` Create a more complex custom error + ```nu > error make { msg: "my custom error message" @@ -61,6 +63,7 @@ Create a more complex custom error ``` Create a custom error for a custom command that shows the span of the argument + ```nu > def foo [x] { error make { diff --git a/commands/docs/every.md b/src/content/docs/commands/docs/every.md similarity index 78% rename from commands/docs/every.md rename to src/content/docs/commands/docs/every.md index 3dd5521f681..4fcde610534 100644 --- a/commands/docs/every.md +++ b/src/content/docs/commands/docs/every.md @@ -9,6 +9,7 @@ usage: | Show (or skip) every n-th row, starting from the first one. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,26 +18,26 @@ feature: default ## Signature -```> every {flags} (stride)``` +`> every {flags} (stride)` ## Flags - - `--skip, -s`: skip the rows that would be returned, instead of selecting them +- `--skip, -s`: skip the rows that would be returned, instead of selecting them ## Parameters - - `stride`: How many rows to skip between (and including) each row returned. - +- `stride`: How many rows to skip between (and including) each row returned. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | ## Examples Get every second row + ```nu > [1 2 3 4 5] | every 2 ╭───┬───╮ @@ -48,6 +49,7 @@ Get every second row ``` Skip every second row + ```nu > [1 2 3 4 5] | every 2 --skip ╭───┬───╮ diff --git a/commands/docs/exec.md b/src/content/docs/commands/docs/exec.md similarity index 88% rename from commands/docs/exec.md rename to src/content/docs/commands/docs/exec.md index 8650485ae06..db01446cf0e 100644 --- a/commands/docs/exec.md +++ b/src/content/docs/commands/docs/exec.md @@ -9,6 +9,7 @@ usage: | Execute a command, replacing or exiting the current process, depending on platform. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for system @@ -17,12 +18,11 @@ feature: default ## Signature -```> exec {flags} (command)``` +`> exec {flags} (command)` ## Parameters - - `command`: The command to execute. - +- `command`: The command to execute. ## Input/output types: @@ -33,17 +33,20 @@ feature: default ## Examples Execute external 'ps aux' tool + ```nu > exec ps aux ``` Execute 'nautilus' + ```nu > exec nautilus ``` ## Notes + On Unix-based systems, the current process is replaced with the command. -On Windows based systems, Nushell will wait for the command to finish and then exit with the command's exit code. \ No newline at end of file +On Windows based systems, Nushell will wait for the command to finish and then exit with the command's exit code. diff --git a/commands/docs/exit.md b/src/content/docs/commands/docs/exit.md similarity index 85% rename from commands/docs/exit.md rename to src/content/docs/commands/docs/exit.md index 4d0b8c9ce1e..f3be3ce8e96 100644 --- a/commands/docs/exit.md +++ b/src/content/docs/commands/docs/exit.md @@ -9,6 +9,7 @@ usage: | Exit Nu. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for shells @@ -17,12 +18,11 @@ feature: default ## Signature -```> exit {flags} (exit_code)``` +`> exit {flags} (exit_code)` ## Parameters - - `exit_code`: Exit code to return immediately with. - +- `exit_code`: Exit code to return immediately with. ## Input/output types: @@ -33,6 +33,7 @@ feature: default ## Examples Exit the current shell + ```nu > exit diff --git a/commands/docs/explain.md b/src/content/docs/commands/docs/explain.md similarity index 90% rename from commands/docs/explain.md rename to src/content/docs/commands/docs/explain.md index 65dc48dda41..adfbaadf15e 100644 --- a/commands/docs/explain.md +++ b/src/content/docs/commands/docs/explain.md @@ -9,6 +9,7 @@ usage: | Explain closure contents. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for debug @@ -17,12 +18,11 @@ feature: default ## Signature -```> explain {flags} (closure)``` +`> explain {flags} (closure)` ## Parameters - - `closure`: The closure to run. - +- `closure`: The closure to run. ## Input/output types: @@ -30,9 +30,11 @@ feature: default | ------- | ------ | | any | any | | nothing | any | + ## Examples Explain a command within a closure + ```nu > explain {|| ls | sort-by name type --ignore-case | get name } | table --expand diff --git a/commands/docs/explore.md b/src/content/docs/commands/docs/explore.md similarity index 75% rename from commands/docs/explore.md rename to src/content/docs/commands/docs/explore.md index 3a04d02a2f1..720f9319892 100644 --- a/commands/docs/explore.md +++ b/src/content/docs/commands/docs/explore.md @@ -9,6 +9,7 @@ usage: | Explore acts as a table pager, just like `less` does for text. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for viewers @@ -17,15 +18,14 @@ feature: default ## Signature -```> explore {flags} ``` +`> explore {flags} ` ## Flags - - `--head, - {bool}`: Show or hide column headers (default true) - - `--index, -i`: Show row indexes when viewing a list - - `--reverse, -r`: Start with the viewport scrolled to the bottom - - `--peek, -p`: When quitting, output the value of the cell the cursor was on - +- `--head, - {bool}`: Show or hide column headers (default true) +- `--index, -i`: Show row indexes when viewing a list +- `--reverse, -r`: Start with the viewport scrolled to the bottom +- `--peek, -p`: When quitting, output the value of the cell the cursor was on ## Input/output types: @@ -36,28 +36,33 @@ feature: default ## Examples Explore the system information record + ```nu > sys | explore ``` Explore the output of `ls` without column names + ```nu > ls | explore --head false ``` Explore a list of Markdown files' contents, with row indexes + ```nu > glob *.md | each {|| open } | explore --index ``` Explore a JSON file, then save the last visited sub-structure to a file + ```nu > open file.json | explore --peek | to json | save part.json ``` ## Notes -Press `:` then `h` to get a help menu. \ No newline at end of file + +Press `:` then `h` to get a help menu. diff --git a/commands/docs/export-env.md b/src/content/docs/commands/docs/export-env.md similarity index 89% rename from commands/docs/export-env.md rename to src/content/docs/commands/docs/export-env.md index 2441ca25106..d77961d3a35 100644 --- a/commands/docs/export-env.md +++ b/src/content/docs/commands/docs/export-env.md @@ -9,6 +9,7 @@ usage: | Run a block and preserve its environment in a current scope. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for env @@ -17,12 +18,11 @@ feature: default ## Signature -```> export-env {flags} (block)``` +`> export-env {flags} (block)` ## Parameters - - `block`: The block to run to set the environment. - +- `block`: The block to run to set the environment. ## Input/output types: @@ -33,12 +33,14 @@ feature: default ## Examples Set an environment variable + ```nu > export-env { $env.SPAM = 'eggs' } ``` Set an environment variable and examine its value + ```nu > export-env { $env.SPAM = 'eggs' }; $env.SPAM eggs diff --git a/src/content/docs/commands/docs/export.md b/src/content/docs/commands/docs/export.md new file mode 100644 index 00000000000..d7b1fbb0360 --- /dev/null +++ b/src/content/docs/commands/docs/export.md @@ -0,0 +1,52 @@ +--- +title: export +categories: | + core +version: 0.90.0 +core: | + Export definitions or environment variables from a module. +usage: | + Export definitions or environment variables from a module. +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for core + +<div class='command-title'>{{ $frontmatter.core }}</div> + +## Signature + +`> export {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------- | +| nothing | nothing | + +## Examples + +Export a definition from a module + +```nu +> module utils { export def my-command [] { "hello" } }; use utils my-command; my-command +hello +``` + +## Notes + +This command is a parser keyword. For details, check: +https://www.nushell.sh/book/thinking_in_nu.html + +## Subcommands: + +| name | type | usage | +| ----------------------------------------------- | ------- | -------------------------------------------------------------------------------- | +| [`export alias`](/commands/docs/export_alias) | Builtin | Alias a command (with optional flags) to a new name and export it from a module. | +| [`export const`](/commands/docs/export_const) | Builtin | Use parse-time constant from a module and export them from this module. | +| [`export def`](/commands/docs/export_def) | Builtin | Define a custom command and export it from a module. | +| [`export extern`](/commands/docs/export_extern) | Builtin | Define an extern and export it from a module. | +| [`export module`](/commands/docs/export_module) | Builtin | Export a custom module from a module. | +| [`export use`](/commands/docs/export_use) | Builtin | Use definitions from a module and export them from this module. | diff --git a/commands/docs/export_alias.md b/src/content/docs/commands/docs/export_alias.md similarity index 81% rename from commands/docs/export_alias.md rename to src/content/docs/commands/docs/export_alias.md index 5981edc218c..1456de4bf6f 100644 --- a/commands/docs/export_alias.md +++ b/src/content/docs/commands/docs/export_alias.md @@ -9,6 +9,7 @@ usage: | Alias a command (with optional flags) to a new name and export it from a module. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,13 +18,12 @@ feature: default ## Signature -```> export alias {flags} (name) (initial_value)``` +`> export alias {flags} (name) (initial_value)` ## Parameters - - `name`: Name of the alias. - - `initial_value`: Equals sign followed by value. - +- `name`: Name of the alias. +- `initial_value`: Equals sign followed by value. ## Input/output types: @@ -34,11 +34,13 @@ feature: default ## Examples Alias ll to ls -l and export it from a module + ```nu > module spam { export alias ll = ls -l } ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/export_const.md b/src/content/docs/commands/docs/export_const.md similarity index 80% rename from commands/docs/export_const.md rename to src/content/docs/commands/docs/export_const.md index fd6ccd3f561..7fdda7503d3 100644 --- a/commands/docs/export_const.md +++ b/src/content/docs/commands/docs/export_const.md @@ -9,6 +9,7 @@ usage: | Use parse-time constant from a module and export them from this module. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,13 +18,12 @@ feature: default ## Signature -```> export const {flags} (const_name) (initial_value)``` +`> export const {flags} (const_name) (initial_value)` ## Parameters - - `const_name`: Constant name. - - `initial_value`: Equals sign followed by constant value. - +- `const_name`: Constant name. +- `initial_value`: Equals sign followed by constant value. ## Input/output types: @@ -34,6 +34,7 @@ feature: default ## Examples Re-export a command from another module + ```nu > module spam { export const foo = 3; } module eggs { export use spam foo } @@ -44,5 +45,6 @@ Re-export a command from another module ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/export_def.md b/src/content/docs/commands/docs/export_def.md similarity index 67% rename from commands/docs/export_def.md rename to src/content/docs/commands/docs/export_def.md index 299ac60e190..5db047f4e23 100644 --- a/commands/docs/export_def.md +++ b/src/content/docs/commands/docs/export_def.md @@ -9,6 +9,7 @@ usage: | Define a custom command and export it from a module. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,19 +18,18 @@ feature: default ## Signature -```> export def {flags} (def_name) (params) (block)``` +`> export def {flags} (def_name) (params) (block)` ## Flags - - `--env, -`: keep the environment defined inside the command - - `--wrapped, -`: treat unknown flags and arguments as strings (requires ...rest-like parameter in signature) +- `--env, -`: keep the environment defined inside the command +- `--wrapped, -`: treat unknown flags and arguments as strings (requires ...rest-like parameter in signature) ## Parameters - - `def_name`: Command name. - - `params`: Parameters. - - `block`: Body of the definition. - +- `def_name`: Command name. +- `params`: Parameters. +- `block`: Body of the definition. ## Input/output types: @@ -40,11 +40,13 @@ feature: default ## Examples Define a custom command in a module and call it + ```nu > module spam { export def foo [] { "foo" } }; use spam foo; foo foo ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/export_extern.md b/src/content/docs/commands/docs/export_extern.md similarity index 81% rename from commands/docs/export_extern.md rename to src/content/docs/commands/docs/export_extern.md index 4de684113a8..89643dc6f87 100644 --- a/commands/docs/export_extern.md +++ b/src/content/docs/commands/docs/export_extern.md @@ -9,6 +9,7 @@ usage: | Define an extern and export it from a module. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,13 +18,12 @@ feature: default ## Signature -```> export extern {flags} (def_name) (params)``` +`> export extern {flags} (def_name) (params)` ## Parameters - - `def_name`: Definition name. - - `params`: Parameters. - +- `def_name`: Definition name. +- `params`: Parameters. ## Input/output types: @@ -34,11 +34,13 @@ feature: default ## Examples Export the signature for an external command + ```nu > export extern echo [text: string] ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/export_module.md b/src/content/docs/commands/docs/export_module.md similarity index 79% rename from commands/docs/export_module.md rename to src/content/docs/commands/docs/export_module.md index 53d8abc4d71..774fb79aec1 100644 --- a/commands/docs/export_module.md +++ b/src/content/docs/commands/docs/export_module.md @@ -9,6 +9,7 @@ usage: | Export a custom module from a module. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,13 +18,12 @@ feature: default ## Signature -```> export module {flags} (module) (block)``` +`> export module {flags} (module) (block)` ## Parameters - - `module`: Module name or module path. - - `block`: Body of the module if 'module' parameter is not a path. - +- `module`: Module name or module path. +- `block`: Body of the module if 'module' parameter is not a path. ## Input/output types: @@ -34,6 +34,7 @@ feature: default ## Examples Define a custom command in a submodule of a module and call it + ```nu > module spam { export module eggs { @@ -46,5 +47,6 @@ foo ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/export_use.md b/src/content/docs/commands/docs/export_use.md similarity index 81% rename from commands/docs/export_use.md rename to src/content/docs/commands/docs/export_use.md index 7ada4342275..2e8bb80c822 100644 --- a/commands/docs/export_use.md +++ b/src/content/docs/commands/docs/export_use.md @@ -9,6 +9,7 @@ usage: | Use definitions from a module and export them from this module. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,13 +18,12 @@ feature: default ## Signature -```> export use {flags} (module) (members)``` +`> export use {flags} (module) (members)` ## Parameters - - `module`: Module or module file. - - `members`: Which members of the module to import. - +- `module`: Module or module file. +- `members`: Which members of the module to import. ## Input/output types: @@ -34,6 +34,7 @@ feature: default ## Examples Re-export a command from another module + ```nu > module spam { export def foo [] { "foo" } } module eggs { export use spam foo } @@ -44,5 +45,6 @@ foo ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/extern.md b/src/content/docs/commands/docs/extern.md similarity index 82% rename from commands/docs/extern.md rename to src/content/docs/commands/docs/extern.md index c4bdc5eabd1..c8dbb31d0f5 100644 --- a/commands/docs/extern.md +++ b/src/content/docs/commands/docs/extern.md @@ -9,6 +9,7 @@ usage: | Define a signature for an external command. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,13 +18,12 @@ feature: default ## Signature -```> extern {flags} (def_name) (params)``` +`> extern {flags} (def_name) (params)` ## Parameters - - `def_name`: Definition name. - - `params`: Parameters. - +- `def_name`: Definition name. +- `params`: Parameters. ## Input/output types: @@ -34,11 +34,13 @@ feature: default ## Examples Write a signature for an external command + ```nu > extern echo [text: string] ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/fill.md b/src/content/docs/commands/docs/fill.md similarity index 75% rename from commands/docs/fill.md rename to src/content/docs/commands/docs/fill.md index 6088187d6ac..8d067d1ecd0 100644 --- a/commands/docs/fill.md +++ b/src/content/docs/commands/docs/fill.md @@ -9,6 +9,7 @@ usage: | Fill and Align. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for conversions @@ -17,61 +18,67 @@ feature: default ## Signature -```> fill {flags} ``` +`> fill {flags} ` ## Flags - - `--width, -w {int}`: The width of the output. Defaults to 1 - - `--alignment, -a {string}`: The alignment of the output. Defaults to Left (Left(l), Right(r), Center(c/m), MiddleRight(cr/mr)) - - `--character, -c {string}`: The character to fill with. Defaults to ' ' (space) - +- `--width, -w {int}`: The width of the output. Defaults to 1 +- `--alignment, -a {string}`: The alignment of the output. Defaults to Left (Left(l), Right(r), Center(c/m), MiddleRight(cr/mr)) +- `--character, -c {string}`: The character to fill with. Defaults to ' ' (space) ## Input/output types: -| input | output | -| -------------- | ------------ | -| filesize | string | -| float | string | -| int | string | +| input | output | +| ---------------- | -------------- | +| filesize | string | +| float | string | +| int | string | | list\<any\> | list\<string\> | | list\<filesize\> | list\<string\> | | list\<float\> | list\<string\> | | list\<int\> | list\<string\> | | list\<string\> | list\<string\> | -| string | string | +| string | string | + ## Examples Fill a string on the left side to a width of 15 with the character '─' + ```nu > 'nushell' | fill --alignment l --character '─' --width 15 nushell──────── ``` Fill a string on the right side to a width of 15 with the character '─' + ```nu > 'nushell' | fill --alignment r --character '─' --width 15 ────────nushell ``` Fill a string on both sides to a width of 15 with the character '─' + ```nu > 'nushell' | fill --alignment m --character '─' --width 15 ────nushell──── ``` Fill a number on the left side to a width of 5 with the character '0' + ```nu > 1 | fill --alignment right --character '0' --width 5 00001 ``` Fill a number on both sides to a width of 5 with the character '0' + ```nu > 1.1 | fill --alignment center --character '0' --width 5 01.10 ``` Fill a filesize on the left side to a width of 5 with the character '0' + ```nu > 1kib | fill --alignment middle --character '0' --width 10 0001024000 diff --git a/commands/docs/filter.md b/src/content/docs/commands/docs/filter.md similarity index 90% rename from commands/docs/filter.md rename to src/content/docs/commands/docs/filter.md index 222a7cc74f9..3380694e4ee 100644 --- a/commands/docs/filter.md +++ b/src/content/docs/commands/docs/filter.md @@ -9,6 +9,7 @@ usage: | Filter values based on a predicate closure. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,22 +18,23 @@ feature: default ## Signature -```> filter {flags} (closure)``` +`> filter {flags} (closure)` ## Parameters - - `closure`: Predicate closure. - +- `closure`: Predicate closure. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | -| range | list\<any\> | +| range | list\<any\> | + ## Examples Filter items of a list according to a condition + ```nu > [1 2] | filter {|x| $x > 1} ╭───┬───╮ @@ -42,6 +44,7 @@ Filter items of a list according to a condition ``` Filter rows of a table according to a condition + ```nu > [{a: 1} {a: 2}] | filter {|x| $x.a > 1} ╭───┬───╮ @@ -53,6 +56,7 @@ Filter rows of a table according to a condition ``` Filter rows of a table according to a stored condition + ```nu > let cond = {|x| $x.a > 1}; [{a: 1} {a: 2}] | filter $cond ╭───┬───╮ @@ -64,6 +68,7 @@ Filter rows of a table according to a stored condition ``` Filter items of a range according to a condition + ```nu > 9..13 | filter {|el| $el mod 2 != 0} ╭───┬────╮ @@ -75,11 +80,13 @@ Filter items of a range according to a condition ``` List all numbers above 3, using an existing closure condition + ```nu > let a = {$in > 3}; [1, 2, 5, 6] | filter $a ``` ## Notes + This command works similar to 'where' but allows reading the predicate closure from -a variable. On the other hand, the "row condition" syntax is not supported. \ No newline at end of file +a variable. On the other hand, the "row condition" syntax is not supported. diff --git a/commands/docs/find.md b/src/content/docs/commands/docs/find.md similarity index 86% rename from commands/docs/find.md rename to src/content/docs/commands/docs/find.md index b72197165a8..0eda82f7c0d 100644 --- a/commands/docs/find.md +++ b/src/content/docs/commands/docs/find.md @@ -9,6 +9,7 @@ usage: | Searches terms in the input. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,43 +18,46 @@ feature: default ## Signature -```> find {flags} ...rest``` +`> find {flags} ...rest` ## Flags - - `--regex, -r {string}`: regex to match with - - `--ignore-case, -i`: case-insensitive regex mode; equivalent to (?i) - - `--multiline, -m`: multi-line regex mode: ^ and $ match begin/end of line; equivalent to (?m) - - `--dotall, -s`: dotall regex mode: allow a dot . to match newlines \n; equivalent to (?s) - - `--columns, -c {list<string>}`: column names to be searched (with rest parameter, not regex yet) - - `--invert, -v`: invert the match +- `--regex, -r {string}`: regex to match with +- `--ignore-case, -i`: case-insensitive regex mode; equivalent to (?i) +- `--multiline, -m`: multi-line regex mode: ^ and $ match begin/end of line; equivalent to (?m) +- `--dotall, -s`: dotall regex mode: allow a dot . to match newlines \n; equivalent to (?s) +- `--columns, -c {list<string>}`: column names to be searched (with rest parameter, not regex yet) +- `--invert, -v`: invert the match ## Parameters - - `...rest`: Terms to search. - +- `...rest`: Terms to search. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | -| string | any | +| string | any | + ## Examples Search for multiple terms in a command output + ```nu > ls | find toml md sh ``` Search and highlight text for a term in a string + ```nu > 'Cargo.toml' | find toml Cargo.toml ``` Search a number or a file size in a list of numbers + ```nu > [1 5 3kb 4 3Mb] | find 5 3kb ╭───┬─────────╮ @@ -64,6 +68,7 @@ Search a number or a file size in a list of numbers ``` Search a char in a list of string + ```nu > [moe larry curly] | find l ╭───┬───────╮ @@ -74,6 +79,7 @@ Search a char in a list of string ``` Find using regex + ```nu > [abc bde arc abf] | find --regex "ab" ╭───┬─────╮ @@ -84,6 +90,7 @@ Find using regex ``` Find using regex case insensitive + ```nu > [aBc bde Arc abf] | find --regex "ab" -i ╭───┬─────╮ @@ -94,6 +101,7 @@ Find using regex case insensitive ``` Find value in records using regex + ```nu > [[version name]; ['0.1.0' nushell] ['0.1.1' fish] ['0.2.0' zsh]] | find --regex "nu" ╭───┬─────────┬─────────╮ @@ -105,6 +113,7 @@ Find value in records using regex ``` Find inverted values in records using regex + ```nu > [[version name]; ['0.1.0' nushell] ['0.1.1' fish] ['0.2.0' zsh]] | find --regex "nu" --invert ╭───┬─────────┬──────╮ @@ -117,6 +126,7 @@ Find inverted values in records using regex ``` Find value in list using regex + ```nu > [["Larry", "Moe"], ["Victor", "Marina"]] | find --regex "rr" ╭───┬───────────────╮ @@ -129,6 +139,7 @@ Find value in list using regex ``` Find inverted values in records using regex + ```nu > [["Larry", "Moe"], ["Victor", "Marina"]] | find --regex "rr" --invert ╭───┬────────────────╮ @@ -141,12 +152,14 @@ Find inverted values in records using regex ``` Remove ANSI sequences from result + ```nu > [[foo bar]; [abc 123] [def 456]] | find 123 | get bar | ansi strip ``` Find and highlight text in specific columns + ```nu > [[col1 col2 col3]; [moe larry curly] [larry curly moe]] | find moe --columns [col1] ╭───┬──────┬───────┬───────╮ diff --git a/commands/docs/first.md b/src/content/docs/commands/docs/first.md similarity index 84% rename from commands/docs/first.md rename to src/content/docs/commands/docs/first.md index 4aa74823931..a254203d70b 100644 --- a/commands/docs/first.md +++ b/src/content/docs/commands/docs/first.md @@ -9,6 +9,7 @@ usage: | Return only the first several rows of the input. Counterpart of `last`. Opposite of `skip`. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,29 +18,31 @@ feature: default ## Signature -```> first {flags} (rows)``` +`> first {flags} (rows)` ## Parameters - - `rows`: Starting from the front, the number of rows to return. - +- `rows`: Starting from the front, the number of rows to return. ## Input/output types: -| input | output | -| --------- | ------ | -| binary | binary | +| input | output | +| ----------- | ------ | +| binary | binary | | list\<any\> | any | -| range | any | +| range | any | + ## Examples Return the first item of a list/table + ```nu > [1 2 3] | first 1 ``` Return the first 2 items of a list/table + ```nu > [1 2 3] | first 2 ╭───┬───╮ @@ -50,6 +53,7 @@ Return the first 2 items of a list/table ``` Return the first 2 bytes of a binary value + ```nu > 0x[01 23 45] | first 2 Length: 2 (0x2) bytes | printable whitespace ascii_other non_ascii diff --git a/commands/docs/flatten.md b/src/content/docs/commands/docs/flatten.md similarity index 91% rename from commands/docs/flatten.md rename to src/content/docs/commands/docs/flatten.md index 3543fcba525..8f813588cd4 100644 --- a/commands/docs/flatten.md +++ b/src/content/docs/commands/docs/flatten.md @@ -9,6 +9,7 @@ usage: | Flatten the table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,26 +18,27 @@ feature: default ## Signature -```> flatten {flags} ...rest``` +`> flatten {flags} ...rest` ## Flags - - `--all, -a`: flatten inner table one level out +- `--all, -a`: flatten inner table one level out ## Parameters - - `...rest`: Optionally flatten data by column. - +- `...rest`: Optionally flatten data by column. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | -| record | table | +| record | table | + ## Examples flatten a table + ```nu > [[N, u, s, h, e, l, l]] | flatten ╭───┬───╮ @@ -52,24 +54,28 @@ flatten a table ``` flatten a table, get the first item + ```nu > [[N, u, s, h, e, l, l]] | flatten | first ``` flatten a column having a nested table + ```nu > [[origin, people]; [Ecuador, ([[name, meal]; ['Andres', 'arepa']])]] | flatten --all | get meal ``` restrict the flattening by passing column names + ```nu > [[origin, crate, versions]; [World, ([[name]; ['nu-cli']]), ['0.21', '0.22']]] | flatten versions --all | last | get versions ``` Flatten inner table + ```nu > { a: b, d: [ 1 2 3 4 ], e: [ 4 3 ] } | flatten d --all ╭───┬───┬───┬───────────╮ diff --git a/commands/docs/fmt.md b/src/content/docs/commands/docs/fmt.md similarity index 86% rename from commands/docs/fmt.md rename to src/content/docs/commands/docs/fmt.md index 685869dc89f..22cbd84d7f2 100644 --- a/commands/docs/fmt.md +++ b/src/content/docs/commands/docs/fmt.md @@ -9,20 +9,20 @@ usage: | Format a number. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for conversions <div class='command-title'>{{ $frontmatter.conversions }}</div> - -::: warning - Command `fmt` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `fmt` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: -## Signature -```> fmt {flags} ``` +## Signature +`> fmt {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ feature: extra ## Examples Get a record containing multiple formats for the number 42 + ```nu > 42 | fmt ╭──────────┬──────────╮ diff --git a/commands/docs/for.md b/src/content/docs/commands/docs/for.md similarity index 75% rename from commands/docs/for.md rename to src/content/docs/commands/docs/for.md index 44bd71b5531..c4035c77b69 100644 --- a/commands/docs/for.md +++ b/src/content/docs/commands/docs/for.md @@ -9,6 +9,7 @@ usage: | Loop over a range. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,18 +18,17 @@ feature: default ## Signature -```> for {flags} (var_name) (range) (block)``` +`> for {flags} (var_name) (range) (block)` ## Flags - - `--numbered, -n`: return a numbered item ($it.index and $it.item) +- `--numbered, -n`: return a numbered item ($it.index and $it.item) ## Parameters - - `var_name`: Name of the looping variable. - - `range`: Range of the loop. - - `block`: The block to run. - +- `var_name`: Name of the looping variable. +- `range`: Range of the loop. +- `block`: The block to run. ## Input/output types: @@ -39,23 +39,27 @@ feature: default ## Examples Print the square of each integer + ```nu > for x in [1 2 3] { print ($x * $x) } ``` Work with elements of a range + ```nu > for $x in 1..3 { print $x } ``` Number each item and print a message + ```nu > for $it in ['bob' 'fred'] --numbered { print $"($it.index) is ($it.item)" } ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/src/content/docs/commands/docs/format.md b/src/content/docs/commands/docs/format.md new file mode 100644 index 00000000000..4602d8314ac --- /dev/null +++ b/src/content/docs/commands/docs/format.md @@ -0,0 +1,40 @@ +--- +title: format +categories: | + strings +version: 0.90.0 +strings: | + Various commands for formatting data. +usage: | + Various commands for formatting data. +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for strings + +<div class='command-title'>{{ $frontmatter.strings }}</div> + +## Signature + +`> format {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | type | usage | +| --------------------------------------------------- | ------- | -------------------------------------------------------- | +| [`format date`](/commands/docs/format_date) | Builtin | Format a given date using a format string. | +| [`format duration`](/commands/docs/format_duration) | Builtin | Outputs duration with a specified unit of time. | +| [`format filesize`](/commands/docs/format_filesize) | Builtin | Converts a column of filesizes to some specified format. | +| [`format pattern`](/commands/docs/format_pattern) | Builtin | Format columns into a string using a simple pattern. | diff --git a/commands/docs/format_date.md b/src/content/docs/commands/docs/format_date.md similarity index 90% rename from commands/docs/format_date.md rename to src/content/docs/commands/docs/format_date.md index 6f195213c12..0c0e5a7baef 100644 --- a/commands/docs/format_date.md +++ b/src/content/docs/commands/docs/format_date.md @@ -9,6 +9,7 @@ usage: | Format a given date using a format string. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for date @@ -17,16 +18,15 @@ feature: default ## Signature -```> format date {flags} (format string)``` +`> format date {flags} (format string)` ## Flags - - `--list, -l`: lists strftime cheatsheet +- `--list, -l`: lists strftime cheatsheet ## Parameters - - `format string`: The desired format date. - +- `format string`: The desired format date. ## Input/output types: @@ -35,33 +35,39 @@ feature: default | datetime | string | | nothing | table | | string | string | + ## Examples Format a given date-time using the default format (RFC 2822). + ```nu > '2021-10-22 20:00:12 +01:00' | into datetime | format date Fri, 22 Oct 2021 20:00:12 +0100 ``` Format a given date-time as a string using the default format (RFC 2822). + ```nu > "2021-10-22 20:00:12 +01:00" | format date Fri, 22 Oct 2021 20:00:12 +0100 ``` Format the current date-time using a given format string. + ```nu > date now | format date "%Y-%m-%d %H:%M:%S" ``` Format the current date using a given format string. + ```nu > date now | format date "%Y-%m-%d %H:%M:%S" ``` Format a given date using a given format string. + ```nu > "2021-10-22 20:00:12 +01:00" | format date "%Y-%m-%d" 2021-10-22 diff --git a/commands/docs/format_duration.md b/src/content/docs/commands/docs/format_duration.md similarity index 74% rename from commands/docs/format_duration.md rename to src/content/docs/commands/docs/format_duration.md index d85a08cd74b..9dc59830885 100644 --- a/commands/docs/format_duration.md +++ b/src/content/docs/commands/docs/format_duration.md @@ -9,6 +9,7 @@ usage: | Outputs duration with a specified unit of time. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,30 +18,32 @@ feature: default ## Signature -```> format duration {flags} (format value) ...rest``` +`> format duration {flags} (format value) ...rest` ## Parameters - - `format value`: The unit in which to display the duration. - - `...rest`: For a data structure input, format duration at the given cell paths. - +- `format value`: The unit in which to display the duration. +- `...rest`: For a data structure input, format duration at the given cell paths. ## Input/output types: -| input | output | -| -------------- | ------------ | -| duration | string | +| input | output | +| ---------------- | -------------- | +| duration | string | | list\<duration\> | list\<string\> | -| table | table | +| table | table | + ## Examples Convert µs duration to the requested second duration as a string + ```nu > 1000000µs | format duration sec 1 sec ``` Convert durations to µs duration as strings + ```nu > [1sec 2sec] | format duration µs ╭───┬────────────╮ @@ -51,6 +54,7 @@ Convert durations to µs duration as strings ``` Convert duration to µs as a string if unit asked for was us + ```nu > 1sec | format duration us 1000000 µs diff --git a/commands/docs/format_filesize.md b/src/content/docs/commands/docs/format_filesize.md similarity index 80% rename from commands/docs/format_filesize.md rename to src/content/docs/commands/docs/format_filesize.md index 501ab70ae72..ac487415972 100644 --- a/commands/docs/format_filesize.md +++ b/src/content/docs/commands/docs/format_filesize.md @@ -9,6 +9,7 @@ usage: | Converts a column of filesizes to some specified format. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,13 +18,12 @@ feature: default ## Signature -```> format filesize {flags} (format value) ...rest``` +`> format filesize {flags} (format value) ...rest` ## Parameters - - `format value`: The format into which convert the file sizes. - - `...rest`: For a data structure input, format filesizes at the given cell paths. - +- `format value`: The format into which convert the file sizes. +- `...rest`: For a data structure input, format filesizes at the given cell paths. ## Input/output types: @@ -32,21 +32,25 @@ feature: default | filesize | string | | record | record | | table | table | + ## Examples Convert the size column to KB + ```nu > ls | format filesize KB size ``` Convert the apparent column to B + ```nu > du | format filesize B apparent ``` Convert the size data to MB + ```nu > 4Gb | format filesize MB 4000.0 MB diff --git a/commands/docs/format_pattern.md b/src/content/docs/commands/docs/format_pattern.md similarity index 71% rename from commands/docs/format_pattern.md rename to src/content/docs/commands/docs/format_pattern.md index 23d36e80cb9..d96a3f207ba 100644 --- a/commands/docs/format_pattern.md +++ b/src/content/docs/commands/docs/format_pattern.md @@ -9,40 +9,43 @@ usage: | Format columns into a string using a simple pattern. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings <div class='command-title'>{{ $frontmatter.strings }}</div> - -::: warning - Command `format pattern` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `format pattern` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> format pattern {flags} (pattern)``` +`> format pattern {flags} (pattern)` ## Parameters - - `pattern`: the pattern to output. e.g.) "{foo}: {bar}" - +- `pattern`: the pattern to output. e.g.) "{foo}: {bar}" ## Input/output types: -| input | output | -| ------ | ------------ | -| record | any | +| input | output | +| ------ | -------------- | +| record | any | | table | list\<string\> | + ## Examples Print filenames with their sizes + ```nu > ls | format pattern '{name}: {size}' ``` Print elements from some columns of a table + ```nu > [[col1, col2]; [v1, v2] [v3, v4]] | format pattern '{col2}' ╭───┬────╮ diff --git a/src/content/docs/commands/docs/from.md b/src/content/docs/commands/docs/from.md new file mode 100644 index 00000000000..ef1937afd53 --- /dev/null +++ b/src/content/docs/commands/docs/from.md @@ -0,0 +1,52 @@ +--- +title: from +categories: | + formats +version: 0.90.0 +formats: | + Parse a string or binary data into structured data. +usage: | + Parse a string or binary data into structured data. +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for formats + +<div class='command-title'>{{ $frontmatter.formats }}</div> + +## Signature + +`> from {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | type | usage | +| --------------------------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------- | +| [`from csv`](/commands/docs/from_csv) | Builtin | Parse text as .csv and create table. | +| [`from eml`](/commands/docs/from_eml) | Builtin,Plugin | Parse text as .eml and create record. | +| [`from ics`](/commands/docs/from_ics) | Builtin,Plugin | Parse text as .ics and create table. | +| [`from ini`](/commands/docs/from_ini) | Builtin,Plugin | Parse text as .ini and create table. | +| [`from json`](/commands/docs/from_json) | Builtin | Convert from json to structured data. | +| [`from nuon`](/commands/docs/from_nuon) | Builtin | Convert from nuon to structured data. | +| [`from ods`](/commands/docs/from_ods) | Builtin | Parse OpenDocument Spreadsheet(.ods) data and create table. | +| [`from ssv`](/commands/docs/from_ssv) | Builtin | Parse text as space-separated values and create a table. The default minimum number of spaces counted as a separator is 2. | +| [`from toml`](/commands/docs/from_toml) | Builtin | Parse text as .toml and create record. | +| [`from tsv`](/commands/docs/from_tsv) | Builtin | Parse text as .tsv and create table. | +| [`from url`](/commands/docs/from_url) | Builtin | Parse url-encoded string as a record. | +| [`from vcf`](/commands/docs/from_vcf) | Builtin,Plugin | Parse text as .vcf and create table. | +| [`from xlsx`](/commands/docs/from_xlsx) | Builtin | Parse binary Excel(.xlsx) data and create table. | +| [`from xml`](/commands/docs/from_xml) | Builtin | Parse text as .xml and create record. | +| [`from yaml`](/commands/docs/from_yaml) | Builtin | Parse text as .yaml/.yml and create table. | +| [`from yml`](/commands/docs/from_yml) | Builtin | Parse text as .yaml/.yml and create table. | diff --git a/commands/docs/from_csv.md b/src/content/docs/commands/docs/from_csv.md similarity index 69% rename from commands/docs/from_csv.md rename to src/content/docs/commands/docs/from_csv.md index d34e2012735..15e22579602 100644 --- a/commands/docs/from_csv.md +++ b/src/content/docs/commands/docs/from_csv.md @@ -9,6 +9,7 @@ usage: | Parse text as .csv and create table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,19 +18,18 @@ feature: default ## Signature -```> from csv {flags} ``` +`> from csv {flags} ` ## Flags - - `--separator, -s {string}`: a character to separate columns (either single char or 4 byte unicode sequence), defaults to ',' - - `--comment, -c {string}`: a comment character to ignore lines starting with it - - `--quote, -q {string}`: a quote character to ignore separators in strings, defaults to '"' - - `--escape, -e {string}`: an escape character for strings containing the quote character - - `--noheaders, -n`: don't treat the first row as column names - - `--flexible, -`: allow the number of fields in records to be variable - - `--no-infer, -`: no field type inferencing - - `--trim, -t {string}`: drop leading and trailing whitespaces around headers names and/or field values - +- `--separator, -s {string}`: a character to separate columns (either single char or 4 byte unicode sequence), defaults to ',' +- `--comment, -c {string}`: a comment character to ignore lines starting with it +- `--quote, -q {string}`: a quote character to ignore separators in strings, defaults to '"' +- `--escape, -e {string}`: an escape character for strings containing the quote character +- `--noheaders, -n`: don't treat the first row as column names +- `--flexible, -`: allow the number of fields in records to be variable +- `--no-infer, -`: no field type inferencing +- `--trim, -t {string}`: drop leading and trailing whitespaces around headers names and/or field values ## Input/output types: @@ -40,6 +40,7 @@ feature: default ## Examples Convert comma-separated data to a table + ```nu > "ColA,ColB 1,2" | from csv @@ -52,36 +53,42 @@ Convert comma-separated data to a table ``` Convert comma-separated data to a table, ignoring headers + ```nu > open data.txt | from csv --noheaders ``` Convert semicolon-separated data to a table + ```nu > open data.txt | from csv --separator ';' ``` Convert comma-separated data to a table, ignoring lines starting with '#' + ```nu > open data.txt | from csv --comment '#' ``` Convert comma-separated data to a table, dropping all possible whitespaces around header names and field values + ```nu > open data.txt | from csv --trim all ``` Convert comma-separated data to a table, dropping all possible whitespaces around header names + ```nu > open data.txt | from csv --trim headers ``` Convert comma-separated data to a table, dropping all possible whitespaces around field values + ```nu > open data.txt | from csv --trim fields diff --git a/commands/docs/from_eml.md b/src/content/docs/commands/docs/from_eml.md similarity index 90% rename from commands/docs/from_eml.md rename to src/content/docs/commands/docs/from_eml.md index a25784d57f3..acb92e2e5c3 100644 --- a/commands/docs/from_eml.md +++ b/src/content/docs/commands/docs/from_eml.md @@ -9,24 +9,24 @@ usage: | Parse text as .eml and create record. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats <div class='command-title'>{{ $frontmatter.formats }}</div> - -::: warning -Command `from eml` resides in [plugin](/book/plugins.html) [`nu_plugin_formats`](https://crates.io/crates/nu_plugin_formats). To use this command, you must install/compile and register nu_plugin_formats +:::caution[warning] +Command `from eml` resides in [plugin](/book/plugins) [`nu_plugin_formats`](https://crates.io/crates/nu_plugin_formats). To use this command, you must install/compile and register nu_plugin_formats ::: + ## Signature -```> from eml {flags} ``` +`> from eml {flags} ` ## Flags - - `--preview-body, -b {int}`: How many bytes of the body to preview - +- `--preview-body, -b {int}`: How many bytes of the body to preview ## Input/output types: @@ -37,6 +37,7 @@ Command `from eml` resides in [plugin](/book/plugins.html) [`nu_plugin_formats`] ## Examples Convert eml structured data into record + ```nu > 'From: test@email.com Subject: Welcome @@ -57,6 +58,7 @@ Test' | from eml ``` Convert eml structured data into record + ```nu > 'From: test@email.com Subject: Welcome diff --git a/commands/docs/from_ics.md b/src/content/docs/commands/docs/from_ics.md similarity index 89% rename from commands/docs/from_ics.md rename to src/content/docs/commands/docs/from_ics.md index 671ac995252..49072fe3a4d 100644 --- a/commands/docs/from_ics.md +++ b/src/content/docs/commands/docs/from_ics.md @@ -9,20 +9,20 @@ usage: | Parse text as .ics and create table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats <div class='command-title'>{{ $frontmatter.formats }}</div> - -::: warning -Command `from ics` resides in [plugin](/book/plugins.html) [`nu_plugin_formats`](https://crates.io/crates/nu_plugin_formats). To use this command, you must install/compile and register nu_plugin_formats +:::caution[warning] +Command `from ics` resides in [plugin](/book/plugins) [`nu_plugin_formats`](https://crates.io/crates/nu_plugin_formats). To use this command, you must install/compile and register nu_plugin_formats ::: -## Signature -```> from ics {flags} ``` +## Signature +`> from ics {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Command `from ics` resides in [plugin](/book/plugins.html) [`nu_plugin_formats`] ## Examples Converts ics formatted string to table + ```nu > 'BEGIN:VCALENDAR END:VCALENDAR' | from ics diff --git a/commands/docs/from_ini.md b/src/content/docs/commands/docs/from_ini.md similarity index 78% rename from commands/docs/from_ini.md rename to src/content/docs/commands/docs/from_ini.md index b41d5e8765a..237a9829f24 100644 --- a/commands/docs/from_ini.md +++ b/src/content/docs/commands/docs/from_ini.md @@ -9,20 +9,20 @@ usage: | Parse text as .ini and create table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats <div class='command-title'>{{ $frontmatter.formats }}</div> - -::: warning -Command `from ini` resides in [plugin](/book/plugins.html) [`nu_plugin_formats`](https://crates.io/crates/nu_plugin_formats). To use this command, you must install/compile and register nu_plugin_formats +:::caution[warning] +Command `from ini` resides in [plugin](/book/plugins) [`nu_plugin_formats`](https://crates.io/crates/nu_plugin_formats). To use this command, you must install/compile and register nu_plugin_formats ::: -## Signature -```> from ini {flags} ``` +## Signature +`> from ini {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Command `from ini` resides in [plugin](/book/plugins.html) [`nu_plugin_formats`] ## Examples Converts ini formatted string to record + ```nu > '[foo] a=1 diff --git a/commands/docs/from_json.md b/src/content/docs/commands/docs/from_json.md similarity index 89% rename from commands/docs/from_json.md rename to src/content/docs/commands/docs/from_json.md index 3272b3851a0..7d8edf96570 100644 --- a/commands/docs/from_json.md +++ b/src/content/docs/commands/docs/from_json.md @@ -9,6 +9,7 @@ usage: | Convert from json to structured data. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,13 +18,12 @@ feature: default ## Signature -```> from json {flags} ``` +`> from json {flags} ` ## Flags - - `--objects, -o`: treat each line as a separate value - - `--strict, -s`: follow the json specification exactly - +- `--objects, -o`: treat each line as a separate value +- `--strict, -s`: follow the json specification exactly ## Input/output types: @@ -34,6 +34,7 @@ feature: default ## Examples Converts json formatted string to table + ```nu > '{ "a": 1 }' | from json ╭───┬───╮ @@ -42,6 +43,7 @@ Converts json formatted string to table ``` Converts json formatted string to table + ```nu > '{ "a": 1, "b": [1, 2] }' | from json ╭───┬───────────╮ @@ -54,6 +56,7 @@ Converts json formatted string to table ``` Parse json strictly which will error on comments and trailing commas + ```nu > '{ "a": 1, "b": 2 }' | from json -s ╭───┬───╮ diff --git a/commands/docs/from_nuon.md b/src/content/docs/commands/docs/from_nuon.md similarity index 97% rename from commands/docs/from_nuon.md rename to src/content/docs/commands/docs/from_nuon.md index 9248be4d4f6..7a10ec92b28 100644 --- a/commands/docs/from_nuon.md +++ b/src/content/docs/commands/docs/from_nuon.md @@ -9,6 +9,7 @@ usage: | Convert from nuon to structured data. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,8 +18,7 @@ feature: default ## Signature -```> from nuon {flags} ``` - +`> from nuon {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Converts nuon formatted string to table + ```nu > '{ a:1 }' | from nuon ╭───┬───╮ @@ -37,6 +38,7 @@ Converts nuon formatted string to table ``` Converts nuon formatted string to table + ```nu > '{ a:1, b: [1, 2] }' | from nuon ╭───┬───────────╮ diff --git a/commands/docs/from_ods.md b/src/content/docs/commands/docs/from_ods.md similarity index 89% rename from commands/docs/from_ods.md rename to src/content/docs/commands/docs/from_ods.md index 96c702670db..893f4a9ad4b 100644 --- a/commands/docs/from_ods.md +++ b/src/content/docs/commands/docs/from_ods.md @@ -9,6 +9,7 @@ usage: | Parse OpenDocument Spreadsheet(.ods) data and create table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,12 +18,11 @@ feature: default ## Signature -```> from ods {flags} ``` +`> from ods {flags} ` ## Flags - - `--sheets, -s {list<string>}`: Only convert specified sheets - +- `--sheets, -s {list<string>}`: Only convert specified sheets ## Input/output types: @@ -33,12 +33,14 @@ feature: default ## Examples Convert binary .ods data to a table + ```nu > open --raw test.ods | from ods ``` Convert binary .ods data to a table, specifying the tables + ```nu > open --raw test.ods | from ods --sheets [Spreadsheet1] diff --git a/commands/docs/from_ssv.md b/src/content/docs/commands/docs/from_ssv.md similarity index 87% rename from commands/docs/from_ssv.md rename to src/content/docs/commands/docs/from_ssv.md index 2fb96ed5a70..77134b86bde 100644 --- a/commands/docs/from_ssv.md +++ b/src/content/docs/commands/docs/from_ssv.md @@ -9,6 +9,7 @@ usage: | Parse text as space-separated values and create a table. The default minimum number of spaces counted as a separator is 2. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,14 +18,13 @@ feature: default ## Signature -```> from ssv {flags} ``` +`> from ssv {flags} ` ## Flags - - `--noheaders, -n`: don't treat the first row as column names - - `--aligned-columns, -a`: assume columns are aligned - - `--minimum-spaces, -m {int}`: the minimum spaces to separate columns - +- `--noheaders, -n`: don't treat the first row as column names +- `--aligned-columns, -a`: assume columns are aligned +- `--minimum-spaces, -m {int}`: the minimum spaces to separate columns ## Input/output types: @@ -35,6 +35,7 @@ feature: default ## Examples Converts ssv formatted string to table + ```nu > 'FOO BAR 1 2' | from ssv @@ -47,6 +48,7 @@ Converts ssv formatted string to table ``` Converts ssv formatted string to table but not treating the first row as column names + ```nu > 'FOO BAR 1 2' | from ssv --noheaders diff --git a/commands/docs/from_toml.md b/src/content/docs/commands/docs/from_toml.md similarity index 97% rename from commands/docs/from_toml.md rename to src/content/docs/commands/docs/from_toml.md index f97543d78de..2457196307c 100644 --- a/commands/docs/from_toml.md +++ b/src/content/docs/commands/docs/from_toml.md @@ -9,6 +9,7 @@ usage: | Parse text as .toml and create record. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,8 +18,7 @@ feature: default ## Signature -```> from toml {flags} ``` - +`> from toml {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Converts toml formatted string to record + ```nu > 'a = 1' | from toml ╭───┬───╮ @@ -37,6 +38,7 @@ Converts toml formatted string to record ``` Converts toml formatted string to record + ```nu > 'a = 1 b = [1, 2]' | from toml diff --git a/commands/docs/from_tsv.md b/src/content/docs/commands/docs/from_tsv.md similarity index 76% rename from commands/docs/from_tsv.md rename to src/content/docs/commands/docs/from_tsv.md index bd466390b9e..9f37833820c 100644 --- a/commands/docs/from_tsv.md +++ b/src/content/docs/commands/docs/from_tsv.md @@ -9,6 +9,7 @@ usage: | Parse text as .tsv and create table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,18 +18,17 @@ feature: default ## Signature -```> from tsv {flags} ``` +`> from tsv {flags} ` ## Flags - - `--comment, -c {string}`: a comment character to ignore lines starting with it - - `--quote, -q {string}`: a quote character to ignore separators in strings, defaults to '"' - - `--escape, -e {string}`: an escape character for strings containing the quote character - - `--noheaders, -n`: don't treat the first row as column names - - `--flexible, -`: allow the number of fields in records to be variable - - `--no-infer, -`: no field type inferencing - - `--trim, -t {string}`: drop leading and trailing whitespaces around headers names and/or field values - +- `--comment, -c {string}`: a comment character to ignore lines starting with it +- `--quote, -q {string}`: a quote character to ignore separators in strings, defaults to '"' +- `--escape, -e {string}`: an escape character for strings containing the quote character +- `--noheaders, -n`: don't treat the first row as column names +- `--flexible, -`: allow the number of fields in records to be variable +- `--no-infer, -`: no field type inferencing +- `--trim, -t {string}`: drop leading and trailing whitespaces around headers names and/or field values ## Input/output types: @@ -39,6 +39,7 @@ feature: default ## Examples Convert tab-separated data to a table + ```nu > "ColA ColB 1 2" | from tsv @@ -51,30 +52,35 @@ Convert tab-separated data to a table ``` Create a tsv file with header columns and open it + ```nu > $'c1(char tab)c2(char tab)c3(char nl)1(char tab)2(char tab)3' | save tsv-data | open tsv-data | from tsv ``` Create a tsv file without header columns and open it + ```nu > $'a1(char tab)b1(char tab)c1(char nl)a2(char tab)b2(char tab)c2' | save tsv-data | open tsv-data | from tsv --noheaders ``` Create a tsv file without header columns and open it, removing all unnecessary whitespaces + ```nu > $'a1(char tab)b1(char tab)c1(char nl)a2(char tab)b2(char tab)c2' | save tsv-data | open tsv-data | from tsv --trim all ``` Create a tsv file without header columns and open it, removing all unnecessary whitespaces in the header names + ```nu > $'a1(char tab)b1(char tab)c1(char nl)a2(char tab)b2(char tab)c2' | save tsv-data | open tsv-data | from tsv --trim headers ``` Create a tsv file without header columns and open it, removing all unnecessary whitespaces in the field values + ```nu > $'a1(char tab)b1(char tab)c1(char nl)a2(char tab)b2(char tab)c2' | save tsv-data | open tsv-data | from tsv --trim fields diff --git a/commands/docs/from_url.md b/src/content/docs/commands/docs/from_url.md similarity index 84% rename from commands/docs/from_url.md rename to src/content/docs/commands/docs/from_url.md index 0998db6033b..f848f7d6bfd 100644 --- a/commands/docs/from_url.md +++ b/src/content/docs/commands/docs/from_url.md @@ -9,20 +9,20 @@ usage: | Parse url-encoded string as a record. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats <div class='command-title'>{{ $frontmatter.formats }}</div> - -::: warning - Command `from url` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `from url` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: -## Signature -```> from url {flags} ``` +## Signature +`> from url {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ feature: extra ## Examples Convert url encoded string into a record + ```nu > 'bread=baguette&cheese=comt%C3%A9&meat=ham&fat=butter' | from url ╭────────┬──────────╮ diff --git a/commands/docs/from_vcf.md b/src/content/docs/commands/docs/from_vcf.md similarity index 87% rename from commands/docs/from_vcf.md rename to src/content/docs/commands/docs/from_vcf.md index 1ab6f0bcd53..bdf6326b243 100644 --- a/commands/docs/from_vcf.md +++ b/src/content/docs/commands/docs/from_vcf.md @@ -9,20 +9,20 @@ usage: | Parse text as .vcf and create table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats <div class='command-title'>{{ $frontmatter.formats }}</div> - -::: warning -Command `from vcf` resides in [plugin](/book/plugins.html) [`nu_plugin_formats`](https://crates.io/crates/nu_plugin_formats). To use this command, you must install/compile and register nu_plugin_formats +:::caution[warning] +Command `from vcf` resides in [plugin](/book/plugins) [`nu_plugin_formats`](https://crates.io/crates/nu_plugin_formats). To use this command, you must install/compile and register nu_plugin_formats ::: -## Signature -```> from vcf {flags} ``` +## Signature +`> from vcf {flags} ` ## Input/output types: @@ -33,6 +33,7 @@ Command `from vcf` resides in [plugin](/book/plugins.html) [`nu_plugin_formats`] ## Examples Converts ics formatted string to table + ```nu > 'BEGIN:VCARD N:Foo diff --git a/commands/docs/from_xlsx.md b/src/content/docs/commands/docs/from_xlsx.md similarity index 89% rename from commands/docs/from_xlsx.md rename to src/content/docs/commands/docs/from_xlsx.md index 7e8693c175a..be946ca983b 100644 --- a/commands/docs/from_xlsx.md +++ b/src/content/docs/commands/docs/from_xlsx.md @@ -9,6 +9,7 @@ usage: | Parse binary Excel(.xlsx) data and create table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,12 +18,11 @@ feature: default ## Signature -```> from xlsx {flags} ``` +`> from xlsx {flags} ` ## Flags - - `--sheets, -s {list<string>}`: Only convert specified sheets - +- `--sheets, -s {list<string>}`: Only convert specified sheets ## Input/output types: @@ -33,12 +33,14 @@ feature: default ## Examples Convert binary .xlsx data to a table + ```nu > open --raw test.xlsx | from xlsx ``` Convert binary .xlsx data to a table, specifying the tables + ```nu > open --raw test.xlsx | from xlsx --sheets [Spreadsheet1] diff --git a/commands/docs/from_xml.md b/src/content/docs/commands/docs/from_xml.md similarity index 95% rename from commands/docs/from_xml.md rename to src/content/docs/commands/docs/from_xml.md index 5a0b5aee471..307a49b682b 100644 --- a/commands/docs/from_xml.md +++ b/src/content/docs/commands/docs/from_xml.md @@ -9,6 +9,7 @@ usage: | Parse text as .xml and create record. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,13 +18,12 @@ feature: default ## Signature -```> from xml {flags} ``` +`> from xml {flags} ` ## Flags - - `--keep-comments, -`: add comment nodes to result - - `--keep-pi, -`: add processing instruction nodes to result - +- `--keep-comments, -`: add comment nodes to result +- `--keep-pi, -`: add processing instruction nodes to result ## Input/output types: @@ -34,6 +34,7 @@ feature: default ## Examples Converts xml formatted string to record + ```nu > '<?xml version="1.0" encoding="UTF-8"?> <note> @@ -55,12 +56,14 @@ Converts xml formatted string to record ``` ## Notes + Every XML entry is represented via a record with tag, attribute and content fields. To represent different types of entries different values are written to this fields: + 1. Tag entry: `{tag: <tag name> attrs: {<attr name>: "<string value>" ...} content: [<entries>]}` 2. Comment entry: `{tag: '!' attrs: null content: "<comment string>"}` 3. Processing instruction (PI): `{tag: '?<pi name>' attrs: null content: "<pi content string>"}` 4. Text: `{tag: null attrs: null content: "<text>"}`. Unlike to xml command all null values are always present and text is never represented via plain -string. This way content of every tag is always a table and is easier to parse \ No newline at end of file +string. This way content of every tag is always a table and is easier to parse diff --git a/commands/docs/from_yaml.md b/src/content/docs/commands/docs/from_yaml.md similarity index 97% rename from commands/docs/from_yaml.md rename to src/content/docs/commands/docs/from_yaml.md index 9252ef0ee41..25d3c58efe8 100644 --- a/commands/docs/from_yaml.md +++ b/src/content/docs/commands/docs/from_yaml.md @@ -9,6 +9,7 @@ usage: | Parse text as .yaml/.yml and create table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,8 +18,7 @@ feature: default ## Signature -```> from yaml {flags} ``` - +`> from yaml {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Converts yaml formatted string to table + ```nu > 'a: 1' | from yaml ╭───┬───╮ @@ -37,6 +38,7 @@ Converts yaml formatted string to table ``` Converts yaml formatted string to table + ```nu > '[ a: 1, b: [1, 2] ]' | from yaml ╭───┬────┬───────────╮ diff --git a/commands/docs/from_yml.md b/src/content/docs/commands/docs/from_yml.md similarity index 97% rename from commands/docs/from_yml.md rename to src/content/docs/commands/docs/from_yml.md index b03938507e0..90fba1acfef 100644 --- a/commands/docs/from_yml.md +++ b/src/content/docs/commands/docs/from_yml.md @@ -9,6 +9,7 @@ usage: | Parse text as .yaml/.yml and create table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,8 +18,7 @@ feature: default ## Signature -```> from yml {flags} ``` - +`> from yml {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Converts yaml formatted string to table + ```nu > 'a: 1' | from yaml ╭───┬───╮ @@ -37,6 +38,7 @@ Converts yaml formatted string to table ``` Converts yaml formatted string to table + ```nu > '[ a: 1, b: [1, 2] ]' | from yaml ╭───┬────┬───────────╮ diff --git a/commands/docs/g.md b/src/content/docs/commands/docs/g.md similarity index 92% rename from commands/docs/g.md rename to src/content/docs/commands/docs/g.md index 59138b4d68c..84fa1bec8f2 100644 --- a/commands/docs/g.md +++ b/src/content/docs/commands/docs/g.md @@ -15,33 +15,37 @@ usage: | ## Signature -```> g (shell_number)``` +`> g (shell_number)` ## Parameters - - `shell_number`: shell number to change to +- `shell_number`: shell number to change to ## Examples Lists all open shells + ```nu > g ``` Make two directories and enter new shells for them, use `g` to jump to the specific shell + ```nu > mkdir foo bar; enter foo; enter ../bar; g 1 ``` Use `shells` to show all the opened shells and run `g 2` to jump to the third one + ```nu > shells; g 2 ``` Make two directories and enter new shells for them, use `g -` to jump to the last used shell + ```nu > mkdir foo bar; enter foo; enter ../bar; g - diff --git a/commands/docs/generate.md b/src/content/docs/commands/docs/generate.md similarity index 88% rename from commands/docs/generate.md rename to src/content/docs/commands/docs/generate.md index 28dea459c49..d969b7e668e 100644 --- a/commands/docs/generate.md +++ b/src/content/docs/commands/docs/generate.md @@ -9,6 +9,7 @@ usage: | Generate a list of values by successively invoking a closure. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for generators @@ -17,23 +18,24 @@ feature: default ## Signature -```> generate {flags} (initial) (closure)``` +`> generate {flags} (initial) (closure)` ## Parameters - - `initial`: Initial value. - - `closure`: Generator function. - +- `initial`: Initial value. +- `closure`: Generator function. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | -| nothing | list\<any\> | +| nothing | list\<any\> | + ## Examples Generate a sequence of numbers + ```nu > generate 0 {|i| if $i <= 10 { {out: $i, next: ($i + 2)} }} ╭───┬────╮ @@ -48,6 +50,7 @@ Generate a sequence of numbers ``` Generate a stream of fibonacci numbers + ```nu > generate [0, 1] {|fib| {out: $fib.0, next: [$fib.1, ($fib.0 + $fib.1)]} } | first 10 ╭───┬────╮ @@ -66,6 +69,7 @@ Generate a stream of fibonacci numbers ``` ## Notes + The generator closure accepts a single argument and returns a record containing two optional keys: 'out' and 'next'. Each invocation, the 'out' value, if present, is added to the stream. If a 'next' key is present, it is diff --git a/commands/docs/get.md b/src/content/docs/commands/docs/get.md similarity index 78% rename from commands/docs/get.md rename to src/content/docs/commands/docs/get.md index d7d653a12b7..3917d56128a 100644 --- a/commands/docs/get.md +++ b/src/content/docs/commands/docs/get.md @@ -9,6 +9,7 @@ usage: | Extract data using a cell path. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,35 +18,37 @@ feature: default ## Signature -```> get {flags} (cell_path) ...rest``` +`> get {flags} (cell_path) ...rest` ## Flags - - `--ignore-errors, -i`: ignore missing data (make all cell path members optional) - - `--sensitive, -s`: get path in a case sensitive manner +- `--ignore-errors, -i`: ignore missing data (make all cell path members optional) +- `--sensitive, -s`: get path in a case sensitive manner ## Parameters - - `cell_path`: The cell path to the data. - - `...rest`: Additional cell paths. - +- `cell_path`: The cell path to the data. +- `...rest`: Additional cell paths. ## Input/output types: -| input | output | -| --------- | ------ | +| input | output | +| ----------- | ------ | | list\<any\> | any | -| record | any | -| table | any | +| record | any | +| table | any | + ## Examples Get an item from a list + ```nu > [0 1 2] | get 1 1 ``` Get a column from a table + ```nu > [{A: A0}] | get A ╭───┬────╮ @@ -55,42 +58,49 @@ Get a column from a table ``` Get a cell from a table + ```nu > [{A: A0}] | get 0.A A0 ``` Extract the name of the 3rd record in a list (same as `ls | $in.name`) + ```nu > ls | get name.2 ``` Extract the name of the 3rd record in a list + ```nu > ls | get 2.name ``` Extract the cpu list from the sys information record + ```nu > sys | get cpu ``` Getting Path/PATH in a case insensitive way + ```nu > $env | get paTH ``` Getting Path in a case sensitive way, won't work for 'PATH' + ```nu > $env | get --sensitive Path ``` ## Notes + This is equivalent to using the cell path access syntax: `$env.OS` is the same as `$env | get OS`. -If multiple cell paths are given, this will produce a list of values. \ No newline at end of file +If multiple cell paths are given, this will produce a list of values. diff --git a/commands/docs/glob.md b/src/content/docs/commands/docs/glob.md similarity index 73% rename from commands/docs/glob.md rename to src/content/docs/commands/docs/glob.md index 74be0479deb..31737762375 100644 --- a/commands/docs/glob.md +++ b/src/content/docs/commands/docs/glob.md @@ -9,6 +9,7 @@ usage: | Creates a list of files and/or folders based on the glob pattern provided. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filesystem @@ -17,94 +18,105 @@ feature: default ## Signature -```> glob {flags} (glob)``` +`> glob {flags} (glob)` ## Flags - - `--depth, -d {int}`: directory depth to search - - `--no-dir, -D`: Whether to filter out directories from the returned paths - - `--no-file, -F`: Whether to filter out files from the returned paths - - `--no-symlink, -S`: Whether to filter out symlinks from the returned paths - - `--exclude, -e {list<string>}`: Patterns to exclude from the search: `glob` will not walk the inside of directories matching the excluded patterns. +- `--depth, -d {int}`: directory depth to search +- `--no-dir, -D`: Whether to filter out directories from the returned paths +- `--no-file, -F`: Whether to filter out files from the returned paths +- `--no-symlink, -S`: Whether to filter out symlinks from the returned paths +- `--exclude, -e {list<string>}`: Patterns to exclude from the search: `glob` will not walk the inside of directories matching the excluded patterns. ## Parameters - - `glob`: The glob expression. - +- `glob`: The glob expression. ## Input/output types: -| input | output | -| ------- | ------------ | +| input | output | +| ------- | -------------- | | nothing | list\<string\> | ## Examples -Search for *.rs files +Search for \*.rs files + ```nu > glob *.rs ``` -Search for *.rs and *.toml files recursively up to 2 folders deep +Search for _.rs and _.toml files recursively up to 2 folders deep + ```nu > glob **/*.{rs,toml} --depth 2 ``` Search for files and folders that begin with uppercase C or lowercase c + ```nu > glob "[Cc]*" ``` Search for files and folders like abc or xyz substituting a character for ? + ```nu > glob "{a?c,x?z}" ``` A case-insensitive search for files and folders that begin with c + ```nu > glob "(?i)c*" ``` Search for files for folders that do not begin with c, C, b, M, or s + ```nu > glob "[!cCbMs]*" ``` Search for files or folders with 3 a's in a row in the name + ```nu > glob <a*:3> ``` Search for files or folders with only a, b, c, or d in the file name between 1 and 10 times + ```nu > glob <[a-d]:1,10> ``` Search for folders that begin with an uppercase ASCII letter, ignoring files and symlinks + ```nu > glob "[A-Z]*" --no-file --no-symlink ``` Search for files named tsconfig.json that are not in node_modules directories + ```nu > glob **/tsconfig.json --exclude [**/node_modules/**] ``` Search for all files that are not in the target nor .git directories + ```nu > glob **/* --exclude [**/target/** **/.git/** */] ``` ## Notes -For more glob pattern help, please refer to https://docs.rs/crate/wax/latest \ No newline at end of file + +For more glob pattern help, please refer to https://docs.rs/crate/wax/latest diff --git a/commands/docs/grid.md b/src/content/docs/commands/docs/grid.md similarity index 82% rename from commands/docs/grid.md rename to src/content/docs/commands/docs/grid.md index 29004d71575..966ebdf5a5c 100644 --- a/commands/docs/grid.md +++ b/src/content/docs/commands/docs/grid.md @@ -9,6 +9,7 @@ usage: | Renders the output to a textual terminal grid. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for viewers @@ -17,24 +18,25 @@ feature: default ## Signature -```> grid {flags} ``` +`> grid {flags} ` ## Flags - - `--width, -w {int}`: number of terminal columns wide (not output columns) - - `--color, -c`: draw output with color - - `--separator, -s {string}`: character to separate grid with - +- `--width, -w {int}`: number of terminal columns wide (not output columns) +- `--color, -c`: draw output with color +- `--separator, -s {string}`: character to separate grid with ## Input/output types: -| input | output | -| --------- | ------ | +| input | output | +| ----------- | ------ | | list\<any\> | string | -| record | string | +| record | string | + ## Examples Render a simple list to a grid + ```nu > [1 2 3 a b c] | grid 1 │ 2 │ 3 │ a │ b │ c @@ -42,6 +44,7 @@ Render a simple list to a grid ``` The above example is the same as: + ```nu > [1 2 3 a b c] | wrap name | grid 1 │ 2 │ 3 │ a │ b │ c @@ -49,6 +52,7 @@ The above example is the same as: ``` Render a record to a grid + ```nu > {name: 'foo', b: 1, c: 2} | grid foo @@ -56,6 +60,7 @@ foo ``` Render a list of records to a grid + ```nu > [{name: 'A', v: 1} {name: 'B', v: 2} {name: 'C', v: 3}] | grid A │ B │ C @@ -63,6 +68,7 @@ A │ B │ C ``` Render a table with 'name' column in it to a grid + ```nu > [[name patch]; [0.1.0 false] [0.1.1 true] [0.2.0 false]] | grid 0.1.0 │ 0.1.1 │ 0.2.0 @@ -70,9 +76,10 @@ Render a table with 'name' column in it to a grid ``` ## Notes + grid was built to give a concise gridded layout for ls. however, it determines what to put in the grid by looking for a column named 'name'. this works great for tables and records but for lists we need to do something different. such as with '[one two three] | grid' it creates a fake column called 'name' for these values so that it -prints out the list properly. \ No newline at end of file +prints out the list properly. diff --git a/commands/docs/group-by.md b/src/content/docs/commands/docs/group-by.md similarity index 93% rename from commands/docs/group-by.md rename to src/content/docs/commands/docs/group-by.md index 45c5014d83d..4f66c0fbfba 100644 --- a/commands/docs/group-by.md +++ b/src/content/docs/commands/docs/group-by.md @@ -9,6 +9,7 @@ usage: | Splits a list or table into groups, and returns a record containing those groups. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,38 +18,40 @@ feature: default ## Signature -```> group-by {flags} (grouper)``` +`> group-by {flags} (grouper)` ## Flags - - `--to-table, -`: Return a table with "groups" and "items" columns +- `--to-table, -`: Return a table with "groups" and "items" columns ## Parameters - - `grouper`: The path to the column to group on. - +- `grouper`: The path to the column to group on. ## Input/output types: -| input | output | -| --------- | ------ | +| input | output | +| ----------- | ------ | | list\<any\> | any | ## Examples Group items by the "type" column's values + ```nu > ls | group-by type ``` Group items by the "foo" column's values, ignoring records without a "foo" column + ```nu > open cool.json | group-by foo? ``` Group using a block which is evaluated against each input value + ```nu > [foo.txt bar.csv baz.txt] | group-by { path parse | get extension } ╭─────┬─────────────────╮ @@ -63,6 +66,7 @@ Group using a block which is evaluated against each input value ``` You can also group by raw values by leaving out the argument + ```nu > ['1' '3' '1' '3' '2' '1' '1'] | group-by ╭───┬───────────╮ @@ -83,6 +87,7 @@ You can also group by raw values by leaving out the argument ``` You can also output a table instead of a record + ```nu > ['1' '3' '1' '3' '2' '1' '1'] | group-by --to-table ╭───┬───────┬───────────╮ diff --git a/commands/docs/group.md b/src/content/docs/commands/docs/group.md similarity index 86% rename from commands/docs/group.md rename to src/content/docs/commands/docs/group.md index 3e855e6cdfd..632f4ac6a8a 100644 --- a/commands/docs/group.md +++ b/src/content/docs/commands/docs/group.md @@ -9,6 +9,7 @@ usage: | Groups input into groups of `group_size`. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,22 +18,22 @@ feature: default ## Signature -```> group {flags} (group_size)``` +`> group {flags} (group_size)` ## Parameters - - `group_size`: The size of each group. - +- `group_size`: The size of each group. ## Input/output types: -| input | output | -| --------- | --------------- | +| input | output | +| ----------- | ------------------- | | list\<any\> | list\<list\<any\>\> | ## Examples Group the a list by pairs + ```nu > [1 2 3 4] | group 2 ╭───┬───────────╮ diff --git a/commands/docs/gstat.md b/src/content/docs/commands/docs/gstat.md similarity index 90% rename from commands/docs/gstat.md rename to src/content/docs/commands/docs/gstat.md index 0724a3b1c24..223f58b8a7c 100644 --- a/commands/docs/gstat.md +++ b/src/content/docs/commands/docs/gstat.md @@ -9,6 +9,7 @@ usage: | Get the git status of a repo feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for prompt @@ -17,12 +18,11 @@ feature: default ## Signature -```> gstat {flags} (path)``` +`> gstat {flags} (path)` ## Parameters - - `path`: path to repo - +- `path`: path to repo ## Input/output types: diff --git a/commands/docs/hash.md b/src/content/docs/commands/docs/hash.md similarity index 56% rename from commands/docs/hash.md rename to src/content/docs/commands/docs/hash.md index 4c59f043652..e610b2df868 100644 --- a/commands/docs/hash.md +++ b/src/content/docs/commands/docs/hash.md @@ -9,6 +9,7 @@ usage: | Apply hash function. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for hash @@ -17,8 +18,7 @@ feature: default ## Signature -```> hash {flags} ``` - +`> hash {flags} ` ## Input/output types: @@ -27,11 +27,12 @@ feature: default | nothing | string | ## Notes + You must use one of the following subcommands. Using this command as-is will only produce this help message. ## Subcommands: -| name | type | usage | -| ---------------------------------------------- | ------- | --------------------------------------------- | -| [`hash md5`](/commands/docs/hash_md5.md) | Builtin | Hash a value using the md5 hash algorithm. | -| [`hash sha256`](/commands/docs/hash_sha256.md) | Builtin | Hash a value using the sha256 hash algorithm. | \ No newline at end of file +| name | type | usage | +| ------------------------------------------- | ------- | --------------------------------------------- | +| [`hash md5`](/commands/docs/hash_md5) | Builtin | Hash a value using the md5 hash algorithm. | +| [`hash sha256`](/commands/docs/hash_sha256) | Builtin | Hash a value using the sha256 hash algorithm. | diff --git a/commands/docs/hash_md5.md b/src/content/docs/commands/docs/hash_md5.md similarity index 87% rename from commands/docs/hash_md5.md rename to src/content/docs/commands/docs/hash_md5.md index ea681846b43..15fb7adcfa0 100644 --- a/commands/docs/hash_md5.md +++ b/src/content/docs/commands/docs/hash_md5.md @@ -9,6 +9,7 @@ usage: | Hash a value using the md5 hash algorithm. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for hash @@ -17,16 +18,15 @@ feature: default ## Signature -```> hash md5 {flags} ...rest``` +`> hash md5 {flags} ...rest` ## Flags - - `--binary, -b`: Output binary instead of hexadecimal representation +- `--binary, -b`: Output binary instead of hexadecimal representation ## Parameters - - `...rest`: Optionally md5 hash data by cell path. - +- `...rest`: Optionally md5 hash data by cell path. ## Input/output types: @@ -35,15 +35,18 @@ feature: default | record | record | | string | any | | table | table | + ## Examples Return the md5 hash of a string, hex-encoded + ```nu > 'abcdefghijklmnopqrstuvwxyz' | hash md5 c3fcd3d76192e4007dfb496cca67e13b ``` Return the md5 hash of a string, as binary + ```nu > 'abcdefghijklmnopqrstuvwxyz' | hash md5 --binary Length: 16 (0x10) bytes | printable whitespace ascii_other non_ascii @@ -52,6 +55,7 @@ Length: 16 (0x10) bytes | printable whitespace ascii_other non_ascii ``` Return the md5 hash of a file's contents + ```nu > open ./nu_0_24_1_windows.zip | hash md5 diff --git a/commands/docs/hash_sha256.md b/src/content/docs/commands/docs/hash_sha256.md similarity index 88% rename from commands/docs/hash_sha256.md rename to src/content/docs/commands/docs/hash_sha256.md index 41c4c197a81..4155e7f3b49 100644 --- a/commands/docs/hash_sha256.md +++ b/src/content/docs/commands/docs/hash_sha256.md @@ -9,6 +9,7 @@ usage: | Hash a value using the sha256 hash algorithm. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for hash @@ -17,16 +18,15 @@ feature: default ## Signature -```> hash sha256 {flags} ...rest``` +`> hash sha256 {flags} ...rest` ## Flags - - `--binary, -b`: Output binary instead of hexadecimal representation +- `--binary, -b`: Output binary instead of hexadecimal representation ## Parameters - - `...rest`: Optionally sha256 hash data by cell path. - +- `...rest`: Optionally sha256 hash data by cell path. ## Input/output types: @@ -35,15 +35,18 @@ feature: default | record | record | | string | any | | table | table | + ## Examples Return the sha256 hash of a string, hex-encoded + ```nu > 'abcdefghijklmnopqrstuvwxyz' | hash sha256 71c480df93d6ae2f1efad1447c66c9525e316218cf51fc8d9ed832f2daf18b73 ``` Return the sha256 hash of a string, as binary + ```nu > 'abcdefghijklmnopqrstuvwxyz' | hash sha256 --binary Length: 32 (0x20) bytes | printable whitespace ascii_other non_ascii @@ -53,6 +56,7 @@ Length: 32 (0x20) bytes | printable whitespace ascii_other non_ascii ``` Return the sha256 hash of a file's contents + ```nu > open ./nu_0_24_1_windows.zip | hash sha256 diff --git a/commands/docs/headers.md b/src/content/docs/commands/docs/headers.md similarity index 92% rename from commands/docs/headers.md rename to src/content/docs/commands/docs/headers.md index e75187ca1ec..1ee6a106dee 100644 --- a/commands/docs/headers.md +++ b/src/content/docs/commands/docs/headers.md @@ -9,6 +9,7 @@ usage: | Use the first row of the table as column names. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,18 +18,19 @@ feature: default ## Signature -```> headers {flags} ``` - +`> headers {flags} ` ## Input/output types: -| input | output | -| --------- | ------ | +| input | output | +| ----------- | ------ | | list\<any\> | table | -| table | table | +| table | table | + ## Examples Sets the column names for a table created by `split column` + ```nu > "a b c|1 2 3" | split row "|" | split column " " | headers ╭───┬───┬───┬───╮ @@ -40,6 +42,7 @@ Sets the column names for a table created by `split column` ``` Columns which don't have data in their first row are removed + ```nu > "a b c|1 2 3|1 2 3 4" | split row "|" | split column " " | headers ╭───┬───┬───┬───╮ diff --git a/src/content/docs/commands/docs/help.md b/src/content/docs/commands/docs/help.md new file mode 100644 index 00000000000..3431b8b0e68 --- /dev/null +++ b/src/content/docs/commands/docs/help.md @@ -0,0 +1,73 @@ +--- +title: help +categories: | + core +version: 0.90.0 +core: | + Display help information about different parts of Nushell. +usage: | + Display help information about different parts of Nushell. +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for core + +<div class='command-title'>{{ $frontmatter.core }}</div> + +## Signature + +`> help {flags} ...rest` + +## Flags + +- `--find, -f {string}`: string to find in command names, usage, and search terms + +## Parameters + +- `...rest`: The name of command, alias or module to get help on. + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | any | + +## Examples + +show help for single command, alias, or module + +```nu +> help match + +``` + +show help for single sub-command, alias, or module + +```nu +> help str lpad + +``` + +search for string in command names, usage and search terms + +```nu +> help --find char + +``` + +## Notes + +`help word` searches for "word" in commands, aliases and modules, in that order. + +## Subcommands: + +| name | type | usage | +| ------------------------------------------------- | ------- | ------------------------------------ | +| [`help aliases`](/commands/docs/help_aliases) | Builtin | Show help on nushell aliases. | +| [`help commands`](/commands/docs/help_commands) | Builtin | Show help on nushell commands. | +| [`help escapes`](/commands/docs/help_escapes) | Builtin | Show help on nushell string escapes. | +| [`help externs`](/commands/docs/help_externs) | Builtin | Show help on nushell externs. | +| [`help modules`](/commands/docs/help_modules) | Builtin | Show help on nushell modules. | +| [`help operators`](/commands/docs/help_operators) | Builtin | Show help on nushell operators. | diff --git a/commands/docs/help_aliases.md b/src/content/docs/commands/docs/help_aliases.md similarity index 82% rename from commands/docs/help_aliases.md rename to src/content/docs/commands/docs/help_aliases.md index bd3e513d23a..444ab9a5193 100644 --- a/commands/docs/help_aliases.md +++ b/src/content/docs/commands/docs/help_aliases.md @@ -9,6 +9,7 @@ usage: | Show help on nushell aliases. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,16 +18,15 @@ feature: default ## Signature -```> help aliases {flags} ...rest``` +`> help aliases {flags} ...rest` ## Flags - - `--find, -f {string}`: string to find in alias names and usage +- `--find, -f {string}`: string to find in alias names and usage ## Parameters - - `...rest`: The name of alias to get help on. - +- `...rest`: The name of alias to get help on. ## Input/output types: @@ -37,18 +37,21 @@ feature: default ## Examples show all aliases + ```nu > help aliases ``` show help for single alias + ```nu > help aliases my-alias ``` search for string in alias names and usages + ```nu > help aliases --find my-alias diff --git a/commands/docs/help_commands.md b/src/content/docs/commands/docs/help_commands.md similarity index 75% rename from commands/docs/help_commands.md rename to src/content/docs/commands/docs/help_commands.md index 9e68eac0525..42e8e47bde3 100644 --- a/commands/docs/help_commands.md +++ b/src/content/docs/commands/docs/help_commands.md @@ -9,6 +9,7 @@ usage: | Show help on nushell commands. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,16 +18,15 @@ feature: default ## Signature -```> help commands {flags} ...rest``` +`> help commands {flags} ...rest` ## Flags - - `--find, -f {string}`: string to find in command names, usage, and search terms +- `--find, -f {string}`: string to find in command names, usage, and search terms ## Parameters - - `...rest`: The name of command to get help on. - +- `...rest`: The name of command to get help on. ## Input/output types: diff --git a/commands/docs/help_escapes.md b/src/content/docs/commands/docs/help_escapes.md similarity index 94% rename from commands/docs/help_escapes.md rename to src/content/docs/commands/docs/help_escapes.md index 0d6b5e2c4cd..971d0b64fb7 100644 --- a/commands/docs/help_escapes.md +++ b/src/content/docs/commands/docs/help_escapes.md @@ -9,6 +9,7 @@ usage: | Show help on nushell string escapes. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,8 +18,7 @@ feature: default ## Signature -```> help escapes {flags} ``` - +`> help escapes {flags} ` ## Input/output types: diff --git a/commands/docs/help_externs.md b/src/content/docs/commands/docs/help_externs.md similarity index 82% rename from commands/docs/help_externs.md rename to src/content/docs/commands/docs/help_externs.md index ba197547f6d..9aa546b0e2b 100644 --- a/commands/docs/help_externs.md +++ b/src/content/docs/commands/docs/help_externs.md @@ -9,6 +9,7 @@ usage: | Show help on nushell externs. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,16 +18,15 @@ feature: default ## Signature -```> help externs {flags} ...rest``` +`> help externs {flags} ...rest` ## Flags - - `--find, -f {string}`: string to find in extern names and usage +- `--find, -f {string}`: string to find in extern names and usage ## Parameters - - `...rest`: The name of extern to get help on. - +- `...rest`: The name of extern to get help on. ## Input/output types: @@ -37,18 +37,21 @@ feature: default ## Examples show all externs + ```nu > help externs ``` show help for single extern + ```nu > help externs smth ``` search for string in extern names and usages + ```nu > help externs --find smth diff --git a/commands/docs/help_modules.md b/src/content/docs/commands/docs/help_modules.md similarity index 85% rename from commands/docs/help_modules.md rename to src/content/docs/commands/docs/help_modules.md index e551414c8ff..7517a91ab82 100644 --- a/commands/docs/help_modules.md +++ b/src/content/docs/commands/docs/help_modules.md @@ -9,6 +9,7 @@ usage: | Show help on nushell modules. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,16 +18,15 @@ feature: default ## Signature -```> help modules {flags} ...rest``` +`> help modules {flags} ...rest` ## Flags - - `--find, -f {string}`: string to find in module names and usage +- `--find, -f {string}`: string to find in module names and usage ## Parameters - - `...rest`: The name of module to get help on. - +- `...rest`: The name of module to get help on. ## Input/output types: @@ -37,24 +37,28 @@ feature: default ## Examples show all modules + ```nu > help modules ``` show help for single module + ```nu > help modules my-module ``` search for string in module names and usages + ```nu > help modules --find my-module ``` ## Notes + When requesting help for a single module, its commands and aliases will be highlighted if they are also available in the current scope. Commands/aliases that were imported under a different name -(such as with a prefix after `use some-module`) will be highlighted in parentheses. \ No newline at end of file +(such as with a prefix after `use some-module`) will be highlighted in parentheses. diff --git a/commands/docs/help_operators.md b/src/content/docs/commands/docs/help_operators.md similarity index 93% rename from commands/docs/help_operators.md rename to src/content/docs/commands/docs/help_operators.md index 7c67365a39a..154bfbf6a13 100644 --- a/commands/docs/help_operators.md +++ b/src/content/docs/commands/docs/help_operators.md @@ -9,6 +9,7 @@ usage: | Show help on nushell operators. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,8 +18,7 @@ feature: default ## Signature -```> help operators {flags} ``` - +`> help operators {flags} ` ## Input/output types: diff --git a/commands/docs/hide-env.md b/src/content/docs/commands/docs/hide-env.md similarity index 79% rename from commands/docs/hide-env.md rename to src/content/docs/commands/docs/hide-env.md index d193165eaf7..0a550bc4e38 100644 --- a/commands/docs/hide-env.md +++ b/src/content/docs/commands/docs/hide-env.md @@ -9,6 +9,7 @@ usage: | Hide environment variables in the current scope. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,16 +18,15 @@ feature: default ## Signature -```> hide-env {flags} ...rest``` +`> hide-env {flags} ...rest` ## Flags - - `--ignore-errors, -i`: do not throw an error if an environment variable was not found +- `--ignore-errors, -i`: do not throw an error if an environment variable was not found ## Parameters - - `...rest`: Environment variable names to hide. - +- `...rest`: Environment variable names to hide. ## Input/output types: @@ -37,6 +37,7 @@ feature: default ## Examples Hide an environment variable + ```nu > $env.HZ_ENV_ABC = 1; hide-env HZ_ENV_ABC; 'HZ_ENV_ABC' in (env).name false diff --git a/commands/docs/hide.md b/src/content/docs/commands/docs/hide.md similarity index 82% rename from commands/docs/hide.md rename to src/content/docs/commands/docs/hide.md index f3a3df12882..b07c5bab738 100644 --- a/commands/docs/hide.md +++ b/src/content/docs/commands/docs/hide.md @@ -9,6 +9,7 @@ usage: | Hide definitions in the current scope. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,13 +18,12 @@ feature: default ## Signature -```> hide {flags} (module) (members)``` +`> hide {flags} (module) (members)` ## Parameters - - `module`: Module or module file. - - `members`: Which members of the module to import. - +- `module`: Module or module file. +- `members`: Which members of the module to import. ## Input/output types: @@ -34,19 +34,22 @@ feature: default ## Examples Hide the alias just defined + ```nu > alias lll = ls -l; hide lll ``` Hide a custom command + ```nu > def say-hi [] { echo 'Hi!' }; hide say-hi ``` ## Notes + Definitions are hidden by priority: First aliases, then custom commands. This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/histogram.md b/src/content/docs/commands/docs/histogram.md similarity index 84% rename from commands/docs/histogram.md rename to src/content/docs/commands/docs/histogram.md index 511d0f6cef5..8f468e6bc70 100644 --- a/commands/docs/histogram.md +++ b/src/content/docs/commands/docs/histogram.md @@ -9,6 +9,7 @@ usage: | Creates a new table with a histogram based on the column name passed in. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for chart @@ -17,39 +18,41 @@ feature: default ## Signature -```> histogram {flags} (column-name) (frequency-column-name)``` +`> histogram {flags} (column-name) (frequency-column-name)` ## Flags - - `--percentage-type, -t {string}`: percentage calculate method, can be 'normalize' or 'relative', in 'normalize', defaults to be 'normalize' +- `--percentage-type, -t {string}`: percentage calculate method, can be 'normalize' or 'relative', in 'normalize', defaults to be 'normalize' ## Parameters - - `column-name`: Column name to calc frequency, no need to provide if input is a list. - - `frequency-column-name`: Histogram's frequency column, default to be frequency column output. - +- `column-name`: Column name to calc frequency, no need to provide if input is a list. +- `frequency-column-name`: Histogram's frequency column, default to be frequency column output. ## Input/output types: -| input | output | -| --------- | ------ | +| input | output | +| ----------- | ------ | | list\<any\> | table | ## Examples Compute a histogram of file types + ```nu > ls | histogram type ``` Compute a histogram for the types of files, with frequency column named freq + ```nu > ls | histogram type freq ``` Compute a histogram for a list of numbers + ```nu > [1 2 1] | histogram ╭───┬───────┬───────┬──────────┬────────────┬────────────────────────────────────────────────────────────────────╮ @@ -62,6 +65,7 @@ Compute a histogram for a list of numbers ``` Compute a histogram for a list of numbers, and percentage is based on the maximum value + ```nu > [1 2 3 1 1 1 2 2 1 1] | histogram --percentage-type relative diff --git a/commands/docs/history.md b/src/content/docs/commands/docs/history.md similarity index 63% rename from commands/docs/history.md rename to src/content/docs/commands/docs/history.md index a8e01cc9bcf..f283c1cbe50 100644 --- a/commands/docs/history.md +++ b/src/content/docs/commands/docs/history.md @@ -9,6 +9,7 @@ usage: | Get the command history. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for history @@ -17,13 +18,12 @@ feature: default ## Signature -```> history {flags} ``` +`> history {flags} ` ## Flags - - `--clear, -c`: Clears out the history entries - - `--long, -l`: Show long listing of entries for sqlite history - +- `--clear, -c`: Clears out the history entries +- `--long, -l`: Show long listing of entries for sqlite history ## Input/output types: @@ -34,26 +34,28 @@ feature: default ## Examples Get current history length + ```nu > history | length ``` Show last 5 commands you have ran + ```nu > history | last 5 ``` Search all the commands from history that contains 'cargo' + ```nu > history | where command =~ cargo | get command ``` - ## Subcommands: -| name | type | usage | -| ------------------------------------------------------ | ------- | -------------------------------- | -| [`history session`](/commands/docs/history_session.md) | Builtin | Get the command history session. | +| name | type | usage | +| --------------------------------------------------- | ------- | -------------------------------- | +| [`history session`](/commands/docs/history_session) | Builtin | Get the command history session. | diff --git a/commands/docs/history_session.md b/src/content/docs/commands/docs/history_session.md similarity index 94% rename from commands/docs/history_session.md rename to src/content/docs/commands/docs/history_session.md index fd51e0e3d2b..e69cf4b9842 100644 --- a/commands/docs/history_session.md +++ b/src/content/docs/commands/docs/history_session.md @@ -9,6 +9,7 @@ usage: | Get the command history session. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for history @@ -17,8 +18,7 @@ feature: default ## Signature -```> history session {flags} ``` - +`> history session {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Get current history session + ```nu > history session diff --git a/src/content/docs/commands/docs/http.md b/src/content/docs/commands/docs/http.md new file mode 100644 index 00000000000..0def6407c35 --- /dev/null +++ b/src/content/docs/commands/docs/http.md @@ -0,0 +1,43 @@ +--- +title: http +categories: | + network +version: 0.90.0 +network: | + Various commands for working with http methods. +usage: | + Various commands for working with http methods. +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for network + +<div class='command-title'>{{ $frontmatter.network }}</div> + +## Signature + +`> http {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | type | usage | +| --------------------------------------------- | ------- | --------------------------------------------------------- | +| [`http delete`](/commands/docs/http_delete) | Builtin | Delete the specified resource. | +| [`http get`](/commands/docs/http_get) | Builtin | Fetch the contents from a URL. | +| [`http head`](/commands/docs/http_head) | Builtin | Get the headers from a URL. | +| [`http options`](/commands/docs/http_options) | Builtin | Requests permitted communication options for a given URL. | +| [`http patch`](/commands/docs/http_patch) | Builtin | Patch a body to a URL. | +| [`http post`](/commands/docs/http_post) | Builtin | Post a body to a URL. | +| [`http put`](/commands/docs/http_put) | Builtin | Put a body to a URL. | diff --git a/commands/docs/http_delete.md b/src/content/docs/commands/docs/http_delete.md similarity index 57% rename from commands/docs/http_delete.md rename to src/content/docs/commands/docs/http_delete.md index 99ad68930fd..798e5abe455 100644 --- a/commands/docs/http_delete.md +++ b/src/content/docs/commands/docs/http_delete.md @@ -9,6 +9,7 @@ usage: | Delete the specified resource. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for network @@ -17,26 +18,25 @@ feature: default ## Signature -```> http delete {flags} (URL)``` +`> http delete {flags} (URL)` ## Flags - - `--user, -u {any}`: the username when authenticating - - `--password, -p {any}`: the password when authenticating - - `--data, -d {any}`: the content to post - - `--content-type, -t {any}`: the MIME type of content to post - - `--max-time, -m {int}`: timeout period in seconds - - `--headers, -H {any}`: custom headers you want to add - - `--raw, -r`: fetch contents as text rather than a table - - `--insecure, -k`: allow insecure server connections when using SSL - - `--full, -f`: returns the full response instead of only the body - - `--allow-errors, -e`: do not fail if the server returns an error code - - `--redirect-mode, -R {string}`: What to do when encountering redirects. Default: 'follow'. Valid options: 'follow' ('f'), 'manual' ('m'), 'error' ('e'). +- `--user, -u {any}`: the username when authenticating +- `--password, -p {any}`: the password when authenticating +- `--data, -d {any}`: the content to post +- `--content-type, -t {any}`: the MIME type of content to post +- `--max-time, -m {int}`: timeout period in seconds +- `--headers, -H {any}`: custom headers you want to add +- `--raw, -r`: fetch contents as text rather than a table +- `--insecure, -k`: allow insecure server connections when using SSL +- `--full, -f`: returns the full response instead of only the body +- `--allow-errors, -e`: do not fail if the server returns an error code +- `--redirect-mode, -R {string}`: What to do when encountering redirects. Default: 'follow'. Valid options: 'follow' ('f'), 'manual' ('m'), 'error' ('e'). ## Parameters - - `URL`: The URL to fetch the contents from. - +- `URL`: The URL to fetch the contents from. ## Input/output types: @@ -47,34 +47,40 @@ feature: default ## Examples http delete from example.com + ```nu > http delete https://www.example.com ``` http delete from example.com, with username and password + ```nu > http delete --user myuser --password mypass https://www.example.com ``` http delete from example.com, with custom header + ```nu > http delete --headers [my-header-key my-header-value] https://www.example.com ``` http delete from example.com, with body + ```nu > http delete --data 'body' https://www.example.com ``` http delete from example.com, with JSON body + ```nu > http delete --content-type application/json --data { field: value } https://www.example.com ``` ## Notes -Performs HTTP DELETE operation. \ No newline at end of file + +Performs HTTP DELETE operation. diff --git a/commands/docs/http_get.md b/src/content/docs/commands/docs/http_get.md similarity index 58% rename from commands/docs/http_get.md rename to src/content/docs/commands/docs/http_get.md index 55e3395a8f4..a7bb605cb0c 100644 --- a/commands/docs/http_get.md +++ b/src/content/docs/commands/docs/http_get.md @@ -9,6 +9,7 @@ usage: | Fetch the contents from a URL. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for network @@ -17,24 +18,23 @@ feature: default ## Signature -```> http get {flags} (URL)``` +`> http get {flags} (URL)` ## Flags - - `--user, -u {any}`: the username when authenticating - - `--password, -p {any}`: the password when authenticating - - `--max-time, -m {int}`: timeout period in seconds - - `--headers, -H {any}`: custom headers you want to add - - `--raw, -r`: fetch contents as text rather than a table - - `--insecure, -k`: allow insecure server connections when using SSL - - `--full, -f`: returns the full response instead of only the body - - `--allow-errors, -e`: do not fail if the server returns an error code - - `--redirect-mode, -R {string}`: What to do when encountering redirects. Default: 'follow'. Valid options: 'follow' ('f'), 'manual' ('m'), 'error' ('e'). +- `--user, -u {any}`: the username when authenticating +- `--password, -p {any}`: the password when authenticating +- `--max-time, -m {int}`: timeout period in seconds +- `--headers, -H {any}`: custom headers you want to add +- `--raw, -r`: fetch contents as text rather than a table +- `--insecure, -k`: allow insecure server connections when using SSL +- `--full, -f`: returns the full response instead of only the body +- `--allow-errors, -e`: do not fail if the server returns an error code +- `--redirect-mode, -R {string}`: What to do when encountering redirects. Default: 'follow'. Valid options: 'follow' ('f'), 'manual' ('m'), 'error' ('e'). ## Parameters - - `URL`: The URL to fetch the contents from. - +- `URL`: The URL to fetch the contents from. ## Input/output types: @@ -45,28 +45,33 @@ feature: default ## Examples Get content from example.com + ```nu > http get https://www.example.com ``` Get content from example.com, with username and password + ```nu > http get --user myuser --password mypass https://www.example.com ``` Get content from example.com, with custom header + ```nu > http get --headers [my-header-key my-header-value] https://www.example.com ``` Get content from example.com, with custom headers + ```nu > http get --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com ``` ## Notes -Performs HTTP GET operation. \ No newline at end of file + +Performs HTTP GET operation. diff --git a/commands/docs/http_head.md b/src/content/docs/commands/docs/http_head.md similarity index 61% rename from commands/docs/http_head.md rename to src/content/docs/commands/docs/http_head.md index cdbbda05c6c..dbd9c5aa57f 100644 --- a/commands/docs/http_head.md +++ b/src/content/docs/commands/docs/http_head.md @@ -9,6 +9,7 @@ usage: | Get the headers from a URL. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for network @@ -17,21 +18,20 @@ feature: default ## Signature -```> http head {flags} (URL)``` +`> http head {flags} (URL)` ## Flags - - `--user, -u {any}`: the username when authenticating - - `--password, -p {any}`: the password when authenticating - - `--max-time, -m {int}`: timeout period in seconds - - `--headers, -H {any}`: custom headers you want to add - - `--insecure, -k`: allow insecure server connections when using SSL - - `--redirect-mode, -R {string}`: What to do when encountering redirects. Default: 'follow'. Valid options: 'follow' ('f'), 'manual' ('m'), 'error' ('e'). +- `--user, -u {any}`: the username when authenticating +- `--password, -p {any}`: the password when authenticating +- `--max-time, -m {int}`: timeout period in seconds +- `--headers, -H {any}`: custom headers you want to add +- `--insecure, -k`: allow insecure server connections when using SSL +- `--redirect-mode, -R {string}`: What to do when encountering redirects. Default: 'follow'. Valid options: 'follow' ('f'), 'manual' ('m'), 'error' ('e'). ## Parameters - - `URL`: The URL to fetch the contents from. - +- `URL`: The URL to fetch the contents from. ## Input/output types: @@ -42,22 +42,26 @@ feature: default ## Examples Get headers from example.com + ```nu > http head https://www.example.com ``` Get headers from example.com, with username and password + ```nu > http head --user myuser --password mypass https://www.example.com ``` Get headers from example.com, with custom header + ```nu > http head --headers [my-header-key my-header-value] https://www.example.com ``` ## Notes -Performs HTTP HEAD operation. \ No newline at end of file + +Performs HTTP HEAD operation. diff --git a/commands/docs/http_options.md b/src/content/docs/commands/docs/http_options.md similarity index 75% rename from commands/docs/http_options.md rename to src/content/docs/commands/docs/http_options.md index 0dde9e78ded..b40b32a65fa 100644 --- a/commands/docs/http_options.md +++ b/src/content/docs/commands/docs/http_options.md @@ -9,6 +9,7 @@ usage: | Requests permitted communication options for a given URL. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for network @@ -17,21 +18,20 @@ feature: default ## Signature -```> http options {flags} (URL)``` +`> http options {flags} (URL)` ## Flags - - `--user, -u {any}`: the username when authenticating - - `--password, -p {any}`: the password when authenticating - - `--max-time, -m {int}`: timeout period in seconds - - `--headers, -H {any}`: custom headers you want to add - - `--insecure, -k`: allow insecure server connections when using SSL - - `--allow-errors, -e`: do not fail if the server returns an error code +- `--user, -u {any}`: the username when authenticating +- `--password, -p {any}`: the password when authenticating +- `--max-time, -m {int}`: timeout period in seconds +- `--headers, -H {any}`: custom headers you want to add +- `--insecure, -k`: allow insecure server connections when using SSL +- `--allow-errors, -e`: do not fail if the server returns an error code ## Parameters - - `URL`: The URL to fetch the options from. - +- `URL`: The URL to fetch the options from. ## Input/output types: @@ -42,34 +42,40 @@ feature: default ## Examples Get options from example.com + ```nu > http options https://www.example.com ``` Get options from example.com, with username and password + ```nu > http options --user myuser --password mypass https://www.example.com ``` Get options from example.com, with custom header + ```nu > http options --headers [my-header-key my-header-value] https://www.example.com ``` Get options from example.com, with custom headers + ```nu > http options --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com ``` Simulate a browser cross-origin preflight request from www.example.com to media.example.com + ```nu > http options https://media.example.com/api/ --headers [Origin https://www.example.com Access-Control-Request-Headers "Content-Type, X-Custom-Header" Access-Control-Request-Method GET] ``` ## Notes -Performs an HTTP OPTIONS request. Most commonly used for making CORS preflight requests. \ No newline at end of file + +Performs an HTTP OPTIONS request. Most commonly used for making CORS preflight requests. diff --git a/commands/docs/http_patch.md b/src/content/docs/commands/docs/http_patch.md similarity index 54% rename from commands/docs/http_patch.md rename to src/content/docs/commands/docs/http_patch.md index a336c4f2218..82e2d232ae3 100644 --- a/commands/docs/http_patch.md +++ b/src/content/docs/commands/docs/http_patch.md @@ -9,6 +9,7 @@ usage: | Patch a body to a URL. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for network @@ -17,26 +18,25 @@ feature: default ## Signature -```> http patch {flags} (URL) (data)``` +`> http patch {flags} (URL) (data)` ## Flags - - `--user, -u {any}`: the username when authenticating - - `--password, -p {any}`: the password when authenticating - - `--content-type, -t {any}`: the MIME type of content to post - - `--max-time, -m {int}`: timeout period in seconds - - `--headers, -H {any}`: custom headers you want to add - - `--raw, -r`: return values as a string instead of a table - - `--insecure, -k`: allow insecure server connections when using SSL - - `--full, -f`: returns the full response instead of only the body - - `--allow-errors, -e`: do not fail if the server returns an error code - - `--redirect-mode, -R {string}`: What to do when encountering redirects. Default: 'follow'. Valid options: 'follow' ('f'), 'manual' ('m'), 'error' ('e'). +- `--user, -u {any}`: the username when authenticating +- `--password, -p {any}`: the password when authenticating +- `--content-type, -t {any}`: the MIME type of content to post +- `--max-time, -m {int}`: timeout period in seconds +- `--headers, -H {any}`: custom headers you want to add +- `--raw, -r`: return values as a string instead of a table +- `--insecure, -k`: allow insecure server connections when using SSL +- `--full, -f`: returns the full response instead of only the body +- `--allow-errors, -e`: do not fail if the server returns an error code +- `--redirect-mode, -R {string}`: What to do when encountering redirects. Default: 'follow'. Valid options: 'follow' ('f'), 'manual' ('m'), 'error' ('e'). ## Parameters - - `URL`: The URL to post to. - - `data`: The contents of the post body. - +- `URL`: The URL to post to. +- `data`: The contents of the post body. ## Input/output types: @@ -47,28 +47,33 @@ feature: default ## Examples Patch content to example.com + ```nu > http patch https://www.example.com 'body' ``` Patch content to example.com, with username and password + ```nu > http patch --user myuser --password mypass https://www.example.com 'body' ``` Patch content to example.com, with custom header + ```nu > http patch --headers [my-header-key my-header-value] https://www.example.com ``` Patch content to example.com, with JSON body + ```nu > http patch --content-type application/json https://www.example.com { field: value } ``` ## Notes -Performs HTTP PATCH operation. \ No newline at end of file + +Performs HTTP PATCH operation. diff --git a/commands/docs/http_post.md b/src/content/docs/commands/docs/http_post.md similarity index 54% rename from commands/docs/http_post.md rename to src/content/docs/commands/docs/http_post.md index d0d35791b01..b4a99f0fa99 100644 --- a/commands/docs/http_post.md +++ b/src/content/docs/commands/docs/http_post.md @@ -9,6 +9,7 @@ usage: | Post a body to a URL. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for network @@ -17,26 +18,25 @@ feature: default ## Signature -```> http post {flags} (URL) (data)``` +`> http post {flags} (URL) (data)` ## Flags - - `--user, -u {any}`: the username when authenticating - - `--password, -p {any}`: the password when authenticating - - `--content-type, -t {any}`: the MIME type of content to post - - `--max-time, -m {int}`: timeout period in seconds - - `--headers, -H {any}`: custom headers you want to add - - `--raw, -r`: return values as a string instead of a table - - `--insecure, -k`: allow insecure server connections when using SSL - - `--full, -f`: returns the full response instead of only the body - - `--allow-errors, -e`: do not fail if the server returns an error code - - `--redirect-mode, -R {string}`: What to do when encountering redirects. Default: 'follow'. Valid options: 'follow' ('f'), 'manual' ('m'), 'error' ('e'). +- `--user, -u {any}`: the username when authenticating +- `--password, -p {any}`: the password when authenticating +- `--content-type, -t {any}`: the MIME type of content to post +- `--max-time, -m {int}`: timeout period in seconds +- `--headers, -H {any}`: custom headers you want to add +- `--raw, -r`: return values as a string instead of a table +- `--insecure, -k`: allow insecure server connections when using SSL +- `--full, -f`: returns the full response instead of only the body +- `--allow-errors, -e`: do not fail if the server returns an error code +- `--redirect-mode, -R {string}`: What to do when encountering redirects. Default: 'follow'. Valid options: 'follow' ('f'), 'manual' ('m'), 'error' ('e'). ## Parameters - - `URL`: The URL to post to. - - `data`: The contents of the post body. - +- `URL`: The URL to post to. +- `data`: The contents of the post body. ## Input/output types: @@ -47,28 +47,33 @@ feature: default ## Examples Post content to example.com + ```nu > http post https://www.example.com 'body' ``` Post content to example.com, with username and password + ```nu > http post --user myuser --password mypass https://www.example.com 'body' ``` Post content to example.com, with custom header + ```nu > http post --headers [my-header-key my-header-value] https://www.example.com ``` Post content to example.com, with JSON body + ```nu > http post --content-type application/json https://www.example.com { field: value } ``` ## Notes -Performs HTTP POST operation. \ No newline at end of file + +Performs HTTP POST operation. diff --git a/commands/docs/http_put.md b/src/content/docs/commands/docs/http_put.md similarity index 54% rename from commands/docs/http_put.md rename to src/content/docs/commands/docs/http_put.md index e12fd59944a..072173254d6 100644 --- a/commands/docs/http_put.md +++ b/src/content/docs/commands/docs/http_put.md @@ -9,6 +9,7 @@ usage: | Put a body to a URL. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for network @@ -17,26 +18,25 @@ feature: default ## Signature -```> http put {flags} (URL) (data)``` +`> http put {flags} (URL) (data)` ## Flags - - `--user, -u {any}`: the username when authenticating - - `--password, -p {any}`: the password when authenticating - - `--content-type, -t {any}`: the MIME type of content to post - - `--max-time, -m {int}`: timeout period in seconds - - `--headers, -H {any}`: custom headers you want to add - - `--raw, -r`: return values as a string instead of a table - - `--insecure, -k`: allow insecure server connections when using SSL - - `--full, -f`: returns the full response instead of only the body - - `--allow-errors, -e`: do not fail if the server returns an error code - - `--redirect-mode, -R {string}`: What to do when encountering redirects. Default: 'follow'. Valid options: 'follow' ('f'), 'manual' ('m'), 'error' ('e'). +- `--user, -u {any}`: the username when authenticating +- `--password, -p {any}`: the password when authenticating +- `--content-type, -t {any}`: the MIME type of content to post +- `--max-time, -m {int}`: timeout period in seconds +- `--headers, -H {any}`: custom headers you want to add +- `--raw, -r`: return values as a string instead of a table +- `--insecure, -k`: allow insecure server connections when using SSL +- `--full, -f`: returns the full response instead of only the body +- `--allow-errors, -e`: do not fail if the server returns an error code +- `--redirect-mode, -R {string}`: What to do when encountering redirects. Default: 'follow'. Valid options: 'follow' ('f'), 'manual' ('m'), 'error' ('e'). ## Parameters - - `URL`: The URL to post to. - - `data`: The contents of the post body. - +- `URL`: The URL to post to. +- `data`: The contents of the post body. ## Input/output types: @@ -47,28 +47,33 @@ feature: default ## Examples Put content to example.com + ```nu > http put https://www.example.com 'body' ``` Put content to example.com, with username and password + ```nu > http put --user myuser --password mypass https://www.example.com 'body' ``` Put content to example.com, with custom header + ```nu > http put --headers [my-header-key my-header-value] https://www.example.com ``` Put content to example.com, with JSON body + ```nu > http put --content-type application/json https://www.example.com { field: value } ``` ## Notes -Performs HTTP PUT operation. \ No newline at end of file + +Performs HTTP PUT operation. diff --git a/commands/docs/if.md b/src/content/docs/commands/docs/if.md similarity index 79% rename from commands/docs/if.md rename to src/content/docs/commands/docs/if.md index 2cc86e546bb..64ecf139a8e 100644 --- a/commands/docs/if.md +++ b/src/content/docs/commands/docs/if.md @@ -9,6 +9,7 @@ usage: | Conditionally run a block. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,14 +18,13 @@ feature: default ## Signature -```> if {flags} (cond) (then_block) (else_expression)``` +`> if {flags} (cond) (then_block) (else_expression)` ## Parameters - - `cond`: Condition to check. - - `then_block`: Block to run if check succeeds. - - `else_expression`: Expression or block to run when the condition is false. - +- `cond`: Condition to check. +- `then_block`: Block to run if check succeeds. +- `else_expression`: Expression or block to run when the condition is false. ## Input/output types: @@ -35,18 +35,21 @@ feature: default ## Examples Output a value if a condition matches, otherwise return nothing + ```nu > if 2 < 3 { 'yes!' } yes! ``` Output a value if a condition matches, else return another value + ```nu > if 5 < 3 { 'yes!' } else { 'no!' } no! ``` Chain multiple if's together + ```nu > if 5 < 3 { 'yes!' } else if 4 < 5 { 'no!' } else { 'okay!' } no! diff --git a/commands/docs/ignore.md b/src/content/docs/commands/docs/ignore.md similarity index 96% rename from commands/docs/ignore.md rename to src/content/docs/commands/docs/ignore.md index 42f29fe56b8..b4262866c10 100644 --- a/commands/docs/ignore.md +++ b/src/content/docs/commands/docs/ignore.md @@ -9,6 +9,7 @@ usage: | Ignore the output of the previous command in the pipeline. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,8 +18,7 @@ feature: default ## Signature -```> ignore {flags} ``` - +`> ignore {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Ignore the output of an echo command + ```nu > echo done | ignore diff --git a/commands/docs/inc.md b/src/content/docs/commands/docs/inc.md similarity index 68% rename from commands/docs/inc.md rename to src/content/docs/commands/docs/inc.md index e57ce47e683..20126968a43 100644 --- a/commands/docs/inc.md +++ b/src/content/docs/commands/docs/inc.md @@ -9,6 +9,7 @@ usage: | Increment a value or version. Optionally use the column of a table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for default @@ -17,18 +18,17 @@ feature: default ## Signature -```> inc {flags} (cell_path)``` +`> inc {flags} (cell_path)` ## Flags - - `--major, -M`: increment the major version (eg 1.2.1 -> 2.0.0) - - `--minor, -m`: increment the minor version (eg 1.2.1 -> 1.3.0) - - `--patch, -p`: increment the patch version (eg 1.2.1 -> 1.2.2) +- `--major, -M`: increment the major version (eg 1.2.1 -> 2.0.0) +- `--minor, -m`: increment the minor version (eg 1.2.1 -> 1.3.0) +- `--patch, -p`: increment the patch version (eg 1.2.1 -> 1.2.2) ## Parameters - - `cell_path`: cell path to update - +- `cell_path`: cell path to update ## Input/output types: diff --git a/commands/docs/input.md b/src/content/docs/commands/docs/input.md similarity index 51% rename from commands/docs/input.md rename to src/content/docs/commands/docs/input.md index 5bf5c6e659f..29ed06054d5 100644 --- a/commands/docs/input.md +++ b/src/content/docs/commands/docs/input.md @@ -9,6 +9,7 @@ usage: | Get input from the user. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for platform @@ -17,18 +18,17 @@ feature: default ## Signature -```> input {flags} (prompt)``` +`> input {flags} (prompt)` ## Flags - - `--bytes-until-any, -u {string}`: read bytes (not text) until any of the given stop bytes is seen - - `--numchar, -n {int}`: number of characters to read; suppresses output - - `--suppress-output, -s`: don't print keystroke values +- `--bytes-until-any, -u {string}`: read bytes (not text) until any of the given stop bytes is seen +- `--numchar, -n {int}`: number of characters to read; suppresses output +- `--suppress-output, -s`: don't print keystroke values ## Parameters - - `prompt`: Prompt to show the user. - +- `prompt`: Prompt to show the user. ## Input/output types: @@ -39,21 +39,22 @@ feature: default ## Examples Get input from the user, and assign to a variable + ```nu > let user_input = (input) ``` Get two characters from the user, and assign to a variable + ```nu > let user_input = (input --numchar 2) ``` - ## Subcommands: -| name | type | usage | -| ------------------------------------------------ | ------- | -------------------------------- | -| [`input list`](/commands/docs/input_list.md) | Builtin | Interactive list selection. | -| [`input listen`](/commands/docs/input_listen.md) | Builtin | Listen for user interface event. | \ No newline at end of file +| name | type | usage | +| --------------------------------------------- | ------- | -------------------------------- | +| [`input list`](/commands/docs/input_list) | Builtin | Interactive list selection. | +| [`input listen`](/commands/docs/input_listen) | Builtin | Listen for user interface event. | diff --git a/commands/docs/input_list.md b/src/content/docs/commands/docs/input_list.md similarity index 75% rename from commands/docs/input_list.md rename to src/content/docs/commands/docs/input_list.md index 8da5941fa1c..e9bb804d218 100644 --- a/commands/docs/input_list.md +++ b/src/content/docs/commands/docs/input_list.md @@ -9,6 +9,7 @@ usage: | Interactive list selection. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for platform @@ -17,56 +18,62 @@ feature: default ## Signature -```> input list {flags} (prompt)``` +`> input list {flags} (prompt)` ## Flags - - `--multi, -m`: Use multiple results, you can press a to toggle all options on/off - - `--fuzzy, -f`: Use a fuzzy select. - - `--index, -i`: Returns list indexes. +- `--multi, -m`: Use multiple results, you can press a to toggle all options on/off +- `--fuzzy, -f`: Use a fuzzy select. +- `--index, -i`: Returns list indexes. ## Parameters - - `prompt`: The prompt to display. - +- `prompt`: The prompt to display. ## Input/output types: -| input | output | -| --------- | ------ | +| input | output | +| ----------- | ------ | | list\<any\> | any | -| range | int | +| range | int | + ## Examples Return a single value from a list + ```nu > [1 2 3 4 5] | input list 'Rate it' ``` Return multiple values from a list + ```nu > [Banana Kiwi Pear Peach Strawberry] | input list --multi 'Add fruits to the basket' ``` Return a single record from a table with fuzzy search + ```nu > ls | input list --fuzzy 'Select the target' ``` Choose an item from a range + ```nu > 1..10 | input list ``` Return the index of a selected item + ```nu > [Banana Kiwi Pear Peach Strawberry] | input list --index ``` ## Notes -Abort with esc or q. \ No newline at end of file + +Abort with esc or q. diff --git a/commands/docs/input_listen.md b/src/content/docs/commands/docs/input_listen.md similarity index 66% rename from commands/docs/input_listen.md rename to src/content/docs/commands/docs/input_listen.md index 9eecfed9e25..3451f62b208 100644 --- a/commands/docs/input_listen.md +++ b/src/content/docs/commands/docs/input_listen.md @@ -9,6 +9,7 @@ usage: | Listen for user interface event. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for platform @@ -17,31 +18,33 @@ feature: default ## Signature -```> input listen {flags} ``` +`> input listen {flags} ` ## Flags - - `--types, -t {list<string>}`: Listen for event of specified types only (can be one of: focus, key, mouse, paste, resize) - - `--raw, -r`: Add raw_code field with numeric value of keycode and raw_flags with bit mask flags - +- `--types, -t {list<string>}`: Listen for event of specified types only (can be one of: focus, key, mouse, paste, resize) +- `--raw, -r`: Add raw_code field with numeric value of keycode and raw_flags with bit mask flags ## Input/output types: -| input | output | -| ------- | ------------------------------------------------ | +| input | output | +| ------- | ---------------------------------------------------- | | nothing | record\<keycode: string, modifiers: list\<string\>\> | ## Examples Listen for a keyboard shortcut and find out how nu receives it + ```nu > input listen --types [key] ``` ## Notes + There are 5 different type of events: focus, key, mouse, paste, resize. Each will produce a corresponding record, distinguished by type field: + ``` { type: focus event: (gained|lost) } { type: key key_type: <key_type> code: <string> modifiers: [ <modifier> ... ] } @@ -49,9 +52,10 @@ corresponding record, distinguished by type field: { type: paste content: <string> } { type: resize col: <int> row: <int> } ``` + There are 6 `modifier` variants: shift, control, alt, super, hyper, meta. There are 4 `key_type` variants: - f - f1, f2, f3 ... keys - char - alphanumeric and special symbols (a, A, 1, $ ...) - media - dedicated media keys (play, pause, tracknext ...) - other - keys not falling under previous categories (up, down, backspace, enter ...) \ No newline at end of file +f - f1, f2, f3 ... keys +char - alphanumeric and special symbols (a, A, 1, $ ...) +media - dedicated media keys (play, pause, tracknext ...) +other - keys not falling under previous categories (up, down, backspace, enter ...) diff --git a/commands/docs/insert.md b/src/content/docs/commands/docs/insert.md similarity index 89% rename from commands/docs/insert.md rename to src/content/docs/commands/docs/insert.md index 6b3ff672c96..e208923225a 100644 --- a/commands/docs/insert.md +++ b/src/content/docs/commands/docs/insert.md @@ -9,6 +9,7 @@ usage: | Insert a new column, using an expression or closure to create each row's values. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,24 +18,25 @@ feature: default ## Signature -```> insert {flags} (field) (new value)``` +`> insert {flags} (field) (new value)` ## Parameters - - `field`: The name of the column to insert. - - `new value`: The new value to give the cell(s). - +- `field`: The name of the column to insert. +- `new value`: The new value to give the cell(s). ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | -| record | record | -| table | table | +| record | record | +| table | table | + ## Examples Insert a new entry into a single record + ```nu > {'name': 'nu', 'stars': 5} | insert alias 'Nushell' ╭───────┬─────────╮ @@ -45,6 +47,7 @@ Insert a new entry into a single record ``` Insert a new column into a table, populating all rows + ```nu > [[project, lang]; ['Nushell', 'Rust']] | insert type 'shell' ╭───┬─────────┬──────┬───────╮ @@ -56,6 +59,7 @@ Insert a new column into a table, populating all rows ``` Insert a new column with values computed based off the other columns + ```nu > [[foo]; [7] [8] [9]] | insert bar {|row| $row.foo * 2 } ╭───┬─────┬─────╮ @@ -69,6 +73,7 @@ Insert a new column with values computed based off the other columns ``` Insert a new value into a list at an index + ```nu > [1 2 4] | insert 2 3 ╭───┬───╮ @@ -81,6 +86,7 @@ Insert a new value into a list at an index ``` Insert a new value at the end of a list + ```nu > [1 2 3] | insert 3 4 ╭───┬───╮ diff --git a/commands/docs/inspect.md b/src/content/docs/commands/docs/inspect.md similarity index 96% rename from commands/docs/inspect.md rename to src/content/docs/commands/docs/inspect.md index 3a3ee6143ee..9ca36023380 100644 --- a/commands/docs/inspect.md +++ b/src/content/docs/commands/docs/inspect.md @@ -9,6 +9,7 @@ usage: | Inspect pipeline results while running a pipeline. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for debug @@ -17,8 +18,7 @@ feature: default ## Signature -```> inspect {flags} ``` - +`> inspect {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Inspect pipeline results + ```nu > ls | inspect | get name | inspect diff --git a/src/content/docs/commands/docs/into.md b/src/content/docs/commands/docs/into.md new file mode 100644 index 00000000000..8c2e2c56fec --- /dev/null +++ b/src/content/docs/commands/docs/into.md @@ -0,0 +1,49 @@ +--- +title: into +categories: | + conversions +version: 0.90.0 +conversions: | + Commands to convert data from one type to another. +usage: | + Commands to convert data from one type to another. +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for conversions + +<div class='command-title'>{{ $frontmatter.conversions }}</div> + +## Signature + +`> into {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | type | usage | +| ------------------------------------------------- | ------- | ------------------------------------------ | +| [`into binary`](/commands/docs/into_binary) | Builtin | Convert value to a binary primitive. | +| [`into bits`](/commands/docs/into_bits) | Builtin | Convert value to a binary primitive. | +| [`into bool`](/commands/docs/into_bool) | Builtin | Convert value to boolean. | +| [`into cell-path`](/commands/docs/into_cell-path) | Builtin | Convert value to a cell-path. | +| [`into datetime`](/commands/docs/into_datetime) | Builtin | Convert text or timestamp into a datetime. | +| [`into duration`](/commands/docs/into_duration) | Builtin | Convert value to duration. | +| [`into filesize`](/commands/docs/into_filesize) | Builtin | Convert value to filesize. | +| [`into float`](/commands/docs/into_float) | Builtin | Convert data into floating point number. | +| [`into int`](/commands/docs/into_int) | Builtin | Convert value to integer. | +| [`into record`](/commands/docs/into_record) | Builtin | Convert value to record. | +| [`into sqlite`](/commands/docs/into_sqlite) | Builtin | Convert table into a SQLite database. | +| [`into string`](/commands/docs/into_string) | Builtin | Convert value to string. | +| [`into value`](/commands/docs/into_value) | Builtin | Infer nushell datatype for each cell. | diff --git a/commands/docs/into_binary.md b/src/content/docs/commands/docs/into_binary.md similarity index 93% rename from commands/docs/into_binary.md rename to src/content/docs/commands/docs/into_binary.md index 2a3e47b42d2..0737fbe986c 100644 --- a/commands/docs/into_binary.md +++ b/src/content/docs/commands/docs/into_binary.md @@ -9,6 +9,7 @@ usage: | Convert value to a binary primitive. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for conversions @@ -17,16 +18,15 @@ feature: default ## Signature -```> into binary {flags} ...rest``` +`> into binary {flags} ...rest` ## Flags - - `--compact, -c`: output without padding zeros +- `--compact, -c`: output without padding zeros ## Parameters - - `...rest`: For a data structure input, convert data at the given cell paths. - +- `...rest`: For a data structure input, convert data at the given cell paths. ## Input/output types: @@ -41,9 +41,11 @@ feature: default | record | record | | string | binary | | table | table | + ## Examples convert string to a nushell binary primitive + ```nu > 'This is a string that is exactly 52 characters long.' | into binary Length: 52 (0x34) bytes | printable whitespace ascii_other non_ascii @@ -55,6 +57,7 @@ Length: 52 (0x34) bytes | printable whitespace ascii_other non_ascii ``` convert a number to a nushell binary primitive + ```nu > 1 | into binary Length: 8 (0x8) bytes | printable whitespace ascii_other non_ascii @@ -63,6 +66,7 @@ Length: 8 (0x8) bytes | printable whitespace ascii_other non_ascii ``` convert a boolean to a nushell binary primitive + ```nu > true | into binary Length: 8 (0x8) bytes | printable whitespace ascii_other non_ascii @@ -71,18 +75,21 @@ Length: 8 (0x8) bytes | printable whitespace ascii_other non_ascii ``` convert a filesize to a nushell binary primitive + ```nu > ls | where name == LICENSE | get size | into binary ``` convert a filepath to a nushell binary primitive + ```nu > ls | where name == LICENSE | get name | path expand | into binary ``` convert a float to a nushell binary primitive + ```nu > 1.234 | into binary Length: 8 (0x8) bytes | printable whitespace ascii_other non_ascii @@ -91,6 +98,7 @@ Length: 8 (0x8) bytes | printable whitespace ascii_other non_ascii ``` convert an int to a nushell binary primitive with compact enabled + ```nu > 10 | into binary --compact Length: 1 (0x1) bytes | printable whitespace ascii_other non_ascii diff --git a/commands/docs/into_bits.md b/src/content/docs/commands/docs/into_bits.md similarity index 87% rename from commands/docs/into_bits.md rename to src/content/docs/commands/docs/into_bits.md index 7ad89d0b213..71eeded344c 100644 --- a/commands/docs/into_bits.md +++ b/src/content/docs/commands/docs/into_bits.md @@ -9,24 +9,24 @@ usage: | Convert value to a binary primitive. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for conversions <div class='command-title'>{{ $frontmatter.conversions }}</div> - -::: warning - Command `into bits` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `into bits` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> into bits {flags} ...rest``` +`> into bits {flags} ...rest` ## Parameters - - `...rest`: for a data structure input, convert data at the given cell paths - +- `...rest`: for a data structure input, convert data at the given cell paths ## Input/output types: @@ -41,45 +41,53 @@ feature: extra | record | record | | string | string | | table | table | + ## Examples convert a binary value into a string, padded to 8 places with 0s + ```nu > 01b | into bits 00000001 ``` convert an int into a string, padded to 8 places with 0s + ```nu > 1 | into bits 00000001 ``` convert a filesize value into a string, padded to 8 places with 0s + ```nu > 1b | into bits 00000001 ``` convert a duration value into a string, padded to 8 places with 0s + ```nu > 1ns | into bits 00000001 ``` convert a boolean value into a string, padded to 8 places with 0s + ```nu > true | into bits 00000001 ``` convert a datetime value into a string, padded to 8 places with 0s + ```nu > 2023-04-17T01:02:03 | into bits 01001101 01101111 01101110 00100000 01000001 01110000 01110010 00100000 00110001 00110111 00100000 00110000 00110001 00111010 00110000 00110010 00111010 00110000 00110011 00100000 00110010 00110000 00110010 00110011 ``` convert a string into a raw binary string, padded with 0s to 8 places + ```nu > 'nushell.sh' | into bits 01101110 01110101 01110011 01101000 01100101 01101100 01101100 00101110 01110011 01101000 diff --git a/commands/docs/into_bool.md b/src/content/docs/commands/docs/into_bool.md similarity index 78% rename from commands/docs/into_bool.md rename to src/content/docs/commands/docs/into_bool.md index ec61a826b5c..7ab3576c8e7 100644 --- a/commands/docs/into_bool.md +++ b/src/content/docs/commands/docs/into_bool.md @@ -9,6 +9,7 @@ usage: | Convert value to boolean. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for conversions @@ -17,27 +18,28 @@ feature: default ## Signature -```> into bool {flags} ...rest``` +`> into bool {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, convert data at the given cell paths. - +- `...rest`: For a data structure input, convert data at the given cell paths. ## Input/output types: -| input | output | -| --------- | ------ | -| bool | bool | -| int | bool | +| input | output | +| ----------- | ------ | +| bool | bool | +| int | bool | | list\<any\> | table | -| number | bool | -| record | record | -| string | bool | -| table | table | +| number | bool | +| record | record | +| string | bool | +| table | table | + ## Examples Convert value to boolean in table + ```nu > [[value]; ['false'] ['1'] [0] [1.0] [true]] | into bool value ╭───┬───────╮ @@ -53,30 +55,35 @@ Convert value to boolean in table ``` Convert bool to boolean + ```nu > true | into bool true ``` convert int to boolean + ```nu > 1 | into bool true ``` convert float to boolean + ```nu > 0.3 | into bool true ``` convert float string to boolean + ```nu > '0.0' | into bool false ``` convert string to boolean + ```nu > 'true' | into bool true diff --git a/commands/docs/into_cell-path.md b/src/content/docs/commands/docs/into_cell-path.md similarity index 76% rename from commands/docs/into_cell-path.md rename to src/content/docs/commands/docs/into_cell-path.md index 8b083397ab3..3ce3c3c7d69 100644 --- a/commands/docs/into_cell-path.md +++ b/src/content/docs/commands/docs/into_cell-path.md @@ -9,6 +9,7 @@ usage: | Convert value to a cell-path. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for conversions @@ -17,41 +18,46 @@ feature: default ## Signature -```> into cell-path {flags} ``` - +`> into cell-path {flags} ` ## Input/output types: -| input | output | -| ---------------------------------------- | --------- | -| int | cell-path | -| list\<any\> | cell-path | +| input | output | +| -------------------------------------------- | --------- | +| int | cell-path | +| list\<any\> | cell-path | | list\<record\<value: any, optional: bool\>\> | cell-path | + ## Examples Convert integer into cell path + ```nu > 5 | into cell-path 5 ``` Convert string into cell path + ```nu > 'some.path' | split row '.' | into cell-path some.path ``` Convert list into cell path + ```nu > [5 c 7 h] | into cell-path 5.c.7.h ``` Convert table into cell path + ```nu > [[value, optional]; [5 true] [c false]] | into cell-path 5.c ``` ## Notes -Converting a string directly into a cell path is intentionally not supported. \ No newline at end of file + +Converting a string directly into a cell path is intentionally not supported. diff --git a/commands/docs/into_datetime.md b/src/content/docs/commands/docs/into_datetime.md similarity index 70% rename from commands/docs/into_datetime.md rename to src/content/docs/commands/docs/into_datetime.md index 682dd102e8b..40e4e38baf8 100644 --- a/commands/docs/into_datetime.md +++ b/src/content/docs/commands/docs/into_datetime.md @@ -9,6 +9,7 @@ usage: | Convert text or timestamp into a datetime. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for conversions @@ -17,63 +18,69 @@ feature: default ## Signature -```> into datetime {flags} ...rest``` +`> into datetime {flags} ...rest` ## Flags - - `--timezone, -z {string}`: Specify timezone if the input is a Unix timestamp. Valid options: 'UTC' ('u') or 'LOCAL' ('l') - - `--offset, -o {int}`: Specify timezone by offset from UTC if the input is a Unix timestamp, like '+8', '-4' - - `--format, -f {string}`: Specify expected format of INPUT string to parse to datetime. Use --list to see options - - `--list, -l`: Show all possible variables for use in --format flag - - `--list-human, -n`: Show human-readable datetime parsing examples +- `--timezone, -z {string}`: Specify timezone if the input is a Unix timestamp. Valid options: 'UTC' ('u') or 'LOCAL' ('l') +- `--offset, -o {int}`: Specify timezone by offset from UTC if the input is a Unix timestamp, like '+8', '-4' +- `--format, -f {string}`: Specify expected format of INPUT string to parse to datetime. Use --list to see options +- `--list, -l`: Show all possible variables for use in --format flag +- `--list-human, -n`: Show human-readable datetime parsing examples ## Parameters - - `...rest`: For a data structure input, convert data at the given cell paths. - +- `...rest`: For a data structure input, convert data at the given cell paths. ## Input/output types: -| input | output | -| ------------ | -------------- | -| int | datetime | +| input | output | +| -------------- | ---------------- | +| int | datetime | | list\<string\> | list\<datetime\> | -| record | record | -| string | datetime | -| table | table | +| record | record | +| string | datetime | +| table | table | + ## Examples Convert any standard timestamp string to datetime + ```nu > '27.02.2021 1:55 pm +0000' | into datetime Sat, 27 Feb 2021 13:55:00 +0000 (2 years ago) ``` Convert any standard timestamp string to datetime + ```nu > '2021-02-27T13:55:40.2246+00:00' | into datetime Sat, 27 Feb 2021 13:55:40 +0000 (2 years ago) ``` Convert non-standard timestamp string to datetime using a custom format + ```nu > '20210227_135540+0000' | into datetime --format '%Y%m%d_%H%M%S%z' Sat, 27 Feb 2021 13:55:40 +0000 (2 years ago) ``` Convert nanosecond-precision unix timestamp to a datetime with offset from UTC + ```nu > 1614434140123456789 | into datetime --offset -5 Sat, 27 Feb 2021 13:55:40 +0000 (2 years ago) ``` Convert standard (seconds) unix timestamp to a UTC datetime + ```nu > 1614434140 * 1_000_000_000 | into datetime Sat, 27 Feb 2021 13:55:40 +0000 (2 years ago) ``` Convert list of timestamps to datetimes + ```nu > ["2023-03-30 10:10:07 -05:00", "2023-05-05 13:43:49 -05:00", "2023-06-05 01:37:42 -05:00"] | into datetime ╭───┬───────────────╮ @@ -85,18 +92,21 @@ Convert list of timestamps to datetimes ``` Parsing human readable datetimes + ```nu > 'Today at 18:30' | into datetime ``` Parsing human readable datetimes + ```nu > 'Last Friday at 19:45' | into datetime ``` Parsing human readable datetimes + ```nu > 'In 5 minutes and 30 seconds' | into datetime diff --git a/commands/docs/into_duration.md b/src/content/docs/commands/docs/into_duration.md similarity index 86% rename from commands/docs/into_duration.md rename to src/content/docs/commands/docs/into_duration.md index ee46be09ba2..09a78f3fd60 100644 --- a/commands/docs/into_duration.md +++ b/src/content/docs/commands/docs/into_duration.md @@ -9,6 +9,7 @@ usage: | Convert value to duration. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for conversions @@ -17,16 +18,15 @@ feature: default ## Signature -```> into duration {flags} ...rest``` +`> into duration {flags} ...rest` ## Flags - - `--unit, -u {string}`: Unit to convert number into (will have an effect only with integer input) +- `--unit, -u {string}`: Unit to convert number into (will have an effect only with integer input) ## Parameters - - `...rest`: For a data structure input, convert data at the given cell paths. - +- `...rest`: For a data structure input, convert data at the given cell paths. ## Input/output types: @@ -36,21 +36,25 @@ feature: default | int | duration | | string | duration | | table | table | + ## Examples Convert duration string to duration value + ```nu > '7min' | into duration 7min ``` Convert compound duration string to duration value + ```nu > '1day 2hr 3min 4sec' | into duration 1day 2hr 3min 4sec ``` Convert table of duration strings to table of duration values + ```nu > [[value]; ['1sec'] ['2min'] ['3hr'] ['4day'] ['5wk']] | into duration value ╭───┬───────╮ @@ -66,22 +70,26 @@ Convert table of duration strings to table of duration values ``` Convert duration to duration + ```nu > 420sec | into duration 7min ``` Convert a number of ns to duration + ```nu > 1_234_567 | into duration 1ms 234µs 567ns ``` Convert a number of an arbitrary unit to duration + ```nu > 1_234 | into duration --unit ms 1sec 234ms ``` ## Notes -Max duration value is i64::MAX nanoseconds; max duration time unit is wk (weeks). \ No newline at end of file + +Max duration value is i64::MAX nanoseconds; max duration time unit is wk (weeks). diff --git a/commands/docs/into_filesize.md b/src/content/docs/commands/docs/into_filesize.md similarity index 76% rename from commands/docs/into_filesize.md rename to src/content/docs/commands/docs/into_filesize.md index 4551f89583d..9b7f6ed64f1 100644 --- a/commands/docs/into_filesize.md +++ b/src/content/docs/commands/docs/into_filesize.md @@ -9,6 +9,7 @@ usage: | Convert value to filesize. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for conversions @@ -17,31 +18,32 @@ feature: default ## Signature -```> into filesize {flags} ...rest``` +`> into filesize {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, convert data at the given cell paths. - +- `...rest`: For a data structure input, convert data at the given cell paths. ## Input/output types: -| input | output | -| -------------- | -------------- | -| filesize | filesize | -| int | filesize | +| input | output | +| ---------------- | ---------------- | +| filesize | filesize | +| int | filesize | | list\<any\> | list\<filesize\> | | list\<filesize\> | list\<filesize\> | | list\<int\> | list\<filesize\> | | list\<number\> | list\<filesize\> | | list\<string\> | list\<filesize\> | -| number | filesize | -| record | record | -| string | filesize | -| table | table | +| number | filesize | +| record | record | +| string | filesize | +| table | table | + ## Examples Convert string to filesize in table + ```nu > [[device size]; ["/dev/sda1" "200"] ["/dev/loop0" "50"]] | into filesize size ╭───┬────────────┬───────╮ @@ -54,24 +56,28 @@ Convert string to filesize in table ``` Convert string to filesize + ```nu > '2' | into filesize 2 B ``` Convert float to filesize + ```nu > 8.3 | into filesize 8 B ``` Convert int to filesize + ```nu > 5 | into filesize 5 B ``` Convert file size to filesize + ```nu > 4KB | into filesize 3.9 KiB diff --git a/commands/docs/into_float.md b/src/content/docs/commands/docs/into_float.md similarity index 74% rename from commands/docs/into_float.md rename to src/content/docs/commands/docs/into_float.md index 54e11e33a15..f6e98a5177f 100644 --- a/commands/docs/into_float.md +++ b/src/content/docs/commands/docs/into_float.md @@ -9,6 +9,7 @@ usage: | Convert data into floating point number. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for conversions @@ -17,27 +18,28 @@ feature: default ## Signature -```> into float {flags} ...rest``` +`> into float {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, convert data at the given cell paths. - +- `...rest`: For a data structure input, convert data at the given cell paths. ## Input/output types: -| input | output | -| --------- | ----------- | -| bool | float | -| float | float | -| int | float | +| input | output | +| ----------- | ------------- | +| bool | float | +| float | float | +| int | float | | list\<any\> | list\<float\> | -| record | record | -| string | float | -| table | table | +| record | record | +| string | float | +| table | table | + ## Examples Convert string to float in table + ```nu > [[num]; ['5.01']] | into float num ╭───┬──────╮ @@ -49,12 +51,14 @@ Convert string to float in table ``` Convert string to floating point number + ```nu > '1.345' | into float 1.345 ``` Coerce list of ints and floats to float + ```nu > [4 -5.9] | into float ╭───┬───────╮ @@ -65,6 +69,7 @@ Coerce list of ints and floats to float ``` Convert boolean to float + ```nu > true | into float 1 diff --git a/commands/docs/into_int.md b/src/content/docs/commands/docs/into_int.md similarity index 72% rename from commands/docs/into_int.md rename to src/content/docs/commands/docs/into_int.md index 88f58fa905a..da2073ad6cf 100644 --- a/commands/docs/into_int.md +++ b/src/content/docs/commands/docs/into_int.md @@ -9,6 +9,7 @@ usage: | Convert value to integer. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for conversions @@ -17,27 +18,26 @@ feature: default ## Signature -```> into int {flags} ...rest``` +`> into int {flags} ...rest` ## Flags - - `--radix, -r {number}`: radix of integer - - `--endian, -e {string}`: byte encode endian, available options: native(default), little, big +- `--radix, -r {number}`: radix of integer +- `--endian, -e {string}`: byte encode endian, available options: native(default), little, big ## Parameters - - `...rest`: For a data structure input, convert data at the given cell paths. - +- `...rest`: For a data structure input, convert data at the given cell paths. ## Input/output types: -| input | output | -| -------------- | --------- | -| binary | int | -| bool | int | -| datetime | int | -| duration | int | -| filesize | int | +| input | output | +| ---------------- | ----------- | +| binary | int | +| bool | int | +| datetime | int | +| duration | int | +| filesize | int | | list\<any\> | list\<int\> | | list\<bool\> | list\<int\> | | list\<datetime\> | list\<int\> | @@ -45,43 +45,50 @@ feature: default | list\<filesize\> | list\<int\> | | list\<number\> | list\<int\> | | list\<string\> | list\<int\> | -| number | int | -| record | record | -| string | int | -| table | table | +| number | int | +| record | record | +| string | int | +| table | table | + ## Examples Convert string to int in table + ```nu > [[num]; ['-5'] [4] [1.5]] | into int num ``` Convert string to int + ```nu > '2' | into int 2 ``` Convert float to int + ```nu > 5.9 | into int 5 ``` Convert decimal string to int + ```nu > '5.9' | into int 5 ``` Convert file size to int + ```nu > 4KB | into int 4000 ``` Convert bool to int + ```nu > [false, true] | into int ╭───┬───╮ @@ -92,36 +99,42 @@ Convert bool to int ``` Convert date to int (Unix nanosecond timestamp) + ```nu > 1983-04-13T12:09:14.123456789-05:00 | into int 419101754123456789 ``` Convert to int from binary data (radix: 2) + ```nu > '1101' | into int --radix 2 13 ``` Convert to int from hex + ```nu > 'FF' | into int --radix 16 255 ``` Convert octal string to int + ```nu > '0o10132' | into int 4186 ``` Convert 0 padded string to int + ```nu > '0010132' | into int 10132 ``` Convert 0 padded string to int with radix 8 + ```nu > '0010132' | into int --radix 8 4186 diff --git a/commands/docs/into_record.md b/src/content/docs/commands/docs/into_record.md similarity index 91% rename from commands/docs/into_record.md rename to src/content/docs/commands/docs/into_record.md index 3d1c372ca7c..8590b3f7bec 100644 --- a/commands/docs/into_record.md +++ b/src/content/docs/commands/docs/into_record.md @@ -9,6 +9,7 @@ usage: | Convert value to record. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for conversions @@ -17,21 +18,22 @@ feature: default ## Signature -```> into record {flags} ``` - +`> into record {flags} ` ## Input/output types: -| input | output | -| --------- | ------ | -| datetime | record | -| duration | record | +| input | output | +| ----------- | ------ | +| datetime | record | +| duration | record | | list\<any\> | record | -| range | record | -| record | record | +| range | record | +| record | record | + ## Examples Convert from one row table to record + ```nu > [[value]; [false]] | into record ╭───────┬───────╮ @@ -40,6 +42,7 @@ Convert from one row table to record ``` Convert from list to record + ```nu > [1 2 3] | into record ╭───┬───╮ @@ -50,6 +53,7 @@ Convert from list to record ``` Convert from range to record + ```nu > 0..2 | into record ╭───┬───╮ @@ -60,6 +64,7 @@ Convert from range to record ``` convert duration to record (weeks max) + ```nu > (-500day - 4hr - 5sec) | into record ╭────────┬────╮ @@ -72,6 +77,7 @@ convert duration to record (weeks max) ``` convert record to record + ```nu > {a: 1, b: 2} | into record ╭───┬───╮ @@ -81,6 +87,7 @@ convert record to record ``` convert date to record + ```nu > 2020-04-12T22:10:57+02:00 | into record ╭──────────┬────────╮ diff --git a/commands/docs/into_sqlite.md b/src/content/docs/commands/docs/into_sqlite.md similarity index 86% rename from commands/docs/into_sqlite.md rename to src/content/docs/commands/docs/into_sqlite.md index 244270e432a..71ea37293ed 100644 --- a/commands/docs/into_sqlite.md +++ b/src/content/docs/commands/docs/into_sqlite.md @@ -9,6 +9,7 @@ usage: | Convert table into a SQLite database. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for conversions @@ -17,16 +18,15 @@ feature: default ## Signature -```> into sqlite {flags} (file-name)``` +`> into sqlite {flags} (file-name)` ## Flags - - `--table-name, -t {string}`: Specify table name to store the data in +- `--table-name, -t {string}`: Specify table name to store the data in ## Parameters - - `file-name`: Specify the filename to save the database to. - +- `file-name`: Specify the filename to save the database to. ## Input/output types: @@ -34,27 +34,32 @@ feature: default | ------ | ------- | | record | nothing | | table | nothing | + ## Examples Convert ls entries into a SQLite database with 'main' as the table name + ```nu > ls | into sqlite my_ls.db ``` Convert ls entries into a SQLite database with 'my_table' as the table name + ```nu > ls | into sqlite my_ls.db -t my_table ``` Convert table literal into a SQLite database with 'main' as the table name + ```nu > [[name]; [-----] [someone] [=====] [somename] ['(((((']] | into sqlite filename.db ``` Insert a single record into a SQLite database + ```nu > { foo: bar, baz: quux } | into sqlite filename.db diff --git a/commands/docs/into_string.md b/src/content/docs/commands/docs/into_string.md similarity index 70% rename from commands/docs/into_string.md rename to src/content/docs/commands/docs/into_string.md index a53a6d43776..867ad47ebbf 100644 --- a/commands/docs/into_string.md +++ b/src/content/docs/commands/docs/into_string.md @@ -9,6 +9,7 @@ usage: | Convert value to string. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for conversions @@ -17,95 +18,106 @@ feature: default ## Signature -```> into string {flags} ...rest``` +`> into string {flags} ...rest` ## Flags - - `--decimals, -d {int}`: decimal digits to which to round +- `--decimals, -d {int}`: decimal digits to which to round ## Parameters - - `...rest`: For a data structure input, convert data at the given cell paths. - +- `...rest`: For a data structure input, convert data at the given cell paths. ## Input/output types: -| input | output | -| --------- | ------------ | -| binary | string | -| bool | string | -| datetime | string | -| duration | string | -| filesize | string | -| int | string | +| input | output | +| ----------- | -------------- | +| binary | string | +| bool | string | +| datetime | string | +| duration | string | +| filesize | string | +| int | string | | list\<any\> | list\<string\> | -| number | string | -| record | record | -| string | string | -| table | table | +| number | string | +| record | record | +| string | string | +| table | table | + ## Examples convert int to string and append three decimal places + ```nu > 5 | into string --decimals 3 5.000 ``` convert float to string and round to nearest integer + ```nu > 1.7 | into string --decimals 0 2 ``` convert float to string + ```nu > 1.7 | into string --decimals 1 1.7 ``` convert float to string and limit to 2 decimals + ```nu > 1.734 | into string --decimals 2 1.73 ``` convert float to string + ```nu > 4.3 | into string 4.3 ``` convert string to string + ```nu > '1234' | into string 1234 ``` convert boolean to string + ```nu > true | into string true ``` convert date to string + ```nu > '2020-10-10 10:00:00 +02:00' | into datetime | into string Sat Oct 10 10:00:00 2020 ``` convert filepath to string + ```nu > ls Cargo.toml | get name | into string ``` convert filesize to string + ```nu > 1KiB | into string 1.0 KiB ``` convert duration to string + ```nu > 9day | into string 1wk 2day diff --git a/commands/docs/into_value.md b/src/content/docs/commands/docs/into_value.md similarity index 89% rename from commands/docs/into_value.md rename to src/content/docs/commands/docs/into_value.md index eaadb417fd5..c2773189002 100644 --- a/commands/docs/into_value.md +++ b/src/content/docs/commands/docs/into_value.md @@ -9,6 +9,7 @@ usage: | Infer nushell datatype for each cell. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,12 +18,11 @@ feature: default ## Signature -```> into value {flags} ``` +`> into value {flags} ` ## Flags - - `--columns, -c {table}`: list of columns to update - +- `--columns, -c {table}`: list of columns to update ## Input/output types: @@ -33,12 +33,14 @@ feature: default ## Examples Infer Nushell values for each cell. + ```nu > $table | into value ``` Infer Nushell values for each cell in the given columns. + ```nu > $table | into value -c [column1, column5] diff --git a/commands/docs/is-admin.md b/src/content/docs/commands/docs/is-admin.md similarity index 96% rename from commands/docs/is-admin.md rename to src/content/docs/commands/docs/is-admin.md index a58f433a722..a16ab5dd9d9 100644 --- a/commands/docs/is-admin.md +++ b/src/content/docs/commands/docs/is-admin.md @@ -9,6 +9,7 @@ usage: | Check if nushell is running with administrator or root privileges. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,8 +18,7 @@ feature: default ## Signature -```> is-admin {flags} ``` - +`> is-admin {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Return 'iamroot' if nushell is running with admin/root privileges, and 'iamnotroot' if not. + ```nu > if (is-admin) { "iamroot" } else { "iamnotroot" } iamnotroot diff --git a/commands/docs/is-empty.md b/src/content/docs/commands/docs/is-empty.md similarity index 88% rename from commands/docs/is-empty.md rename to src/content/docs/commands/docs/is-empty.md index f067682b7cc..ecbcf71364d 100644 --- a/commands/docs/is-empty.md +++ b/src/content/docs/commands/docs/is-empty.md @@ -9,6 +9,7 @@ usage: | Check for empty values. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,12 +18,11 @@ feature: default ## Signature -```> is-empty {flags} ...rest``` +`> is-empty {flags} ...rest` ## Parameters - - `...rest`: The names of the columns to check emptiness. - +- `...rest`: The names of the columns to check emptiness. ## Input/output types: @@ -33,18 +33,21 @@ feature: default ## Examples Check if a string is empty + ```nu > '' | is-empty true ``` Check if a list is empty + ```nu > [] | is-empty true ``` Check if more than one column are empty + ```nu > [[meal size]; [arepa small] [taco '']] | is-empty meal size false diff --git a/commands/docs/is-terminal.md b/src/content/docs/commands/docs/is-terminal.md similarity index 81% rename from commands/docs/is-terminal.md rename to src/content/docs/commands/docs/is-terminal.md index 398cfa9f467..3d8f00d97c4 100644 --- a/commands/docs/is-terminal.md +++ b/src/content/docs/commands/docs/is-terminal.md @@ -9,6 +9,7 @@ usage: | Check if stdin, stdout, or stderr is a terminal. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for platform @@ -17,14 +18,13 @@ feature: default ## Signature -```> is-terminal {flags} ``` +`> is-terminal {flags} ` ## Flags - - `--stdin, -i`: Check if stdin is a terminal - - `--stdout, -o`: Check if stdout is a terminal - - `--stderr, -e`: Check if stderr is a terminal - +- `--stdin, -i`: Check if stdin is a terminal +- `--stdout, -o`: Check if stdout is a terminal +- `--stderr, -e`: Check if stderr is a terminal ## Input/output types: @@ -35,6 +35,7 @@ feature: default ## Examples Return "terminal attached" if standard input is attached to a terminal, and "no terminal" if not. + ```nu > if (is-terminal --stdin) { "terminal attached" } else { "no terminal" } terminal attached diff --git a/commands/docs/items.md b/src/content/docs/commands/docs/items.md similarity index 88% rename from commands/docs/items.md rename to src/content/docs/commands/docs/items.md index 3cef5567951..1538ac8ae47 100644 --- a/commands/docs/items.md +++ b/src/content/docs/commands/docs/items.md @@ -9,6 +9,7 @@ usage: | Given a record, iterate on each pair of column name and associated value. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,12 +18,11 @@ feature: default ## Signature -```> items {flags} (closure)``` +`> items {flags} (closure)` ## Parameters - - `closure`: The closure to run. - +- `closure`: The closure to run. ## Input/output types: @@ -33,6 +33,7 @@ feature: default ## Examples Iterate over each key-value pair of a record + ```nu > { new: york, san: francisco } | items {|key, value| echo $'($key) ($value)' } ╭───┬───────────────╮ @@ -43,4 +44,5 @@ Iterate over each key-value pair of a record ``` ## Notes -This is a the fusion of `columns`, `values` and `each`. \ No newline at end of file + +This is a the fusion of `columns`, `values` and `each`. diff --git a/commands/docs/join.md b/src/content/docs/commands/docs/join.md similarity index 65% rename from commands/docs/join.md rename to src/content/docs/commands/docs/join.md index e00f65a97ed..8752cd49ca7 100644 --- a/commands/docs/join.md +++ b/src/content/docs/commands/docs/join.md @@ -9,6 +9,7 @@ usage: | Join two tables. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,21 +18,20 @@ feature: default ## Signature -```> join {flags} (right-table) (left-on) (right-on)``` +`> join {flags} (right-table) (left-on) (right-on)` ## Flags - - `--inner, -i`: Inner join (default) - - `--left, -l`: Left-outer join - - `--right, -r`: Right-outer join - - `--outer, -o`: Outer join +- `--inner, -i`: Inner join (default) +- `--left, -l`: Left-outer join +- `--right, -r`: Right-outer join +- `--outer, -o`: Outer join ## Parameters - - `right-table`: The right table in the join. - - `left-on`: Name of column in input (left) table to join on. - - `right-on`: Name of column in right table to join on. Defaults to same column as left table. - +- `right-table`: The right table in the join. +- `left-on`: Name of column in input (left) table to join on. +- `right-on`: Name of column in right table to join on. Defaults to same column as left table. ## Input/output types: @@ -42,6 +42,7 @@ feature: default ## Examples Join two tables + ```nu > [{a: 1 b: 2}] | join [{a: 1 c: 3}] a ╭───┬───┬───┬───╮ diff --git a/src/content/docs/commands/docs/keybindings.md b/src/content/docs/commands/docs/keybindings.md new file mode 100644 index 00000000000..a5395b00ac9 --- /dev/null +++ b/src/content/docs/commands/docs/keybindings.md @@ -0,0 +1,42 @@ +--- +title: keybindings +categories: | + platform +version: 0.90.0 +platform: | + Keybindings related commands. +usage: | + Keybindings related commands. +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for platform + +<div class='command-title'>{{ $frontmatter.platform }}</div> + +## Signature + +`> keybindings {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +For more information on input and keybindings, check: +https://www.nushell.sh/book/line_editor.html + +## Subcommands: + +| name | type | usage | +| ----------------------------------------------------------- | ------- | -------------------------------------------------------------- | +| [`keybindings default`](/commands/docs/keybindings_default) | Builtin | List default keybindings. | +| [`keybindings list`](/commands/docs/keybindings_list) | Builtin | List available options that can be used to create keybindings. | +| [`keybindings listen`](/commands/docs/keybindings_listen) | Builtin | Get input from the user. | diff --git a/commands/docs/keybindings_default.md b/src/content/docs/commands/docs/keybindings_default.md similarity index 94% rename from commands/docs/keybindings_default.md rename to src/content/docs/commands/docs/keybindings_default.md index 2904be0b831..5409e05c4ed 100644 --- a/commands/docs/keybindings_default.md +++ b/src/content/docs/commands/docs/keybindings_default.md @@ -9,6 +9,7 @@ usage: | List default keybindings. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for platform @@ -17,8 +18,7 @@ feature: default ## Signature -```> keybindings default {flags} ``` - +`> keybindings default {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Get list with default keybindings + ```nu > keybindings default diff --git a/commands/docs/keybindings_list.md b/src/content/docs/commands/docs/keybindings_list.md similarity index 77% rename from commands/docs/keybindings_list.md rename to src/content/docs/commands/docs/keybindings_list.md index b36873f6af3..7b746d8edc0 100644 --- a/commands/docs/keybindings_list.md +++ b/src/content/docs/commands/docs/keybindings_list.md @@ -9,6 +9,7 @@ usage: | List available options that can be used to create keybindings. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for platform @@ -17,16 +18,15 @@ feature: default ## Signature -```> keybindings list {flags} ``` +`> keybindings list {flags} ` ## Flags - - `--modifiers, -m`: list of modifiers - - `--keycodes, -k`: list of keycodes - - `--modes, -o`: list of edit modes - - `--events, -e`: list of reedline event - - `--edits, -d`: list of edit commands - +- `--modifiers, -m`: list of modifiers +- `--keycodes, -k`: list of keycodes +- `--modes, -o`: list of edit modes +- `--events, -e`: list of reedline event +- `--edits, -d`: list of edit commands ## Input/output types: @@ -37,18 +37,21 @@ feature: default ## Examples Get list of key modifiers + ```nu > keybindings list --modifiers ``` Get list of reedline events and edit commands + ```nu > keybindings list -e -d ``` Get list with all the available options + ```nu > keybindings list diff --git a/commands/docs/keybindings_listen.md b/src/content/docs/commands/docs/keybindings_listen.md similarity index 91% rename from commands/docs/keybindings_listen.md rename to src/content/docs/commands/docs/keybindings_listen.md index 4ef9ed049d2..12fc70230f6 100644 --- a/commands/docs/keybindings_listen.md +++ b/src/content/docs/commands/docs/keybindings_listen.md @@ -9,6 +9,7 @@ usage: | Get input from the user. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for platform @@ -17,8 +18,7 @@ feature: default ## Signature -```> keybindings listen {flags} ``` - +`> keybindings listen {flags} ` ## Input/output types: @@ -29,10 +29,12 @@ feature: default ## Examples Type and see key event codes + ```nu > keybindings listen ``` ## Notes -This is an internal debugging tool. For better output, try `input listen --types [key]` \ No newline at end of file + +This is an internal debugging tool. For better output, try `input listen --types [key]` diff --git a/commands/docs/kill.md b/src/content/docs/commands/docs/kill.md similarity index 68% rename from commands/docs/kill.md rename to src/content/docs/commands/docs/kill.md index 9bcd813d35a..20b050d3d38 100644 --- a/commands/docs/kill.md +++ b/src/content/docs/commands/docs/kill.md @@ -9,6 +9,7 @@ usage: | Kill a process using the process id. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for platform @@ -17,19 +18,18 @@ feature: default ## Signature -```> kill {flags} (pid) ...rest``` +`> kill {flags} (pid) ...rest` ## Flags - - `--force, -f`: forcefully kill the process - - `--quiet, -q`: won't print anything to the console - - `--signal, -s {int}`: signal decimal number to be sent instead of the default 15 (unsupported on Windows) +- `--force, -f`: forcefully kill the process +- `--quiet, -q`: won't print anything to the console +- `--signal, -s {int}`: signal decimal number to be sent instead of the default 15 (unsupported on Windows) ## Parameters - - `pid`: Process id of process that is to be killed. - - `...rest`: Rest of processes to kill. - +- `pid`: Process id of process that is to be killed. +- `...rest`: Rest of processes to kill. ## Input/output types: @@ -40,18 +40,21 @@ feature: default ## Examples Kill the pid using the most memory + ```nu > ps | sort-by mem | last | kill $in.pid ``` Force kill a given pid + ```nu > kill --force 12345 ``` Send INT signal + ```nu > kill -s 2 12345 diff --git a/commands/docs/last.md b/src/content/docs/commands/docs/last.md similarity index 86% rename from commands/docs/last.md rename to src/content/docs/commands/docs/last.md index 4561dca04e7..2d73769ed1b 100644 --- a/commands/docs/last.md +++ b/src/content/docs/commands/docs/last.md @@ -9,6 +9,7 @@ usage: | Return only the last several rows of the input. Counterpart of `first`. Opposite of `drop`. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,22 +18,23 @@ feature: default ## Signature -```> last {flags} (rows)``` +`> last {flags} (rows)` ## Parameters - - `rows`: Starting from the back, the number of rows to return. - +- `rows`: Starting from the back, the number of rows to return. ## Input/output types: -| input | output | -| --------- | ------ | -| binary | binary | +| input | output | +| ----------- | ------ | +| binary | binary | | list\<any\> | any | + ## Examples Return the last 2 items of a list/table + ```nu > [1,2,3] | last 2 ╭───┬───╮ @@ -43,12 +45,14 @@ Return the last 2 items of a list/table ``` Return the last item of a list/table + ```nu > [1,2,3] | last 3 ``` Return the last 2 bytes of a binary value + ```nu > 0x[01 23 45] | last 2 Length: 2 (0x2) bytes | printable whitespace ascii_other non_ascii diff --git a/commands/docs/lazy_make.md b/src/content/docs/commands/docs/lazy_make.md similarity index 68% rename from commands/docs/lazy_make.md rename to src/content/docs/commands/docs/lazy_make.md index cb5bb47645f..4af9433b7c6 100644 --- a/commands/docs/lazy_make.md +++ b/src/content/docs/commands/docs/lazy_make.md @@ -9,6 +9,7 @@ usage: | Create a lazy record. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,13 +18,12 @@ feature: default ## Signature -```> lazy make {flags} ``` +`> lazy make {flags} ` ## Flags - - `--columns, -c {list<string>}`: Closure that gets called when the LazyRecord needs to list the available column names - - `--get-value, -g {closure(string)}`: Closure to call when a value needs to be produced on demand - +- `--columns, -c {list<string>}`: Closure that gets called when the LazyRecord needs to list the available column names +- `--get-value, -g {closure(string)}`: Closure to call when a value needs to be produced on demand ## Input/output types: @@ -34,20 +34,23 @@ feature: default ## Examples Create a lazy record + ```nu > lazy make --columns ["haskell", "futures", "nushell"] --get-value { |lazything| $lazything + "!" } ``` Test the laziness of lazy records + ```nu > lazy make --columns ["hello"] --get-value { |key| print $"getting ($key)!"; $key | str upcase } ``` ## Notes + Lazy records are special records that only evaluate their values once the property is requested. - For example, when printing a lazy record, all of its fields will be collected. But when accessing - a specific property, only it will be evaluated. +For example, when printing a lazy record, all of its fields will be collected. But when accessing +a specific property, only it will be evaluated. - Note that this is unrelated to the lazyframes feature bundled with dataframes. \ No newline at end of file + Note that this is unrelated to the lazyframes feature bundled with dataframes. diff --git a/commands/docs/length.md b/src/content/docs/commands/docs/length.md similarity index 90% rename from commands/docs/length.md rename to src/content/docs/commands/docs/length.md index fb0220c8d95..3f844758f47 100644 --- a/commands/docs/length.md +++ b/src/content/docs/commands/docs/length.md @@ -9,6 +9,7 @@ usage: | Count the number of items in an input list or rows in a table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,24 +18,25 @@ feature: default ## Signature -```> length {flags} ``` - +`> length {flags} ` ## Input/output types: -| input | output | -| --------- | ------ | +| input | output | +| ----------- | ------ | | list\<any\> | int | ## Examples Count the number of items in a list + ```nu > [1 2 3 4 5] | length 5 ``` Count the number of rows in a table + ```nu > [{a:1 b:2}, {a:2 b:3}] | length 2 diff --git a/commands/docs/let-env.md b/src/content/docs/commands/docs/let-env.md similarity index 81% rename from commands/docs/let-env.md rename to src/content/docs/commands/docs/let-env.md index be362197811..c4e352cac7a 100644 --- a/commands/docs/let-env.md +++ b/src/content/docs/commands/docs/let-env.md @@ -9,6 +9,7 @@ usage: | `let-env FOO = ...` has been removed, use `$env.FOO = ...` instead. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for removed @@ -17,13 +18,12 @@ feature: default ## Signature -```> let-env {flags} (var_name) (initial_value)``` +`> let-env {flags} (var_name) (initial_value)` ## Parameters - - `var_name`: Variable name. - - `initial_value`: Equals sign followed by value. - +- `var_name`: Variable name. +- `initial_value`: Equals sign followed by value. ## Input/output types: diff --git a/commands/docs/let.md b/src/content/docs/commands/docs/let.md similarity index 81% rename from commands/docs/let.md rename to src/content/docs/commands/docs/let.md index 0c180273b65..b744a45d2c3 100644 --- a/commands/docs/let.md +++ b/src/content/docs/commands/docs/let.md @@ -9,6 +9,7 @@ usage: | Create a variable and give it a value. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,13 +18,12 @@ feature: default ## Signature -```> let {flags} (var_name) (initial_value)``` +`> let {flags} (var_name) (initial_value)` ## Parameters - - `var_name`: Variable name. - - `initial_value`: Equals sign followed by value. - +- `var_name`: Variable name. +- `initial_value`: Equals sign followed by value. ## Input/output types: @@ -34,23 +34,27 @@ feature: default ## Examples Set a variable to a value + ```nu > let x = 10 ``` Set a variable to the result of an expression + ```nu > let x = 10 + 100 ``` Set a variable based on the condition + ```nu > let x = if false { -1 } else { 1 } ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/lines.md b/src/content/docs/commands/docs/lines.md similarity index 85% rename from commands/docs/lines.md rename to src/content/docs/commands/docs/lines.md index a1caedb6a8c..646f584e0f7 100644 --- a/commands/docs/lines.md +++ b/src/content/docs/commands/docs/lines.md @@ -9,6 +9,7 @@ usage: | Converts input to lines. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,22 +18,22 @@ feature: default ## Signature -```> lines {flags} ``` +`> lines {flags} ` ## Flags - - `--skip-empty, -s`: skip empty lines - +- `--skip-empty, -s`: skip empty lines ## Input/output types: -| input | output | -| ----- | ------------ | +| input | output | +| ----- | -------------- | | any | list\<string\> | ## Examples Split multi-line string into lines + ```nu > $"two\nlines" | lines ╭───┬───────╮ diff --git a/commands/docs/load-env.md b/src/content/docs/commands/docs/load-env.md similarity index 90% rename from commands/docs/load-env.md rename to src/content/docs/commands/docs/load-env.md index c8bfbd6c5bd..6143e328938 100644 --- a/commands/docs/load-env.md +++ b/src/content/docs/commands/docs/load-env.md @@ -9,6 +9,7 @@ usage: | Loads an environment update from a record. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filesystem @@ -17,12 +18,11 @@ feature: default ## Signature -```> load-env {flags} (update)``` +`> load-env {flags} (update)` ## Parameters - - `update`: The record to use for updates. - +- `update`: The record to use for updates. ## Input/output types: @@ -30,15 +30,18 @@ feature: default | ------- | ------- | | nothing | nothing | | record | nothing | + ## Examples Load variables from an input stream + ```nu > {NAME: ABE, AGE: UNKNOWN} | load-env; $env.NAME ABE ``` Load variables from an argument + ```nu > load-env {NAME: ABE, AGE: UNKNOWN}; $env.NAME ABE diff --git a/commands/docs/loop.md b/src/content/docs/commands/docs/loop.md similarity index 91% rename from commands/docs/loop.md rename to src/content/docs/commands/docs/loop.md index db98ac47063..23f7484c9d0 100644 --- a/commands/docs/loop.md +++ b/src/content/docs/commands/docs/loop.md @@ -9,6 +9,7 @@ usage: | Run a block in a loop. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,12 +18,11 @@ feature: default ## Signature -```> loop {flags} (block)``` +`> loop {flags} (block)` ## Parameters - - `block`: Block to loop. - +- `block`: Block to loop. ## Input/output types: @@ -33,6 +33,7 @@ feature: default ## Examples Loop while a condition is true + ```nu > mut x = 0; loop { if $x > 10 { break }; $x = $x + 1 }; $x 11 diff --git a/commands/docs/ls.md b/src/content/docs/commands/docs/ls.md similarity index 67% rename from commands/docs/ls.md rename to src/content/docs/commands/docs/ls.md index 7fb60f41023..262bb091239 100644 --- a/commands/docs/ls.md +++ b/src/content/docs/commands/docs/ls.md @@ -9,6 +9,7 @@ usage: | List the filenames, sizes, and modification times of items in a directory. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filesystem @@ -17,22 +18,21 @@ feature: default ## Signature -```> ls {flags} (pattern)``` +`> ls {flags} (pattern)` ## Flags - - `--all, -a`: Show hidden files - - `--long, -l`: Get all available columns for each entry (slower; columns are platform-dependent) - - `--short-names, -s`: Only print the file names, and not the path - - `--full-paths, -f`: display paths as absolute paths - - `--du, -d`: Display the apparent directory size ("disk usage") in place of the directory metadata size - - `--directory, -D`: List the specified directory itself instead of its contents - - `--mime-type, -m`: Show mime-type in type column instead of 'file' (based on filenames only; files' contents are not examined) +- `--all, -a`: Show hidden files +- `--long, -l`: Get all available columns for each entry (slower; columns are platform-dependent) +- `--short-names, -s`: Only print the file names, and not the path +- `--full-paths, -f`: display paths as absolute paths +- `--du, -d`: Display the apparent directory size ("disk usage") in place of the directory metadata size +- `--directory, -D`: List the specified directory itself instead of its contents +- `--mime-type, -m`: Show mime-type in type column instead of 'file' (based on filenames only; files' contents are not examined) ## Parameters - - `pattern`: The glob pattern to use. - +- `pattern`: The glob pattern to use. ## Input/output types: @@ -43,48 +43,56 @@ feature: default ## Examples List visible files in the current directory + ```nu > ls ``` List visible files in a subdirectory + ```nu > ls subdir ``` List visible files with full path in the parent directory + ```nu > ls -f .. ``` List Rust files + ```nu > ls *.rs ``` List files and directories whose name do not contain 'bar' + ```nu > ls -s | where name !~ bar ``` List all dirs in your home directory + ```nu > ls -a ~ | where type == dir ``` List all dirs in your home directory which have not been modified in 7 days + ```nu > ls -as ~ | where type == dir and modified < ((date now) - 7day) ``` List given paths and show directories themselves + ```nu > ['/path/to/directory' '/path/to/file'] | each {|| ls -D $in } | flatten diff --git a/commands/docs/match.md b/src/content/docs/commands/docs/match.md similarity index 90% rename from commands/docs/match.md rename to src/content/docs/commands/docs/match.md index 48acb92e185..2c7304e2a33 100644 --- a/commands/docs/match.md +++ b/src/content/docs/commands/docs/match.md @@ -9,6 +9,7 @@ usage: | Conditionally run a block on a matched value. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,13 +18,12 @@ feature: default ## Signature -```> match {flags} (value) (match_block)``` +`> match {flags} (value) (match_block)` ## Parameters - - `value`: Value to check. - - `match_block`: Block to run if check succeeds. - +- `value`: Value to check. +- `match_block`: Block to run if check succeeds. ## Input/output types: @@ -34,36 +34,42 @@ feature: default ## Examples Match on a value in range + ```nu > match 3 { 1..10 => 'yes!' } yes! ``` Match on a field in a record + ```nu > match {a: 100} { {a: $my_value} => { $my_value } } 100 ``` Match with a catch-all + ```nu > match 3 { 1 => { 'yes!' }, _ => { 'no!' } } no! ``` Match against a list + ```nu > match [1, 2, 3] { [$a, $b, $c] => { $a + $b + $c }, _ => 0 } 6 ``` Match against pipeline input + ```nu > {a: {b: 3}} | match $in {{a: { $b }} => ($b + 10) } 13 ``` Match with a guard + ```nu > match [1 2 3] { [$x, ..$y] if $x == 1 => { 'good list' }, diff --git a/src/content/docs/commands/docs/math.md b/src/content/docs/commands/docs/math.md new file mode 100644 index 00000000000..a17b1faa022 --- /dev/null +++ b/src/content/docs/commands/docs/math.md @@ -0,0 +1,65 @@ +--- +title: math +categories: | + math +version: 0.90.0 +math: | + Use mathematical functions as aggregate functions on a list of numbers or tables. +usage: | + Use mathematical functions as aggregate functions on a list of numbers or tables. +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for math + +<div class='command-title'>{{ $frontmatter.math }}</div> + +## Signature + +`> math {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | type | usage | +| ----------------------------------------------- | ------- | ------------------------------------------------------------------------------------- | +| [`math abs`](/commands/docs/math_abs) | Builtin | Returns the absolute value of a number. | +| [`math arccos`](/commands/docs/math_arccos) | Builtin | Returns the arccosine of the number. | +| [`math arccosh`](/commands/docs/math_arccosh) | Builtin | Returns the inverse of the hyperbolic cosine function. | +| [`math arcsin`](/commands/docs/math_arcsin) | Builtin | Returns the arcsine of the number. | +| [`math arcsinh`](/commands/docs/math_arcsinh) | Builtin | Returns the inverse of the hyperbolic sine function. | +| [`math arctan`](/commands/docs/math_arctan) | Builtin | Returns the arctangent of the number. | +| [`math arctanh`](/commands/docs/math_arctanh) | Builtin | Returns the inverse of the hyperbolic tangent function. | +| [`math avg`](/commands/docs/math_avg) | Builtin | Returns the average of a list of numbers. | +| [`math ceil`](/commands/docs/math_ceil) | Builtin | Returns the ceil of a number (smallest integer greater than or equal to that number). | +| [`math cos`](/commands/docs/math_cos) | Builtin | Returns the cosine of the number. | +| [`math cosh`](/commands/docs/math_cosh) | Builtin | Returns the hyperbolic cosine of the number. | +| [`math exp`](/commands/docs/math_exp) | Builtin | Returns e raised to the power of x. | +| [`math floor`](/commands/docs/math_floor) | Builtin | Returns the floor of a number (largest integer less than or equal to that number). | +| [`math ln`](/commands/docs/math_ln) | Builtin | Returns the natural logarithm. Base: (math e). | +| [`math log`](/commands/docs/math_log) | Builtin | Returns the logarithm for an arbitrary base. | +| [`math max`](/commands/docs/math_max) | Builtin | Returns the maximum of a list of values, or of columns in a table. | +| [`math median`](/commands/docs/math_median) | Builtin | Computes the median of a list of numbers. | +| [`math min`](/commands/docs/math_min) | Builtin | Finds the minimum within a list of values or tables. | +| [`math mode`](/commands/docs/math_mode) | Builtin | Returns the most frequent element(s) from a list of numbers or tables. | +| [`math product`](/commands/docs/math_product) | Builtin | Returns the product of a list of numbers or the products of each column of a table. | +| [`math round`](/commands/docs/math_round) | Builtin | Returns the input number rounded to the specified precision. | +| [`math sin`](/commands/docs/math_sin) | Builtin | Returns the sine of the number. | +| [`math sinh`](/commands/docs/math_sinh) | Builtin | Returns the hyperbolic sine of the number. | +| [`math sqrt`](/commands/docs/math_sqrt) | Builtin | Returns the square root of the input number. | +| [`math stddev`](/commands/docs/math_stddev) | Builtin | Returns the standard deviation of a list of numbers, or of each column in a table. | +| [`math sum`](/commands/docs/math_sum) | Builtin | Returns the sum of a list of numbers or of each column in a table. | +| [`math tan`](/commands/docs/math_tan) | Builtin | Returns the tangent of the number. | +| [`math tanh`](/commands/docs/math_tanh) | Builtin | Returns the hyperbolic tangent of the number. | +| [`math variance`](/commands/docs/math_variance) | Builtin | Returns the variance of a list of numbers or of each column in a table. | diff --git a/commands/docs/math_abs.md b/src/content/docs/commands/docs/math_abs.md similarity index 81% rename from commands/docs/math_abs.md rename to src/content/docs/commands/docs/math_abs.md index 5509b9907d6..3220feaef7e 100644 --- a/commands/docs/math_abs.md +++ b/src/content/docs/commands/docs/math_abs.md @@ -9,6 +9,7 @@ usage: | Returns the absolute value of a number. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math @@ -17,20 +18,21 @@ feature: default ## Signature -```> math abs {flags} ``` - +`> math abs {flags} ` ## Input/output types: -| input | output | -| -------------- | -------------- | -| duration | duration | +| input | output | +| ---------------- | ---------------- | +| duration | duration | | list\<duration\> | list\<duration\> | | list\<number\> | list\<number\> | -| number | number | +| number | number | + ## Examples Compute absolute value of each number in a list of numbers + ```nu > [-50 -100.0 25] | math abs ╭───┬────────╮ diff --git a/commands/docs/math_arccos.md b/src/content/docs/commands/docs/math_arccos.md similarity index 65% rename from commands/docs/math_arccos.md rename to src/content/docs/commands/docs/math_arccos.md index 34606049b54..180f57d0bc2 100644 --- a/commands/docs/math_arccos.md +++ b/src/content/docs/commands/docs/math_arccos.md @@ -9,40 +9,43 @@ usage: | Returns the arccosine of the number. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math <div class='command-title'>{{ $frontmatter.math }}</div> - -::: warning - Command `math arccos` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `math arccos` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> math arccos {flags} ``` +`> math arccos {flags} ` ## Flags - - `--degrees, -d`: Return degrees instead of radians - +- `--degrees, -d`: Return degrees instead of radians ## Input/output types: -| input | output | -| ------------ | ----------- | +| input | output | +| -------------- | ------------- | | list\<number\> | list\<float\> | -| number | float | +| number | float | + ## Examples Get the arccosine of 1 + ```nu > 1 | math arccos 0 ``` Get the arccosine of -1 in degrees + ```nu > -1 | math arccos --degrees 180 diff --git a/commands/docs/math_arccosh.md b/src/content/docs/commands/docs/math_arccosh.md similarity index 67% rename from commands/docs/math_arccosh.md rename to src/content/docs/commands/docs/math_arccosh.md index 5a67c382a5c..2e0eae896d9 100644 --- a/commands/docs/math_arccosh.md +++ b/src/content/docs/commands/docs/math_arccosh.md @@ -9,30 +9,32 @@ usage: | Returns the inverse of the hyperbolic cosine function. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math <div class='command-title'>{{ $frontmatter.math }}</div> - -::: warning - Command `math arccosh` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `math arccosh` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: -## Signature -```> math arccosh {flags} ``` +## Signature +`> math arccosh {flags} ` ## Input/output types: -| input | output | -| ------------ | ----------- | +| input | output | +| -------------- | ------------- | | list\<number\> | list\<float\> | -| number | float | +| number | float | + ## Examples Get the arccosh of 1 + ```nu > 1 | math arccosh 0 diff --git a/commands/docs/math_arcsin.md b/src/content/docs/commands/docs/math_arcsin.md similarity index 65% rename from commands/docs/math_arcsin.md rename to src/content/docs/commands/docs/math_arcsin.md index 390774a2b08..9be279b85b7 100644 --- a/commands/docs/math_arcsin.md +++ b/src/content/docs/commands/docs/math_arcsin.md @@ -9,40 +9,43 @@ usage: | Returns the arcsine of the number. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math <div class='command-title'>{{ $frontmatter.math }}</div> - -::: warning - Command `math arcsin` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `math arcsin` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> math arcsin {flags} ``` +`> math arcsin {flags} ` ## Flags - - `--degrees, -d`: Return degrees instead of radians - +- `--degrees, -d`: Return degrees instead of radians ## Input/output types: -| input | output | -| ------------ | ----------- | +| input | output | +| -------------- | ------------- | | list\<number\> | list\<float\> | -| number | float | +| number | float | + ## Examples Get the arcsine of 1 + ```nu > 1 | math arcsin 1.5707963267948966 ``` Get the arcsine of 1 in degrees + ```nu > 1 | math arcsin --degrees 90 diff --git a/commands/docs/math_arcsinh.md b/src/content/docs/commands/docs/math_arcsinh.md similarity index 67% rename from commands/docs/math_arcsinh.md rename to src/content/docs/commands/docs/math_arcsinh.md index 7112824e8b8..46a83d23aa1 100644 --- a/commands/docs/math_arcsinh.md +++ b/src/content/docs/commands/docs/math_arcsinh.md @@ -9,30 +9,32 @@ usage: | Returns the inverse of the hyperbolic sine function. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math <div class='command-title'>{{ $frontmatter.math }}</div> - -::: warning - Command `math arcsinh` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `math arcsinh` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: -## Signature -```> math arcsinh {flags} ``` +## Signature +`> math arcsinh {flags} ` ## Input/output types: -| input | output | -| ------------ | ----------- | +| input | output | +| -------------- | ------------- | | list\<number\> | list\<float\> | -| number | float | +| number | float | + ## Examples Get the arcsinh of 0 + ```nu > 0 | math arcsinh 0 diff --git a/commands/docs/math_arctan.md b/src/content/docs/commands/docs/math_arctan.md similarity index 66% rename from commands/docs/math_arctan.md rename to src/content/docs/commands/docs/math_arctan.md index b1d8ac577cb..321c960ab15 100644 --- a/commands/docs/math_arctan.md +++ b/src/content/docs/commands/docs/math_arctan.md @@ -9,40 +9,43 @@ usage: | Returns the arctangent of the number. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math <div class='command-title'>{{ $frontmatter.math }}</div> - -::: warning - Command `math arctan` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `math arctan` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> math arctan {flags} ``` +`> math arctan {flags} ` ## Flags - - `--degrees, -d`: Return degrees instead of radians - +- `--degrees, -d`: Return degrees instead of radians ## Input/output types: -| input | output | -| ------------ | ----------- | +| input | output | +| -------------- | ------------- | | list\<number\> | list\<float\> | -| number | float | +| number | float | + ## Examples Get the arctangent of 1 + ```nu > 1 | math arctan 0.7853981633974483 ``` Get the arctangent of -1 in degrees + ```nu > -1 | math arctan --degrees -45 diff --git a/commands/docs/math_arctanh.md b/src/content/docs/commands/docs/math_arctanh.md similarity index 67% rename from commands/docs/math_arctanh.md rename to src/content/docs/commands/docs/math_arctanh.md index 1831094a9f8..db7ed065b85 100644 --- a/commands/docs/math_arctanh.md +++ b/src/content/docs/commands/docs/math_arctanh.md @@ -9,30 +9,32 @@ usage: | Returns the inverse of the hyperbolic tangent function. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math <div class='command-title'>{{ $frontmatter.math }}</div> - -::: warning - Command `math arctanh` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `math arctanh` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: -## Signature -```> math arctanh {flags} ``` +## Signature +`> math arctanh {flags} ` ## Input/output types: -| input | output | -| ------------ | ----------- | +| input | output | +| -------------- | ------------- | | list\<number\> | list\<float\> | -| number | float | +| number | float | + ## Examples Get the arctanh of 1 + ```nu > 1 | math arctanh inf diff --git a/commands/docs/math_avg.md b/src/content/docs/commands/docs/math_avg.md similarity index 76% rename from commands/docs/math_avg.md rename to src/content/docs/commands/docs/math_avg.md index 9c772ed4475..8a71e59337f 100644 --- a/commands/docs/math_avg.md +++ b/src/content/docs/commands/docs/math_avg.md @@ -9,6 +9,7 @@ usage: | Returns the average of a list of numbers. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math @@ -17,37 +18,40 @@ feature: default ## Signature -```> math avg {flags} ``` - +`> math avg {flags} ` ## Input/output types: -| input | output | -| -------------- | -------- | -| duration | duration | -| filesize | filesize | +| input | output | +| ---------------- | -------- | +| duration | duration | +| filesize | filesize | | list\<duration\> | duration | | list\<filesize\> | filesize | | list\<number\> | number | -| number | number | -| range | number | -| record | record | -| table | record | +| number | number | +| range | number | +| record | record | +| table | record | + ## Examples Compute the average of a list of numbers + ```nu > [-50 100.0 25] | math avg 25 ``` Compute the average of a list of durations + ```nu > [2sec 1min] | math avg 31sec ``` Compute the average of each column in a table + ```nu > [[a b]; [1 2] [3 4]] | math avg ╭───┬───╮ diff --git a/commands/docs/math_ceil.md b/src/content/docs/commands/docs/math_ceil.md similarity index 86% rename from commands/docs/math_ceil.md rename to src/content/docs/commands/docs/math_ceil.md index 3f33b12c70a..dd80203c79c 100644 --- a/commands/docs/math_ceil.md +++ b/src/content/docs/commands/docs/math_ceil.md @@ -9,6 +9,7 @@ usage: | Returns the ceil of a number (smallest integer greater than or equal to that number). feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math @@ -17,18 +18,19 @@ feature: default ## Signature -```> math ceil {flags} ``` - +`> math ceil {flags} ` ## Input/output types: -| input | output | -| ------------ | --------- | +| input | output | +| -------------- | ----------- | | list\<number\> | list\<int\> | -| number | int | +| number | int | + ## Examples Apply the ceil function to a list of numbers + ```nu > [1.5 2.3 -3.1] | math ceil ╭───┬────╮ diff --git a/commands/docs/math_cos.md b/src/content/docs/commands/docs/math_cos.md similarity index 72% rename from commands/docs/math_cos.md rename to src/content/docs/commands/docs/math_cos.md index 4cfa8a66bd1..55b7cbc04e9 100644 --- a/commands/docs/math_cos.md +++ b/src/content/docs/commands/docs/math_cos.md @@ -9,40 +9,43 @@ usage: | Returns the cosine of the number. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math <div class='command-title'>{{ $frontmatter.math }}</div> - -::: warning - Command `math cos` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `math cos` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> math cos {flags} ``` +`> math cos {flags} ` ## Flags - - `--degrees, -d`: Use degrees instead of radians - +- `--degrees, -d`: Use degrees instead of radians ## Input/output types: -| input | output | -| ------------ | ----------- | +| input | output | +| -------------- | ------------- | | list\<number\> | list\<float\> | -| number | float | +| number | float | + ## Examples Apply the cosine to π + ```nu > 3.141592 | math cos | math round --precision 4 -1 ``` Apply the cosine to a list of angles in degrees + ```nu > [0 90 180 270 360] | math cos --degrees ╭───┬───────╮ diff --git a/commands/docs/math_cosh.md b/src/content/docs/commands/docs/math_cosh.md similarity index 68% rename from commands/docs/math_cosh.md rename to src/content/docs/commands/docs/math_cosh.md index 0b4c93801bf..f1d45289bca 100644 --- a/commands/docs/math_cosh.md +++ b/src/content/docs/commands/docs/math_cosh.md @@ -9,30 +9,32 @@ usage: | Returns the hyperbolic cosine of the number. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math <div class='command-title'>{{ $frontmatter.math }}</div> - -::: warning - Command `math cosh` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `math cosh` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: -## Signature -```> math cosh {flags} ``` +## Signature +`> math cosh {flags} ` ## Input/output types: -| input | output | -| ------------ | ----------- | +| input | output | +| -------------- | ------------- | | list\<number\> | list\<float\> | -| number | float | +| number | float | + ## Examples Apply the hyperbolic cosine to 1 + ```nu > 1 | math cosh 1.5430806348152435 diff --git a/commands/docs/math_exp.md b/src/content/docs/commands/docs/math_exp.md similarity index 69% rename from commands/docs/math_exp.md rename to src/content/docs/commands/docs/math_exp.md index 16dc0023fc3..c459cb211ce 100644 --- a/commands/docs/math_exp.md +++ b/src/content/docs/commands/docs/math_exp.md @@ -9,36 +9,39 @@ usage: | Returns e raised to the power of x. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math <div class='command-title'>{{ $frontmatter.math }}</div> - -::: warning - Command `math exp` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `math exp` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: -## Signature -```> math exp {flags} ``` +## Signature +`> math exp {flags} ` ## Input/output types: -| input | output | -| ------------ | ----------- | +| input | output | +| -------------- | ------------- | | list\<number\> | list\<float\> | -| number | float | +| number | float | + ## Examples Get e raised to the power of zero + ```nu > 0 | math exp 1 ``` Get e (same as 'math e') + ```nu > 1 | math exp 2.718281828459045 diff --git a/commands/docs/math_floor.md b/src/content/docs/commands/docs/math_floor.md similarity index 86% rename from commands/docs/math_floor.md rename to src/content/docs/commands/docs/math_floor.md index e4bf46328c1..5625d305dbb 100644 --- a/commands/docs/math_floor.md +++ b/src/content/docs/commands/docs/math_floor.md @@ -9,6 +9,7 @@ usage: | Returns the floor of a number (largest integer less than or equal to that number). feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math @@ -17,18 +18,19 @@ feature: default ## Signature -```> math floor {flags} ``` - +`> math floor {flags} ` ## Input/output types: -| input | output | -| ------------ | --------- | +| input | output | +| -------------- | ----------- | | list\<number\> | list\<int\> | -| number | int | +| number | int | + ## Examples Apply the floor function to a list of numbers + ```nu > [1.5 2.3 -3.1] | math floor ╭───┬────╮ diff --git a/commands/docs/math_ln.md b/src/content/docs/commands/docs/math_ln.md similarity index 69% rename from commands/docs/math_ln.md rename to src/content/docs/commands/docs/math_ln.md index 2c5eb5d7304..543e035cb19 100644 --- a/commands/docs/math_ln.md +++ b/src/content/docs/commands/docs/math_ln.md @@ -9,30 +9,32 @@ usage: | Returns the natural logarithm. Base: (math e). feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math <div class='command-title'>{{ $frontmatter.math }}</div> - -::: warning - Command `math ln` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `math ln` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: -## Signature -```> math ln {flags} ``` +## Signature +`> math ln {flags} ` ## Input/output types: -| input | output | -| ------------ | ----------- | +| input | output | +| -------------- | ------------- | | list\<number\> | list\<float\> | -| number | float | +| number | float | + ## Examples Get the natural logarithm of e + ```nu > 2.7182818 | math ln | math round --precision 4 1 diff --git a/commands/docs/math_log.md b/src/content/docs/commands/docs/math_log.md similarity index 80% rename from commands/docs/math_log.md rename to src/content/docs/commands/docs/math_log.md index adb9c036b2c..92585c645dd 100644 --- a/commands/docs/math_log.md +++ b/src/content/docs/commands/docs/math_log.md @@ -9,6 +9,7 @@ usage: | Returns the logarithm for an arbitrary base. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math @@ -17,28 +18,30 @@ feature: default ## Signature -```> math log {flags} (base)``` +`> math log {flags} (base)` ## Parameters - - `base`: Base for which the logarithm should be computed. - +- `base`: Base for which the logarithm should be computed. ## Input/output types: -| input | output | -| ------------ | ----------- | +| input | output | +| -------------- | ------------- | | list\<number\> | list\<float\> | -| number | float | +| number | float | + ## Examples Get the logarithm of 100 to the base 10 + ```nu > 100 | math log 10 2 ``` Get the log2 of a list of values + ```nu > [16 8 4] | math log 2 ╭───┬──────╮ diff --git a/commands/docs/math_max.md b/src/content/docs/commands/docs/math_max.md similarity index 84% rename from commands/docs/math_max.md rename to src/content/docs/commands/docs/math_max.md index 7dc061abddf..3b94435d6c9 100644 --- a/commands/docs/math_max.md +++ b/src/content/docs/commands/docs/math_max.md @@ -9,6 +9,7 @@ usage: | Returns the maximum of a list of values, or of columns in a table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math @@ -17,29 +18,31 @@ feature: default ## Signature -```> math max {flags} ``` - +`> math max {flags} ` ## Input/output types: -| input | output | -| -------------- | -------- | +| input | output | +| ---------------- | -------- | | list\<any\> | any | | list\<duration\> | duration | | list\<filesize\> | filesize | | list\<number\> | number | -| range | number | -| record | record | -| table | record | +| range | number | +| record | record | +| table | record | + ## Examples Find the maximum of a list of numbers + ```nu > [-50 100 25] | math max 100 ``` Find the maxima of the columns of a table + ```nu > [{a: 1 b: 3} {a: 2 b: -1}] | math max ╭───┬───╮ @@ -49,6 +52,7 @@ Find the maxima of the columns of a table ``` Find the maximum of a list of dates + ```nu > [2022-02-02 2022-12-30 2012-12-12] | math max Fri, 30 Dec 2022 00:00:00 +0000 (a year ago) diff --git a/commands/docs/math_median.md b/src/content/docs/commands/docs/math_median.md similarity index 83% rename from commands/docs/math_median.md rename to src/content/docs/commands/docs/math_median.md index 29b2acd0922..ee432601d64 100644 --- a/commands/docs/math_median.md +++ b/src/content/docs/commands/docs/math_median.md @@ -9,6 +9,7 @@ usage: | Computes the median of a list of numbers. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math @@ -17,28 +18,30 @@ feature: default ## Signature -```> math median {flags} ``` - +`> math median {flags} ` ## Input/output types: -| input | output | -| -------------- | -------- | +| input | output | +| ---------------- | -------- | | list\<duration\> | duration | | list\<filesize\> | filesize | | list\<number\> | number | -| range | number | -| record | record | -| table | record | +| range | number | +| record | record | +| table | record | + ## Examples Compute the median of a list of numbers + ```nu > [3 8 9 12 12 15] | math median 10.5 ``` Compute the medians of the columns of a table + ```nu > [{a: 1 b: 3} {a: 2 b: -1} {a: -3 b: 5}] | math median ╭───┬───╮ @@ -48,6 +51,7 @@ Compute the medians of the columns of a table ``` Find the median of a list of file sizes + ```nu > [5KB 10MB 200B] | math median 4.9 KiB diff --git a/commands/docs/math_min.md b/src/content/docs/commands/docs/math_min.md similarity index 84% rename from commands/docs/math_min.md rename to src/content/docs/commands/docs/math_min.md index d729a1e626b..657b4e67ff8 100644 --- a/commands/docs/math_min.md +++ b/src/content/docs/commands/docs/math_min.md @@ -9,6 +9,7 @@ usage: | Finds the minimum within a list of values or tables. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math @@ -17,29 +18,31 @@ feature: default ## Signature -```> math min {flags} ``` - +`> math min {flags} ` ## Input/output types: -| input | output | -| -------------- | -------- | +| input | output | +| ---------------- | -------- | | list\<any\> | any | | list\<duration\> | duration | | list\<filesize\> | filesize | | list\<number\> | number | -| range | number | -| record | record | -| table | record | +| range | number | +| record | record | +| table | record | + ## Examples Compute the minimum of a list of numbers + ```nu > [-50 100 25] | math min -50 ``` Compute the minima of the columns of a table + ```nu > [{a: 1 b: 3} {a: 2 b: -1}] | math min ╭───┬────╮ @@ -49,6 +52,7 @@ Compute the minima of the columns of a table ``` Find the minimum of a list of arbitrary values (Warning: Weird) + ```nu > [-50 'hello' true] | math min true diff --git a/commands/docs/math_mode.md b/src/content/docs/commands/docs/math_mode.md similarity index 90% rename from commands/docs/math_mode.md rename to src/content/docs/commands/docs/math_mode.md index 03074f620ae..3aeb313fc6a 100644 --- a/commands/docs/math_mode.md +++ b/src/content/docs/commands/docs/math_mode.md @@ -9,6 +9,7 @@ usage: | Returns the most frequent element(s) from a list of numbers or tables. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math @@ -17,20 +18,21 @@ feature: default ## Signature -```> math mode {flags} ``` - +`> math mode {flags} ` ## Input/output types: -| input | output | -| -------------- | -------------- | +| input | output | +| ---------------- | ---------------- | | list\<duration\> | list\<duration\> | | list\<filesize\> | list\<filesize\> | | list\<number\> | list\<number\> | -| table | record | +| table | record | + ## Examples Compute the mode(s) of a list of numbers + ```nu > [3 3 9 12 12 15] | math mode ╭───┬────╮ @@ -41,6 +43,7 @@ Compute the mode(s) of a list of numbers ``` Compute the mode(s) of the columns of a table + ```nu > [{a: 1 b: 3} {a: 2 b: -1} {a: 1 b: 5}] | math mode ╭───┬────────────╮ diff --git a/commands/docs/math_product.md b/src/content/docs/commands/docs/math_product.md similarity index 83% rename from commands/docs/math_product.md rename to src/content/docs/commands/docs/math_product.md index 95284dd0eaa..a5cc0cdbf08 100644 --- a/commands/docs/math_product.md +++ b/src/content/docs/commands/docs/math_product.md @@ -9,6 +9,7 @@ usage: | Returns the product of a list of numbers or the products of each column of a table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math @@ -17,26 +18,28 @@ feature: default ## Signature -```> math product {flags} ``` - +`> math product {flags} ` ## Input/output types: -| input | output | -| ------------ | ------ | +| input | output | +| -------------- | ------ | | list\<number\> | number | -| range | number | -| record | record | -| table | record | +| range | number | +| record | record | +| table | record | + ## Examples Compute the product of a list of numbers + ```nu > [2 3 3 4] | math product 72 ``` Compute the product of each column in a table + ```nu > [[a b]; [1 2] [3 4]] | math product ╭───┬───╮ diff --git a/commands/docs/math_round.md b/src/content/docs/commands/docs/math_round.md similarity index 86% rename from commands/docs/math_round.md rename to src/content/docs/commands/docs/math_round.md index 9584d10b267..4d49f13ced5 100644 --- a/commands/docs/math_round.md +++ b/src/content/docs/commands/docs/math_round.md @@ -9,6 +9,7 @@ usage: | Returns the input number rounded to the specified precision. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math @@ -17,22 +18,23 @@ feature: default ## Signature -```> math round {flags} ``` +`> math round {flags} ` ## Flags - - `--precision, -p {number}`: digits of precision - +- `--precision, -p {number}`: digits of precision ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<number\> | list\<number\> | -| number | number | +| number | number | + ## Examples Apply the round function to a list of numbers + ```nu > [1.5 2.3 -3.1] | math round ╭───┬────╮ @@ -44,6 +46,7 @@ Apply the round function to a list of numbers ``` Apply the round function with precision specified + ```nu > [1.555 2.333 -3.111] | math round --precision 2 ╭───┬───────╮ @@ -55,6 +58,7 @@ Apply the round function with precision specified ``` Apply negative precision to a list of numbers + ```nu > [123, 123.3, -123.4] | math round --precision -1 ╭───┬──────╮ diff --git a/commands/docs/math_sin.md b/src/content/docs/commands/docs/math_sin.md similarity index 73% rename from commands/docs/math_sin.md rename to src/content/docs/commands/docs/math_sin.md index 6dfdb81926a..7e993387083 100644 --- a/commands/docs/math_sin.md +++ b/src/content/docs/commands/docs/math_sin.md @@ -9,40 +9,43 @@ usage: | Returns the sine of the number. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math <div class='command-title'>{{ $frontmatter.math }}</div> - -::: warning - Command `math sin` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `math sin` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> math sin {flags} ``` +`> math sin {flags} ` ## Flags - - `--degrees, -d`: Use degrees instead of radians - +- `--degrees, -d`: Use degrees instead of radians ## Input/output types: -| input | output | -| ------------ | ----------- | +| input | output | +| -------------- | ------------- | | list\<number\> | list\<float\> | -| number | float | +| number | float | + ## Examples Apply the sine to π/2 + ```nu > 3.141592 / 2 | math sin | math round --precision 4 1 ``` Apply the sine to a list of angles in degrees + ```nu > [0 90 180 270 360] | math sin -d | math round --precision 4 ╭───┬───────╮ diff --git a/commands/docs/math_sinh.md b/src/content/docs/commands/docs/math_sinh.md similarity index 67% rename from commands/docs/math_sinh.md rename to src/content/docs/commands/docs/math_sinh.md index a371fd544c5..f4ffa044994 100644 --- a/commands/docs/math_sinh.md +++ b/src/content/docs/commands/docs/math_sinh.md @@ -9,30 +9,32 @@ usage: | Returns the hyperbolic sine of the number. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math <div class='command-title'>{{ $frontmatter.math }}</div> - -::: warning - Command `math sinh` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `math sinh` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: -## Signature -```> math sinh {flags} ``` +## Signature +`> math sinh {flags} ` ## Input/output types: -| input | output | -| ------------ | ----------- | +| input | output | +| -------------- | ------------- | | list\<number\> | list\<float\> | -| number | float | +| number | float | + ## Examples Apply the hyperbolic sine to 1 + ```nu > 1 | math sinh 1.1752011936438014 diff --git a/commands/docs/math_sqrt.md b/src/content/docs/commands/docs/math_sqrt.md similarity index 84% rename from commands/docs/math_sqrt.md rename to src/content/docs/commands/docs/math_sqrt.md index 07aaf01f12b..e7963dc62fc 100644 --- a/commands/docs/math_sqrt.md +++ b/src/content/docs/commands/docs/math_sqrt.md @@ -9,6 +9,7 @@ usage: | Returns the square root of the input number. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math @@ -17,18 +18,19 @@ feature: default ## Signature -```> math sqrt {flags} ``` - +`> math sqrt {flags} ` ## Input/output types: -| input | output | -| ------------ | ----------- | +| input | output | +| -------------- | ------------- | | list\<number\> | list\<float\> | -| number | float | +| number | float | + ## Examples Compute the square root of each number in a list + ```nu > [9 16] | math sqrt ╭───┬──────╮ diff --git a/commands/docs/math_stddev.md b/src/content/docs/commands/docs/math_stddev.md similarity index 81% rename from commands/docs/math_stddev.md rename to src/content/docs/commands/docs/math_stddev.md index 2964fd3818a..25dea1aa38f 100644 --- a/commands/docs/math_stddev.md +++ b/src/content/docs/commands/docs/math_stddev.md @@ -9,6 +9,7 @@ usage: | Returns the standard deviation of a list of numbers, or of each column in a table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math @@ -17,35 +18,38 @@ feature: default ## Signature -```> math stddev {flags} ``` +`> math stddev {flags} ` ## Flags - - `--sample, -s`: calculate sample standard deviation (i.e. using N-1 as the denominator) - +- `--sample, -s`: calculate sample standard deviation (i.e. using N-1 as the denominator) ## Input/output types: -| input | output | -| ------------ | ------ | +| input | output | +| -------------- | ------ | | list\<number\> | number | -| record | record | -| table | record | +| record | record | +| table | record | + ## Examples Compute the standard deviation of a list of numbers + ```nu > [1 2 3 4 5] | math stddev 1.4142135623730951 ``` Compute the sample standard deviation of a list of numbers + ```nu > [1 2 3 4 5] | math stddev --sample 1.5811388300841898 ``` Compute the standard deviation of each column in a table + ```nu > [[a b]; [1 2] [3 4]] | math stddev ╭───┬───╮ diff --git a/commands/docs/math_sum.md b/src/content/docs/commands/docs/math_sum.md similarity index 83% rename from commands/docs/math_sum.md rename to src/content/docs/commands/docs/math_sum.md index 3cbc0e393c6..8fb0b19d070 100644 --- a/commands/docs/math_sum.md +++ b/src/content/docs/commands/docs/math_sum.md @@ -9,6 +9,7 @@ usage: | Returns the sum of a list of numbers or of each column in a table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math @@ -17,34 +18,37 @@ feature: default ## Signature -```> math sum {flags} ``` - +`> math sum {flags} ` ## Input/output types: -| input | output | -| -------------- | -------- | +| input | output | +| ---------------- | -------- | | list\<duration\> | duration | | list\<filesize\> | filesize | | list\<number\> | number | -| range | number | -| record | record | -| table | record | +| range | number | +| record | record | +| table | record | + ## Examples Sum a list of numbers + ```nu > [1 2 3] | math sum 6 ``` Get the disk usage for the current directory + ```nu > ls | get size | math sum ``` Compute the sum of each column in a table + ```nu > [[a b]; [1 2] [3 4]] | math sum ╭───┬───╮ diff --git a/commands/docs/math_tan.md b/src/content/docs/commands/docs/math_tan.md similarity index 71% rename from commands/docs/math_tan.md rename to src/content/docs/commands/docs/math_tan.md index 6fd6d623712..0de51333f45 100644 --- a/commands/docs/math_tan.md +++ b/src/content/docs/commands/docs/math_tan.md @@ -9,40 +9,43 @@ usage: | Returns the tangent of the number. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math <div class='command-title'>{{ $frontmatter.math }}</div> - -::: warning - Command `math tan` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `math tan` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> math tan {flags} ``` +`> math tan {flags} ` ## Flags - - `--degrees, -d`: Use degrees instead of radians - +- `--degrees, -d`: Use degrees instead of radians ## Input/output types: -| input | output | -| ------------ | ----------- | +| input | output | +| -------------- | ------------- | | list\<number\> | list\<float\> | -| number | float | +| number | float | + ## Examples Apply the tangent to π/4 + ```nu > 3.141592 / 4 | math tan | math round --precision 4 1 ``` Apply the tangent to a list of angles in degrees + ```nu > [-45 0 45] | math tan --degrees ╭───┬───────╮ diff --git a/commands/docs/math_tanh.md b/src/content/docs/commands/docs/math_tanh.md similarity index 64% rename from commands/docs/math_tanh.md rename to src/content/docs/commands/docs/math_tanh.md index 61d64bfc270..24f70b7ea7b 100644 --- a/commands/docs/math_tanh.md +++ b/src/content/docs/commands/docs/math_tanh.md @@ -9,30 +9,32 @@ usage: | Returns the hyperbolic tangent of the number. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math <div class='command-title'>{{ $frontmatter.math }}</div> - -::: warning - Command `math tanh` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `math tanh` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: -## Signature -```> math tanh {flags} ``` +## Signature +`> math tanh {flags} ` ## Input/output types: -| input | output | -| ------------ | ----------- | +| input | output | +| -------------- | ------------- | | list\<number\> | list\<float\> | -| number | float | +| number | float | + ## Examples -Apply the hyperbolic tangent to 10*π +Apply the hyperbolic tangent to 10\*π + ```nu > 3.141592 * 10 | math tanh | math round --precision 4 1 diff --git a/commands/docs/math_variance.md b/src/content/docs/commands/docs/math_variance.md similarity index 80% rename from commands/docs/math_variance.md rename to src/content/docs/commands/docs/math_variance.md index 5f9ee781f4b..38bc8f82e2b 100644 --- a/commands/docs/math_variance.md +++ b/src/content/docs/commands/docs/math_variance.md @@ -9,6 +9,7 @@ usage: | Returns the variance of a list of numbers or of each column in a table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for math @@ -17,35 +18,38 @@ feature: default ## Signature -```> math variance {flags} ``` +`> math variance {flags} ` ## Flags - - `--sample, -s`: calculate sample variance (i.e. using N-1 as the denominator) - +- `--sample, -s`: calculate sample variance (i.e. using N-1 as the denominator) ## Input/output types: -| input | output | -| ------------ | ------ | +| input | output | +| -------------- | ------ | | list\<number\> | number | -| record | record | -| table | record | +| record | record | +| table | record | + ## Examples Get the variance of a list of numbers + ```nu > [1 2 3 4 5] | math variance 2 ``` Get the sample variance of a list of numbers + ```nu > [1 2 3 4 5] | math variance --sample 2.5 ``` Compute the variance of each column in a table + ```nu > [[a b]; [1 2] [3 4]] | math variance ╭───┬───╮ diff --git a/commands/docs/merge.md b/src/content/docs/commands/docs/merge.md similarity index 93% rename from commands/docs/merge.md rename to src/content/docs/commands/docs/merge.md index 719fbd8b1b6..3c892e5f6c6 100644 --- a/commands/docs/merge.md +++ b/src/content/docs/commands/docs/merge.md @@ -9,6 +9,7 @@ usage: | Merge the input with a record or table, overwriting values in matching columns. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,12 +18,11 @@ feature: default ## Signature -```> merge {flags} (value)``` +`> merge {flags} (value)` ## Parameters - - `value`: The new value to merge with. - +- `value`: The new value to merge with. ## Input/output types: @@ -30,9 +30,11 @@ feature: default | ------ | ------ | | record | record | | table | table | + ## Examples Add an 'index' column to the input table + ```nu > [a b c] | wrap name | merge ( [1 2 3] | wrap index ) ╭───┬──────╮ @@ -46,6 +48,7 @@ Add an 'index' column to the input table ``` Merge two records + ```nu > {a: 1, b: 2} | merge {c: 3} ╭───┬───╮ @@ -56,6 +59,7 @@ Merge two records ``` Merge two tables, overwriting overlapping columns + ```nu > [{columnA: A0 columnB: B0}] | merge [{columnA: 'A0*'}] ╭───┬─────────┬─────────╮ @@ -67,8 +71,9 @@ Merge two tables, overwriting overlapping columns ``` ## Notes + You may provide a column structure to merge When merging tables, row 0 of the input table is overwritten with values from row 0 of the provided table, then -repeating this process with row 1, and so on. \ No newline at end of file +repeating this process with row 1, and so on. diff --git a/commands/docs/metadata.md b/src/content/docs/commands/docs/metadata.md similarity index 87% rename from commands/docs/metadata.md rename to src/content/docs/commands/docs/metadata.md index 617adf01b41..003a66e77cd 100644 --- a/commands/docs/metadata.md +++ b/src/content/docs/commands/docs/metadata.md @@ -9,6 +9,7 @@ usage: | Get the metadata for items in the stream. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for debug @@ -17,12 +18,11 @@ feature: default ## Signature -```> metadata {flags} (expression)``` +`> metadata {flags} (expression)` ## Parameters - - `expression`: The expression you want metadata for. - +- `expression`: The expression you want metadata for. ## Input/output types: @@ -33,12 +33,14 @@ feature: default ## Examples Get the metadata of a variable + ```nu > let a = 42; metadata $a ``` Get the metadata of the input + ```nu > ls | metadata diff --git a/commands/docs/mkdir.md b/src/content/docs/commands/docs/mkdir.md similarity index 85% rename from commands/docs/mkdir.md rename to src/content/docs/commands/docs/mkdir.md index 191f7a2cd4c..dc40e3c99aa 100644 --- a/commands/docs/mkdir.md +++ b/src/content/docs/commands/docs/mkdir.md @@ -9,6 +9,7 @@ usage: | Make directories, creates intermediary directories as required. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filesystem @@ -17,16 +18,15 @@ feature: default ## Signature -```> mkdir {flags} ...rest``` +`> mkdir {flags} ...rest` ## Flags - - `--verbose, -v`: print created path(s). +- `--verbose, -v`: print created path(s). ## Parameters - - `...rest`: The name(s) of the path(s) to create. - +- `...rest`: The name(s) of the path(s) to create. ## Input/output types: @@ -37,12 +37,14 @@ feature: default ## Examples Make a directory named foo + ```nu > mkdir foo ``` Make multiple directories and show the paths created + ```nu > mkdir -v foo/bar foo2 diff --git a/commands/docs/mktemp.md b/src/content/docs/commands/docs/mktemp.md similarity index 69% rename from commands/docs/mktemp.md rename to src/content/docs/commands/docs/mktemp.md index eda9211caab..3c9df8d9589 100644 --- a/commands/docs/mktemp.md +++ b/src/content/docs/commands/docs/mktemp.md @@ -9,6 +9,7 @@ usage: | Create temporary files or directories using uutils/coreutils mktemp. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filesystem @@ -17,19 +18,18 @@ feature: default ## Signature -```> mktemp {flags} (template)``` +`> mktemp {flags} (template)` ## Flags - - `--suffix, - {string}`: Append suffix to template; must not contain a slash. - - `--tmpdir-path, -p {path}`: Interpret TEMPLATE relative to tmpdir-path. If tmpdir-path is not set use $TMPDIR - - `--tmpdir, -t`: Interpret TEMPLATE relative to the system temporary directory. - - `--directory, -d`: Create a directory instead of a file. +- `--suffix, - {string}`: Append suffix to template; must not contain a slash. +- `--tmpdir-path, -p {path}`: Interpret TEMPLATE relative to tmpdir-path. If tmpdir-path is not set use $TMPDIR +- `--tmpdir, -t`: Interpret TEMPLATE relative to the system temporary directory. +- `--directory, -d`: Create a directory instead of a file. ## Parameters - - `template`: Optional pattern from which the name of the file or directory is derived. Must contain at least three 'X's in last component. - +- `template`: Optional pattern from which the name of the file or directory is derived. Must contain at least three 'X's in last component. ## Input/output types: @@ -40,24 +40,28 @@ feature: default ## Examples Make a temporary file with the given suffix in the current working directory. + ```nu > mktemp --suffix .txt <WORKING_DIR>/tmp.lekjbhelyx.txt ``` Make a temporary file named testfile.XXX with the 'X's as random characters in the current working directory. + ```nu > mktemp testfile.XXX <WORKING_DIR>/testfile.4kh ``` Make a temporary file with a template in the system temp directory. + ```nu > mktemp -t testfile.XXX /tmp/testfile.4kh ``` Make a temporary directory with randomly generated name in the temporary directory. + ```nu > mktemp -d /tmp/tmp.NMw9fJr8K0 diff --git a/commands/docs/module.md b/src/content/docs/commands/docs/module.md similarity index 83% rename from commands/docs/module.md rename to src/content/docs/commands/docs/module.md index 370e732c1ac..091a779b478 100644 --- a/commands/docs/module.md +++ b/src/content/docs/commands/docs/module.md @@ -9,6 +9,7 @@ usage: | Define a custom module. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,13 +18,12 @@ feature: default ## Signature -```> module {flags} (module) (block)``` +`> module {flags} (module) (block)` ## Parameters - - `module`: Module name or module path. - - `block`: Body of the module if 'module' parameter is not a module path. - +- `module`: Module name or module path. +- `block`: Body of the module if 'module' parameter is not a module path. ## Input/output types: @@ -34,23 +34,27 @@ feature: default ## Examples Define a custom command in a module and call it + ```nu > module spam { export def foo [] { "foo" } }; use spam foo; foo foo ``` Define an environment variable in a module + ```nu > module foo { export-env { $env.FOO = "BAZ" } }; use foo; $env.FOO BAZ ``` Define a custom command that participates in the environment in a module and call it + ```nu > module foo { export def --env bar [] { $env.FOO_BAR = "BAZ" } }; use foo bar; bar; $env.FOO_BAR BAZ ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/move.md b/src/content/docs/commands/docs/move.md similarity index 88% rename from commands/docs/move.md rename to src/content/docs/commands/docs/move.md index 8675d26e5ef..31558989585 100644 --- a/commands/docs/move.md +++ b/src/content/docs/commands/docs/move.md @@ -9,6 +9,7 @@ usage: | Move columns before or after other columns. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,17 +18,16 @@ feature: default ## Signature -```> move {flags} ...rest``` +`> move {flags} ...rest` ## Flags - - `--after, - {string}`: the column that will precede the columns moved - - `--before, - {string}`: the column that will be the next after the columns moved +- `--after, - {string}`: the column that will precede the columns moved +- `--before, - {string}`: the column that will be the next after the columns moved ## Parameters - - `...rest`: The columns to move. - +- `...rest`: The columns to move. ## Input/output types: @@ -35,9 +35,11 @@ feature: default | ------ | ------ | | record | record | | table | table | + ## Examples Move a column before the first column + ```nu > [[name value index]; [foo a 1] [bar b 2] [baz c 3]] | move index --before name ╭───┬──────┬───────╮ @@ -51,6 +53,7 @@ Move a column before the first column ``` Move multiple columns after the last column and reorder them + ```nu > [[name value index]; [foo a 1] [bar b 2] [baz c 3]] | move value name --after index ╭───┬───────┬──────╮ @@ -64,6 +67,7 @@ Move multiple columns after the last column and reorder them ``` Move columns of a record + ```nu > { name: foo, value: a, index: 1 } | move name --before index ╭───────┬─────╮ diff --git a/commands/docs/mut.md b/src/content/docs/commands/docs/mut.md similarity index 84% rename from commands/docs/mut.md rename to src/content/docs/commands/docs/mut.md index 7a663bfd269..57d93564900 100644 --- a/commands/docs/mut.md +++ b/src/content/docs/commands/docs/mut.md @@ -9,6 +9,7 @@ usage: | Create a mutable variable and give it a value. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,13 +18,12 @@ feature: default ## Signature -```> mut {flags} (var_name) (initial_value)``` +`> mut {flags} (var_name) (initial_value)` ## Parameters - - `var_name`: Variable name. - - `initial_value`: Equals sign followed by value. - +- `var_name`: Variable name. +- `initial_value`: Equals sign followed by value. ## Input/output types: @@ -34,29 +34,34 @@ feature: default ## Examples Set a mutable variable to a value, then update it + ```nu > mut x = 10; $x = 12 ``` Upsert a value inside a mutable data structure + ```nu > mut a = {b:{c:1}}; $a.b.c = 2 ``` Set a mutable variable to the result of an expression + ```nu > mut x = 10 + 100 ``` Set a mutable variable based on the condition + ```nu > mut x = if false { -1 } else { 1 } ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/mv.md b/src/content/docs/commands/docs/mv.md similarity index 61% rename from commands/docs/mv.md rename to src/content/docs/commands/docs/mv.md index c5f369ec75d..9abdbf3f27d 100644 --- a/commands/docs/mv.md +++ b/src/content/docs/commands/docs/mv.md @@ -9,6 +9,7 @@ usage: | Move files or directories. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filesystem @@ -17,20 +18,19 @@ feature: default ## Signature -```> mv {flags} (source) (destination)``` +`> mv {flags} (source) (destination)` ## Flags - - `--verbose, -v`: make mv to be verbose, showing files been moved. - - `--force, -f`: overwrite the destination. - - `--interactive, -i`: ask user to confirm action - - `--update, -u`: move only when the SOURCE file is newer than the destination file(with -f) or when the destination file is missing +- `--verbose, -v`: make mv to be verbose, showing files been moved. +- `--force, -f`: overwrite the destination. +- `--interactive, -i`: ask user to confirm action +- `--update, -u`: move only when the SOURCE file is newer than the destination file(with -f) or when the destination file is missing ## Parameters - - `source`: The location to move files/directories from. - - `destination`: The location to move files/directories to. - +- `source`: The location to move files/directories from. +- `destination`: The location to move files/directories to. ## Input/output types: @@ -41,18 +41,21 @@ feature: default ## Examples Rename a file + ```nu > mv before.txt after.txt ``` Move a file into a directory + ```nu > mv test.txt my/subdirectory ``` Move many files into a directory + ```nu > mv *.txt my/subdirectory diff --git a/commands/docs/n.md b/src/content/docs/commands/docs/n.md similarity index 97% rename from commands/docs/n.md rename to src/content/docs/commands/docs/n.md index 24b30a14225..5ff70097517 100644 --- a/commands/docs/n.md +++ b/src/content/docs/commands/docs/n.md @@ -15,17 +15,19 @@ usage: | ## Signature -```> n ``` +`> n ` ## Examples Make two directories and enter new shells for them, use `n` to jump to the next shell + ```nu > mkdir foo bar; enter foo; enter ../bar; n ``` Run `n` several times and note the changes of current directory + ```nu > n diff --git a/commands/docs/nu-check.md b/src/content/docs/commands/docs/nu-check.md similarity index 80% rename from commands/docs/nu-check.md rename to src/content/docs/commands/docs/nu-check.md index e4cf89bc437..d2a040841bb 100644 --- a/commands/docs/nu-check.md +++ b/src/content/docs/commands/docs/nu-check.md @@ -9,6 +9,7 @@ usage: | Validate and parse input content. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,70 +18,78 @@ feature: default ## Signature -```> nu-check {flags} (path)``` +`> nu-check {flags} (path)` ## Flags - - `--as-module, -m`: Parse content as module - - `--debug, -d`: Show error messages - - `--all, -a`: Parse content as script first, returns result if success, otherwise, try with module +- `--as-module, -m`: Parse content as module +- `--debug, -d`: Show error messages +- `--all, -a`: Parse content as script first, returns result if success, otherwise, try with module ## Parameters - - `path`: File path to parse. - +- `path`: File path to parse. ## Input/output types: -| input | output | -| --------- | ------ | +| input | output | +| ----------- | ------ | | list\<any\> | bool | -| string | bool | +| string | bool | + ## Examples Parse a input file as script(Default) + ```nu > nu-check script.nu ``` Parse a input file as module + ```nu > nu-check --as-module module.nu ``` Parse a input file by showing error message + ```nu > nu-check --debug script.nu ``` Parse an external stream as script by showing error message + ```nu > open foo.nu | nu-check --debug script.nu ``` Parse an internal stream as module by showing error message + ```nu > open module.nu | lines | nu-check --debug --as-module module.nu ``` Parse a string as script + ```nu > $'two(char nl)lines' | nu-check ``` Heuristically parse which begins with script first, if it sees a failure, try module afterwards + ```nu > nu-check -a script.nu ``` Heuristically parse by showing error message + ```nu > open foo.nu | lines | nu-check --all --debug diff --git a/commands/docs/nu-highlight.md b/src/content/docs/commands/docs/nu-highlight.md similarity index 95% rename from commands/docs/nu-highlight.md rename to src/content/docs/commands/docs/nu-highlight.md index 1f90223104a..6d51fdc2769 100644 --- a/commands/docs/nu-highlight.md +++ b/src/content/docs/commands/docs/nu-highlight.md @@ -9,6 +9,7 @@ usage: | Syntax highlight the input string. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,8 +18,7 @@ feature: default ## Signature -```> nu-highlight {flags} ``` - +`> nu-highlight {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Describe the type of a string + ```nu > 'let x = 3' | nu-highlight diff --git a/commands/docs/open.md b/src/content/docs/commands/docs/open.md similarity index 85% rename from commands/docs/open.md rename to src/content/docs/commands/docs/open.md index 0295b192e68..cc825aaf96d 100644 --- a/commands/docs/open.md +++ b/src/content/docs/commands/docs/open.md @@ -9,6 +9,7 @@ usage: | Load a file into a cell, converting to table if possible (avoid by appending '--raw'). feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filesystem @@ -17,17 +18,16 @@ feature: default ## Signature -```> open {flags} (filename) ...rest``` +`> open {flags} (filename) ...rest` ## Flags - - `--raw, -r`: open file as raw binary +- `--raw, -r`: open file as raw binary ## Parameters - - `filename`: The filename to use. - - `...rest`: Optional additional files to open. - +- `filename`: The filename to use. +- `...rest`: Optional additional files to open. ## Input/output types: @@ -35,37 +35,44 @@ feature: default | ------- | ------ | | nothing | any | | string | any | + ## Examples Open a file, with structure (based on file extension or SQLite database header) + ```nu > open myfile.json ``` Open a file, as raw bytes + ```nu > open myfile.json --raw ``` Open a file, using the input to get filename + ```nu > 'myfile.txt' | open ``` Open a file, and decode it by the specified encoding + ```nu > open myfile.txt --raw | decode utf-8 ``` Create a custom `from` parser to open newline-delimited JSON files with `open` + ```nu > def "from ndjson" [] { from json -o }; open myfile.ndjson ``` ## Notes -Support to automatically parse files with an extension `.xyz` can be provided by a `from xyz` command in scope. \ No newline at end of file + +Support to automatically parse files with an extension `.xyz` can be provided by a `from xyz` command in scope. diff --git a/src/content/docs/commands/docs/overlay.md b/src/content/docs/commands/docs/overlay.md new file mode 100644 index 00000000000..5e7d9515457 --- /dev/null +++ b/src/content/docs/commands/docs/overlay.md @@ -0,0 +1,43 @@ +--- +title: overlay +categories: | + core +version: 0.90.0 +core: | + Commands for manipulating overlays. +usage: | + Commands for manipulating overlays. +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for core + +<div class='command-title'>{{ $frontmatter.core }}</div> + +## Signature + +`> overlay {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +This command is a parser keyword. For details, check: +https://www.nushell.sh/book/thinking_in_nu.html + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | type | usage | +| --------------------------------------------- | ------- | -------------------------------------------- | +| [`overlay hide`](/commands/docs/overlay_hide) | Builtin | Hide an active overlay. | +| [`overlay list`](/commands/docs/overlay_list) | Builtin | List all active overlays. | +| [`overlay new`](/commands/docs/overlay_new) | Builtin | Create an empty overlay. | +| [`overlay use`](/commands/docs/overlay_use) | Builtin | Use definitions from a module as an overlay. | diff --git a/commands/docs/overlay_hide.md b/src/content/docs/commands/docs/overlay_hide.md similarity index 79% rename from commands/docs/overlay_hide.md rename to src/content/docs/commands/docs/overlay_hide.md index cd53f3045f6..f6ebd4a8446 100644 --- a/commands/docs/overlay_hide.md +++ b/src/content/docs/commands/docs/overlay_hide.md @@ -9,6 +9,7 @@ usage: | Hide an active overlay. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,17 +18,16 @@ feature: default ## Signature -```> overlay hide {flags} (name)``` +`> overlay hide {flags} (name)` ## Flags - - `--keep-custom, -k`: Keep all newly added commands and aliases in the next activated overlay. - - `--keep-env, -e {list<string>}`: List of environment variables to keep in the next activated overlay +- `--keep-custom, -k`: Keep all newly added commands and aliases in the next activated overlay. +- `--keep-env, -e {list<string>}`: List of environment variables to keep in the next activated overlay ## Parameters - - `name`: Overlay to hide. - +- `name`: Overlay to hide. ## Input/output types: @@ -38,6 +38,7 @@ feature: default ## Examples Keep a custom command after hiding the overlay + ```nu > module spam { export def foo [] { "foo" } } overlay use spam @@ -49,6 +50,7 @@ Keep a custom command after hiding the overlay ``` Hide an overlay created from a file + ```nu > 'export alias f = "foo"' | save spam.nu overlay use spam.nu @@ -57,6 +59,7 @@ Hide an overlay created from a file ``` Hide the last activated overlay + ```nu > module spam { export-env { $env.FOO = "foo" } } overlay use spam @@ -65,6 +68,7 @@ Hide the last activated overlay ``` Keep the current working directory when removing an overlay + ```nu > overlay new spam cd some-dir @@ -73,5 +77,6 @@ Keep the current working directory when removing an overlay ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/overlay_list.md b/src/content/docs/commands/docs/overlay_list.md similarity index 80% rename from commands/docs/overlay_list.md rename to src/content/docs/commands/docs/overlay_list.md index d68a3be4282..fe116569fe1 100644 --- a/commands/docs/overlay_list.md +++ b/src/content/docs/commands/docs/overlay_list.md @@ -9,6 +9,7 @@ usage: | List all active overlays. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,18 +18,18 @@ feature: default ## Signature -```> overlay list {flags} ``` - +`> overlay list {flags} ` ## Input/output types: -| input | output | -| ------- | ------------ | +| input | output | +| ------- | -------------- | | nothing | list\<string\> | ## Examples Get the last activated overlay + ```nu > module spam { export def foo [] { "foo" } } overlay use spam @@ -37,4 +38,5 @@ spam ``` ## Notes -The overlays are listed in the order they were activated. \ No newline at end of file + +The overlays are listed in the order they were activated. diff --git a/commands/docs/overlay_new.md b/src/content/docs/commands/docs/overlay_new.md similarity index 85% rename from commands/docs/overlay_new.md rename to src/content/docs/commands/docs/overlay_new.md index bd89d2ae10c..bc45f4f0615 100644 --- a/commands/docs/overlay_new.md +++ b/src/content/docs/commands/docs/overlay_new.md @@ -9,6 +9,7 @@ usage: | Create an empty overlay. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,12 +18,11 @@ feature: default ## Signature -```> overlay new {flags} (name)``` +`> overlay new {flags} (name)` ## Parameters - - `name`: Name of the overlay. - +- `name`: Name of the overlay. ## Input/output types: @@ -33,13 +33,15 @@ feature: default ## Examples Create an empty overlay + ```nu > overlay new spam ``` ## Notes + The command will first create an empty module, then add it as an overlay. This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/overlay_use.md b/src/content/docs/commands/docs/overlay_use.md similarity index 76% rename from commands/docs/overlay_use.md rename to src/content/docs/commands/docs/overlay_use.md index b8987cdb3e4..90d774d85f5 100644 --- a/commands/docs/overlay_use.md +++ b/src/content/docs/commands/docs/overlay_use.md @@ -9,6 +9,7 @@ usage: | Use definitions from a module as an overlay. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,18 +18,17 @@ feature: default ## Signature -```> overlay use {flags} (name) (as)``` +`> overlay use {flags} (name) (as)` ## Flags - - `--prefix, -p`: Prepend module name to the imported commands and aliases - - `--reload, -r`: If the overlay already exists, reload its definitions and environment. +- `--prefix, -p`: Prepend module name to the imported commands and aliases +- `--reload, -r`: If the overlay already exists, reload its definitions and environment. ## Parameters - - `name`: Module name to use overlay for. - - `as`: `as` keyword followed by a new name. - +- `name`: Module name to use overlay for. +- `as`: `as` keyword followed by a new name. ## Input/output types: @@ -39,6 +39,7 @@ feature: default ## Examples Create an overlay from a module + ```nu > module spam { export def foo [] { "foo" } } overlay use spam @@ -47,6 +48,7 @@ Create an overlay from a module ``` Create an overlay from a module and rename it + ```nu > module spam { export def foo [] { "foo" } } overlay use spam as spam_new @@ -55,6 +57,7 @@ Create an overlay from a module and rename it ``` Create an overlay with a prefix + ```nu > 'export def foo { "foo" }' overlay use --prefix spam @@ -63,6 +66,7 @@ Create an overlay with a prefix ``` Create an overlay from a file + ```nu > 'export-env { $env.FOO = "foo" }' | save spam.nu overlay use spam.nu @@ -71,5 +75,6 @@ Create an overlay from a file ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/p.md b/src/content/docs/commands/docs/p.md similarity index 97% rename from commands/docs/p.md rename to src/content/docs/commands/docs/p.md index 7cc8289c2e5..53a3626df9e 100644 --- a/commands/docs/p.md +++ b/src/content/docs/commands/docs/p.md @@ -15,17 +15,19 @@ usage: | ## Signature -```> p ``` +`> p ` ## Examples Make two directories and enter new shells for them, use `p` to jump to the previous shell + ```nu > mkdir foo bar; enter foo; enter ../bar; p ``` Run `p` several times and note the changes of current directory + ```nu > p diff --git a/commands/docs/par-each.md b/src/content/docs/commands/docs/par-each.md similarity index 85% rename from commands/docs/par-each.md rename to src/content/docs/commands/docs/par-each.md index 3b7716023e1..f422e5a2a4e 100644 --- a/commands/docs/par-each.md +++ b/src/content/docs/commands/docs/par-each.md @@ -9,6 +9,7 @@ usage: | Run a closure on each row of the input list in parallel, creating a new list with the results. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,34 +18,36 @@ feature: default ## Signature -```> par-each {flags} (closure)``` +`> par-each {flags} (closure)` ## Flags - - `--threads, -t {int}`: the number of threads to use - - `--keep-order, -k`: keep sequence of output same as the order of input +- `--threads, -t {int}`: the number of threads to use +- `--keep-order, -k`: keep sequence of output same as the order of input ## Parameters - - `closure`: The closure to run. - +- `closure`: The closure to run. ## Input/output types: -| input | output | -| --------- | --------- | -| any | any | +| input | output | +| ----------- | ----------- | +| any | any | | list\<any\> | list\<any\> | -| table | list\<any\> | +| table | list\<any\> | + ## Examples Multiplies each number. Note that the list will become arbitrarily disordered. + ```nu > [1 2 3] | par-each {|e| $e * 2 } ``` Multiplies each number, keeping an original order + ```nu > [1 2 3] | par-each --keep-order {|e| $e * 2 } ╭───┬───╮ @@ -56,6 +59,7 @@ Multiplies each number, keeping an original order ``` Enumerate and sort-by can be used to reconstruct the original order + ```nu > 1..3 | enumerate | par-each {|p| update item ($p.item * 2)} | sort-by item | get item ╭───┬───╮ @@ -67,6 +71,7 @@ Enumerate and sort-by can be used to reconstruct the original order ``` Output can still be sorted afterward + ```nu > [foo bar baz] | par-each {|e| $e + '!' } | sort ╭───┬──────╮ @@ -78,6 +83,7 @@ Output can still be sorted afterward ``` Iterate over each element, producing a list showing indexes of any 2s + ```nu > [1 2 3] | enumerate | par-each { |e| if $e.item == 2 { $"found 2 at ($e.index)!"} } ╭───┬───────────────╮ diff --git a/commands/docs/parse.md b/src/content/docs/commands/docs/parse.md similarity index 93% rename from commands/docs/parse.md rename to src/content/docs/commands/docs/parse.md index 7477777cda9..f51e2dada81 100644 --- a/commands/docs/parse.md +++ b/src/content/docs/commands/docs/parse.md @@ -9,6 +9,7 @@ usage: | Parse columns from string data using a simple pattern. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,26 +18,27 @@ feature: default ## Signature -```> parse {flags} (pattern)``` +`> parse {flags} (pattern)` ## Flags - - `--regex, -r`: use full regex syntax for patterns +- `--regex, -r`: use full regex syntax for patterns ## Parameters - - `pattern`: The pattern to match. - +- `pattern`: The pattern to match. ## Input/output types: -| input | output | -| --------- | ------ | +| input | output | +| ----------- | ------ | | list\<any\> | table | -| string | table | +| string | table | + ## Examples Parse a string into two named columns + ```nu > "hi there" | parse "{foo} {bar}" ╭───┬─────┬───────╮ @@ -48,6 +50,7 @@ Parse a string into two named columns ``` Parse a string using regex pattern + ```nu > "hi there" | parse --regex '(?P<foo>\w+) (?P<bar>\w+)' ╭───┬─────┬───────╮ @@ -59,6 +62,7 @@ Parse a string using regex pattern ``` Parse a string using fancy-regex named capture group pattern + ```nu > "foo bar." | parse --regex '\s*(?<name>\w+)(?=\.)' ╭───┬──────╮ @@ -70,6 +74,7 @@ Parse a string using fancy-regex named capture group pattern ``` Parse a string using fancy-regex capture group pattern + ```nu > "foo! bar." | parse --regex '(\w+)(?=\.)|(\w+)(?=!)' ╭───┬──────────┬──────────╮ @@ -82,6 +87,7 @@ Parse a string using fancy-regex capture group pattern ``` Parse a string using fancy-regex look behind pattern + ```nu > " @another(foo bar) " | parse --regex '\s*(?<=[() ])(@\w+)(\([^)]*\))?\s*' ╭───┬──────────┬───────────╮ @@ -93,6 +99,7 @@ Parse a string using fancy-regex look behind pattern ``` Parse a string using fancy-regex look ahead atomic group pattern + ```nu > "abcd" | parse --regex '^a(bc(?=d)|b)cd$' ╭───┬──────────╮ diff --git a/src/content/docs/commands/docs/path.md b/src/content/docs/commands/docs/path.md new file mode 100644 index 00000000000..ae6e62d82c5 --- /dev/null +++ b/src/content/docs/commands/docs/path.md @@ -0,0 +1,58 @@ +--- +title: path +categories: | + path +version: 0.90.0 +path: | + Explore and manipulate paths. +usage: | + Explore and manipulate paths. +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for path + +<div class='command-title'>{{ $frontmatter.path }}</div> + +## Signature + +`> path {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +There are three ways to represent a path: + +- As a path literal, e.g., '/home/viking/spam.txt' +- As a structured path: a table with 'parent', 'stem', and 'extension' (and +- 'prefix' on Windows) columns. This format is produced by the 'path parse' + subcommand. +- As a list of path parts, e.g., '[ / home viking spam.txt ]'. Splitting into + parts is done by the `path split` command. + +All subcommands accept all three variants as an input. Furthermore, the 'path +join' subcommand can be used to join the structured path or path parts back into +the path literal. + +## Subcommands: + +| name | type | usage | +| ----------------------------------------------------- | ------- | ----------------------------------------------------------------------- | +| [`path basename`](/commands/docs/path_basename) | Builtin | Get the final component of a path. | +| [`path dirname`](/commands/docs/path_dirname) | Builtin | Get the parent directory of a path. | +| [`path exists`](/commands/docs/path_exists) | Builtin | Check whether a path exists. | +| [`path expand`](/commands/docs/path_expand) | Builtin | Try to expand a path to its absolute form. | +| [`path join`](/commands/docs/path_join) | Builtin | Join a structured path or a list of path parts. | +| [`path parse`](/commands/docs/path_parse) | Builtin | Convert a path into structured data. | +| [`path relative-to`](/commands/docs/path_relative-to) | Builtin | Express a path as relative to another path. | +| [`path split`](/commands/docs/path_split) | Builtin | Split a path into a list based on the system's path separator. | +| [`path type`](/commands/docs/path_type) | Builtin | Get the type of the object a path refers to (e.g., file, dir, symlink). | diff --git a/commands/docs/path_basename.md b/src/content/docs/commands/docs/path_basename.md similarity index 79% rename from commands/docs/path_basename.md rename to src/content/docs/commands/docs/path_basename.md index 4218900a046..a78060c1801 100644 --- a/commands/docs/path_basename.md +++ b/src/content/docs/commands/docs/path_basename.md @@ -9,6 +9,7 @@ usage: | Get the final component of a path. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for path @@ -17,28 +18,30 @@ feature: default ## Signature -```> path basename {flags} ``` +`> path basename {flags} ` ## Flags - - `--replace, -r {string}`: Return original path with basename replaced by this string - +- `--replace, -r {string}`: Return original path with basename replaced by this string ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| string | string | +| string | string | + ## Examples Get basename of a path + ```nu > '/home/joe/test.txt' | path basename test.txt ``` Get basename of a list of paths + ```nu > [ /home/joe, /home/doe ] | path basename ╭───┬─────╮ @@ -49,6 +52,7 @@ Get basename of a list of paths ``` Replace basename of a path + ```nu > '/home/joe/test.txt' | path basename --replace 'spam.png' /home/joe/spam.png diff --git a/commands/docs/path_dirname.md b/src/content/docs/commands/docs/path_dirname.md similarity index 79% rename from commands/docs/path_dirname.md rename to src/content/docs/commands/docs/path_dirname.md index 28ffa71a5c7..5e447776580 100644 --- a/commands/docs/path_dirname.md +++ b/src/content/docs/commands/docs/path_dirname.md @@ -9,6 +9,7 @@ usage: | Get the parent directory of a path. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for path @@ -17,29 +18,31 @@ feature: default ## Signature -```> path dirname {flags} ``` +`> path dirname {flags} ` ## Flags - - `--replace, -r {string}`: Return original path with dirname replaced by this string - - `--num-levels, -n {int}`: Number of directories to walk up - +- `--replace, -r {string}`: Return original path with dirname replaced by this string +- `--num-levels, -n {int}`: Number of directories to walk up ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| string | string | +| string | string | + ## Examples Get dirname of a path + ```nu > '/home/joe/code/test.txt' | path dirname /home/joe/code ``` Get dirname of a list of paths + ```nu > [ /home/joe/test.txt, /home/doe/test.txt ] | path dirname ╭───┬───────────╮ @@ -50,12 +53,14 @@ Get dirname of a list of paths ``` Walk up two levels + ```nu > '/home/joe/code/test.txt' | path dirname --num-levels 2 /home/joe ``` Replace the part that would be returned with a custom path + ```nu > '/home/joe/code/test.txt' | path dirname --num-levels 2 --replace /home/viking /home/viking/code/test.txt diff --git a/commands/docs/path_exists.md b/src/content/docs/commands/docs/path_exists.md similarity index 83% rename from commands/docs/path_exists.md rename to src/content/docs/commands/docs/path_exists.md index 72663b86c4f..4caf25e6daf 100644 --- a/commands/docs/path_exists.md +++ b/src/content/docs/commands/docs/path_exists.md @@ -9,6 +9,7 @@ usage: | Check whether a path exists. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for path @@ -17,28 +18,30 @@ feature: default ## Signature -```> path exists {flags} ``` +`> path exists {flags} ` ## Flags - - `--no-symlink, -n`: Do not resolve symbolic links - +- `--no-symlink, -n`: Do not resolve symbolic links ## Input/output types: -| input | output | -| ------------ | ---------- | +| input | output | +| -------------- | ------------ | | list\<string\> | list\<bool\> | -| string | bool | +| string | bool | + ## Examples Check if a file exists + ```nu > '/home/joe/todo.txt' | path exists false ``` Check if files in list exist + ```nu > [ /home/joe/todo.txt, /home/doe/todo.txt ] | path exists ╭───┬───────╮ @@ -49,5 +52,6 @@ Check if files in list exist ``` ## Notes + This only checks if it is possible to either `open` or `cd` to the given path. -If you need to distinguish dirs and files, please use `path type`. \ No newline at end of file +If you need to distinguish dirs and files, please use `path type`. diff --git a/commands/docs/path_expand.md b/src/content/docs/commands/docs/path_expand.md similarity index 77% rename from commands/docs/path_expand.md rename to src/content/docs/commands/docs/path_expand.md index dda8922d9d8..e0994b78275 100644 --- a/commands/docs/path_expand.md +++ b/src/content/docs/commands/docs/path_expand.md @@ -9,6 +9,7 @@ usage: | Try to expand a path to its absolute form. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for path @@ -17,35 +18,38 @@ feature: default ## Signature -```> path expand {flags} ``` +`> path expand {flags} ` ## Flags - - `--strict, -s`: Throw an error if the path could not be expanded - - `--no-symlink, -n`: Do not resolve symbolic links - +- `--strict, -s`: Throw an error if the path could not be expanded +- `--no-symlink, -n`: Do not resolve symbolic links ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| string | string | +| string | string | + ## Examples Expand an absolute path + ```nu > '/home/joe/foo/../bar' | path expand /home/joe/bar ``` Expand a relative path + ```nu > 'foo/../bar' | path expand ``` Expand a list of paths + ```nu > [ /foo/../bar, /foo/../baz ] | path expand ╭───┬──────╮ diff --git a/commands/docs/path_join.md b/src/content/docs/commands/docs/path_join.md similarity index 82% rename from commands/docs/path_join.md rename to src/content/docs/commands/docs/path_join.md index 826741d7b5a..23c7a174471 100644 --- a/commands/docs/path_join.md +++ b/src/content/docs/commands/docs/path_join.md @@ -9,6 +9,7 @@ usage: | Join a structured path or a list of path parts. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for path @@ -17,60 +18,67 @@ feature: default ## Signature -```> path join {flags} ...rest``` +`> path join {flags} ...rest` ## Parameters - - `...rest`: Path to append to the input. - +- `...rest`: Path to append to the input. ## Input/output types: -| input | output | -| ------------ | ------------ | -| list\<string\> | string | -| record | string | -| string | string | -| table | list\<string\> | +| input | output | +| -------------- | -------------- | +| list\<string\> | string | +| record | string | +| string | string | +| table | list\<string\> | + ## Examples Append a filename to a path + ```nu > '/home/viking' | path join spam.txt /home/viking/spam.txt ``` Append a filename to a path + ```nu > '/home/viking' | path join spams this_spam.txt /home/viking/spams/this_spam.txt ``` Use relative paths, e.g. '..' will go up one directory + ```nu > '/home/viking' | path join .. folder /home/viking/../folder ``` Use absolute paths, e.g. '/' will bring you to the top level directory + ```nu > '/home/viking' | path join / folder /folder ``` Join a list of parts into a path + ```nu > [ '/' 'home' 'viking' 'spam.txt' ] | path join /home/viking/spam.txt ``` Join a structured path into a path + ```nu > { parent: '/home/viking', stem: 'spam', extension: 'txt' } | path join /home/viking/spam.txt ``` Join a table of structured paths into a list of paths + ```nu > [[ parent stem extension ]; [ '/home/viking' 'spam' 'txt' ]] | path join ╭───┬───────────────────────╮ @@ -80,5 +88,6 @@ Join a table of structured paths into a list of paths ``` ## Notes + Optionally, append an additional path to the result. It is designed to accept -the output of 'path parse' and 'path split' subcommands. \ No newline at end of file +the output of 'path parse' and 'path split' subcommands. diff --git a/commands/docs/path_parse.md b/src/content/docs/commands/docs/path_parse.md similarity index 88% rename from commands/docs/path_parse.md rename to src/content/docs/commands/docs/path_parse.md index e5754d5fdb3..bedb5335246 100644 --- a/commands/docs/path_parse.md +++ b/src/content/docs/commands/docs/path_parse.md @@ -9,6 +9,7 @@ usage: | Convert a path into structured data. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for path @@ -17,22 +18,23 @@ feature: default ## Signature -```> path parse {flags} ``` +`> path parse {flags} ` ## Flags - - `--extension, -e {string}`: Manually supply the extension (without the dot) - +- `--extension, -e {string}`: Manually supply the extension (without the dot) ## Input/output types: -| input | output | -| ------------ | ------ | +| input | output | +| -------------- | ------ | | list\<string\> | table | -| string | record | +| string | record | + ## Examples Parse a path + ```nu > '/home/viking/spam.txt' | path parse ╭───────────┬──────────────╮ @@ -43,12 +45,14 @@ Parse a path ``` Replace a complex extension + ```nu > '/home/viking/spam.tar.gz' | path parse --extension tar.gz | upsert extension { 'txt' } ``` Ignore the extension + ```nu > '/etc/conf.d' | path parse --extension '' ╭───────────┬────────╮ @@ -59,6 +63,7 @@ Ignore the extension ``` Parse all paths in a list + ```nu > [ /home/viking.d /home/spam.txt ] | path parse ╭───┬────────┬────────┬───────────╮ @@ -71,5 +76,6 @@ Parse all paths in a list ``` ## Notes + Each path is split into a table with 'parent', 'stem' and 'extension' fields. -On Windows, an extra 'prefix' column is added. \ No newline at end of file +On Windows, an extra 'prefix' column is added. diff --git a/commands/docs/path_relative-to.md b/src/content/docs/commands/docs/path_relative-to.md similarity index 85% rename from commands/docs/path_relative-to.md rename to src/content/docs/commands/docs/path_relative-to.md index 01f9178d452..b787505d1d9 100644 --- a/commands/docs/path_relative-to.md +++ b/src/content/docs/commands/docs/path_relative-to.md @@ -9,6 +9,7 @@ usage: | Express a path as relative to another path. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for path @@ -17,28 +18,30 @@ feature: default ## Signature -```> path relative-to {flags} (path)``` +`> path relative-to {flags} (path)` ## Parameters - - `path`: Parent shared with the input path. - +- `path`: Parent shared with the input path. ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| string | string | +| string | string | + ## Examples Find a relative path from two absolute paths + ```nu > '/home/viking' | path relative-to '/home' viking ``` Find a relative path from absolute paths in list + ```nu > [ /home/viking, /home/spam ] | path relative-to '/home' ╭───┬────────╮ @@ -49,12 +52,14 @@ Find a relative path from absolute paths in list ``` Find a relative path from two relative paths + ```nu > 'eggs/bacon/sausage/spam' | path relative-to 'eggs/bacon/sausage' spam ``` ## Notes + Can be used only when the input and the argument paths are either both absolute or both relative. The argument path needs to be a parent of the input -path. \ No newline at end of file +path. diff --git a/commands/docs/path_split.md b/src/content/docs/commands/docs/path_split.md similarity index 91% rename from commands/docs/path_split.md rename to src/content/docs/commands/docs/path_split.md index ac6f2c5dfb0..1d742c27296 100644 --- a/commands/docs/path_split.md +++ b/src/content/docs/commands/docs/path_split.md @@ -9,6 +9,7 @@ usage: | Split a path into a list based on the system's path separator. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for path @@ -17,18 +18,19 @@ feature: default ## Signature -```> path split {flags} ``` - +`> path split {flags} ` ## Input/output types: -| input | output | -| ------------ | ------------------ | +| input | output | +| -------------- | ---------------------- | | list\<string\> | list\<list\<string\>\> | -| string | list\<string\> | +| string | list\<string\> | + ## Examples Split a path into parts + ```nu > '/home/viking/spam.txt' | path split ╭───┬──────────╮ @@ -41,6 +43,7 @@ Split a path into parts ``` Split paths in list into parts + ```nu > [ /home/viking/spam.txt /home/viking/eggs.txt ] | path split ╭───┬──────────────────╮ diff --git a/commands/docs/path_type.md b/src/content/docs/commands/docs/path_type.md similarity index 80% rename from commands/docs/path_type.md rename to src/content/docs/commands/docs/path_type.md index 749209b0ae4..9ac259b9a7f 100644 --- a/commands/docs/path_type.md +++ b/src/content/docs/commands/docs/path_type.md @@ -9,6 +9,7 @@ usage: | Get the type of the object a path refers to (e.g., file, dir, symlink). feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for path @@ -17,29 +18,32 @@ feature: default ## Signature -```> path type {flags} ``` - +`> path type {flags} ` ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| string | string | +| string | string | + ## Examples Show type of a filepath + ```nu > '.' | path type dir ``` Show type of a filepaths in a list + ```nu > ls | get name | path type ``` ## Notes + This checks the file system to confirm the path's object type. -If nothing is found, an empty string will be returned. \ No newline at end of file +If nothing is found, an empty string will be returned. diff --git a/commands/docs/port.md b/src/content/docs/commands/docs/port.md similarity index 83% rename from commands/docs/port.md rename to src/content/docs/commands/docs/port.md index 5e662b59636..337785d1b4e 100644 --- a/commands/docs/port.md +++ b/src/content/docs/commands/docs/port.md @@ -9,6 +9,7 @@ usage: | Get a free port from system. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for network @@ -17,13 +18,12 @@ feature: default ## Signature -```> port {flags} (start) (end)``` +`> port {flags} (start) (end)` ## Parameters - - `start`: The start port to scan (inclusive). - - `end`: The end port to scan (inclusive). - +- `start`: The start port to scan (inclusive). +- `end`: The end port to scan (inclusive). ## Input/output types: @@ -34,12 +34,14 @@ feature: default ## Examples get a free port between 3121 and 4000 + ```nu > port 3121 4000 3121 ``` get a free port from system + ```nu > port diff --git a/commands/docs/prepend.md b/src/content/docs/commands/docs/prepend.md similarity index 93% rename from commands/docs/prepend.md rename to src/content/docs/commands/docs/prepend.md index 4870b364b14..df3ae229f6e 100644 --- a/commands/docs/prepend.md +++ b/src/content/docs/commands/docs/prepend.md @@ -9,6 +9,7 @@ usage: | Prepend any number of rows to a table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,22 +18,22 @@ feature: default ## Signature -```> prepend {flags} (row)``` +`> prepend {flags} (row)` ## Parameters - - `row`: The row, list, or table to prepend. - +- `row`: The row, list, or table to prepend. ## Input/output types: -| input | output | -| ----- | --------- | +| input | output | +| ----- | ----------- | | any | list\<any\> | ## Examples prepend a list to an item + ```nu > 0 | prepend [1 2 3] ╭───┬───╮ @@ -45,6 +46,7 @@ prepend a list to an item ``` Prepend a list of strings to a string + ```nu > "a" | prepend ["b"] ╭───┬───╮ @@ -55,6 +57,7 @@ Prepend a list of strings to a string ``` Prepend one int item + ```nu > [1 2 3 4] | prepend 0 ╭───┬───╮ @@ -68,6 +71,7 @@ Prepend one int item ``` Prepend two int items + ```nu > [2 3 4] | prepend [0 1] ╭───┬───╮ @@ -81,6 +85,7 @@ Prepend two int items ``` Prepend ints and strings + ```nu > [2 nu 4 shell] | prepend [0 1 rocks] ╭───┬───────╮ @@ -96,6 +101,7 @@ Prepend ints and strings ``` Prepend a range + ```nu > [3 4] | prepend 0..2 ╭───┬───╮ @@ -109,7 +115,8 @@ Prepend a range ``` ## Notes + Be aware that this command 'unwraps' lists passed to it. So, if you pass a variable to it, and you want the variable's contents to be prepended without being unwrapped, it's wise to pre-emptively wrap the variable in a list, like so: `prepend [$val]`. This way, `prepend` will -only unwrap the outer list, and leave the variable's contents untouched. \ No newline at end of file +only unwrap the outer list, and leave the variable's contents untouched. diff --git a/commands/docs/print.md b/src/content/docs/commands/docs/print.md similarity index 78% rename from commands/docs/print.md rename to src/content/docs/commands/docs/print.md index ed6ab040076..e672b83f547 100644 --- a/commands/docs/print.md +++ b/src/content/docs/commands/docs/print.md @@ -9,6 +9,7 @@ usage: | Print the given values to stdout. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,17 +18,16 @@ feature: default ## Signature -```> print {flags} ...rest``` +`> print {flags} ...rest` ## Flags - - `--no-newline, -n`: print without inserting a newline for the line ending - - `--stderr, -e`: print to stderr instead of stdout +- `--no-newline, -n`: print without inserting a newline for the line ending +- `--stderr, -e`: print to stderr instead of stdout ## Parameters - - `...rest`: the values to print - +- `...rest`: the values to print ## Input/output types: @@ -35,22 +35,26 @@ feature: default | ------- | ------- | | any | nothing | | nothing | nothing | + ## Examples Print 'hello world' + ```nu > print "hello world" ``` Print the sum of 2 and 3 + ```nu > print (2 + 3) ``` ## Notes + Unlike `echo`, this command does not return any value (`print | describe` will return "nothing"). Since this command has no output, there is no point in piping it with other commands. -`print` may be used inside blocks of code (e.g.: hooks) to display text during execution without interfering with the pipeline. \ No newline at end of file +`print` may be used inside blocks of code (e.g.: hooks) to display text during execution without interfering with the pipeline. diff --git a/commands/docs/ps.md b/src/content/docs/commands/docs/ps.md similarity index 92% rename from commands/docs/ps.md rename to src/content/docs/commands/docs/ps.md index 6265374c1cb..e23cbb01a84 100644 --- a/commands/docs/ps.md +++ b/src/content/docs/commands/docs/ps.md @@ -9,6 +9,7 @@ usage: | View information about system processes. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for system @@ -17,12 +18,11 @@ feature: default ## Signature -```> ps {flags} ``` +`> ps {flags} ` ## Flags - - `--long, -l`: list all available columns for each entry - +- `--long, -l`: list all available columns for each entry ## Input/output types: @@ -33,30 +33,35 @@ feature: default ## Examples List the system processes + ```nu > ps ``` List the top 5 system processes with the highest memory usage + ```nu > ps | sort-by mem | last 5 ``` List the top 3 system processes with the highest CPU usage + ```nu > ps | sort-by cpu | last 3 ``` List the system processes with 'nu' in their names + ```nu > ps | where name =~ 'nu' ``` Get the parent process id of the current nu process + ```nu > ps | where pid == $nu.pid | get ppid diff --git a/src/content/docs/commands/docs/query.md b/src/content/docs/commands/docs/query.md new file mode 100644 index 00000000000..872a5462c35 --- /dev/null +++ b/src/content/docs/commands/docs/query.md @@ -0,0 +1,36 @@ +--- +title: query +categories: | + filters +version: 0.90.0 +filters: | + Show all the query commands +usage: | + Show all the query commands +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for filters + +<div class='command-title'>{{ $frontmatter.filters }}</div> + +## Signature + +`> query {flags} ` + +## Input/output types: + +| input | output | +| ----- | ------ | +| any | any | + +## Subcommands: + +| name | type | usage | +| ----------------------------------------- | -------------- | ---------------------------------------------------- | -------------------------- | +| [`query db`](/commands/docs/query_db) | Builtin | Query a database using SQL. | +| [`query json`](/commands/docs/query_json) | Builtin,Plugin | execute json query on json file (open --raw \<file\> | query json 'query string') | +| [`query web`](/commands/docs/query_web) | Builtin,Plugin | execute selector query on html/web | +| [`query xml`](/commands/docs/query_xml) | Builtin,Plugin | execute xpath query on xml | diff --git a/commands/docs/query_db.md b/src/content/docs/commands/docs/query_db.md similarity index 88% rename from commands/docs/query_db.md rename to src/content/docs/commands/docs/query_db.md index 239c755d8b7..259ef2b5d00 100644 --- a/commands/docs/query_db.md +++ b/src/content/docs/commands/docs/query_db.md @@ -9,6 +9,7 @@ usage: | Query a database using SQL. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for database @@ -17,12 +18,11 @@ feature: default ## Signature -```> query db {flags} (SQL)``` +`> query db {flags} (SQL)` ## Parameters - - `SQL`: SQL to execute against the database. - +- `SQL`: SQL to execute against the database. ## Input/output types: @@ -33,6 +33,7 @@ feature: default ## Examples Execute SQL against a SQLite database + ```nu > open foo.db | query db "SELECT * FROM Bar" diff --git a/commands/docs/query_json.md b/src/content/docs/commands/docs/query_json.md similarity index 91% rename from commands/docs/query_json.md rename to src/content/docs/commands/docs/query_json.md index db464c32088..a58d09c8c40 100644 --- a/commands/docs/query_json.md +++ b/src/content/docs/commands/docs/query_json.md @@ -9,6 +9,7 @@ usage: | execute json query on json file (open --raw <file> | query json 'query string') feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,12 +18,11 @@ feature: default ## Signature -```> query json {flags} (query)``` +`> query json {flags} (query)` ## Parameters - - `query`: json query - +- `query`: json query ## Input/output types: diff --git a/commands/docs/query_web.md b/src/content/docs/commands/docs/query_web.md similarity index 79% rename from commands/docs/query_web.md rename to src/content/docs/commands/docs/query_web.md index 83c3bb5cc8e..95157c211f3 100644 --- a/commands/docs/query_web.md +++ b/src/content/docs/commands/docs/query_web.md @@ -9,6 +9,7 @@ usage: | execute selector query on html/web feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for network @@ -17,16 +18,15 @@ feature: default ## Signature -```> query web {flags} ``` +`> query web {flags} ` ## Flags - - `--query, -q {string}`: selector query - - `--as-html, -m`: return the query output as html - - `--attribute, -a {string}`: downselect based on the given attribute - - `--as-table, -t {list<string>}`: find table based on column header list - - `--inspect, -i`: run in inspect mode to provide more information for determining column headers - +- `--query, -q {string}`: selector query +- `--as-html, -m`: return the query output as html +- `--attribute, -a {string}`: downselect based on the given attribute +- `--as-table, -t {list<string>}`: find table based on column header list +- `--inspect, -i`: run in inspect mode to provide more information for determining column headers ## Input/output types: @@ -37,12 +37,14 @@ feature: default ## Examples Retrieve all `<header>` elements from phoronix.com website + ```nu > http get https://phoronix.com | query web --query 'header' | flatten ``` Retrieve a html table from Wikipedia and parse it into a nushell table using table headers as guides + ```nu > http get https://en.wikipedia.org/wiki/List_of_cities_in_India_by_population | query web --as-table [City 'Population(2011)[3]' 'Population(2001)[3][a]' 'State or unionterritory' 'Ref'] @@ -50,12 +52,14 @@ Retrieve a html table from Wikipedia and parse it into a nushell table using tab ``` Pass multiple css selectors to extract several elements within single query, group the query results together and rotate them to create a table + ```nu > http get https://www.nushell.sh | query web --query 'h2, h2 + p' | each {str join} | group 2 | each {rotate --ccw tagline description} | flatten ``` Retrieve a specific html attribute instead of the default text + ```nu > http get https://example.org | query web --query a --attribute href diff --git a/commands/docs/query_xml.md b/src/content/docs/commands/docs/query_xml.md similarity index 89% rename from commands/docs/query_xml.md rename to src/content/docs/commands/docs/query_xml.md index 5758fbd093f..3471653a8c5 100644 --- a/commands/docs/query_xml.md +++ b/src/content/docs/commands/docs/query_xml.md @@ -9,6 +9,7 @@ usage: | execute xpath query on xml feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,12 +18,11 @@ feature: default ## Signature -```> query xml {flags} (query)``` +`> query xml {flags} (query)` ## Parameters - - `query`: xpath query - +- `query`: xpath query ## Input/output types: diff --git a/src/content/docs/commands/docs/random.md b/src/content/docs/commands/docs/random.md new file mode 100644 index 00000000000..ae73e07918e --- /dev/null +++ b/src/content/docs/commands/docs/random.md @@ -0,0 +1,42 @@ +--- +title: random +categories: | + random +version: 0.90.0 +random: | + Generate a random value. +usage: | + Generate a random value. +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for random + +<div class='command-title'>{{ $frontmatter.random }}</div> + +## Signature + +`> random {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | type | usage | +| --------------------------------------------- | ------- | -------------------------------------------------- | +| [`random bool`](/commands/docs/random_bool) | Builtin | Generate a random boolean value. | +| [`random chars`](/commands/docs/random_chars) | Builtin | Generate random chars. | +| [`random dice`](/commands/docs/random_dice) | Builtin | Generate a random dice roll. | +| [`random float`](/commands/docs/random_float) | Builtin | Generate a random float within a range [min..max]. | +| [`random int`](/commands/docs/random_int) | Builtin | Generate a random integer [min..max]. | +| [`random uuid`](/commands/docs/random_uuid) | Builtin | Generate a random uuid4 string. | diff --git a/commands/docs/random_bool.md b/src/content/docs/commands/docs/random_bool.md similarity index 87% rename from commands/docs/random_bool.md rename to src/content/docs/commands/docs/random_bool.md index 415e92a5cbc..dc82d68aaad 100644 --- a/commands/docs/random_bool.md +++ b/src/content/docs/commands/docs/random_bool.md @@ -9,6 +9,7 @@ usage: | Generate a random boolean value. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for random @@ -17,12 +18,11 @@ feature: default ## Signature -```> random bool {flags} ``` +`> random bool {flags} ` ## Flags - - `--bias, -b {number}`: Adjusts the probability of a "true" outcome - +- `--bias, -b {number}`: Adjusts the probability of a "true" outcome ## Input/output types: @@ -33,12 +33,14 @@ feature: default ## Examples Generate a random boolean value + ```nu > random bool ``` Generate a random boolean value with a 75% chance of "true" + ```nu > random bool --bias 0.75 diff --git a/commands/docs/random_chars.md b/src/content/docs/commands/docs/random_chars.md similarity index 89% rename from commands/docs/random_chars.md rename to src/content/docs/commands/docs/random_chars.md index 11851ca9342..81237510548 100644 --- a/commands/docs/random_chars.md +++ b/src/content/docs/commands/docs/random_chars.md @@ -9,6 +9,7 @@ usage: | Generate random chars. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for random @@ -17,12 +18,11 @@ feature: default ## Signature -```> random chars {flags} ``` +`> random chars {flags} ` ## Flags - - `--length, -l {int}`: Number of chars - +- `--length, -l {int}`: Number of chars ## Input/output types: @@ -33,12 +33,14 @@ feature: default ## Examples Generate random chars + ```nu > random chars ``` Generate random chars with specified length + ```nu > random chars --length 20 diff --git a/commands/docs/random_dice.md b/src/content/docs/commands/docs/random_dice.md similarity index 76% rename from commands/docs/random_dice.md rename to src/content/docs/commands/docs/random_dice.md index 7d15f3e7b84..0b5d815ca95 100644 --- a/commands/docs/random_dice.md +++ b/src/content/docs/commands/docs/random_dice.md @@ -9,6 +9,7 @@ usage: | Generate a random dice roll. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for random @@ -17,29 +18,30 @@ feature: default ## Signature -```> random dice {flags} ``` +`> random dice {flags} ` ## Flags - - `--dice, -d {int}`: The amount of dice being rolled - - `--sides, -s {int}`: The amount of sides a die has - +- `--dice, -d {int}`: The amount of dice being rolled +- `--sides, -s {int}`: The amount of sides a die has ## Input/output types: -| input | output | -| ------- | --------- | +| input | output | +| ------- | ----------- | | nothing | list\<any\> | ## Examples Roll 1 dice with 6 sides each + ```nu > random dice ``` Roll 10 dice with 12 sides each + ```nu > random dice --dice 10 --sides 12 diff --git a/commands/docs/random_float.md b/src/content/docs/commands/docs/random_float.md similarity index 93% rename from commands/docs/random_float.md rename to src/content/docs/commands/docs/random_float.md index 9a7c2ec5fa0..9d6b8301b43 100644 --- a/commands/docs/random_float.md +++ b/src/content/docs/commands/docs/random_float.md @@ -9,6 +9,7 @@ usage: | Generate a random float within a range [min..max]. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for random @@ -17,12 +18,11 @@ feature: default ## Signature -```> random float {flags} (range)``` +`> random float {flags} (range)` ## Parameters - - `range`: Range of values. - +- `range`: Range of values. ## Input/output types: @@ -33,24 +33,28 @@ feature: default ## Examples Generate a default float value between 0 and 1 + ```nu > random float ``` Generate a random float less than or equal to 500 + ```nu > random float ..500 ``` Generate a random float greater than or equal to 100000 + ```nu > random float 100000.. ``` Generate a random float between 1.0 and 1.1 + ```nu > random float 1.0..1.1 diff --git a/commands/docs/random_int.md b/src/content/docs/commands/docs/random_int.md similarity index 92% rename from commands/docs/random_int.md rename to src/content/docs/commands/docs/random_int.md index 656d966fd3b..68baf521bc5 100644 --- a/commands/docs/random_int.md +++ b/src/content/docs/commands/docs/random_int.md @@ -9,6 +9,7 @@ usage: | Generate a random integer [min..max]. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for random @@ -17,12 +18,11 @@ feature: default ## Signature -```> random int {flags} (range)``` +`> random int {flags} (range)` ## Parameters - - `range`: Range of values. - +- `range`: Range of values. ## Input/output types: @@ -33,24 +33,28 @@ feature: default ## Examples Generate an unconstrained random integer + ```nu > random int ``` Generate a random integer less than or equal to 500 + ```nu > random int ..500 ``` Generate a random integer greater than or equal to 100000 + ```nu > random int 100000.. ``` Generate a random integer between 1 and 10 + ```nu > random int 1..10 diff --git a/commands/docs/random_uuid.md b/src/content/docs/commands/docs/random_uuid.md similarity index 95% rename from commands/docs/random_uuid.md rename to src/content/docs/commands/docs/random_uuid.md index bbe16868e9e..b82c72a49c6 100644 --- a/commands/docs/random_uuid.md +++ b/src/content/docs/commands/docs/random_uuid.md @@ -9,6 +9,7 @@ usage: | Generate a random uuid4 string. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for random @@ -17,8 +18,7 @@ feature: default ## Signature -```> random uuid {flags} ``` - +`> random uuid {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Generate a random uuid4 string + ```nu > random uuid diff --git a/commands/docs/range.md b/src/content/docs/commands/docs/range.md similarity index 88% rename from commands/docs/range.md rename to src/content/docs/commands/docs/range.md index 617bed47d10..3d0eabcf255 100644 --- a/commands/docs/range.md +++ b/src/content/docs/commands/docs/range.md @@ -9,6 +9,7 @@ usage: | Return only the selected rows. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,22 +18,22 @@ feature: default ## Signature -```> range {flags} (rows)``` +`> range {flags} (rows)` ## Parameters - - `rows`: Range of rows to return. - +- `rows`: Range of rows to return. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | ## Examples Get the last 2 items + ```nu > [0,1,2,3,4,5] | range 4..5 ╭───┬───╮ @@ -43,6 +44,7 @@ Get the last 2 items ``` Get the last 2 items + ```nu > [0,1,2,3,4,5] | range (-2).. ╭───┬───╮ @@ -53,6 +55,7 @@ Get the last 2 items ``` Get the next to last 2 items + ```nu > [0,1,2,3,4,5] | range (-3)..-2 ╭───┬───╮ diff --git a/commands/docs/reduce.md b/src/content/docs/commands/docs/reduce.md similarity index 87% rename from commands/docs/reduce.md rename to src/content/docs/commands/docs/reduce.md index df039ef08d2..4f1e9feda58 100644 --- a/commands/docs/reduce.md +++ b/src/content/docs/commands/docs/reduce.md @@ -9,6 +9,7 @@ usage: | Aggregate a list to a single value using an accumulator closure. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,57 +18,63 @@ feature: default ## Signature -```> reduce {flags} (closure)``` +`> reduce {flags} (closure)` ## Flags - - `--fold, -f {any}`: reduce with initial value +- `--fold, -f {any}`: reduce with initial value ## Parameters - - `closure`: Reducing function. - +- `closure`: Reducing function. ## Input/output types: -| input | output | -| --------- | ------ | +| input | output | +| ----------- | ------ | | list\<any\> | any | -| range | any | -| table | any | +| range | any | +| table | any | + ## Examples Sum values of a list (same as 'math sum') + ```nu > [ 1 2 3 4 ] | reduce {|it, acc| $it + $acc } 10 ``` Sum values of a list, plus their indexes + ```nu > [ 8 7 6 ] | enumerate | reduce --fold 0 {|it, acc| $acc + $it.item + $it.index } 24 ``` Sum values with a starting value (fold) + ```nu > [ 1 2 3 4 ] | reduce --fold 10 {|it, acc| $acc + $it } 20 ``` Replace selected characters in a string with 'X' + ```nu > [ i o t ] | reduce --fold "Arthur, King of the Britons" {|it, acc| $acc | str replace --all $it "X" } ArXhur, KXng Xf Xhe BrXXXns ``` Add ascending numbers to each of the filenames, and join with semicolons. + ```nu > ['foo.gz', 'bar.gz', 'baz.gz'] | enumerate | reduce --fold '' {|str all| $"($all)(if $str.index != 0 {'; '})($str.index + 1)-($str.item)" } 1-foo.gz; 2-bar.gz; 3-baz.gz ``` Concatenate a string with itself, using a range to determine the number of times. + ```nu > let s = "Str"; 0..2 | reduce --fold '' {|it, acc| $acc + $s} StrStrStr diff --git a/commands/docs/register.md b/src/content/docs/commands/docs/register.md similarity index 75% rename from commands/docs/register.md rename to src/content/docs/commands/docs/register.md index 4dc1826a9ca..d3ff0eb0bf0 100644 --- a/commands/docs/register.md +++ b/src/content/docs/commands/docs/register.md @@ -9,6 +9,7 @@ usage: | Register a plugin. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,17 +18,16 @@ feature: default ## Signature -```> register {flags} (plugin) (signature)``` +`> register {flags} (plugin) (signature)` ## Flags - - `--shell, -s {path}`: path of shell used to run plugin (cmd, sh, python, etc) +- `--shell, -s {path}`: path of shell used to run plugin (cmd, sh, python, etc) ## Parameters - - `plugin`: Path of executable for plugin. - - `signature`: Block with signature description as json object. - +- `plugin`: Path of executable for plugin. +- `signature`: Block with signature description as json object. ## Input/output types: @@ -38,17 +38,20 @@ feature: default ## Examples Register `nu_plugin_query` plugin from ~/.cargo/bin/ dir + ```nu > register ~/.cargo/bin/nu_plugin_query ``` Register `nu_plugin_query` plugin from `nu -c` (writes/updates $nu.plugin-path) + ```nu > let plugin = ((which nu).path.0 | path dirname | path join 'nu_plugin_query'); nu -c $'register ($plugin); version' ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/registry_query.md b/src/content/docs/commands/docs/registry_query.md similarity index 51% rename from commands/docs/registry_query.md rename to src/content/docs/commands/docs/registry_query.md index 95a3187c6ca..6c4a4bac7c1 100644 --- a/commands/docs/registry_query.md +++ b/src/content/docs/commands/docs/registry_query.md @@ -8,6 +8,7 @@ system: | usage: | Query the Windows registry. --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for system @@ -16,27 +17,26 @@ usage: | ## Signature -```> registry query {flags} (key) (value)``` +`> registry query {flags} (key) (value)` ## Flags - - `--hkcr, -`: query the hkey_classes_root hive - - `--hkcu, -`: query the hkey_current_user hive - - `--hklm, -`: query the hkey_local_machine hive - - `--hku, -`: query the hkey_users hive - - `--hkpd, -`: query the hkey_performance_data hive - - `--hkpt, -`: query the hkey_performance_text hive - - `--hkpnls, -`: query the hkey_performance_nls_text hive - - `--hkcc, -`: query the hkey_current_config hive - - `--hkdd, -`: query the hkey_dyn_data hive - - `--hkculs, -`: query the hkey_current_user_local_settings hive - - `--no-expand, -u`: do not expand %ENV% placeholders in REG_EXPAND_SZ +- `--hkcr, -`: query the hkey_classes_root hive +- `--hkcu, -`: query the hkey_current_user hive +- `--hklm, -`: query the hkey_local_machine hive +- `--hku, -`: query the hkey_users hive +- `--hkpd, -`: query the hkey_performance_data hive +- `--hkpt, -`: query the hkey_performance_text hive +- `--hkpnls, -`: query the hkey_performance_nls_text hive +- `--hkcc, -`: query the hkey_current_config hive +- `--hkdd, -`: query the hkey_dyn_data hive +- `--hkculs, -`: query the hkey_current_user_local_settings hive +- `--no-expand, -u`: do not expand %ENV% placeholders in REG_EXPAND_SZ ## Parameters - - `key`: registry key to query - - `value`: optionally supply a registry value to query - +- `key`: registry key to query +- `value`: optionally supply a registry value to query ## Input/output types: @@ -47,16 +47,19 @@ usage: | ## Examples Query the HKEY_CURRENT_USER hive + ```nu > registry query --hkcu environment ``` Query the HKEY_LOCAL_MACHINE hive + ```nu > registry query --hklm 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment' ``` ## Notes + Currently supported only on Windows systems. diff --git a/commands/docs/reject.md b/src/content/docs/commands/docs/reject.md similarity index 92% rename from commands/docs/reject.md rename to src/content/docs/commands/docs/reject.md index 582d928dca0..ced8f005cd2 100644 --- a/commands/docs/reject.md +++ b/src/content/docs/commands/docs/reject.md @@ -9,6 +9,7 @@ usage: | Remove the given columns or rows from the table. Opposite of `select`. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,16 +18,15 @@ feature: default ## Signature -```> reject {flags} ...rest``` +`> reject {flags} ...rest` ## Flags - - `--ignore-errors, -i`: ignore missing data (make all cell path members optional) +- `--ignore-errors, -i`: ignore missing data (make all cell path members optional) ## Parameters - - `...rest`: The names of columns to remove from the table. - +- `...rest`: The names of columns to remove from the table. ## Input/output types: @@ -34,15 +34,18 @@ feature: default | ------ | ------ | | record | record | | table | table | + ## Examples Reject a column in the `ls` table + ```nu > ls | reject modified ``` Reject a column in a table + ```nu > [[a, b]; [1, 2]] | reject a ╭───┬───╮ @@ -54,6 +57,7 @@ Reject a column in a table ``` Reject a row in a table + ```nu > [[a, b]; [1, 2] [3, 4]] | reject 1 ╭───┬───┬───╮ @@ -65,6 +69,7 @@ Reject a row in a table ``` Reject the specified field in a record + ```nu > {a: 1, b: 2} | reject a ╭───┬───╮ @@ -73,6 +78,7 @@ Reject the specified field in a record ``` Reject a nested field in a record + ```nu > {a: {b: 3, c: 5}} | reject a.b ╭───┬───────────╮ @@ -83,12 +89,14 @@ Reject a nested field in a record ``` Reject columns by a provided list of columns + ```nu > let cols = [size type];[[name type size]; [Cargo.toml toml 1kb] [Cargo.lock toml 2kb]] | reject $cols ``` Reject columns by a list of columns directly + ```nu > [[name type size]; [Cargo.toml toml 1kb] [Cargo.lock toml 2kb]] | reject ["size", "type"] ╭───┬────────────╮ @@ -101,10 +109,12 @@ Reject columns by a list of columns directly ``` Reject rows by a provided list of rows + ```nu > let rows = [0 2];[[name type size]; [Cargo.toml toml 1kb] [Cargo.lock toml 2kb] [file.json json 3kb]] | reject $rows ``` ## Notes -To remove a quantity of rows or columns, use `skip`, `drop`, or `drop column`. \ No newline at end of file + +To remove a quantity of rows or columns, use `skip`, `drop`, or `drop column`. diff --git a/commands/docs/rename.md b/src/content/docs/commands/docs/rename.md similarity index 90% rename from commands/docs/rename.md rename to src/content/docs/commands/docs/rename.md index a8237132c22..42bf6c2aa12 100644 --- a/commands/docs/rename.md +++ b/src/content/docs/commands/docs/rename.md @@ -9,6 +9,7 @@ usage: | Creates a new table with columns renamed. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,17 +18,16 @@ feature: default ## Signature -```> rename {flags} ...rest``` +`> rename {flags} ...rest` ## Flags - - `--column, -c {record}`: column name to be changed - - `--block, -b {closure(any)}`: A closure to apply changes on each column +- `--column, -c {record}`: column name to be changed +- `--block, -b {closure(any)}`: A closure to apply changes on each column ## Parameters - - `...rest`: The new names for the columns. - +- `...rest`: The new names for the columns. ## Input/output types: @@ -35,9 +35,11 @@ feature: default | ------ | ------ | | record | record | | table | table | + ## Examples Rename a column + ```nu > [[a, b]; [1, 2]] | rename my_column ╭───┬───────────┬───╮ @@ -49,6 +51,7 @@ Rename a column ``` Rename many columns + ```nu > [[a, b, c]; [1, 2, 3]] | rename eggs ham bacon ╭───┬──────┬─────┬───────╮ @@ -60,6 +63,7 @@ Rename many columns ``` Rename a specific column + ```nu > [[a, b, c]; [1, 2, 3]] | rename --column { a: ham } ╭───┬─────┬───┬───╮ @@ -71,6 +75,7 @@ Rename a specific column ``` Rename the fields of a record + ```nu > {a: 1 b: 2} | rename x y ╭───┬───╮ @@ -80,6 +85,7 @@ Rename the fields of a record ``` Rename fields based on a given closure + ```nu > {abc: 1, bbc: 2} | rename --block {str replace --all 'b' 'z'} ╭─────┬───╮ diff --git a/commands/docs/return.md b/src/content/docs/commands/docs/return.md similarity index 82% rename from commands/docs/return.md rename to src/content/docs/commands/docs/return.md index e1d555fffbb..44600d6c32e 100644 --- a/commands/docs/return.md +++ b/src/content/docs/commands/docs/return.md @@ -9,6 +9,7 @@ usage: | Return early from a function. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,12 +18,11 @@ feature: default ## Signature -```> return {flags} (return_value)``` +`> return {flags} (return_value)` ## Parameters - - `return_value`: Optional value to return. - +- `return_value`: Optional value to return. ## Input/output types: @@ -33,11 +33,13 @@ feature: default ## Examples Return early + ```nu > def foo [] { return } ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/reverse.md b/src/content/docs/commands/docs/reverse.md similarity index 91% rename from commands/docs/reverse.md rename to src/content/docs/commands/docs/reverse.md index 71a69b4579b..b57cff5360d 100644 --- a/commands/docs/reverse.md +++ b/src/content/docs/commands/docs/reverse.md @@ -9,6 +9,7 @@ usage: | Reverses the input list or table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,18 +18,18 @@ feature: default ## Signature -```> reverse {flags} ``` - +`> reverse {flags} ` ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | ## Examples Reverse a list + ```nu > [0,1,2,3] | reverse ╭───┬───╮ @@ -41,6 +42,7 @@ Reverse a list ``` Reverse a table + ```nu > [{a: 1} {a: 2}] | reverse ╭───┬───╮ diff --git a/commands/docs/rm.md b/src/content/docs/commands/docs/rm.md similarity index 61% rename from commands/docs/rm.md rename to src/content/docs/commands/docs/rm.md index 05d216765fd..b15a5b1e0b2 100644 --- a/commands/docs/rm.md +++ b/src/content/docs/commands/docs/rm.md @@ -9,6 +9,7 @@ usage: | Remove files and directories. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filesystem @@ -17,23 +18,22 @@ feature: default ## Signature -```> rm {flags} (filename) ...rest``` +`> rm {flags} (filename) ...rest` ## Flags - - `--trash, -t`: move to the platform's trash instead of permanently deleting. not used on android and ios - - `--permanent, -p`: delete permanently, ignoring the 'always_trash' config option. always enabled on android and ios - - `--recursive, -r`: delete subdirectories recursively - - `--force, -f`: suppress error when no file - - `--verbose, -v`: print names of deleted files - - `--interactive, -i`: ask user to confirm action - - `--interactive-once, -I`: ask user to confirm action only once +- `--trash, -t`: move to the platform's trash instead of permanently deleting. not used on android and ios +- `--permanent, -p`: delete permanently, ignoring the 'always_trash' config option. always enabled on android and ios +- `--recursive, -r`: delete subdirectories recursively +- `--force, -f`: suppress error when no file +- `--verbose, -v`: print names of deleted files +- `--interactive, -i`: ask user to confirm action +- `--interactive-once, -I`: ask user to confirm action only once ## Parameters - - `filename`: The file or files you want to remove. - - `...rest`: Additional file path(s) to remove. - +- `filename`: The file or files you want to remove. +- `...rest`: Additional file path(s) to remove. ## Input/output types: @@ -44,30 +44,35 @@ feature: default ## Examples Delete, or move a file to the trash (based on the 'always_trash' config option) + ```nu > rm file.txt ``` Move a file to the trash + ```nu > rm --trash file.txt ``` Delete a file permanently, even if the 'always_trash' config option is true + ```nu > rm --permanent file.txt ``` Delete a file, ignoring 'file not found' errors + ```nu > rm --force file.txt ``` Delete all 0KB files in the current directory + ```nu > ls | where size == 0KB and type == file | each { rm $in.name } | null diff --git a/src/content/docs/commands/docs/roll.md b/src/content/docs/commands/docs/roll.md new file mode 100644 index 00000000000..432da30939d --- /dev/null +++ b/src/content/docs/commands/docs/roll.md @@ -0,0 +1,44 @@ +--- +title: roll +categories: | + filters +version: 0.90.0 +filters: | + Rolling commands for tables. +usage: | + Rolling commands for tables. +feature: extra +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for filters + +<div class='command-title'>{{ $frontmatter.filters }}</div> + +:::caution[warning] +Command `roll` was not included in the official binaries by default, you have to build it with `--features=extra` flag +::: + +## Signature + +`> roll {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | type | usage | +| ----------------------------------------- | ------- | ---------------------------------- | +| [`roll down`](/commands/docs/roll_down) | Builtin | Roll table rows down. | +| [`roll left`](/commands/docs/roll_left) | Builtin | Roll record or table columns left. | +| [`roll right`](/commands/docs/roll_right) | Builtin | Roll table columns right. | +| [`roll up`](/commands/docs/roll_up) | Builtin | Roll table rows up. | diff --git a/commands/docs/roll_down.md b/src/content/docs/commands/docs/roll_down.md similarity index 79% rename from commands/docs/roll_down.md rename to src/content/docs/commands/docs/roll_down.md index 88c280f4059..65049ca1c88 100644 --- a/commands/docs/roll_down.md +++ b/src/content/docs/commands/docs/roll_down.md @@ -9,24 +9,24 @@ usage: | Roll table rows down. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters <div class='command-title'>{{ $frontmatter.filters }}</div> - -::: warning - Command `roll down` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `roll down` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> roll down {flags} ``` +`> roll down {flags} ` ## Flags - - `--by, -b {int}`: Number of rows to roll - +- `--by, -b {int}`: Number of rows to roll ## Input/output types: @@ -37,6 +37,7 @@ feature: extra ## Examples Rolls rows down of a table + ```nu > [[a b]; [1 2] [3 4] [5 6]] | roll down ╭───┬───┬───╮ diff --git a/commands/docs/roll_left.md b/src/content/docs/commands/docs/roll_left.md similarity index 83% rename from commands/docs/roll_left.md rename to src/content/docs/commands/docs/roll_left.md index 48820e99280..0f1e23c0d20 100644 --- a/commands/docs/roll_left.md +++ b/src/content/docs/commands/docs/roll_left.md @@ -9,25 +9,25 @@ usage: | Roll record or table columns left. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters <div class='command-title'>{{ $frontmatter.filters }}</div> - -::: warning - Command `roll left` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `roll left` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> roll left {flags} ``` +`> roll left {flags} ` ## Flags - - `--by, -b {int}`: Number of columns to roll - - `--cells-only, -c`: rotates columns leaving headers fixed - +- `--by, -b {int}`: Number of columns to roll +- `--cells-only, -c`: rotates columns leaving headers fixed ## Input/output types: @@ -35,9 +35,11 @@ feature: extra | ------ | ------ | | record | record | | table | table | + ## Examples Rolls columns of a record to the left + ```nu > {a:1 b:2 c:3} | roll left ╭───┬───╮ @@ -48,6 +50,7 @@ Rolls columns of a record to the left ``` Rolls columns of a table to the left + ```nu > [[a b c]; [1 2 3] [4 5 6]] | roll left ╭───┬───┬───┬───╮ @@ -60,6 +63,7 @@ Rolls columns of a table to the left ``` Rolls columns to the left without changing column names + ```nu > [[a b c]; [1 2 3] [4 5 6]] | roll left --cells-only ╭───┬───┬───┬───╮ diff --git a/commands/docs/roll_right.md b/src/content/docs/commands/docs/roll_right.md similarity index 83% rename from commands/docs/roll_right.md rename to src/content/docs/commands/docs/roll_right.md index aa013f69308..bfc775d6aa1 100644 --- a/commands/docs/roll_right.md +++ b/src/content/docs/commands/docs/roll_right.md @@ -9,25 +9,25 @@ usage: | Roll table columns right. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters <div class='command-title'>{{ $frontmatter.filters }}</div> - -::: warning - Command `roll right` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `roll right` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> roll right {flags} ``` +`> roll right {flags} ` ## Flags - - `--by, -b {int}`: Number of columns to roll - - `--cells-only, -c`: rotates columns leaving headers fixed - +- `--by, -b {int}`: Number of columns to roll +- `--cells-only, -c`: rotates columns leaving headers fixed ## Input/output types: @@ -35,9 +35,11 @@ feature: extra | ------ | ------ | | record | record | | table | table | + ## Examples Rolls columns of a record to the right + ```nu > {a:1 b:2 c:3} | roll right ╭───┬───╮ @@ -48,6 +50,7 @@ Rolls columns of a record to the right ``` Rolls columns to the right + ```nu > [[a b c]; [1 2 3] [4 5 6]] | roll right ╭───┬───┬───┬───╮ @@ -60,6 +63,7 @@ Rolls columns to the right ``` Rolls columns to the right with fixed headers + ```nu > [[a b c]; [1 2 3] [4 5 6]] | roll right --cells-only ╭───┬───┬───┬───╮ diff --git a/commands/docs/roll_up.md b/src/content/docs/commands/docs/roll_up.md similarity index 78% rename from commands/docs/roll_up.md rename to src/content/docs/commands/docs/roll_up.md index 8161b75192a..7121e788314 100644 --- a/commands/docs/roll_up.md +++ b/src/content/docs/commands/docs/roll_up.md @@ -9,24 +9,24 @@ usage: | Roll table rows up. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters <div class='command-title'>{{ $frontmatter.filters }}</div> - -::: warning - Command `roll up` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `roll up` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> roll up {flags} ``` +`> roll up {flags} ` ## Flags - - `--by, -b {int}`: Number of rows to roll - +- `--by, -b {int}`: Number of rows to roll ## Input/output types: @@ -37,6 +37,7 @@ feature: extra ## Examples Rolls rows up + ```nu > [[a b]; [1 2] [3 4] [5 6]] | roll up ╭───┬───┬───╮ diff --git a/commands/docs/rotate.md b/src/content/docs/commands/docs/rotate.md similarity index 93% rename from commands/docs/rotate.md rename to src/content/docs/commands/docs/rotate.md index 72a3dfb9993..9854f8a6014 100644 --- a/commands/docs/rotate.md +++ b/src/content/docs/commands/docs/rotate.md @@ -9,28 +9,28 @@ usage: | Rotates a table or record clockwise (default) or counter-clockwise (use --ccw flag). feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters <div class='command-title'>{{ $frontmatter.filters }}</div> - -::: warning - Command `rotate` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `rotate` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> rotate {flags} ...rest``` +`> rotate {flags} ...rest` ## Flags - - `--ccw, -`: rotate counter clockwise +- `--ccw, -`: rotate counter clockwise ## Parameters - - `...rest`: the names to give columns once rotated - +- `...rest`: the names to give columns once rotated ## Input/output types: @@ -38,9 +38,11 @@ feature: extra | ------ | ------ | | record | table | | table | table | + ## Examples Rotate a record clockwise, producing a table (like `transpose` but with column order reversed) + ```nu > {a:1, b:2} | rotate ╭───┬─────────┬─────────╮ @@ -53,6 +55,7 @@ Rotate a record clockwise, producing a table (like `transpose` but with column o ``` Rotate 2x3 table clockwise + ```nu > [[a b]; [1 2] [3 4] [5 6]] | rotate ╭───┬─────────┬─────────┬─────────┬─────────╮ @@ -65,6 +68,7 @@ Rotate 2x3 table clockwise ``` Rotate table clockwise and change columns names + ```nu > [[a b]; [1 2]] | rotate col_a col_b ╭───┬───────┬───────╮ @@ -77,6 +81,7 @@ Rotate table clockwise and change columns names ``` Rotate table counter clockwise + ```nu > [[a b]; [1 2]] | rotate --ccw ╭───┬─────────┬─────────╮ @@ -89,6 +94,7 @@ Rotate table counter clockwise ``` Rotate table counter-clockwise + ```nu > [[a b]; [1 2] [3 4] [5 6]] | rotate --ccw ╭───┬─────────┬─────────┬─────────┬─────────╮ @@ -101,6 +107,7 @@ Rotate table counter-clockwise ``` Rotate table counter-clockwise and change columns names + ```nu > [[a b]; [1 2]] | rotate --ccw col_a col_b ╭───┬───────┬───────╮ diff --git a/commands/docs/run-external.md b/src/content/docs/commands/docs/run-external.md similarity index 63% rename from commands/docs/run-external.md rename to src/content/docs/commands/docs/run-external.md index 8296514b339..98ea91a834b 100644 --- a/commands/docs/run-external.md +++ b/src/content/docs/commands/docs/run-external.md @@ -9,6 +9,7 @@ usage: | Runs external command. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for system @@ -17,20 +18,19 @@ feature: default ## Signature -```> run-external {flags} (command) ...rest``` +`> run-external {flags} (command) ...rest` ## Flags - - `--redirect-stdout, -`: redirect stdout to the pipeline - - `--redirect-stderr, -`: redirect stderr to the pipeline - - `--redirect-combine, -`: redirect both stdout and stderr combined to the pipeline (collected in stdout) - - `--trim-end-newline, -`: trimming end newlines +- `--redirect-stdout, -`: redirect stdout to the pipeline +- `--redirect-stderr, -`: redirect stderr to the pipeline +- `--redirect-combine, -`: redirect both stdout and stderr combined to the pipeline (collected in stdout) +- `--trim-end-newline, -`: trimming end newlines ## Parameters - - `command`: External command to run. - - `...rest`: Arguments for external command. - +- `command`: External command to run. +- `...rest`: Arguments for external command. ## Input/output types: @@ -41,12 +41,14 @@ feature: default ## Examples Run an external command + ```nu > run-external "echo" "-n" "hello" ``` Redirect stdout from an external command into the pipeline + ```nu > run-external --redirect-stdout "echo" "-n" "hello" | split chars diff --git a/commands/docs/save.md b/src/content/docs/commands/docs/save.md similarity index 74% rename from commands/docs/save.md rename to src/content/docs/commands/docs/save.md index b391b171954..2bca4f905e5 100644 --- a/commands/docs/save.md +++ b/src/content/docs/commands/docs/save.md @@ -9,6 +9,7 @@ usage: | Save a file. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filesystem @@ -17,20 +18,19 @@ feature: default ## Signature -```> save {flags} (filename)``` +`> save {flags} (filename)` ## Flags - - `--stderr, -e {path}`: the filename used to save stderr, only works with `-r` flag - - `--raw, -r`: save file as raw binary - - `--append, -a`: append input to the end of the file - - `--force, -f`: overwrite the destination - - `--progress, -p`: enable progress bar +- `--stderr, -e {path}`: the filename used to save stderr, only works with `-r` flag +- `--raw, -r`: save file as raw binary +- `--append, -a`: append input to the end of the file +- `--force, -f`: overwrite the destination +- `--progress, -p`: enable progress bar ## Parameters - - `filename`: The filename to use. - +- `filename`: The filename to use. ## Input/output types: @@ -41,30 +41,35 @@ feature: default ## Examples Save a string to foo.txt in the current directory + ```nu > 'save me' | save foo.txt ``` Append a string to the end of foo.txt + ```nu > 'append me' | save --append foo.txt ``` Save a record to foo.json in the current directory + ```nu > { a: 1, b: 2 } | save foo.json ``` Save a running program's stderr to foo.txt + ```nu > do -i {} | save foo.txt --stderr foo.txt ``` Save a running program's stderr to separate file + ```nu > do -i {} | save foo.txt --stderr bar.txt diff --git a/commands/docs/schema.md b/src/content/docs/commands/docs/schema.md similarity index 96% rename from commands/docs/schema.md rename to src/content/docs/commands/docs/schema.md index 77aa78731ec..c584325387b 100644 --- a/commands/docs/schema.md +++ b/src/content/docs/commands/docs/schema.md @@ -9,6 +9,7 @@ usage: | Show the schema of a SQLite database. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for database @@ -17,8 +18,7 @@ feature: default ## Signature -```> schema {flags} ``` - +`> schema {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Show the schema of a SQLite database + ```nu > open foo.db | schema diff --git a/src/content/docs/commands/docs/scope.md b/src/content/docs/commands/docs/scope.md new file mode 100644 index 00000000000..dd5dddb43c2 --- /dev/null +++ b/src/content/docs/commands/docs/scope.md @@ -0,0 +1,38 @@ +--- +title: scope +categories: | + core +version: 0.90.0 +core: | + Commands for getting info about what is in scope. +usage: | + Commands for getting info about what is in scope. +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for core + +<div class='command-title'>{{ $frontmatter.core }}</div> + +## Signature + +`> scope {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Subcommands: + +| name | type | usage | +| --------------------------------------------------------- | ------- | -------------------------------------------------------- | +| [`scope aliases`](/commands/docs/scope_aliases) | Builtin | Output info on the aliases in the current scope. | +| [`scope commands`](/commands/docs/scope_commands) | Builtin | Output info on the commands in the current scope. | +| [`scope engine-stats`](/commands/docs/scope_engine-stats) | Builtin | Output stats on the engine in the current state. | +| [`scope externs`](/commands/docs/scope_externs) | Builtin | Output info on the known externals in the current scope. | +| [`scope modules`](/commands/docs/scope_modules) | Builtin | Output info on the modules in the current scope. | +| [`scope variables`](/commands/docs/scope_variables) | Builtin | Output info on the variables in the current scope. | diff --git a/commands/docs/scope_aliases.md b/src/content/docs/commands/docs/scope_aliases.md similarity index 95% rename from commands/docs/scope_aliases.md rename to src/content/docs/commands/docs/scope_aliases.md index 950375fb9cd..a615b7fa287 100644 --- a/commands/docs/scope_aliases.md +++ b/src/content/docs/commands/docs/scope_aliases.md @@ -9,6 +9,7 @@ usage: | Output info on the aliases in the current scope. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,8 +18,7 @@ feature: default ## Signature -```> scope aliases {flags} ``` - +`> scope aliases {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Show the aliases in the current scope + ```nu > scope aliases diff --git a/commands/docs/scope_commands.md b/src/content/docs/commands/docs/scope_commands.md similarity index 95% rename from commands/docs/scope_commands.md rename to src/content/docs/commands/docs/scope_commands.md index 9a5a84ae577..3a9288c97f1 100644 --- a/commands/docs/scope_commands.md +++ b/src/content/docs/commands/docs/scope_commands.md @@ -9,6 +9,7 @@ usage: | Output info on the commands in the current scope. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,8 +18,7 @@ feature: default ## Signature -```> scope commands {flags} ``` - +`> scope commands {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Show the commands in the current scope + ```nu > scope commands diff --git a/commands/docs/scope_engine-stats.md b/src/content/docs/commands/docs/scope_engine-stats.md similarity index 94% rename from commands/docs/scope_engine-stats.md rename to src/content/docs/commands/docs/scope_engine-stats.md index 81ede24bb8b..006e0b559cd 100644 --- a/commands/docs/scope_engine-stats.md +++ b/src/content/docs/commands/docs/scope_engine-stats.md @@ -9,6 +9,7 @@ usage: | Output stats on the engine in the current state. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,8 +18,7 @@ feature: default ## Signature -```> scope engine-stats {flags} ``` - +`> scope engine-stats {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Show the stats on the current engine state + ```nu > scope engine-stats diff --git a/commands/docs/scope_externs.md b/src/content/docs/commands/docs/scope_externs.md similarity index 95% rename from commands/docs/scope_externs.md rename to src/content/docs/commands/docs/scope_externs.md index a6bf8a045cf..37fe1f8dbcf 100644 --- a/commands/docs/scope_externs.md +++ b/src/content/docs/commands/docs/scope_externs.md @@ -9,6 +9,7 @@ usage: | Output info on the known externals in the current scope. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,8 +18,7 @@ feature: default ## Signature -```> scope externs {flags} ``` - +`> scope externs {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Show the known externals in the current scope + ```nu > scope externs diff --git a/commands/docs/scope_modules.md b/src/content/docs/commands/docs/scope_modules.md similarity index 95% rename from commands/docs/scope_modules.md rename to src/content/docs/commands/docs/scope_modules.md index 3f0193e482a..a596b1d3950 100644 --- a/commands/docs/scope_modules.md +++ b/src/content/docs/commands/docs/scope_modules.md @@ -9,6 +9,7 @@ usage: | Output info on the modules in the current scope. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,8 +18,7 @@ feature: default ## Signature -```> scope modules {flags} ``` - +`> scope modules {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Show the modules in the current scope + ```nu > scope modules diff --git a/commands/docs/scope_variables.md b/src/content/docs/commands/docs/scope_variables.md similarity index 94% rename from commands/docs/scope_variables.md rename to src/content/docs/commands/docs/scope_variables.md index 5c7f1ec6b3d..2e8568fecb7 100644 --- a/commands/docs/scope_variables.md +++ b/src/content/docs/commands/docs/scope_variables.md @@ -9,6 +9,7 @@ usage: | Output info on the variables in the current scope. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,8 +18,7 @@ feature: default ## Signature -```> scope variables {flags} ``` - +`> scope variables {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Show the variables in the current scope + ```nu > scope variables diff --git a/commands/docs/select.md b/src/content/docs/commands/docs/select.md similarity index 88% rename from commands/docs/select.md rename to src/content/docs/commands/docs/select.md index 5451bd012da..91371c0a9a1 100644 --- a/commands/docs/select.md +++ b/src/content/docs/commands/docs/select.md @@ -9,6 +9,7 @@ usage: | Select only these columns or rows from the input. Opposite of `reject`. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,27 +18,28 @@ feature: default ## Signature -```> select {flags} ...rest``` +`> select {flags} ...rest` ## Flags - - `--ignore-errors, -i`: ignore missing data (make all cell path members optional) +- `--ignore-errors, -i`: ignore missing data (make all cell path members optional) ## Parameters - - `...rest`: The columns to select from the table. - +- `...rest`: The columns to select from the table. ## Input/output types: -| input | output | -| --------- | ------ | +| input | output | +| ----------- | ------ | | list\<any\> | any | -| record | record | -| table | table | +| record | record | +| table | table | + ## Examples Select a column in a table + ```nu > [{a: a b: b}] | select a ╭───┬───╮ @@ -49,6 +51,7 @@ Select a column in a table ``` Select a field in a record + ```nu > {a: a b: b} | select a ╭───┬───╮ @@ -57,24 +60,28 @@ Select a field in a record ``` Select just the `name` column + ```nu > ls | select name ``` Select the first four rows (this is the same as `first 4`) + ```nu > ls | select 0 1 2 3 ``` Select columns by a provided list of columns + ```nu > let cols = [name type];[[name type size]; [Cargo.toml toml 1kb] [Cargo.lock toml 2kb]] | select $cols ``` Select columns by a provided list of columns + ```nu > [[name type size]; [Cargo.toml toml 1kb] [Cargo.lock toml 2kb]] | select ["name", "type"] ╭───┬────────────┬──────╮ @@ -87,12 +94,14 @@ Select columns by a provided list of columns ``` Select rows by a provided list of rows + ```nu > let rows = [0 2];[[name type size]; [Cargo.toml toml 1kb] [Cargo.lock toml 2kb] [file.json json 3kb]] | select $rows ``` ## Notes + This differs from `get` in that, rather than accessing the given value in the data structure, it removes all non-selected values from the structure. Hence, using `select` on a table will -produce a table, a list will produce a list, and a record will produce a record. \ No newline at end of file +produce a table, a list will produce a list, and a record will produce a record. diff --git a/commands/docs/seq.md b/src/content/docs/commands/docs/seq.md similarity index 71% rename from commands/docs/seq.md rename to src/content/docs/commands/docs/seq.md index d308789db97..5b247265bdb 100644 --- a/commands/docs/seq.md +++ b/src/content/docs/commands/docs/seq.md @@ -9,6 +9,7 @@ usage: | Output sequences of numbers. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for generators @@ -17,22 +18,22 @@ feature: default ## Signature -```> seq {flags} ...rest``` +`> seq {flags} ...rest` ## Parameters - - `...rest`: Sequence values. - +- `...rest`: Sequence values. ## Input/output types: -| input | output | -| ------- | ------------ | +| input | output | +| ------- | -------------- | | nothing | list\<number\> | ## Examples sequence 1 to 10 + ```nu > seq 1 10 ╭───┬────╮ @@ -51,6 +52,7 @@ sequence 1 to 10 ``` sequence 1.0 to 2.0 by 0.1s + ```nu > seq 1.0 0.1 2.0 ╭────┬──────╮ @@ -70,15 +72,15 @@ sequence 1.0 to 2.0 by 0.1s ``` sequence 1 to 5, then convert to a string with a pipe separator + ```nu > seq 1 5 | str join '|' ``` - ## Subcommands: -| name | type | usage | -| ---------------------------------------- | ------- | ------------------------------------- | -| [`seq char`](/commands/docs/seq_char.md) | Builtin | Print a sequence of ASCII characters. | -| [`seq date`](/commands/docs/seq_date.md) | Builtin | Print sequences of dates. | \ No newline at end of file +| name | type | usage | +| ------------------------------------- | ------- | ------------------------------------- | +| [`seq char`](/commands/docs/seq_char) | Builtin | Print a sequence of ASCII characters. | +| [`seq date`](/commands/docs/seq_date) | Builtin | Print sequences of dates. | diff --git a/commands/docs/seq_char.md b/src/content/docs/commands/docs/seq_char.md similarity index 80% rename from commands/docs/seq_char.md rename to src/content/docs/commands/docs/seq_char.md index 4d7bf92be4d..bd0b88165f5 100644 --- a/commands/docs/seq_char.md +++ b/src/content/docs/commands/docs/seq_char.md @@ -9,6 +9,7 @@ usage: | Print a sequence of ASCII characters. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for generators @@ -17,23 +18,23 @@ feature: default ## Signature -```> seq char {flags} (start) (end)``` +`> seq char {flags} (start) (end)` ## Parameters - - `start`: Start of character sequence (inclusive). - - `end`: End of character sequence (inclusive). - +- `start`: Start of character sequence (inclusive). +- `end`: End of character sequence (inclusive). ## Input/output types: -| input | output | -| ------- | ------------ | +| input | output | +| ------- | -------------- | | nothing | list\<string\> | ## Examples sequence a to e + ```nu > seq char a e ╭───┬───╮ @@ -47,6 +48,7 @@ sequence a to e ``` sequence a to e, and put the characters in a pipe-separated string + ```nu > seq char a e | str join '|' diff --git a/commands/docs/seq_date.md b/src/content/docs/commands/docs/seq_date.md similarity index 77% rename from commands/docs/seq_date.md rename to src/content/docs/commands/docs/seq_date.md index c6aea25fbc7..c3fb2d7b4e9 100644 --- a/commands/docs/seq_date.md +++ b/src/content/docs/commands/docs/seq_date.md @@ -9,6 +9,7 @@ usage: | Print sequences of dates. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for generators @@ -17,46 +18,49 @@ feature: default ## Signature -```> seq date {flags} ``` +`> seq date {flags} ` ## Flags - - `--output-format, -o {string}`: prints dates in this format (defaults to %Y-%m-%d) - - `--input-format, -i {string}`: give argument dates in this format (defaults to %Y-%m-%d) - - `--begin-date, -b {string}`: beginning date range - - `--end-date, -e {string}`: ending date - - `--increment, -n {int}`: increment dates by this number - - `--days, -d {int}`: number of days to print - - `--reverse, -r`: print dates in reverse - +- `--output-format, -o {string}`: prints dates in this format (defaults to %Y-%m-%d) +- `--input-format, -i {string}`: give argument dates in this format (defaults to %Y-%m-%d) +- `--begin-date, -b {string}`: beginning date range +- `--end-date, -e {string}`: ending date +- `--increment, -n {int}`: increment dates by this number +- `--days, -d {int}`: number of days to print +- `--reverse, -r`: print dates in reverse ## Input/output types: -| input | output | -| ------- | ------------ | +| input | output | +| ------- | -------------- | | nothing | list\<string\> | ## Examples print the next 10 days in YYYY-MM-DD format with newline separator + ```nu > seq date --days 10 ``` print the previous 10 days in YYYY-MM-DD format with newline separator + ```nu > seq date --days 10 --reverse ``` print the previous 10 days starting today in MM/DD/YYYY format with newline separator + ```nu > seq date --days 10 -o '%m/%d/%Y' --reverse ``` print the first 10 days in January, 2020 + ```nu > seq date --begin-date '2020-01-01' --end-date '2020-01-10' ╭───┬────────────╮ @@ -75,6 +79,7 @@ print the first 10 days in January, 2020 ``` print every fifth day between January 1st 2020 and January 31st 2020 + ```nu > seq date --begin-date '2020-01-01' --end-date '2020-01-31' --increment 5 ╭───┬────────────╮ diff --git a/commands/docs/shells.md b/src/content/docs/commands/docs/shells.md similarity index 96% rename from commands/docs/shells.md rename to src/content/docs/commands/docs/shells.md index 03c51b5d274..988cbb45c8e 100644 --- a/commands/docs/shells.md +++ b/src/content/docs/commands/docs/shells.md @@ -15,17 +15,19 @@ usage: | ## Signature -```> shells ``` +`> shells ` ## Examples Enter a new shell at parent path '..' and show all opened shells + ```nu > enter ..; shells ``` Show currently active shell + ```nu > shells | where active == true diff --git a/commands/docs/shuffle.md b/src/content/docs/commands/docs/shuffle.md similarity index 88% rename from commands/docs/shuffle.md rename to src/content/docs/commands/docs/shuffle.md index 2d2bb0fda54..f370d3ca19a 100644 --- a/commands/docs/shuffle.md +++ b/src/content/docs/commands/docs/shuffle.md @@ -9,6 +9,7 @@ usage: | Shuffle rows randomly. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,18 +18,18 @@ feature: default ## Signature -```> shuffle {flags} ``` - +`> shuffle {flags} ` ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | ## Examples Shuffle rows randomly (execute it several times and see the difference) + ```nu > [[version patch]; ['1.0.0' false] ['3.0.1' true] ['2.0.0' false]] | shuffle diff --git a/commands/docs/skip.md b/src/content/docs/commands/docs/skip.md similarity index 65% rename from commands/docs/skip.md rename to src/content/docs/commands/docs/skip.md index 9b3632d4e51..af94faae18a 100644 --- a/commands/docs/skip.md +++ b/src/content/docs/commands/docs/skip.md @@ -9,6 +9,7 @@ usage: | Skip the first several rows of the input. Counterpart of `drop`. Opposite of `first`. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,22 +18,23 @@ feature: default ## Signature -```> skip {flags} (n)``` +`> skip {flags} (n)` ## Parameters - - `n`: The number of elements to skip. - +- `n`: The number of elements to skip. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | -| table | table | +| table | table | + ## Examples Skip the first value of a list + ```nu > [2 4 6 8] | skip 1 ╭───┬───╮ @@ -44,6 +46,7 @@ Skip the first value of a list ``` Skip two rows of a table + ```nu > [[editions]; [2015] [2018] [2021]] | skip 2 ╭───┬──────────╮ @@ -55,11 +58,12 @@ Skip two rows of a table ``` ## Notes + To skip specific numbered rows, try `drop nth`. To skip specific named columns, try `reject`. ## Subcommands: -| name | type | usage | -| -------------------------------------------- | ------- | ----------------------------------------------------- | -| [`skip until`](/commands/docs/skip_until.md) | Builtin | Skip elements of the input until a predicate is true. | -| [`skip while`](/commands/docs/skip_while.md) | Builtin | Skip elements of the input while a predicate is true. | \ No newline at end of file +| name | type | usage | +| ----------------------------------------- | ------- | ----------------------------------------------------- | +| [`skip until`](/commands/docs/skip_until) | Builtin | Skip elements of the input until a predicate is true. | +| [`skip while`](/commands/docs/skip_while) | Builtin | Skip elements of the input while a predicate is true. | diff --git a/commands/docs/skip_until.md b/src/content/docs/commands/docs/skip_until.md similarity index 86% rename from commands/docs/skip_until.md rename to src/content/docs/commands/docs/skip_until.md index a0d62938423..b18a31e6f00 100644 --- a/commands/docs/skip_until.md +++ b/src/content/docs/commands/docs/skip_until.md @@ -9,6 +9,7 @@ usage: | Skip elements of the input until a predicate is true. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,22 +18,23 @@ feature: default ## Signature -```> skip until {flags} (predicate)``` +`> skip until {flags} (predicate)` ## Parameters - - `predicate`: The predicate that skipped element must not match. - +- `predicate`: The predicate that skipped element must not match. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | -| table | table | +| table | table | + ## Examples Skip until the element is positive + ```nu > [-2 0 2 -1] | skip until {|x| $x > 0 } ╭───┬────╮ @@ -43,6 +45,7 @@ Skip until the element is positive ``` Skip until the element is positive using stored condition + ```nu > let cond = {|x| $x > 0 }; [-2 0 2 -1] | skip until $cond ╭───┬────╮ @@ -53,6 +56,7 @@ Skip until the element is positive using stored condition ``` Skip until the field value is positive + ```nu > [{a: -2} {a: 0} {a: 2} {a: -1}] | skip until {|x| $x.a > 0 } ╭───┬────╮ diff --git a/commands/docs/skip_while.md b/src/content/docs/commands/docs/skip_while.md similarity index 86% rename from commands/docs/skip_while.md rename to src/content/docs/commands/docs/skip_while.md index b893ef16254..d9f42a32240 100644 --- a/commands/docs/skip_while.md +++ b/src/content/docs/commands/docs/skip_while.md @@ -9,6 +9,7 @@ usage: | Skip elements of the input while a predicate is true. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,22 +18,23 @@ feature: default ## Signature -```> skip while {flags} (predicate)``` +`> skip while {flags} (predicate)` ## Parameters - - `predicate`: The predicate that skipped element must match. - +- `predicate`: The predicate that skipped element must match. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | -| table | table | +| table | table | + ## Examples Skip while the element is negative + ```nu > [-2 0 2 -1] | skip while {|x| $x < 0 } ╭───┬────╮ @@ -44,6 +46,7 @@ Skip while the element is negative ``` Skip while the element is negative using stored condition + ```nu > let cond = {|x| $x < 0 }; [-2 0 2 -1] | skip while $cond ╭───┬────╮ @@ -55,6 +58,7 @@ Skip while the element is negative using stored condition ``` Skip while the field value is negative + ```nu > [{a: -2} {a: 0} {a: 2} {a: -1}] | skip while {|x| $x.a < 0 } ╭───┬────╮ diff --git a/commands/docs/sleep.md b/src/content/docs/commands/docs/sleep.md similarity index 87% rename from commands/docs/sleep.md rename to src/content/docs/commands/docs/sleep.md index daf5d75260d..6ec6e731cd4 100644 --- a/commands/docs/sleep.md +++ b/src/content/docs/commands/docs/sleep.md @@ -9,6 +9,7 @@ usage: | Delay for a specified amount of time. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for platform @@ -17,13 +18,12 @@ feature: default ## Signature -```> sleep {flags} (duration) ...rest``` +`> sleep {flags} (duration) ...rest` ## Parameters - - `duration`: Time to sleep. - - `...rest`: Additional time. - +- `duration`: Time to sleep. +- `...rest`: Additional time. ## Input/output types: @@ -34,18 +34,21 @@ feature: default ## Examples Sleep for 1sec + ```nu > sleep 1sec ``` Sleep for 3sec + ```nu > sleep 1sec 1sec 1sec ``` Send output after 1sec + ```nu > sleep 1sec; echo done diff --git a/commands/docs/sort-by.md b/src/content/docs/commands/docs/sort-by.md similarity index 74% rename from commands/docs/sort-by.md rename to src/content/docs/commands/docs/sort-by.md index 94445b19157..3786fde0ac2 100644 --- a/commands/docs/sort-by.md +++ b/src/content/docs/commands/docs/sort-by.md @@ -9,6 +9,7 @@ usage: | Sort by the given columns, in increasing order. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,41 +18,44 @@ feature: default ## Signature -```> sort-by {flags} ...rest``` +`> sort-by {flags} ...rest` ## Flags - - `--reverse, -r`: Sort in reverse order - - `--ignore-case, -i`: Sort string-based columns case-insensitively - - `--natural, -n`: Sort alphanumeric string-based columns naturally (1, 9, 10, 99, 100, ...) +- `--reverse, -r`: Sort in reverse order +- `--ignore-case, -i`: Sort string-based columns case-insensitively +- `--natural, -n`: Sort alphanumeric string-based columns naturally (1, 9, 10, 99, 100, ...) ## Parameters - - `...rest`: The column(s) to sort by. - +- `...rest`: The column(s) to sort by. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | -| record | table | -| table | table | +| record | table | +| table | table | + ## Examples Sort files by modified date + ```nu > ls | sort-by modified ``` Sort files by name (case-insensitive) + ```nu > ls | sort-by name --ignore-case ``` Sort a table by a column (reversed order) + ```nu > [[fruit count]; [apple 9] [pear 3] [orange 7]] | sort-by fruit --reverse ╭───┬────────┬───────╮ diff --git a/commands/docs/sort.md b/src/content/docs/commands/docs/sort.md similarity index 82% rename from commands/docs/sort.md rename to src/content/docs/commands/docs/sort.md index f389c3f109f..e8544d0a950 100644 --- a/commands/docs/sort.md +++ b/src/content/docs/commands/docs/sort.md @@ -9,6 +9,7 @@ usage: | Sort in increasing order. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,25 +18,26 @@ feature: default ## Signature -```> sort {flags} ``` +`> sort {flags} ` ## Flags - - `--reverse, -r`: Sort in reverse order - - `--ignore-case, -i`: Sort string-based data case-insensitively - - `--values, -v`: If input is a single record, sort the record by values; ignored if input is not a single record - - `--natural, -n`: Sort alphanumeric string-based values naturally (1, 9, 10, 99, 100, ...) - +- `--reverse, -r`: Sort in reverse order +- `--ignore-case, -i`: Sort string-based data case-insensitively +- `--values, -v`: If input is a single record, sort the record by values; ignored if input is not a single record +- `--natural, -n`: Sort alphanumeric string-based values naturally (1, 9, 10, 99, 100, ...) ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | -| record | record | +| record | record | + ## Examples sort the list by increasing value + ```nu > [2 0 1] | sort ╭───┬───╮ @@ -47,6 +49,7 @@ sort the list by increasing value ``` sort the list by decreasing value + ```nu > [2 0 1] | sort --reverse ╭───┬───╮ @@ -58,6 +61,7 @@ sort the list by decreasing value ``` sort a list of strings + ```nu > [betty amy sarah] | sort ╭───┬───────╮ @@ -69,6 +73,7 @@ sort a list of strings ``` sort a list of strings in reverse + ```nu > [betty amy sarah] | sort --reverse ╭───┬───────╮ @@ -80,6 +85,7 @@ sort a list of strings in reverse ``` Sort strings (case-insensitive) + ```nu > [airplane Truck Car] | sort -i ╭───┬──────────╮ @@ -91,6 +97,7 @@ Sort strings (case-insensitive) ``` Sort strings (reversed case-insensitive) + ```nu > [airplane Truck Car] | sort -i -r ╭───┬──────────╮ @@ -102,6 +109,7 @@ Sort strings (reversed case-insensitive) ``` Sort record by key (case-insensitive) + ```nu > {b: 3, a: 4} | sort ╭───┬───╮ @@ -111,6 +119,7 @@ Sort record by key (case-insensitive) ``` Sort record by value + ```nu > {b: 4, a: 3, c:1} | sort -v ╭───┬───╮ diff --git a/commands/docs/source-env.md b/src/content/docs/commands/docs/source-env.md similarity index 85% rename from commands/docs/source-env.md rename to src/content/docs/commands/docs/source-env.md index f6fa557078c..4f8dbc9defa 100644 --- a/commands/docs/source-env.md +++ b/src/content/docs/commands/docs/source-env.md @@ -9,6 +9,7 @@ usage: | Source the environment from a source file into the current environment. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,12 +18,11 @@ feature: default ## Signature -```> source-env {flags} (filename)``` +`> source-env {flags} (filename)` ## Parameters - - `filename`: The filepath to the script file to source the environment from. - +- `filename`: The filepath to the script file to source the environment from. ## Input/output types: @@ -33,6 +33,7 @@ feature: default ## Examples Sources the environment from foo.nu in the current context + ```nu > source-env foo.nu diff --git a/commands/docs/source.md b/src/content/docs/commands/docs/source.md similarity index 85% rename from commands/docs/source.md rename to src/content/docs/commands/docs/source.md index c30cecb17ad..6bae533b16e 100644 --- a/commands/docs/source.md +++ b/src/content/docs/commands/docs/source.md @@ -9,6 +9,7 @@ usage: | Runs a script file in the current context. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,12 +18,11 @@ feature: default ## Signature -```> source {flags} (filename)``` +`> source {flags} (filename)` ## Parameters - - `filename`: The filepath to the script file to source. - +- `filename`: The filepath to the script file to source. ## Input/output types: @@ -33,17 +33,20 @@ feature: default ## Examples Runs foo.nu in the current context + ```nu > source foo.nu ``` Runs foo.nu in current context and call the command defined, suppose foo.nu has content: `def say-hi [] { echo 'Hi!' }` + ```nu > source ./foo.nu; say-hi ``` ## Notes + This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/split-by.md b/src/content/docs/commands/docs/split-by.md similarity index 97% rename from commands/docs/split-by.md rename to src/content/docs/commands/docs/split-by.md index de1be154d39..ef47490ea25 100644 --- a/commands/docs/split-by.md +++ b/src/content/docs/commands/docs/split-by.md @@ -9,6 +9,7 @@ usage: | Split a record into groups. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,12 +18,11 @@ feature: default ## Signature -```> split-by {flags} (splitter)``` +`> split-by {flags} (splitter)` ## Parameters - - `splitter`: The splitter value to use. - +- `splitter`: The splitter value to use. ## Input/output types: @@ -33,6 +33,7 @@ feature: default ## Examples split items by column named "lang" + ```nu > { '2019': [ diff --git a/src/content/docs/commands/docs/split.md b/src/content/docs/commands/docs/split.md new file mode 100644 index 00000000000..258e60d971d --- /dev/null +++ b/src/content/docs/commands/docs/split.md @@ -0,0 +1,41 @@ +--- +title: split +categories: | + strings +version: 0.90.0 +strings: | + Split contents across desired subcommand (like row, column) via the separator. +usage: | + Split contents across desired subcommand (like row, column) via the separator. +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for strings + +<div class='command-title'>{{ $frontmatter.strings }}</div> + +## Signature + +`> split {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | type | usage | +| --------------------------------------------- | ------- | ------------------------------------------------------- | +| [`split chars`](/commands/docs/split_chars) | Builtin | Split a string into a list of characters. | +| [`split column`](/commands/docs/split_column) | Builtin | Split a string into multiple columns using a separator. | +| [`split list`](/commands/docs/split_list) | Builtin | Split a list into multiple lists using a separator. | +| [`split row`](/commands/docs/split_row) | Builtin | Split a string into multiple rows using a separator. | +| [`split words`](/commands/docs/split_words) | Builtin | Split a string's words into separate rows. | diff --git a/commands/docs/split_chars.md b/src/content/docs/commands/docs/split_chars.md similarity index 84% rename from commands/docs/split_chars.md rename to src/content/docs/commands/docs/split_chars.md index 4c210216869..343c65584ce 100644 --- a/commands/docs/split_chars.md +++ b/src/content/docs/commands/docs/split_chars.md @@ -9,6 +9,7 @@ usage: | Split a string into a list of characters. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,23 +18,24 @@ feature: default ## Signature -```> split chars {flags} ``` +`> split chars {flags} ` ## Flags - - `--grapheme-clusters, -g`: split on grapheme clusters - - `--code-points, -c`: split on code points (default; splits combined characters) - +- `--grapheme-clusters, -g`: split on grapheme clusters +- `--code-points, -c`: split on code points (default; splits combined characters) ## Input/output types: -| input | output | -| ------------ | ------------------ | +| input | output | +| -------------- | ---------------------- | | list\<string\> | list\<list\<string\>\> | -| string | list\<string\> | +| string | list\<string\> | + ## Examples Split the string into a list of characters + ```nu > 'hello' | split chars ╭───┬───╮ @@ -47,6 +49,7 @@ Split the string into a list of characters ``` Split on grapheme clusters + ```nu > '🇯🇵ほげ' | split chars --grapheme-clusters ╭───┬────╮ @@ -58,6 +61,7 @@ Split on grapheme clusters ``` Split multiple strings into lists of characters + ```nu > ['hello', 'world'] | split chars ╭───┬───────────╮ diff --git a/commands/docs/split_column.md b/src/content/docs/commands/docs/split_column.md similarity index 87% rename from commands/docs/split_column.md rename to src/content/docs/commands/docs/split_column.md index 98eb62cd299..8c2a7604c6f 100644 --- a/commands/docs/split_column.md +++ b/src/content/docs/commands/docs/split_column.md @@ -9,6 +9,7 @@ usage: | Split a string into multiple columns using a separator. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,28 +18,29 @@ feature: default ## Signature -```> split column {flags} (separator) ...rest``` +`> split column {flags} (separator) ...rest` ## Flags - - `--collapse-empty, -c`: remove empty columns - - `--regex, -r`: separator is a regular expression +- `--collapse-empty, -c`: remove empty columns +- `--regex, -r`: separator is a regular expression ## Parameters - - `separator`: The character or string that denotes what separates columns. - - `...rest`: Column names to give the new columns. - +- `separator`: The character or string that denotes what separates columns. +- `...rest`: Column names to give the new columns. ## Input/output types: -| input | output | -| ------------ | ------ | +| input | output | +| -------------- | ------ | | list\<string\> | table | -| string | table | +| string | table | + ## Examples Split a string into columns by the specified separator + ```nu > 'a--b--c' | split column '--' ╭───┬─────────┬─────────┬─────────╮ @@ -50,6 +52,7 @@ Split a string into columns by the specified separator ``` Split a string into columns of char and remove the empty columns + ```nu > 'abc' | split column --collapse-empty '' ╭───┬─────────┬─────────┬─────────╮ @@ -61,6 +64,7 @@ Split a string into columns of char and remove the empty columns ``` Split a list of strings into a table + ```nu > ['a-b' 'c-d'] | split column - ╭───┬─────────┬─────────╮ @@ -73,6 +77,7 @@ Split a list of strings into a table ``` Split a list of strings into a table, ignoring padding + ```nu > ['a - b' 'c - d'] | split column --regex '\s*-\s*' ╭───┬─────────┬─────────╮ diff --git a/commands/docs/split_list.md b/src/content/docs/commands/docs/split_list.md similarity index 92% rename from commands/docs/split_list.md rename to src/content/docs/commands/docs/split_list.md index fe55b097d68..6f961a8e914 100644 --- a/commands/docs/split_list.md +++ b/src/content/docs/commands/docs/split_list.md @@ -9,6 +9,7 @@ usage: | Split a list into multiple lists using a separator. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,26 +18,26 @@ feature: default ## Signature -```> split list {flags} (separator)``` +`> split list {flags} (separator)` ## Flags - - `--regex, -r`: separator is a regular expression, matching values that can be coerced into a string +- `--regex, -r`: separator is a regular expression, matching values that can be coerced into a string ## Parameters - - `separator`: The value that denotes what separates the list. - +- `separator`: The value that denotes what separates the list. ## Input/output types: -| input | output | -| --------- | --------------- | +| input | output | +| ----------- | ------------------- | | list\<any\> | list\<list\<any\>\> | ## Examples Split a list of chars into two lists + ```nu > [a, b, c, d, e, f, g] | split list d ╭───┬───────────╮ @@ -55,6 +56,7 @@ Split a list of chars into two lists ``` Split a list of lists into two lists of lists + ```nu > [[1,2], [2,3], [3,4]] | split list [2,3] ╭───┬───────────────────╮ @@ -75,6 +77,7 @@ Split a list of lists into two lists of lists ``` Split a list of chars into two lists + ```nu > [a, b, c, d, a, e, f, g] | split list a ╭───┬───────────╮ @@ -93,6 +96,7 @@ Split a list of chars into two lists ``` Split a list of chars into lists based on multiple characters + ```nu > [a, b, c, d, a, e, f, g] | split list --regex '(b|e)' ╭───┬───────────╮ diff --git a/commands/docs/split_row.md b/src/content/docs/commands/docs/split_row.md similarity index 80% rename from commands/docs/split_row.md rename to src/content/docs/commands/docs/split_row.md index fd2f7a52b99..a44ef9a63e7 100644 --- a/commands/docs/split_row.md +++ b/src/content/docs/commands/docs/split_row.md @@ -9,6 +9,7 @@ usage: | Split a string into multiple rows using a separator. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,27 +18,28 @@ feature: default ## Signature -```> split row {flags} (separator)``` +`> split row {flags} (separator)` ## Flags - - `--number, -n {int}`: Split into maximum number of items - - `--regex, -r`: use regex syntax for separator +- `--number, -n {int}`: Split into maximum number of items +- `--regex, -r`: use regex syntax for separator ## Parameters - - `separator`: A character or regex that denotes what separates rows. - +- `separator`: A character or regex that denotes what separates rows. ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| string | list\<string\> | +| string | list\<string\> | + ## Examples Split a string into rows of char + ```nu > 'abc' | split row '' ╭───┬───╮ @@ -51,6 +53,7 @@ Split a string into rows of char ``` Split a string into rows by the specified separator + ```nu > 'a--b--c' | split row '--' ╭───┬───╮ @@ -62,6 +65,7 @@ Split a string into rows by the specified separator ``` Split a string by '-' + ```nu > '-a-b-c-' | split row '-' ╭───┬───╮ @@ -75,6 +79,7 @@ Split a string by '-' ``` Split a string by regex + ```nu > 'a b c' | split row -r '\s+' ╭───┬───╮ diff --git a/commands/docs/split_words.md b/src/content/docs/commands/docs/split_words.md similarity index 74% rename from commands/docs/split_words.md rename to src/content/docs/commands/docs/split_words.md index 4f28dd49980..8f5631f75ac 100644 --- a/commands/docs/split_words.md +++ b/src/content/docs/commands/docs/split_words.md @@ -9,6 +9,7 @@ usage: | Split a string's words into separate rows. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,24 +18,25 @@ feature: default ## Signature -```> split words {flags} ``` +`> split words {flags} ` ## Flags - - `--min-word-length, -l {int}`: The minimum word length - - `--grapheme-clusters, -g`: measure word length in grapheme clusters (requires -l) - - `--utf-8-bytes, -b`: measure word length in UTF-8 bytes (default; requires -l; non-ASCII chars are length 2+) - +- `--min-word-length, -l {int}`: The minimum word length +- `--grapheme-clusters, -g`: measure word length in grapheme clusters (requires -l) +- `--utf-8-bytes, -b`: measure word length in UTF-8 bytes (default; requires -l; non-ASCII chars are length 2+) ## Input/output types: -| input | output | -| ------------ | ------------------ | +| input | output | +| -------------- | ---------------------- | | list\<string\> | list\<list\<string\>\> | -| string | list\<string\> | +| string | list\<string\> | + ## Examples Split the string's words into separate rows + ```nu > 'hello world' | split words ╭───┬───────╮ @@ -45,6 +47,7 @@ Split the string's words into separate rows ``` Split the string's words, of at least 3 characters, into separate rows + ```nu > 'hello to the world' | split words --min-word-length 3 ╭───┬───────╮ @@ -56,6 +59,7 @@ Split the string's words, of at least 3 characters, into separate rows ``` A real-world example of splitting words + ```nu > http get https://www.gutenberg.org/files/11/11-0.txt | str downcase | split words --min-word-length 2 | uniq --count | sort-by count --reverse | first 10 diff --git a/commands/docs/start.md b/src/content/docs/commands/docs/start.md similarity index 94% rename from commands/docs/start.md rename to src/content/docs/commands/docs/start.md index 84a08e6ffb5..92fb58ef56b 100644 --- a/commands/docs/start.md +++ b/src/content/docs/commands/docs/start.md @@ -9,6 +9,7 @@ usage: | Open a folder, file or website in the default application or viewer. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filesystem @@ -17,12 +18,11 @@ feature: default ## Signature -```> start {flags} (path)``` +`> start {flags} (path)` ## Parameters - - `path`: Path to open. - +- `path`: Path to open. ## Input/output types: @@ -30,33 +30,39 @@ feature: default | ------- | ------ | | nothing | any | | string | any | + ## Examples Open a text file with the default text editor + ```nu > start file.txt ``` Open an image with the default image viewer + ```nu > start file.jpg ``` Open the current directory with the default file manager + ```nu > start . ``` Open a pdf with the default pdf viewer + ```nu > start file.pdf ``` Open a website with default browser + ```nu > start https://www.nushell.sh diff --git a/src/content/docs/commands/docs/stor.md b/src/content/docs/commands/docs/stor.md new file mode 100644 index 00000000000..577ed79235a --- /dev/null +++ b/src/content/docs/commands/docs/stor.md @@ -0,0 +1,44 @@ +--- +title: stor +categories: | + database +version: 0.90.0 +database: | + Various commands for working with the in-memory sqlite database. +usage: | + Various commands for working with the in-memory sqlite database. +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for database + +<div class='command-title'>{{ $frontmatter.database }}</div> + +## Signature + +`> stor {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | type | usage | +| ------------------------------------------- | ------- | --------------------------------------------------------------------------- | +| [`stor create`](/commands/docs/stor_create) | Builtin | Create a table in the in-memory sqlite database. | +| [`stor delete`](/commands/docs/stor_delete) | Builtin | Delete a table or specified rows in the in-memory sqlite database. | +| [`stor export`](/commands/docs/stor_export) | Builtin | Export the in-memory sqlite database to a sqlite database file. | +| [`stor import`](/commands/docs/stor_import) | Builtin | Import a sqlite database file into the in-memory sqlite database. | +| [`stor insert`](/commands/docs/stor_insert) | Builtin | Insert information into a specified table in the in-memory sqlite database. | +| [`stor open`](/commands/docs/stor_open) | Builtin | Opens the in-memory sqlite database. | +| [`stor reset`](/commands/docs/stor_reset) | Builtin | Reset the in-memory database by dropping all tables. | +| [`stor update`](/commands/docs/stor_update) | Builtin | Update information in a specified table in the in-memory sqlite database. | diff --git a/commands/docs/stor_create.md b/src/content/docs/commands/docs/stor_create.md similarity index 82% rename from commands/docs/stor_create.md rename to src/content/docs/commands/docs/stor_create.md index 82eed2d9f91..1f0a8dedc59 100644 --- a/commands/docs/stor_create.md +++ b/src/content/docs/commands/docs/stor_create.md @@ -9,6 +9,7 @@ usage: | Create a table in the in-memory sqlite database. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for database @@ -17,13 +18,12 @@ feature: default ## Signature -```> stor create {flags} ``` +`> stor create {flags} ` ## Flags - - `--table-name, -t {string}`: name of the table you want to create - - `--columns, -c {record}`: a record of column names and datatypes - +- `--table-name, -t {string}`: name of the table you want to create +- `--columns, -c {record}`: a record of column names and datatypes ## Input/output types: @@ -34,6 +34,7 @@ feature: default ## Examples Create an in-memory sqlite database with specified table name, column names, and column data types + ```nu > stor create --table-name nudb --columns {bool1: bool, int1: int, float1: float, str1: str, datetime1: datetime} diff --git a/commands/docs/stor_delete.md b/src/content/docs/commands/docs/stor_delete.md similarity index 80% rename from commands/docs/stor_delete.md rename to src/content/docs/commands/docs/stor_delete.md index ceafe50ee4f..4889a91c014 100644 --- a/commands/docs/stor_delete.md +++ b/src/content/docs/commands/docs/stor_delete.md @@ -9,6 +9,7 @@ usage: | Delete a table or specified rows in the in-memory sqlite database. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for database @@ -17,13 +18,12 @@ feature: default ## Signature -```> stor delete {flags} ``` +`> stor delete {flags} ` ## Flags - - `--table-name, -t {string}`: name of the table you want to insert into - - `--where-clause, -w {string}`: a sql string to use as a where clause without the WHERE keyword - +- `--table-name, -t {string}`: name of the table you want to insert into +- `--where-clause, -w {string}`: a sql string to use as a where clause without the WHERE keyword ## Input/output types: @@ -34,12 +34,14 @@ feature: default ## Examples Delete a table from the in-memory sqlite database + ```nu > stor delete --table-name nudb ``` Delete some rows from the in-memory sqlite database with a where clause + ```nu > stor delete --table-name nudb --where-clause "int1 == 5" diff --git a/commands/docs/stor_export.md b/src/content/docs/commands/docs/stor_export.md similarity index 85% rename from commands/docs/stor_export.md rename to src/content/docs/commands/docs/stor_export.md index b19f1e0a5ee..85bd456e10e 100644 --- a/commands/docs/stor_export.md +++ b/src/content/docs/commands/docs/stor_export.md @@ -9,6 +9,7 @@ usage: | Export the in-memory sqlite database to a sqlite database file. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for database @@ -17,12 +18,11 @@ feature: default ## Signature -```> stor export {flags} ``` +`> stor export {flags} ` ## Flags - - `--file-name, -f {string}`: file name to export the sqlite in-memory database to - +- `--file-name, -f {string}`: file name to export the sqlite in-memory database to ## Input/output types: @@ -33,6 +33,7 @@ feature: default ## Examples Export the in-memory sqlite database + ```nu > stor export --file-name nudb.sqlite diff --git a/commands/docs/stor_import.md b/src/content/docs/commands/docs/stor_import.md similarity index 86% rename from commands/docs/stor_import.md rename to src/content/docs/commands/docs/stor_import.md index 14b4dd85d90..697ea166a12 100644 --- a/commands/docs/stor_import.md +++ b/src/content/docs/commands/docs/stor_import.md @@ -9,6 +9,7 @@ usage: | Import a sqlite database file into the in-memory sqlite database. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for database @@ -17,12 +18,11 @@ feature: default ## Signature -```> stor import {flags} ``` +`> stor import {flags} ` ## Flags - - `--file-name, -f {string}`: file name to export the sqlite in-memory database to - +- `--file-name, -f {string}`: file name to export the sqlite in-memory database to ## Input/output types: @@ -33,6 +33,7 @@ feature: default ## Examples Import a sqlite database file into the in-memory sqlite database + ```nu > stor import --file-name nudb.sqlite diff --git a/commands/docs/stor_insert.md b/src/content/docs/commands/docs/stor_insert.md similarity index 79% rename from commands/docs/stor_insert.md rename to src/content/docs/commands/docs/stor_insert.md index f61a6db5663..bf836a75bf2 100644 --- a/commands/docs/stor_insert.md +++ b/src/content/docs/commands/docs/stor_insert.md @@ -9,6 +9,7 @@ usage: | Insert information into a specified table in the in-memory sqlite database. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for database @@ -17,13 +18,12 @@ feature: default ## Signature -```> stor insert {flags} ``` +`> stor insert {flags} ` ## Flags - - `--table-name, -t {string}`: name of the table you want to insert into - - `--data-record, -d {record}`: a record of column names and column values to insert into the specified table - +- `--table-name, -t {string}`: name of the table you want to insert into +- `--data-record, -d {record}`: a record of column names and column values to insert into the specified table ## Input/output types: @@ -34,6 +34,7 @@ feature: default ## Examples Insert data the in-memory sqlite database using a data-record of column-name and column-value pairs + ```nu > stor insert --table-name nudb --data-record {bool1: true, int1: 5, float1: 1.1, str1: fdncred, datetime1: 2023-04-17} diff --git a/commands/docs/stor_open.md b/src/content/docs/commands/docs/stor_open.md similarity index 95% rename from commands/docs/stor_open.md rename to src/content/docs/commands/docs/stor_open.md index 2c48dd209db..bf620ab10b9 100644 --- a/commands/docs/stor_open.md +++ b/src/content/docs/commands/docs/stor_open.md @@ -9,6 +9,7 @@ usage: | Opens the in-memory sqlite database. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for database @@ -17,8 +18,7 @@ feature: default ## Signature -```> stor open {flags} ``` - +`> stor open {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Open the in-memory sqlite database + ```nu > stor open diff --git a/commands/docs/stor_reset.md b/src/content/docs/commands/docs/stor_reset.md similarity index 95% rename from commands/docs/stor_reset.md rename to src/content/docs/commands/docs/stor_reset.md index 092829a0d08..f3c8b5fc847 100644 --- a/commands/docs/stor_reset.md +++ b/src/content/docs/commands/docs/stor_reset.md @@ -9,6 +9,7 @@ usage: | Reset the in-memory database by dropping all tables. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for database @@ -17,8 +18,7 @@ feature: default ## Signature -```> stor reset {flags} ``` - +`> stor reset {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Reset the in-memory sqlite database + ```nu > stor reset diff --git a/commands/docs/stor_update.md b/src/content/docs/commands/docs/stor_update.md similarity index 74% rename from commands/docs/stor_update.md rename to src/content/docs/commands/docs/stor_update.md index 46370ce30ad..80d0db692c6 100644 --- a/commands/docs/stor_update.md +++ b/src/content/docs/commands/docs/stor_update.md @@ -9,6 +9,7 @@ usage: | Update information in a specified table in the in-memory sqlite database. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for database @@ -17,14 +18,13 @@ feature: default ## Signature -```> stor update {flags} ``` +`> stor update {flags} ` ## Flags - - `--table-name, -t {string}`: name of the table you want to insert into - - `--update-record, -u {record}`: a record of column names and column values to update in the specified table - - `--where-clause, -w {string}`: a sql string to use as a where clause without the WHERE keyword - +- `--table-name, -t {string}`: name of the table you want to insert into +- `--update-record, -u {record}`: a record of column names and column values to update in the specified table +- `--where-clause, -w {string}`: a sql string to use as a where clause without the WHERE keyword ## Input/output types: @@ -35,12 +35,14 @@ feature: default ## Examples Update the in-memory sqlite database + ```nu > stor update --table-name nudb --update-record {str1: nushell datetime1: 2020-04-17} ``` Update the in-memory sqlite database with a where clause + ```nu > stor update --table-name nudb --update-record {str1: nushell datetime1: 2020-04-17} --where-clause "bool1 = 1" diff --git a/src/content/docs/commands/docs/str.md b/src/content/docs/commands/docs/str.md new file mode 100644 index 00000000000..ce1f6126c27 --- /dev/null +++ b/src/content/docs/commands/docs/str.md @@ -0,0 +1,63 @@ +--- +title: str +categories: | + strings +version: 0.90.0 +strings: | + Various commands for working with string data. +usage: | + Various commands for working with string data. +feature: extra +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for strings + +<div class='command-title'>{{ $frontmatter.strings }}</div> + +:::caution[warning] +Command `str` was not included in the official binaries by default, you have to build it with `--features=extra` flag +::: + +## Signature + +`> str {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | type | usage | +| --------------------------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| [`str camel-case`](/commands/docs/str_camel-case) | Builtin | Convert a string to camelCase. | +| [`str capitalize`](/commands/docs/str_capitalize) | Builtin | Capitalize first letter of text. | +| [`str contains`](/commands/docs/str_contains) | Builtin | Checks if string input contains a substring. | +| [`str distance`](/commands/docs/str_distance) | Builtin | Compare two strings and return the edit distance/Levenshtein distance. | +| [`str downcase`](/commands/docs/str_downcase) | Builtin | Make text lowercase. | +| [`str ends-with`](/commands/docs/str_ends-with) | Builtin | Check if an input ends with a string. | +| [`str escape-glob`](/commands/docs/str_escape-glob) | Builtin | Escape glob pattern. | +| [`str expand`](/commands/docs/str_expand) | Builtin | Generates all possible combinations defined in brace expansion syntax. | +| [`str index-of`](/commands/docs/str_index-of) | Builtin | Returns start index of first occurrence of string in input, or -1 if no match. | +| [`str join`](/commands/docs/str_join) | Builtin | Concatenate multiple strings into a single string, with an optional separator between each. | +| [`str kebab-case`](/commands/docs/str_kebab-case) | Builtin | Convert a string to kebab-case. | +| [`str length`](/commands/docs/str_length) | Builtin | Output the length of any strings in the pipeline. | +| [`str pascal-case`](/commands/docs/str_pascal-case) | Builtin | Convert a string to PascalCase. | +| [`str replace`](/commands/docs/str_replace) | Builtin | Find and replace text. | +| [`str reverse`](/commands/docs/str_reverse) | Builtin | Reverse every string in the pipeline. | +| [`str screaming-snake-case`](/commands/docs/str_screaming-snake-case) | Builtin | Convert a string to SCREAMING_SNAKE_CASE. | +| [`str snake-case`](/commands/docs/str_snake-case) | Builtin | Convert a string to snake_case. | +| [`str starts-with`](/commands/docs/str_starts-with) | Builtin | Check if an input starts with a string. | +| [`str stats`](/commands/docs/str_stats) | Builtin | Gather word count statistics on the text. | +| [`str substring`](/commands/docs/str_substring) | Builtin | Get part of a string. Note that the start is included but the end is excluded, and that the first character of a string is index 0. | +| [`str title-case`](/commands/docs/str_title-case) | Builtin | Convert a string to Title Case. | +| [`str trim`](/commands/docs/str_trim) | Builtin | Trim whitespace or specific character. | +| [`str upcase`](/commands/docs/str_upcase) | Builtin | Make text uppercase. | diff --git a/commands/docs/str_camel-case.md b/src/content/docs/commands/docs/str_camel-case.md similarity index 72% rename from commands/docs/str_camel-case.md rename to src/content/docs/commands/docs/str_camel-case.md index 7a2e7e8bdc6..c62fa65b577 100644 --- a/commands/docs/str_camel-case.md +++ b/src/content/docs/commands/docs/str_camel-case.md @@ -9,54 +9,59 @@ usage: | Convert a string to camelCase. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings <div class='command-title'>{{ $frontmatter.strings }}</div> - -::: warning - Command `str camel-case` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `str camel-case` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> str camel-case {flags} ...rest``` +`> str camel-case {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, convert strings at the given cell paths - +- `...rest`: For a data structure input, convert strings at the given cell paths ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples convert a string to camelCase + ```nu > 'NuShell' | str camel-case nuShell ``` convert a string to camelCase + ```nu > 'this-is-the-first-case' | str camel-case thisIsTheFirstCase ``` convert a string to camelCase + ```nu > 'this_is_the_second_case' | str camel-case thisIsTheSecondCase ``` convert a column from a table to camelCase + ```nu > [[lang, gems]; [nu_test, 100]] | str camel-case lang ╭───┬────────┬──────╮ diff --git a/commands/docs/str_capitalize.md b/src/content/docs/commands/docs/str_capitalize.md similarity index 77% rename from commands/docs/str_capitalize.md rename to src/content/docs/commands/docs/str_capitalize.md index a874ba7f5bd..c010a326f19 100644 --- a/commands/docs/str_capitalize.md +++ b/src/content/docs/commands/docs/str_capitalize.md @@ -9,6 +9,7 @@ usage: | Capitalize first letter of text. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,36 +18,39 @@ feature: default ## Signature -```> str capitalize {flags} ...rest``` +`> str capitalize {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, convert strings at the given cell paths. - +- `...rest`: For a data structure input, convert strings at the given cell paths. ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples Capitalize contents + ```nu > 'good day' | str capitalize Good day ``` Capitalize contents + ```nu > 'anton' | str capitalize Anton ``` Capitalize a column in a table + ```nu > [[lang, gems]; [nu_test, 100]] | str capitalize lang ╭───┬─────────┬──────╮ diff --git a/commands/docs/str_contains.md b/src/content/docs/commands/docs/str_contains.md similarity index 83% rename from commands/docs/str_contains.md rename to src/content/docs/commands/docs/str_contains.md index 47e3826473d..6096f716eab 100644 --- a/commands/docs/str_contains.md +++ b/src/content/docs/commands/docs/str_contains.md @@ -9,6 +9,7 @@ usage: | Checks if string input contains a substring. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,42 +18,45 @@ feature: default ## Signature -```> str contains {flags} (string) ...rest``` +`> str contains {flags} (string) ...rest` ## Flags - - `--ignore-case, -i`: search is case insensitive - - `--not, -n`: does not contain +- `--ignore-case, -i`: search is case insensitive +- `--not, -n`: does not contain ## Parameters - - `string`: The substring to find. - - `...rest`: For a data structure input, check strings at the given cell paths, and replace with result. - +- `string`: The substring to find. +- `...rest`: For a data structure input, check strings at the given cell paths, and replace with result. ## Input/output types: -| input | output | -| ------------ | ---------- | +| input | output | +| -------------- | ------------ | | list\<string\> | list\<bool\> | -| record | record | -| string | bool | -| table | table | +| record | record | +| string | bool | +| table | table | + ## Examples Check if input contains string + ```nu > 'my_library.rb' | str contains '.rb' true ``` Check if input contains string case insensitive + ```nu > 'my_library.rb' | str contains --ignore-case '.RB' true ``` Check if input contains string in a record + ```nu > { ColA: test, ColB: 100 } | str contains 'e' ColA ╭──────┬──────╮ @@ -62,6 +66,7 @@ Check if input contains string in a record ``` Check if input contains string in a table + ```nu > [[ColA ColB]; [test 100]] | str contains --ignore-case 'E' ColA ╭───┬──────┬──────╮ @@ -73,6 +78,7 @@ Check if input contains string in a table ``` Check if input contains string in a table + ```nu > [[ColA ColB]; [test hello]] | str contains 'e' ColA ColB ╭───┬──────┬──────╮ @@ -84,12 +90,14 @@ Check if input contains string in a table ``` Check if input string contains 'banana' + ```nu > 'hello' | str contains 'banana' false ``` Check if list contains string + ```nu > [one two three] | str contains o ╭───┬───────╮ @@ -101,6 +109,7 @@ Check if list contains string ``` Check if list does not contain string + ```nu > [one two three] | str contains --not o ╭───┬───────╮ diff --git a/commands/docs/str_distance.md b/src/content/docs/commands/docs/str_distance.md similarity index 86% rename from commands/docs/str_distance.md rename to src/content/docs/commands/docs/str_distance.md index cbbce0aaf1c..acc0313b8a5 100644 --- a/commands/docs/str_distance.md +++ b/src/content/docs/commands/docs/str_distance.md @@ -9,6 +9,7 @@ usage: | Compare two strings and return the edit distance/Levenshtein distance. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,13 +18,12 @@ feature: default ## Signature -```> str distance {flags} (compare-string) ...rest``` +`> str distance {flags} (compare-string) ...rest` ## Parameters - - `compare-string`: The first string to compare. - - `...rest`: For a data structure input, check strings at the given cell paths, and replace with result. - +- `compare-string`: The first string to compare. +- `...rest`: For a data structure input, check strings at the given cell paths, and replace with result. ## Input/output types: @@ -32,15 +32,18 @@ feature: default | record | record | | string | int | | table | table | + ## Examples get the edit distance between two strings + ```nu > 'nushell' | str distance 'nutshell' 1 ``` Compute edit distance between strings in table and another string, using cell paths + ```nu > [{a: 'nutshell' b: 'numetal'}] | str distance 'nushell' 'a' 'b' ╭───┬───┬───╮ @@ -52,6 +55,7 @@ Compute edit distance between strings in table and another string, using cell pa ``` Compute edit distance between strings in record and another string, using cell paths + ```nu > {a: 'nutshell' b: 'numetal'} | str distance 'nushell' a b ╭───┬───╮ diff --git a/commands/docs/str_downcase.md b/src/content/docs/commands/docs/str_downcase.md similarity index 80% rename from commands/docs/str_downcase.md rename to src/content/docs/commands/docs/str_downcase.md index a4215d74dec..35a116d6bea 100644 --- a/commands/docs/str_downcase.md +++ b/src/content/docs/commands/docs/str_downcase.md @@ -9,6 +9,7 @@ usage: | Make text lowercase. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,36 +18,39 @@ feature: default ## Signature -```> str downcase {flags} ...rest``` +`> str downcase {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, convert strings at the given cell paths. - +- `...rest`: For a data structure input, convert strings at the given cell paths. ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples Downcase contents + ```nu > 'NU' | str downcase nu ``` Downcase contents + ```nu > 'TESTa' | str downcase testa ``` Downcase contents + ```nu > [[ColA ColB]; [Test ABC]] | str downcase ColA ╭───┬──────┬──────╮ @@ -58,6 +62,7 @@ Downcase contents ``` Downcase contents + ```nu > [[ColA ColB]; [Test ABC]] | str downcase ColA ColB ╭───┬──────┬──────╮ diff --git a/commands/docs/str_ends-with.md b/src/content/docs/commands/docs/str_ends-with.md similarity index 70% rename from commands/docs/str_ends-with.md rename to src/content/docs/commands/docs/str_ends-with.md index 1bb60b06af4..ca332505c0c 100644 --- a/commands/docs/str_ends-with.md +++ b/src/content/docs/commands/docs/str_ends-with.md @@ -9,6 +9,7 @@ usage: | Check if an input ends with a string. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,35 +18,37 @@ feature: default ## Signature -```> str ends-with {flags} (string) ...rest``` +`> str ends-with {flags} (string) ...rest` ## Flags - - `--ignore-case, -i`: search is case insensitive +- `--ignore-case, -i`: search is case insensitive ## Parameters - - `string`: The string to match. - - `...rest`: For a data structure input, check strings at the given cell paths, and replace with result. - +- `string`: The string to match. +- `...rest`: For a data structure input, check strings at the given cell paths, and replace with result. ## Input/output types: -| input | output | -| ------------ | ---------- | +| input | output | +| -------------- | ------------ | | list\<string\> | list\<bool\> | -| record | record | -| string | bool | -| table | table | +| record | record | +| string | bool | +| table | table | + ## Examples Checks if string ends with '.rb' + ```nu > 'my_library.rb' | str ends-with '.rb' true ``` Checks if strings end with '.txt' + ```nu > ['my_library.rb', 'README.txt'] | str ends-with '.txt' ╭───┬───────╮ @@ -56,6 +59,7 @@ Checks if strings end with '.txt' ``` Checks if string ends with '.RB', case-insensitive + ```nu > 'my_library.rb' | str ends-with --ignore-case '.RB' true diff --git a/commands/docs/str_escape-glob.md b/src/content/docs/commands/docs/str_escape-glob.md similarity index 65% rename from commands/docs/str_escape-glob.md rename to src/content/docs/commands/docs/str_escape-glob.md index 585030c058d..67ceff92f7d 100644 --- a/commands/docs/str_escape-glob.md +++ b/src/content/docs/commands/docs/str_escape-glob.md @@ -9,6 +9,7 @@ usage: | Escape glob pattern. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,24 +18,25 @@ feature: default ## Signature -```> str escape-glob {flags} ...rest``` +`> str escape-glob {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, turn strings at the given cell paths into substrings. - +- `...rest`: For a data structure input, turn strings at the given cell paths into substrings. ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples escape glob pattern before list + ```nu > let f = 'test[a]'; ls ($f | str escape-glob) diff --git a/commands/docs/str_expand.md b/src/content/docs/commands/docs/str_expand.md similarity index 92% rename from commands/docs/str_expand.md rename to src/content/docs/commands/docs/str_expand.md index fdf77c912a7..85281996c9a 100644 --- a/commands/docs/str_expand.md +++ b/src/content/docs/commands/docs/str_expand.md @@ -9,6 +9,7 @@ usage: | Generates all possible combinations defined in brace expansion syntax. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,22 +18,23 @@ feature: default ## Signature -```> str expand {flags} ``` +`> str expand {flags} ` ## Flags - - `--path, -`: Replaces all backslashes with double backslashes, useful for Path. - +- `--path, -`: Replaces all backslashes with double backslashes, useful for Path. ## Input/output types: -| input | output | -| ------------ | ------------------ | +| input | output | +| -------------- | ---------------------- | | list\<string\> | list\<list\<string\>\> | -| string | list\<string\> | +| string | list\<string\> | + ## Examples Define a range inside braces to produce a list of string. + ```nu > "{3..5}" | str expand ╭───┬───╮ @@ -44,6 +46,7 @@ Define a range inside braces to produce a list of string. ``` Ignore the next character after the backslash ('\') + ```nu > 'A{B\,,C}' | str expand ╭───┬─────╮ @@ -54,6 +57,7 @@ Ignore the next character after the backslash ('\') ``` Commas that are not inside any braces need to be skipped. + ```nu > 'Welcome\, {home,mon ami}!' | str expand ╭───┬───────────────────╮ @@ -64,6 +68,7 @@ Commas that are not inside any braces need to be skipped. ``` Use double backslashes to add a backslash. + ```nu > 'A{B\\,C}' | str expand ╭───┬─────╮ @@ -74,6 +79,7 @@ Use double backslashes to add a backslash. ``` Export comma separated values inside braces (`{}`) to a string list. + ```nu > "{apple,banana,cherry}" | str expand ╭───┬────────╮ @@ -85,6 +91,7 @@ Export comma separated values inside braces (`{}`) to a string list. ``` If the piped data is path, you may want to use --path flag, or else manually replace the backslashes with double backslashes. + ```nu > 'C:\{Users,Windows}' | str expand --path ╭───┬────────────╮ @@ -95,6 +102,7 @@ If the piped data is path, you may want to use --path flag, or else manually rep ``` Brace expressions can be used one after another. + ```nu > "A{b,c}D{e,f}G" | str expand ╭───┬───────╮ @@ -107,6 +115,7 @@ Brace expressions can be used one after another. ``` Collection may include an empty item. It can be put at the start of the list. + ```nu > "A{,B,C}" | str expand ╭───┬────╮ @@ -118,6 +127,7 @@ Collection may include an empty item. It can be put at the start of the list. ``` Empty item can be at the end of the collection. + ```nu > "A{B,C,}" | str expand ╭───┬────╮ @@ -129,6 +139,7 @@ Empty item can be at the end of the collection. ``` Empty item can be in the middle of the collection. + ```nu > "A{B,,C}" | str expand ╭───┬────╮ @@ -140,6 +151,7 @@ Empty item can be in the middle of the collection. ``` Also, it is possible to use one inside another. Here is a real-world example, that creates files: + ```nu > "A{B{1,3},C{2,5}}D" | str expand ╭───┬──────╮ @@ -152,4 +164,5 @@ Also, it is possible to use one inside another. Here is a real-world example, th ``` ## Notes -This syntax may seem familiar with `glob {A,B}.C`. The difference is glob relies on filesystem, but str expand is not. Inside braces, we put variants. Then basically we're creating all possible outcomes. \ No newline at end of file + +This syntax may seem familiar with `glob {A,B}.C`. The difference is glob relies on filesystem, but str expand is not. Inside braces, we put variants. Then basically we're creating all possible outcomes. diff --git a/commands/docs/str_index-of.md b/src/content/docs/commands/docs/str_index-of.md similarity index 65% rename from commands/docs/str_index-of.md rename to src/content/docs/commands/docs/str_index-of.md index f3e548bc819..e0d98354f9c 100644 --- a/commands/docs/str_index-of.md +++ b/src/content/docs/commands/docs/str_index-of.md @@ -9,6 +9,7 @@ usage: | Returns start index of first occurrence of string in input, or -1 if no match. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,62 +18,68 @@ feature: default ## Signature -```> str index-of {flags} (string) ...rest``` +`> str index-of {flags} (string) ...rest` ## Flags - - `--grapheme-clusters, -g`: count indexes using grapheme clusters (all visible chars have length 1) - - `--utf-8-bytes, -b`: count indexes using UTF-8 bytes (default; non-ASCII chars have length 2+) - - `--range, -r {range}`: optional start and/or end index - - `--end, -e`: search from the end of the input +- `--grapheme-clusters, -g`: count indexes using grapheme clusters (all visible chars have length 1) +- `--utf-8-bytes, -b`: count indexes using UTF-8 bytes (default; non-ASCII chars have length 2+) +- `--range, -r {range}`: optional start and/or end index +- `--end, -e`: search from the end of the input ## Parameters - - `string`: The string to find in the input. - - `...rest`: For a data structure input, search strings at the given cell paths, and replace with result. - +- `string`: The string to find in the input. +- `...rest`: For a data structure input, search strings at the given cell paths, and replace with result. ## Input/output types: -| input | output | -| ------------ | --------- | +| input | output | +| -------------- | ----------- | | list\<string\> | list\<int\> | -| record | record | -| string | int | -| table | table | +| record | record | +| string | int | +| table | table | + ## Examples Returns index of string in input + ```nu > 'my_library.rb' | str index-of '.rb' 10 ``` Count length using grapheme clusters + ```nu > '🇯🇵ほげ ふが ぴよ' | str index-of --grapheme-clusters 'ふが' 4 ``` Returns index of string in input within a`rhs open range` + ```nu > '.rb.rb' | str index-of '.rb' --range 1.. 3 ``` Returns index of string in input within a lhs open range + ```nu > '123456' | str index-of '6' --range ..4 -1 ``` Returns index of string in input within a range + ```nu > '123456' | str index-of '3' --range 1..4 2 ``` Returns index of string in input + ```nu > '/this/is/some/path/file.txt' | str index-of '/' -e 18 diff --git a/commands/docs/str_join.md b/src/content/docs/commands/docs/str_join.md similarity index 81% rename from commands/docs/str_join.md rename to src/content/docs/commands/docs/str_join.md index 7e8e34fc5ab..20d32f52cca 100644 --- a/commands/docs/str_join.md +++ b/src/content/docs/commands/docs/str_join.md @@ -9,6 +9,7 @@ usage: | Concatenate multiple strings into a single string, with an optional separator between each. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,28 +18,30 @@ feature: default ## Signature -```> str join {flags} (separator)``` +`> str join {flags} (separator)` ## Parameters - - `separator`: Optional separator to use when creating string. - +- `separator`: Optional separator to use when creating string. ## Input/output types: -| input | output | -| --------- | ------ | +| input | output | +| ----------- | ------ | | list\<any\> | string | -| string | string | +| string | string | + ## Examples Create a string from input + ```nu > ['nu', 'shell'] | str join nushell ``` Create a string from input with a separator + ```nu > ['nu', 'shell'] | str join '-' nu-shell diff --git a/commands/docs/str_kebab-case.md b/src/content/docs/commands/docs/str_kebab-case.md similarity index 72% rename from commands/docs/str_kebab-case.md rename to src/content/docs/commands/docs/str_kebab-case.md index 986a26adaf6..c9d4f2f74d7 100644 --- a/commands/docs/str_kebab-case.md +++ b/src/content/docs/commands/docs/str_kebab-case.md @@ -9,54 +9,59 @@ usage: | Convert a string to kebab-case. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings <div class='command-title'>{{ $frontmatter.strings }}</div> - -::: warning - Command `str kebab-case` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `str kebab-case` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> str kebab-case {flags} ...rest``` +`> str kebab-case {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, convert strings at the given cell paths - +- `...rest`: For a data structure input, convert strings at the given cell paths ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples convert a string to kebab-case + ```nu > 'NuShell' | str kebab-case nu-shell ``` convert a string to kebab-case + ```nu > 'thisIsTheFirstCase' | str kebab-case this-is-the-first-case ``` convert a string to kebab-case + ```nu > 'THIS_IS_THE_SECOND_CASE' | str kebab-case this-is-the-second-case ``` convert a column from a table to kebab-case + ```nu > [[lang, gems]; [nuTest, 100]] | str kebab-case lang ╭───┬─────────┬──────╮ diff --git a/commands/docs/str_length.md b/src/content/docs/commands/docs/str_length.md similarity index 64% rename from commands/docs/str_length.md rename to src/content/docs/commands/docs/str_length.md index 85d2ef66816..0d660bd7275 100644 --- a/commands/docs/str_length.md +++ b/src/content/docs/commands/docs/str_length.md @@ -9,6 +9,7 @@ usage: | Output the length of any strings in the pipeline. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,41 +18,44 @@ feature: default ## Signature -```> str length {flags} ...rest``` +`> str length {flags} ...rest` ## Flags - - `--grapheme-clusters, -g`: count length using grapheme clusters (all visible chars have length 1) - - `--utf-8-bytes, -b`: count length using UTF-8 bytes (default; all non-ASCII chars have length 2+) +- `--grapheme-clusters, -g`: count length using grapheme clusters (all visible chars have length 1) +- `--utf-8-bytes, -b`: count length using UTF-8 bytes (default; all non-ASCII chars have length 2+) ## Parameters - - `...rest`: For a data structure input, replace strings at the given cell paths with their length. - +- `...rest`: For a data structure input, replace strings at the given cell paths with their length. ## Input/output types: -| input | output | -| ------------ | --------- | +| input | output | +| -------------- | ----------- | | list\<string\> | list\<int\> | -| record | record | -| string | int | -| table | table | +| record | record | +| string | int | +| table | table | + ## Examples Return the lengths of a string + ```nu > 'hello' | str length 5 ``` Count length using grapheme clusters + ```nu > '🇯🇵ほげ ふが ぴよ' | str length --grapheme-clusters 9 ``` Return the lengths of multiple strings + ```nu > ['hi' 'there'] | str length ╭───┬───╮ diff --git a/commands/docs/str_pascal-case.md b/src/content/docs/commands/docs/str_pascal-case.md similarity index 72% rename from commands/docs/str_pascal-case.md rename to src/content/docs/commands/docs/str_pascal-case.md index 0f2baf8e8a1..677a24dc77f 100644 --- a/commands/docs/str_pascal-case.md +++ b/src/content/docs/commands/docs/str_pascal-case.md @@ -9,54 +9,59 @@ usage: | Convert a string to PascalCase. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings <div class='command-title'>{{ $frontmatter.strings }}</div> - -::: warning - Command `str pascal-case` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `str pascal-case` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> str pascal-case {flags} ...rest``` +`> str pascal-case {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, convert strings at the given cell paths - +- `...rest`: For a data structure input, convert strings at the given cell paths ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples convert a string to PascalCase + ```nu > 'nu-shell' | str pascal-case NuShell ``` convert a string to PascalCase + ```nu > 'this-is-the-first-case' | str pascal-case ThisIsTheFirstCase ``` convert a string to PascalCase + ```nu > 'this_is_the_second_case' | str pascal-case ThisIsTheSecondCase ``` convert a column from a table to PascalCase + ```nu > [[lang, gems]; [nu_test, 100]] | str pascal-case lang ╭───┬────────┬──────╮ diff --git a/commands/docs/str_replace.md b/src/content/docs/commands/docs/str_replace.md similarity index 78% rename from commands/docs/str_replace.md rename to src/content/docs/commands/docs/str_replace.md index 959544f1834..fcdcbb2c155 100644 --- a/commands/docs/str_replace.md +++ b/src/content/docs/commands/docs/str_replace.md @@ -9,6 +9,7 @@ usage: | Find and replace text. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,57 +18,62 @@ feature: default ## Signature -```> str replace {flags} (find) (replace) ...rest``` +`> str replace {flags} (find) (replace) ...rest` ## Flags - - `--all, -a`: replace all occurrences of the pattern - - `--no-expand, -n`: do not expand capture groups (like $name) in the replacement string - - `--regex, -r`: match the pattern as a regular expression in the input, instead of a substring - - `--multiline, -m`: multi-line regex mode (implies --regex): ^ and $ match begin/end of line; equivalent to (?m) +- `--all, -a`: replace all occurrences of the pattern +- `--no-expand, -n`: do not expand capture groups (like $name) in the replacement string +- `--regex, -r`: match the pattern as a regular expression in the input, instead of a substring +- `--multiline, -m`: multi-line regex mode (implies --regex): ^ and $ match begin/end of line; equivalent to (?m) ## Parameters - - `find`: The pattern to find. - - `replace`: The replacement string. - - `...rest`: For a data structure input, operate on strings at the given cell paths. - +- `find`: The pattern to find. +- `replace`: The replacement string. +- `...rest`: For a data structure input, operate on strings at the given cell paths. ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples Find and replace the first occurrence of a substring + ```nu > 'c:\some\cool\path' | str replace 'c:\some\cool' '~' ~\path ``` Find and replace all occurrences of a substring + ```nu > 'abc abc abc' | str replace --all 'b' 'z' azc azc azc ``` Find and replace contents with capture group using regular expression + ```nu > 'my_library.rb' | str replace -r '(.+).rb' '$1.nu' my_library.nu ``` Find and replace all occurrences of find string using regular expression + ```nu > 'abc abc abc' | str replace --all --regex 'b' 'z' azc azc azc ``` Find and replace all occurrences of find string in table using regular expression + ```nu > [[ColA ColB ColC]; [abc abc ads]] | str replace --all --regex 'b' 'z' ColA ColC ╭───┬──────┬──────┬──────╮ @@ -79,6 +85,7 @@ Find and replace all occurrences of find string in table using regular expressio ``` Find and replace all occurrences of find string in record using regular expression + ```nu > { KeyA: abc, KeyB: abc, KeyC: ads } | str replace --all --regex 'b' 'z' KeyA KeyC ╭──────┬─────╮ @@ -89,30 +96,35 @@ Find and replace all occurrences of find string in record using regular expressi ``` Find and replace contents without using the replace parameter as a regular expression + ```nu > 'dogs_$1_cats' | str replace -r '\$1' '$2' -n dogs_$2_cats ``` Use captures to manipulate the input text using regular expression + ```nu > "abc-def" | str replace -r "(.+)-(.+)" "${2}_${1}" def_abc ``` Find and replace with fancy-regex using regular expression + ```nu > 'a successful b' | str replace -r '\b([sS])uc(?:cs|s?)e(ed(?:ed|ing|s?)|ss(?:es|ful(?:ly)?|i(?:ons?|ve(?:ly)?)|ors?)?)\b' '${1}ucce$2' a successful b ``` Find and replace with fancy-regex using regular expression + ```nu > 'GHIKK-9+*' | str replace -r '[*[:xdigit:]+]' 'z' GHIKK-z+* ``` Find and replace on individual lines using multiline regular expression + ```nu > "non-matching line\n123. one line\n124. another line\n" | str replace --all --multiline '^[0-9]+\. ' '' non-matching line diff --git a/commands/docs/str_reverse.md b/src/content/docs/commands/docs/str_reverse.md similarity index 73% rename from commands/docs/str_reverse.md rename to src/content/docs/commands/docs/str_reverse.md index 946e58f8776..5ab45645995 100644 --- a/commands/docs/str_reverse.md +++ b/src/content/docs/commands/docs/str_reverse.md @@ -9,6 +9,7 @@ usage: | Reverse every string in the pipeline. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,30 +18,32 @@ feature: default ## Signature -```> str reverse {flags} ...rest``` +`> str reverse {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, reverse strings at the given cell paths. - +- `...rest`: For a data structure input, reverse strings at the given cell paths. ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples Reverse a single string + ```nu > 'Nushell' | str reverse llehsuN ``` Reverse multiple strings in a list + ```nu > ['Nushell' 'is' 'cool'] | str reverse ╭───┬─────────╮ diff --git a/commands/docs/str_screaming-snake-case.md b/src/content/docs/commands/docs/str_screaming-snake-case.md similarity index 73% rename from commands/docs/str_screaming-snake-case.md rename to src/content/docs/commands/docs/str_screaming-snake-case.md index 289ec63862d..b271fa4dc86 100644 --- a/commands/docs/str_screaming-snake-case.md +++ b/src/content/docs/commands/docs/str_screaming-snake-case.md @@ -9,54 +9,59 @@ usage: | Convert a string to SCREAMING_SNAKE_CASE. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings <div class='command-title'>{{ $frontmatter.strings }}</div> - -::: warning - Command `str screaming-snake-case` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `str screaming-snake-case` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> str screaming-snake-case {flags} ...rest``` +`> str screaming-snake-case {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, convert strings at the given cell paths - +- `...rest`: For a data structure input, convert strings at the given cell paths ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples convert a string to SCREAMING_SNAKE_CASE + ```nu > "NuShell" | str screaming-snake-case NU_SHELL ``` convert a string to SCREAMING_SNAKE_CASE + ```nu > "this_is_the_second_case" | str screaming-snake-case THIS_IS_THE_SECOND_CASE ``` convert a string to SCREAMING_SNAKE_CASE + ```nu > "this-is-the-first-case" | str screaming-snake-case THIS_IS_THE_FIRST_CASE ``` convert a column from a table to SCREAMING_SNAKE_CASE + ```nu > [[lang, gems]; [nu_test, 100]] | str screaming-snake-case lang ╭───┬─────────┬──────╮ diff --git a/commands/docs/str_snake-case.md b/src/content/docs/commands/docs/str_snake-case.md similarity index 72% rename from commands/docs/str_snake-case.md rename to src/content/docs/commands/docs/str_snake-case.md index 4f4a08b5ff6..1a0ce1e4f65 100644 --- a/commands/docs/str_snake-case.md +++ b/src/content/docs/commands/docs/str_snake-case.md @@ -9,54 +9,59 @@ usage: | Convert a string to snake_case. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings <div class='command-title'>{{ $frontmatter.strings }}</div> - -::: warning - Command `str snake-case` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `str snake-case` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> str snake-case {flags} ...rest``` +`> str snake-case {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, convert strings at the given cell paths - +- `...rest`: For a data structure input, convert strings at the given cell paths ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples convert a string to snake_case + ```nu > "NuShell" | str snake-case nu_shell ``` convert a string to snake_case + ```nu > "this_is_the_second_case" | str snake-case this_is_the_second_case ``` convert a string to snake_case + ```nu > "this-is-the-first-case" | str snake-case this_is_the_first_case ``` convert a column from a table to snake_case + ```nu > [[lang, gems]; [nuTest, 100]] | str snake-case lang ╭───┬─────────┬──────╮ diff --git a/commands/docs/str_starts-with.md b/src/content/docs/commands/docs/str_starts-with.md similarity index 70% rename from commands/docs/str_starts-with.md rename to src/content/docs/commands/docs/str_starts-with.md index 9eb340eda5d..5f78f8bf615 100644 --- a/commands/docs/str_starts-with.md +++ b/src/content/docs/commands/docs/str_starts-with.md @@ -9,6 +9,7 @@ usage: | Check if an input starts with a string. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,47 +18,51 @@ feature: default ## Signature -```> str starts-with {flags} (string) ...rest``` +`> str starts-with {flags} (string) ...rest` ## Flags - - `--ignore-case, -i`: search is case insensitive +- `--ignore-case, -i`: search is case insensitive ## Parameters - - `string`: The string to match. - - `...rest`: For a data structure input, check strings at the given cell paths, and replace with result. - +- `string`: The string to match. +- `...rest`: For a data structure input, check strings at the given cell paths, and replace with result. ## Input/output types: -| input | output | -| ------------ | ---------- | +| input | output | +| -------------- | ------------ | | list\<string\> | list\<bool\> | -| record | record | -| string | bool | -| table | table | +| record | record | +| string | bool | +| table | table | + ## Examples Checks if input string starts with 'my' + ```nu > 'my_library.rb' | str starts-with 'my' true ``` Checks if input string starts with 'Car' + ```nu > 'Cargo.toml' | str starts-with 'Car' true ``` Checks if input string starts with '.toml' + ```nu > 'Cargo.toml' | str starts-with '.toml' false ``` Checks if input string starts with 'cargo', case-insensitive + ```nu > 'Cargo.toml' | str starts-with --ignore-case 'cargo' true diff --git a/commands/docs/str_stats.md b/src/content/docs/commands/docs/str_stats.md similarity index 98% rename from commands/docs/str_stats.md rename to src/content/docs/commands/docs/str_stats.md index 563132e74cb..7444deb06ba 100644 --- a/commands/docs/str_stats.md +++ b/src/content/docs/commands/docs/str_stats.md @@ -9,6 +9,7 @@ usage: | Gather word count statistics on the text. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,8 +18,7 @@ feature: default ## Signature -```> str stats {flags} ``` - +`> str stats {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Count the number of words in a string + ```nu > "There are seven words in this sentence" | str stats ╭───────────┬────╮ @@ -41,6 +42,7 @@ Count the number of words in a string ``` Counts unicode characters + ```nu > '今天天气真好' | str stats ╭───────────┬────╮ @@ -53,6 +55,7 @@ Counts unicode characters ``` Counts Unicode characters correctly in a string + ```nu > "Amélie Amelie" | str stats ╭───────────┬────╮ diff --git a/commands/docs/str_substring.md b/src/content/docs/commands/docs/str_substring.md similarity index 62% rename from commands/docs/str_substring.md rename to src/content/docs/commands/docs/str_substring.md index 9ab27369c67..678d866ecce 100644 --- a/commands/docs/str_substring.md +++ b/src/content/docs/commands/docs/str_substring.md @@ -9,6 +9,7 @@ usage: | Get part of a string. Note that the start is included but the end is excluded, and that the first character of a string is index 0. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,36 +18,38 @@ feature: default ## Signature -```> str substring {flags} (range) ...rest``` +`> str substring {flags} (range) ...rest` ## Flags - - `--grapheme-clusters, -g`: count indexes and split using grapheme clusters (all visible chars have length 1) - - `--utf-8-bytes, -b`: count indexes and split using UTF-8 bytes (default; non-ASCII chars have length 2+) +- `--grapheme-clusters, -g`: count indexes and split using grapheme clusters (all visible chars have length 1) +- `--utf-8-bytes, -b`: count indexes and split using UTF-8 bytes (default; non-ASCII chars have length 2+) ## Parameters - - `range`: The indexes to substring [start end]. - - `...rest`: For a data structure input, turn strings at the given cell paths into substrings. - +- `range`: The indexes to substring [start end]. +- `...rest`: For a data structure input, turn strings at the given cell paths into substrings. ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples Get a substring "nushell" from the text "good nushell" using a range + ```nu > 'good nushell' | str substring 5..12 nushell ``` Count indexes and split using grapheme clusters + ```nu > '🇯🇵ほげ ふが ぴよ' | str substring --grapheme-clusters 4..6 ふが diff --git a/commands/docs/str_title-case.md b/src/content/docs/commands/docs/str_title-case.md similarity index 70% rename from commands/docs/str_title-case.md rename to src/content/docs/commands/docs/str_title-case.md index 4c680fddb27..3a9387c36e0 100644 --- a/commands/docs/str_title-case.md +++ b/src/content/docs/commands/docs/str_title-case.md @@ -9,48 +9,52 @@ usage: | Convert a string to Title Case. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings <div class='command-title'>{{ $frontmatter.strings }}</div> - -::: warning - Command `str title-case` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `str title-case` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> str title-case {flags} ...rest``` +`> str title-case {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, convert strings at the given cell paths - +- `...rest`: For a data structure input, convert strings at the given cell paths ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples convert a string to Title Case + ```nu > 'nu-shell' | str title-case Nu Shell ``` convert a string to Title Case + ```nu > 'this is a test case' | str title-case This Is A Test Case ``` convert a column from a table to Title Case + ```nu > [[title, count]; ['nu test', 100]] | str title-case title ╭───┬─────────┬───────╮ diff --git a/commands/docs/str_trim.md b/src/content/docs/commands/docs/str_trim.md similarity index 67% rename from commands/docs/str_trim.md rename to src/content/docs/commands/docs/str_trim.md index bacfa490159..803b1fbb70f 100644 --- a/commands/docs/str_trim.md +++ b/src/content/docs/commands/docs/str_trim.md @@ -9,6 +9,7 @@ usage: | Trim whitespace or specific character. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,54 +18,59 @@ feature: default ## Signature -```> str trim {flags} ...rest``` +`> str trim {flags} ...rest` ## Flags - - `--char, -c {string}`: character to trim (default: whitespace) - - `--left, -l`: trims characters only from the beginning of the string - - `--right, -r`: trims characters only from the end of the string +- `--char, -c {string}`: character to trim (default: whitespace) +- `--left, -l`: trims characters only from the beginning of the string +- `--right, -r`: trims characters only from the end of the string ## Parameters - - `...rest`: For a data structure input, trim strings at the given cell paths. - +- `...rest`: For a data structure input, trim strings at the given cell paths. ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples Trim whitespace + ```nu > 'Nu shell ' | str trim Nu shell ``` Trim a specific character (not the whitespace) + ```nu > '=== Nu shell ===' | str trim --char '=' Nu shell ``` Trim whitespace from the beginning of string + ```nu > ' Nu shell ' | str trim --left Nu shell ``` Trim whitespace from the end of string + ```nu > ' Nu shell ' | str trim --right Nu shell ``` Trim a specific character only from the end of the string + ```nu > '=== Nu shell ===' | str trim --right --char '=' === Nu shell diff --git a/commands/docs/str_upcase.md b/src/content/docs/commands/docs/str_upcase.md similarity index 64% rename from commands/docs/str_upcase.md rename to src/content/docs/commands/docs/str_upcase.md index 986c278b4f3..2e19b01180f 100644 --- a/commands/docs/str_upcase.md +++ b/src/content/docs/commands/docs/str_upcase.md @@ -9,6 +9,7 @@ usage: | Make text uppercase. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,24 +18,25 @@ feature: default ## Signature -```> str upcase {flags} ...rest``` +`> str upcase {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, convert strings at the given cell paths. - +- `...rest`: For a data structure input, convert strings at the given cell paths. ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples Upcase contents + ```nu > 'nu' | str upcase NU diff --git a/commands/docs/sys.md b/src/content/docs/commands/docs/sys.md similarity index 97% rename from commands/docs/sys.md rename to src/content/docs/commands/docs/sys.md index 9bf015145ff..854dbf14c8e 100644 --- a/commands/docs/sys.md +++ b/src/content/docs/commands/docs/sys.md @@ -9,6 +9,7 @@ usage: | View information about the system. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for system @@ -17,8 +18,7 @@ feature: default ## Signature -```> sys {flags} ``` - +`> sys {flags} ` ## Input/output types: @@ -29,18 +29,21 @@ feature: default ## Examples Show info about the system + ```nu > sys ``` Show the os system name with get + ```nu > (sys).host | get name ``` Show the os system name + ```nu > (sys).host.name diff --git a/commands/docs/table.md b/src/content/docs/commands/docs/table.md similarity index 67% rename from commands/docs/table.md rename to src/content/docs/commands/docs/table.md index e604b4225e3..012109793d5 100644 --- a/commands/docs/table.md +++ b/src/content/docs/commands/docs/table.md @@ -9,6 +9,7 @@ usage: | Render the table. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for viewers @@ -17,22 +18,21 @@ feature: default ## Signature -```> table {flags} ``` +`> table {flags} ` ## Flags - - `--theme, -t {string}`: set a table mode/theme - - `--index, -i {any}`: enable (true) or disable (false) the #/index column or set the starting index - - `--width, -w {int}`: number of terminal columns wide (not output columns) - - `--expand, -e`: expand the table structure in a light mode - - `--expand-deep, -d {int}`: an expand limit of recursion which will take place, must be used with --expand - - `--flatten, -`: Flatten simple arrays - - `--flatten-separator, - {string}`: sets a separator when 'flatten' used - - `--collapse, -c`: expand the table structure in collapse mode. -Be aware collapse mode currently doesn't support width control - - `--abbreviated, -a {int}`: abbreviate the data in the table by truncating the middle part and only showing amount provided on top and bottom - - `--list, -l`: list available table modes/themes - +- `--theme, -t {string}`: set a table mode/theme +- `--index, -i {any}`: enable (true) or disable (false) the #/index column or set the starting index +- `--width, -w {int}`: number of terminal columns wide (not output columns) +- `--expand, -e`: expand the table structure in a light mode +- `--expand-deep, -d {int}`: an expand limit of recursion which will take place, must be used with --expand +- `--flatten, -`: Flatten simple arrays +- `--flatten-separator, - {string}`: sets a separator when 'flatten' used +- `--collapse, -c`: expand the table structure in collapse mode. + Be aware collapse mode currently doesn't support width control +- `--abbreviated, -a {int}`: abbreviate the data in the table by truncating the middle part and only showing amount provided on top and bottom +- `--list, -l`: list available table modes/themes ## Input/output types: @@ -43,12 +43,14 @@ Be aware collapse mode currently doesn't support width control ## Examples List the files in current directory, with indexes starting from 1 + ```nu > ls | table --index 1 ``` Render data in table view + ```nu > [[a b]; [1 2] [3 4]] | table ╭───┬───┬───╮ @@ -61,6 +63,7 @@ Render data in table view ``` Render data in table view (expanded) + ```nu > [[a b]; [1 2] [2 [4 4]]] | table --expand ╭───┬───┬───╮ @@ -73,6 +76,7 @@ Render data in table view (expanded) ``` Render data in table view (collapsed) + ```nu > [[a b]; [1 2] [2 [4 4]]] | table --collapse ╭───┬───┬───╮ @@ -85,28 +89,33 @@ Render data in table view (collapsed) ``` Change the table theme to the specified theme for a single run + ```nu > [[a b]; [1 2] [2 [4 4]]] | table --theme basic ``` Force showing of the #/index column for a single run + ```nu > [[a b]; [1 2] [2 [4 4]]] | table -i true ``` Set the starting number of the #/index column to 100 for a single run + ```nu > [[a b]; [1 2] [2 [4 4]]] | table -i 100 ``` Force hiding of the #/index column for a single run + ```nu > [[a b]; [1 2] [2 [4 4]]] | table -i false ``` ## Notes -If the table contains a column called 'index', this column is used as the table index instead of the usual continuous index. \ No newline at end of file + +If the table contains a column called 'index', this column is used as the table index instead of the usual continuous index. diff --git a/commands/docs/take.md b/src/content/docs/commands/docs/take.md similarity index 69% rename from commands/docs/take.md rename to src/content/docs/commands/docs/take.md index 374960bc59f..4b2c66fc356 100644 --- a/commands/docs/take.md +++ b/src/content/docs/commands/docs/take.md @@ -9,6 +9,7 @@ usage: | Take only the first n elements of a list, or the first n bytes of a binary value. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,24 +18,25 @@ feature: default ## Signature -```> take {flags} (n)``` +`> take {flags} (n)` ## Parameters - - `n`: Starting from the front, the number of elements to return. - +- `n`: Starting from the front, the number of elements to return. ## Input/output types: -| input | output | -| --------- | ------------ | -| binary | binary | +| input | output | +| ----------- | -------------- | +| binary | binary | | list\<any\> | list\<any\> | -| range | list\<number\> | -| table | table | +| range | list\<number\> | +| table | table | + ## Examples Return the first item of a list/table + ```nu > [1 2 3] | take 1 ╭───┬───╮ @@ -44,6 +46,7 @@ Return the first item of a list/table ``` Return the first 2 items of a list/table + ```nu > [1 2 3] | take 2 ╭───┬───╮ @@ -54,6 +57,7 @@ Return the first 2 items of a list/table ``` Return the first two rows of a table + ```nu > [[editions]; [2015] [2018] [2021]] | take 2 ╭───┬──────────╮ @@ -66,6 +70,7 @@ Return the first two rows of a table ``` Return the first 2 bytes of a binary value + ```nu > 0x[01 23 45] | take 2 Length: 2 (0x2) bytes | printable whitespace ascii_other non_ascii @@ -74,6 +79,7 @@ Length: 2 (0x2) bytes | printable whitespace ascii_other non_ascii ``` Return the first 3 elements of a range + ```nu > 1..10 | take 3 ╭───┬───╮ @@ -84,10 +90,9 @@ Return the first 3 elements of a range ``` - ## Subcommands: -| name | type | usage | -| -------------------------------------------- | ------- | ----------------------------------------------------- | -| [`take until`](/commands/docs/take_until.md) | Builtin | Take elements of the input until a predicate is true. | -| [`take while`](/commands/docs/take_while.md) | Builtin | Take elements of the input while a predicate is true. | \ No newline at end of file +| name | type | usage | +| ----------------------------------------- | ------- | ----------------------------------------------------- | +| [`take until`](/commands/docs/take_until) | Builtin | Take elements of the input until a predicate is true. | +| [`take while`](/commands/docs/take_while) | Builtin | Take elements of the input while a predicate is true. | diff --git a/commands/docs/take_until.md b/src/content/docs/commands/docs/take_until.md similarity index 86% rename from commands/docs/take_until.md rename to src/content/docs/commands/docs/take_until.md index 096ebf024e0..10a915ea0f0 100644 --- a/commands/docs/take_until.md +++ b/src/content/docs/commands/docs/take_until.md @@ -9,6 +9,7 @@ usage: | Take elements of the input until a predicate is true. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,22 +18,23 @@ feature: default ## Signature -```> take until {flags} (predicate)``` +`> take until {flags} (predicate)` ## Parameters - - `predicate`: The predicate that element(s) must not match. - +- `predicate`: The predicate that element(s) must not match. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | -| table | table | +| table | table | + ## Examples Take until the element is positive + ```nu > [-1 -2 9 1] | take until {|x| $x > 0 } ╭───┬────╮ @@ -43,6 +45,7 @@ Take until the element is positive ``` Take until the element is positive using stored condition + ```nu > let cond = {|x| $x > 0 }; [-1 -2 9 1] | take until $cond ╭───┬────╮ @@ -53,6 +56,7 @@ Take until the element is positive using stored condition ``` Take until the field value is positive + ```nu > [{a: -1} {a: -2} {a: 9} {a: 1}] | take until {|x| $x.a > 0 } ╭───┬────╮ diff --git a/commands/docs/take_while.md b/src/content/docs/commands/docs/take_while.md similarity index 86% rename from commands/docs/take_while.md rename to src/content/docs/commands/docs/take_while.md index 67c1081fd15..1bb0d862c25 100644 --- a/commands/docs/take_while.md +++ b/src/content/docs/commands/docs/take_while.md @@ -9,6 +9,7 @@ usage: | Take elements of the input while a predicate is true. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,22 +18,23 @@ feature: default ## Signature -```> take while {flags} (predicate)``` +`> take while {flags} (predicate)` ## Parameters - - `predicate`: The predicate that element(s) must match. - +- `predicate`: The predicate that element(s) must match. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | -| table | table | +| table | table | + ## Examples Take while the element is negative + ```nu > [-1 -2 9 1] | take while {|x| $x < 0 } ╭───┬────╮ @@ -43,6 +45,7 @@ Take while the element is negative ``` Take while the element is negative using stored condition + ```nu > let cond = {|x| $x < 0 }; [-1 -2 9 1] | take while $cond ╭───┬────╮ @@ -53,6 +56,7 @@ Take while the element is negative using stored condition ``` Take while the field value is negative + ```nu > [{a: -1} {a: -2} {a: 9} {a: 1}] | take while {|x| $x.a < 0 } ╭───┬────╮ diff --git a/commands/docs/term_size.md b/src/content/docs/commands/docs/term_size.md similarity index 87% rename from commands/docs/term_size.md rename to src/content/docs/commands/docs/term_size.md index 5d1124206e6..a96898a24a2 100644 --- a/commands/docs/term_size.md +++ b/src/content/docs/commands/docs/term_size.md @@ -9,6 +9,7 @@ usage: | Returns a record containing the number of columns (width) and rows (height) of the terminal. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for platform @@ -17,30 +18,32 @@ feature: default ## Signature -```> term size {flags} ``` - +`> term size {flags} ` ## Input/output types: -| input | output | -| ------- | ------------------------------- | +| input | output | +| ------- | --------------------------------- | | nothing | record\<columns: int, rows: int\> | ## Examples Return the columns (width) and rows (height) of the terminal + ```nu > term size ``` Return the columns (width) of the terminal + ```nu > (term size).columns ``` Return the rows (height) of the terminal + ```nu > (term size).rows diff --git a/commands/docs/timeit.md b/src/content/docs/commands/docs/timeit.md similarity index 91% rename from commands/docs/timeit.md rename to src/content/docs/commands/docs/timeit.md index f366d377364..7396dce45c5 100644 --- a/commands/docs/timeit.md +++ b/src/content/docs/commands/docs/timeit.md @@ -9,6 +9,7 @@ usage: | Time the running time of a block. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for debug @@ -17,12 +18,11 @@ feature: default ## Signature -```> timeit {flags} (command)``` +`> timeit {flags} (command)` ## Parameters - - `command`: The command or block to run. - +- `command`: The command or block to run. ## Input/output types: @@ -30,21 +30,25 @@ feature: default | ------- | -------- | | any | duration | | nothing | duration | + ## Examples Times a command within a closure + ```nu > timeit { sleep 500ms } ``` Times a command using an existing input + ```nu > http get https://www.nushell.sh/book/ | timeit { split chars } ``` Times a command invocation + ```nu > timeit ls -la diff --git a/src/content/docs/commands/docs/to.md b/src/content/docs/commands/docs/to.md new file mode 100644 index 00000000000..bfeeb40834d --- /dev/null +++ b/src/content/docs/commands/docs/to.md @@ -0,0 +1,46 @@ +--- +title: to +categories: | + formats +version: 0.90.0 +formats: | + Translate structured data to a format. +usage: | + Translate structured data to a format. +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for formats + +<div class='command-title'>{{ $frontmatter.formats }}</div> + +## Signature + +`> to {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | type | usage | +| ----------------------------------- | ------- | ------------------------------------------------------------- | +| [`to csv`](/commands/docs/to_csv) | Builtin | Convert table into .csv text . | +| [`to html`](/commands/docs/to_html) | Builtin | Convert table into simple HTML. | +| [`to json`](/commands/docs/to_json) | Builtin | Converts table data into JSON text. | +| [`to md`](/commands/docs/to_md) | Builtin | Convert table into simple Markdown. | +| [`to nuon`](/commands/docs/to_nuon) | Builtin | Converts table data into Nuon (Nushell Object Notation) text. | +| [`to text`](/commands/docs/to_text) | Builtin | Converts data into simple text. | +| [`to toml`](/commands/docs/to_toml) | Builtin | Convert record into .toml text. | +| [`to tsv`](/commands/docs/to_tsv) | Builtin | Convert table into .tsv text. | +| [`to xml`](/commands/docs/to_xml) | Builtin | Convert special record structure into .xml text. | +| [`to yaml`](/commands/docs/to_yaml) | Builtin | Convert table into .yaml/.yml text. | diff --git a/commands/docs/to_csv.md b/src/content/docs/commands/docs/to_csv.md similarity index 83% rename from commands/docs/to_csv.md rename to src/content/docs/commands/docs/to_csv.md index 5d2e2cf15ff..a51940f089e 100644 --- a/commands/docs/to_csv.md +++ b/src/content/docs/commands/docs/to_csv.md @@ -9,6 +9,7 @@ usage: | Convert table into .csv text . feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,13 +18,12 @@ feature: default ## Signature -```> to csv {flags} ``` +`> to csv {flags} ` ## Flags - - `--separator, -s {string}`: a character to separate columns, defaults to ',' - - `--noheaders, -n`: do not output the columns names as the first row - +- `--separator, -s {string}`: a character to separate columns, defaults to ',' +- `--noheaders, -n`: do not output the columns names as the first row ## Input/output types: @@ -31,9 +31,11 @@ feature: default | ------ | ------ | | record | string | | table | string | + ## Examples Outputs an CSV string representing the contents of this table + ```nu > [[foo bar]; [1 2]] | to csv foo,bar @@ -42,6 +44,7 @@ foo,bar ``` Outputs an CSV string representing the contents of this table + ```nu > [[foo bar]; [1 2]] | to csv --separator ';' foo;bar @@ -50,6 +53,7 @@ foo;bar ``` Outputs an CSV string representing the contents of this record + ```nu > {a: 1 b: 2} | to csv a,b diff --git a/commands/docs/to_html.md b/src/content/docs/commands/docs/to_html.md similarity index 68% rename from commands/docs/to_html.md rename to src/content/docs/commands/docs/to_html.md index 8ddd2df54cd..ebdb2285a03 100644 --- a/commands/docs/to_html.md +++ b/src/content/docs/commands/docs/to_html.md @@ -9,29 +9,29 @@ usage: | Convert table into simple HTML. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats <div class='command-title'>{{ $frontmatter.formats }}</div> - -::: warning - Command `to html` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `to html` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> to html {flags} ``` +`> to html {flags} ` ## Flags - - `--html-color, -c`: change ansi colors to html colors - - `--no-color, -n`: remove all ansi colors in output - - `--dark, -d`: indicate your background color is a darker color - - `--partial, -p`: only output the html for the content itself - - `--theme, -t {string}`: the name of the theme to use (github, blulocolight, ...) - - `--list, -l`: produce a color table of all available themes - +- `--html-color, -c`: change ansi colors to html colors +- `--no-color, -n`: remove all ansi colors in output +- `--dark, -d`: indicate your background color is a darker color +- `--partial, -p`: only output the html for the content itself +- `--theme, -t {string}`: the name of the theme to use (github, blulocolight, ...) +- `--list, -l`: produce a color table of all available themes ## Input/output types: @@ -41,23 +41,27 @@ feature: extra ## Examples -Outputs an HTML string representing the contents of this table +Outputs an HTML string representing the contents of this table + ```nu > [[foo bar]; [1 2]] | to html <html><style>body { background-color:white;color:black; }</style><body><table><thead><tr><th>foo</th><th>bar</th></tr></thead><tbody><tr><td>1</td><td>2</td></tr></tbody></table></body></html> ``` Optionally, only output the html for the content itself + ```nu > [[foo bar]; [1 2]] | to html --partial <div style="background-color:white;color:black;"><table><thead><tr><th>foo</th><th>bar</th></tr></thead><tbody><tr><td>1</td><td>2</td></tr></tbody></table></div> ``` Optionally, output the string with a dark background + ```nu > [[foo bar]; [1 2]] | to html --dark <html><style>body { background-color:black;color:white; }</style><body><table><thead><tr><th>foo</th><th>bar</th></tr></thead><tbody><tr><td>1</td><td>2</td></tr></tbody></table></body></html> ``` ## Notes -Screenshots of the themes can be browsed here: https://github.com/mbadolato/iTerm2-Color-Schemes. \ No newline at end of file + +Screenshots of the themes can be browsed here: https://github.com/mbadolato/iTerm2-Color-Schemes. diff --git a/commands/docs/to_json.md b/src/content/docs/commands/docs/to_json.md similarity index 83% rename from commands/docs/to_json.md rename to src/content/docs/commands/docs/to_json.md index 0442d8653af..03c8929df3f 100644 --- a/commands/docs/to_json.md +++ b/src/content/docs/commands/docs/to_json.md @@ -9,6 +9,7 @@ usage: | Converts table data into JSON text. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,14 +18,13 @@ feature: default ## Signature -```> to json {flags} ``` +`> to json {flags} ` ## Flags - - `--raw, -r`: remove all of the whitespace - - `--indent, -i {number}`: specify indentation width - - `--tabs, -t {number}`: specify indentation tab quantity - +- `--raw, -r`: remove all of the whitespace +- `--indent, -i {number}`: specify indentation width +- `--tabs, -t {number}`: specify indentation tab quantity ## Input/output types: @@ -35,6 +35,7 @@ feature: default ## Examples Outputs a JSON string, with default indentation, representing the contents of this table + ```nu > [a b c] | to json [ @@ -45,6 +46,7 @@ Outputs a JSON string, with default indentation, representing the contents of th ``` Outputs a JSON string, with 4-space indentation, representing the contents of this table + ```nu > [Joe Bob Sam] | to json --indent 4 [ @@ -55,6 +57,7 @@ Outputs a JSON string, with 4-space indentation, representing the contents of th ``` Outputs an unformatted JSON string representing the contents of this table + ```nu > [1 2 3] | to json -r [1,2,3] diff --git a/commands/docs/to_md.md b/src/content/docs/commands/docs/to_md.md similarity index 86% rename from commands/docs/to_md.md rename to src/content/docs/commands/docs/to_md.md index 793a3225614..d7e7bed98ad 100644 --- a/commands/docs/to_md.md +++ b/src/content/docs/commands/docs/to_md.md @@ -9,6 +9,7 @@ usage: | Convert table into simple Markdown. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,13 +18,12 @@ feature: default ## Signature -```> to md {flags} ``` +`> to md {flags} ` ## Flags - - `--pretty, -p`: Formats the Markdown table to vertically align items - - `--per-element, -e`: treat each row as markdown syntax element - +- `--pretty, -p`: Formats the Markdown table to vertically align items +- `--per-element, -e`: treat each row as markdown syntax element ## Input/output types: @@ -34,6 +34,7 @@ feature: default ## Examples Outputs an MD string representing the contents of this table + ```nu > [[foo bar]; [1 2]] | to md |foo|bar| @@ -43,6 +44,7 @@ Outputs an MD string representing the contents of this table ``` Optionally, output a formatted markdown string + ```nu > [[foo bar]; [1 2]] | to md --pretty | foo | bar | @@ -52,6 +54,7 @@ Optionally, output a formatted markdown string ``` Treat each row as a markdown element + ```nu > [{"H1": "Welcome to Nushell" } [[foo bar]; [1 2]]] | to md --per-element --pretty # Welcome to Nushell @@ -61,6 +64,7 @@ Treat each row as a markdown element ``` Render a list + ```nu > [0 1 2] | to md --pretty 0 diff --git a/commands/docs/to_nuon.md b/src/content/docs/commands/docs/to_nuon.md similarity index 83% rename from commands/docs/to_nuon.md rename to src/content/docs/commands/docs/to_nuon.md index 661efb4c1ad..bdf393c23d4 100644 --- a/commands/docs/to_nuon.md +++ b/src/content/docs/commands/docs/to_nuon.md @@ -9,6 +9,7 @@ usage: | Converts table data into Nuon (Nushell Object Notation) text. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,14 +18,13 @@ feature: default ## Signature -```> to nuon {flags} ``` +`> to nuon {flags} ` ## Flags - - `--raw, -r`: remove all of the whitespace (default behaviour and overwrites -i and -t) - - `--indent, -i {number}`: specify indentation width - - `--tabs, -t {number}`: specify indentation tab quantity - +- `--raw, -r`: remove all of the whitespace (default behaviour and overwrites -i and -t) +- `--indent, -i {number}`: specify indentation width +- `--tabs, -t {number}`: specify indentation tab quantity ## Input/output types: @@ -35,12 +35,14 @@ feature: default ## Examples Outputs a NUON string representing the contents of this list, compact by default + ```nu > [1 2 3] | to nuon [1, 2, 3] ``` Outputs a NUON array of ints, with pretty indentation + ```nu > [1 2 3] | to nuon --indent 2 [ @@ -51,12 +53,14 @@ Outputs a NUON array of ints, with pretty indentation ``` Overwrite any set option with --raw + ```nu > [1 2 3] | to nuon --indent 2 --raw [1, 2, 3] ``` A more complex record with multiple data types + ```nu > {date: 2000-01-01, data: [1 [2 3] 4.56]} | to nuon --indent 2 { diff --git a/commands/docs/to_text.md b/src/content/docs/commands/docs/to_text.md similarity index 96% rename from commands/docs/to_text.md rename to src/content/docs/commands/docs/to_text.md index 311532d3a0d..575ac796562 100644 --- a/commands/docs/to_text.md +++ b/src/content/docs/commands/docs/to_text.md @@ -9,6 +9,7 @@ usage: | Converts data into simple text. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,8 +18,7 @@ feature: default ## Signature -```> to text {flags} ``` - +`> to text {flags} ` ## Input/output types: @@ -29,18 +29,21 @@ feature: default ## Examples Outputs data as simple text + ```nu > 1 | to text 1 ``` Outputs external data as simple text + ```nu > git help -a | lines | find -r '^ ' | to text ``` Outputs records as simple text + ```nu > ls | to text diff --git a/commands/docs/to_toml.md b/src/content/docs/commands/docs/to_toml.md similarity index 96% rename from commands/docs/to_toml.md rename to src/content/docs/commands/docs/to_toml.md index 7e241435358..9f5915dce8a 100644 --- a/commands/docs/to_toml.md +++ b/src/content/docs/commands/docs/to_toml.md @@ -9,6 +9,7 @@ usage: | Convert record into .toml text. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,8 +18,7 @@ feature: default ## Signature -```> to toml {flags} ``` - +`> to toml {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Outputs an TOML string representing the contents of this record + ```nu > {foo: 1 bar: 'qwe'} | to toml bar = "qwe" diff --git a/commands/docs/to_tsv.md b/src/content/docs/commands/docs/to_tsv.md similarity index 88% rename from commands/docs/to_tsv.md rename to src/content/docs/commands/docs/to_tsv.md index 8b3b3f42162..f5b08746f6f 100644 --- a/commands/docs/to_tsv.md +++ b/src/content/docs/commands/docs/to_tsv.md @@ -9,6 +9,7 @@ usage: | Convert table into .tsv text. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,12 +18,11 @@ feature: default ## Signature -```> to tsv {flags} ``` +`> to tsv {flags} ` ## Flags - - `--noheaders, -n`: do not output the column names as the first row - +- `--noheaders, -n`: do not output the column names as the first row ## Input/output types: @@ -30,9 +30,11 @@ feature: default | ------ | ------ | | record | string | | table | string | + ## Examples Outputs an TSV string representing the contents of this table + ```nu > [[foo bar]; [1 2]] | to tsv foobar @@ -41,6 +43,7 @@ foobar ``` Outputs an TSV string representing the contents of this record + ```nu > {a: 1 b: 2} | to tsv ab diff --git a/commands/docs/to_xml.md b/src/content/docs/commands/docs/to_xml.md similarity index 88% rename from commands/docs/to_xml.md rename to src/content/docs/commands/docs/to_xml.md index 23ea6f8ee92..17d2201d14c 100644 --- a/commands/docs/to_xml.md +++ b/src/content/docs/commands/docs/to_xml.md @@ -9,6 +9,7 @@ usage: | Convert special record structure into .xml text. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,14 +18,13 @@ feature: default ## Signature -```> to xml {flags} ``` +`> to xml {flags} ` ## Flags - - `--indent, -i {int}`: Formats the XML text with the provided indentation setting - - `--partial-escape, -p`: Only escape mandatory characters in text and attributes - - `--self-closed, -s`: Output empty tags as self closing - +- `--indent, -i {int}`: Formats the XML text with the provided indentation setting +- `--partial-escape, -p`: Only escape mandatory characters in text and attributes +- `--self-closed, -s`: Output empty tags as self closing ## Input/output types: @@ -35,18 +35,21 @@ feature: default ## Examples Outputs an XML string representing the contents of this table + ```nu > {tag: note attributes: {} content : [{tag: remember attributes: {} content : [{tag: null attributes: null content : Event}]}]} | to xml <note><remember>Event</remember></note> ``` When formatting xml null and empty record fields can be omitted and strings can be written without a wrapping record + ```nu > {tag: note content : [{tag: remember content : [Event]}]} | to xml <note><remember>Event</remember></note> ``` Optionally, formats the text with a custom indentation setting + ```nu > {tag: note content : [{tag: remember content : [Event]}]} | to xml --indent 3 <note> @@ -55,23 +58,27 @@ Optionally, formats the text with a custom indentation setting ``` Produce less escaping sequences in resulting xml + ```nu > {tag: note attributes: {a: "'qwe'\\"} content: ["\"'"]} | to xml --partial-escape <note a="'qwe'\">"'</note> ``` Save space using self-closed tags + ```nu > {tag: root content: [[tag]; [a] [b] [c]]} | to xml --self-closed <root><a/><b/><c/></root> ``` ## Notes + Every XML entry is represented via a record with tag, attribute and content fields. To represent different types of entries different values must be written to this fields: + 1. Tag entry: `{tag: <tag name> attributes: {<attr name>: "<string value>" ...} content: [<entries>]}` 2. Comment entry: `{tag: '!' attributes: null content: "<comment string>"}` 3. Processing instruction (PI): `{tag: '?<pi name>' attributes: null content: "<pi content string>"}` 4. Text: `{tag: null attributes: null content: "<text>"}`. Or as plain `<text>` instead of record. -Additionally any field which is: empty record, empty list or null, can be omitted. \ No newline at end of file +Additionally any field which is: empty record, empty list or null, can be omitted. diff --git a/commands/docs/to_yaml.md b/src/content/docs/commands/docs/to_yaml.md similarity index 96% rename from commands/docs/to_yaml.md rename to src/content/docs/commands/docs/to_yaml.md index 6e53919a878..aae81188de2 100644 --- a/commands/docs/to_yaml.md +++ b/src/content/docs/commands/docs/to_yaml.md @@ -9,6 +9,7 @@ usage: | Convert table into .yaml/.yml text. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for formats @@ -17,8 +18,7 @@ feature: default ## Signature -```> to yaml {flags} ``` - +`> to yaml {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Outputs an YAML string representing the contents of this table + ```nu > [[foo bar]; ["1" "2"]] | to yaml - foo: '1' diff --git a/commands/docs/touch.md b/src/content/docs/commands/docs/touch.md similarity index 63% rename from commands/docs/touch.md rename to src/content/docs/commands/docs/touch.md index cd0af6ff62e..81af93c9c74 100644 --- a/commands/docs/touch.md +++ b/src/content/docs/commands/docs/touch.md @@ -9,6 +9,7 @@ usage: | Creates one or more files. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filesystem @@ -17,20 +18,19 @@ feature: default ## Signature -```> touch {flags} (filename) ...rest``` +`> touch {flags} (filename) ...rest` ## Flags - - `--reference, -r {string}`: change the file or directory time to the time of the reference file/directory - - `--modified, -m`: change the modification time of the file or directory. If no timestamp, date or reference file/directory is given, the current time is used - - `--access, -a`: change the access time of the file or directory. If no timestamp, date or reference file/directory is given, the current time is used - - `--no-create, -c`: do not create the file if it does not exist +- `--reference, -r {string}`: change the file or directory time to the time of the reference file/directory +- `--modified, -m`: change the modification time of the file or directory. If no timestamp, date or reference file/directory is given, the current time is used +- `--access, -a`: change the access time of the file or directory. If no timestamp, date or reference file/directory is given, the current time is used +- `--no-create, -c`: do not create the file if it does not exist ## Parameters - - `filename`: The path of the file you want to create. - - `...rest`: Additional files to create. - +- `filename`: The path of the file you want to create. +- `...rest`: Additional files to create. ## Input/output types: @@ -41,36 +41,42 @@ feature: default ## Examples Creates "fixture.json" + ```nu > touch fixture.json ``` Creates files a, b and c + ```nu > touch a b c ``` Changes the last modified time of "fixture.json" to today's date + ```nu > touch -m fixture.json ``` Changes the last modified time of files a, b and c to a date + ```nu > touch -m -d "yesterday" a b c ``` Changes the last modified time of file d and e to "fixture.json"'s last modified time + ```nu > touch -m -r fixture.json d e ``` Changes the last accessed time of "fixture.json" to a date + ```nu > touch -a -d "August 24, 2019; 12:30:30" fixture.json diff --git a/commands/docs/transpose.md b/src/content/docs/commands/docs/transpose.md similarity index 78% rename from commands/docs/transpose.md rename to src/content/docs/commands/docs/transpose.md index 45a44a2f5ae..f5bf931e8ce 100644 --- a/commands/docs/transpose.md +++ b/src/content/docs/commands/docs/transpose.md @@ -9,6 +9,7 @@ usage: | Transposes the table contents so rows become columns and columns become rows. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,20 +18,19 @@ feature: default ## Signature -```> transpose {flags} ...rest``` +`> transpose {flags} ...rest` ## Flags - - `--header-row, -r`: treat the first row as column names - - `--ignore-titles, -i`: don't transpose the column names into values - - `--as-record, -d`: transfer to record if the result is a table and contains only one row - - `--keep-last, -l`: on repetition of record fields due to `header-row`, keep the last value obtained - - `--keep-all, -a`: on repetition of record fields due to `header-row`, keep all the values obtained +- `--header-row, -r`: treat the first row as column names +- `--ignore-titles, -i`: don't transpose the column names into values +- `--as-record, -d`: transfer to record if the result is a table and contains only one row +- `--keep-last, -l`: on repetition of record fields due to `header-row`, keep the last value obtained +- `--keep-all, -a`: on repetition of record fields due to `header-row`, keep all the values obtained ## Parameters - - `...rest`: The names to give columns once transposed. - +- `...rest`: The names to give columns once transposed. ## Input/output types: @@ -38,9 +38,11 @@ feature: default | ------ | ------ | | record | table | | table | any | + ## Examples Transposes the table contents with default column names + ```nu > [[c1 c2]; [1 2]] | transpose ╭───┬─────────┬─────────╮ @@ -53,6 +55,7 @@ Transposes the table contents with default column names ``` Transposes the table contents with specified column names + ```nu > [[c1 c2]; [1 2]] | transpose key val ╭───┬─────┬─────╮ @@ -65,6 +68,7 @@ Transposes the table contents with specified column names ``` Transposes the table without column names and specify a new column name + ```nu > [[c1 c2]; [1 2]] | transpose --ignore-titles val ╭───┬─────╮ @@ -77,6 +81,7 @@ Transposes the table without column names and specify a new column name ``` Transfer back to record with -d flag + ```nu > {c1: 1, c2: 2} | transpose | transpose --ignore-titles -r -d ╭────┬───╮ diff --git a/commands/docs/try.md b/src/content/docs/commands/docs/try.md similarity index 84% rename from commands/docs/try.md rename to src/content/docs/commands/docs/try.md index f05e89afd60..0b84dfdca16 100644 --- a/commands/docs/try.md +++ b/src/content/docs/commands/docs/try.md @@ -9,6 +9,7 @@ usage: | Try to run a block, if it fails optionally run a catch block. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,13 +18,12 @@ feature: default ## Signature -```> try {flags} (try_block) (catch_block)``` +`> try {flags} (try_block) (catch_block)` ## Parameters - - `try_block`: Block to run. - - `catch_block`: Block to run if try block fails. - +- `try_block`: Block to run. +- `catch_block`: Block to run if try block fails. ## Input/output types: @@ -34,12 +34,14 @@ feature: default ## Examples Try to run a missing command + ```nu > try { asdfasdf } ``` Try to run a missing command + ```nu > try { asdfasdf } catch { 'missing' } missing diff --git a/commands/docs/tutor.md b/src/content/docs/commands/docs/tutor.md similarity index 80% rename from commands/docs/tutor.md rename to src/content/docs/commands/docs/tutor.md index 3a8a234cc1e..5aae202f0b1 100644 --- a/commands/docs/tutor.md +++ b/src/content/docs/commands/docs/tutor.md @@ -9,6 +9,7 @@ usage: | Run the tutorial. To begin, run: tutor. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for misc @@ -17,16 +18,15 @@ feature: default ## Signature -```> tutor {flags} (search)``` +`> tutor {flags} (search)` ## Flags - - `--find, -f {string}`: Search tutorial for a phrase +- `--find, -f {string}`: Search tutorial for a phrase ## Parameters - - `search`: Item to search for, or 'list' to list available tutorials. - +- `search`: Item to search for, or 'list' to list available tutorials. ## Input/output types: @@ -37,12 +37,14 @@ feature: default ## Examples Begin the tutorial + ```nu > tutor begin ``` Search a tutorial by phrase + ```nu > tutor --find "$in" diff --git a/commands/docs/ulimit.md b/src/content/docs/commands/docs/ulimit.md similarity index 58% rename from commands/docs/ulimit.md rename to src/content/docs/commands/docs/ulimit.md index 7912c966bbc..25b17799851 100644 --- a/commands/docs/ulimit.md +++ b/src/content/docs/commands/docs/ulimit.md @@ -9,6 +9,7 @@ usage: | Set or get resource usage limits. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for platform @@ -17,25 +18,24 @@ feature: default ## Signature -```> ulimit {flags} (limit)``` +`> ulimit {flags} (limit)` ## Flags - - `--soft, -S`: Sets soft resource limit - - `--hard, -H`: Sets hard resource limit - - `--all, -a`: Prints all current limits - - `--core-size, -c`: Maximum size of core files created - - `--data-size, -d`: Maximum size of a process's data segment - - `--file-size, -f`: Maximum size of files created by the shell - - `--file-descriptor-count, -n`: Maximum number of open file descriptors - - `--stack-size, -s`: Maximum stack size - - `--cpu-time, -t`: Maximum amount of CPU time in seconds - - `--virtual-memory-size, -v`: Maximum amount of virtual memory available to each process +- `--soft, -S`: Sets soft resource limit +- `--hard, -H`: Sets hard resource limit +- `--all, -a`: Prints all current limits +- `--core-size, -c`: Maximum size of core files created +- `--data-size, -d`: Maximum size of a process's data segment +- `--file-size, -f`: Maximum size of files created by the shell +- `--file-descriptor-count, -n`: Maximum number of open file descriptors +- `--stack-size, -s`: Maximum stack size +- `--cpu-time, -t`: Maximum amount of CPU time in seconds +- `--virtual-memory-size, -v`: Maximum amount of virtual memory available to each process ## Parameters - - `limit`: Limit value. - +- `limit`: Limit value. ## Input/output types: @@ -46,36 +46,42 @@ feature: default ## Examples Print all current limits + ```nu > ulimit -a ``` Print specified limits + ```nu > ulimit --core-size --data-size --file-size ``` Set limit + ```nu > ulimit --core-size 102400 ``` Set stack size soft limit + ```nu > ulimit -s -S 10240 ``` Set virtual memory size hard limit + ```nu > ulimit -v -H 10240 ``` Set core size limit to unlimited + ```nu > ulimit -c unlimited diff --git a/commands/docs/umkdir.md b/src/content/docs/commands/docs/umkdir.md similarity index 84% rename from commands/docs/umkdir.md rename to src/content/docs/commands/docs/umkdir.md index 277bde84b46..155bc588971 100644 --- a/commands/docs/umkdir.md +++ b/src/content/docs/commands/docs/umkdir.md @@ -9,6 +9,7 @@ usage: | Create directories, with intermediary directories if required using uutils/coreutils mkdir. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filesystem @@ -17,16 +18,15 @@ feature: default ## Signature -```> umkdir {flags} ...rest``` +`> umkdir {flags} ...rest` ## Flags - - `--verbose, -v`: print a message for each created directory. +- `--verbose, -v`: print a message for each created directory. ## Parameters - - `...rest`: The name(s) of the path(s) to create. - +- `...rest`: The name(s) of the path(s) to create. ## Input/output types: @@ -37,12 +37,14 @@ feature: default ## Examples Make a directory named foo + ```nu > umkdir foo ``` Make multiple directories and show the paths created + ```nu > umkdir -v foo/bar foo2 diff --git a/commands/docs/umv.md b/src/content/docs/commands/docs/umv.md similarity index 68% rename from commands/docs/umv.md rename to src/content/docs/commands/docs/umv.md index d3623e742f8..0da35671989 100644 --- a/commands/docs/umv.md +++ b/src/content/docs/commands/docs/umv.md @@ -9,6 +9,7 @@ usage: | Move files or directories. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filesystem @@ -17,20 +18,19 @@ feature: default ## Signature -```> umv {flags} ...rest``` +`> umv {flags} ...rest` ## Flags - - `--force, -f`: do not prompt before overwriting - - `--verbose, -v`: explain what is being done. - - `--progress, -p`: display a progress bar - - `--interactive, -i`: prompt before overwriting - - `--no-clobber, -n`: do not overwrite an existing file +- `--force, -f`: do not prompt before overwriting +- `--verbose, -v`: explain what is being done. +- `--progress, -p`: display a progress bar +- `--interactive, -i`: prompt before overwriting +- `--no-clobber, -n`: do not overwrite an existing file ## Parameters - - `...rest`: Rename SRC to DST, or move SRC to DIR. - +- `...rest`: Rename SRC to DST, or move SRC to DIR. ## Input/output types: @@ -41,18 +41,21 @@ feature: default ## Examples Rename a file + ```nu > umv before.txt after.txt ``` Move a file into a directory + ```nu > umv test.txt my/subdirectory ``` Move many files into a directory + ```nu > umv *.txt my/subdirectory diff --git a/commands/docs/uniq-by.md b/src/content/docs/commands/docs/uniq-by.md similarity index 68% rename from commands/docs/uniq-by.md rename to src/content/docs/commands/docs/uniq-by.md index b774a906348..a5acbe591b7 100644 --- a/commands/docs/uniq-by.md +++ b/src/content/docs/commands/docs/uniq-by.md @@ -9,6 +9,7 @@ usage: | Return the distinct values in the input by the given column(s). feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,29 +18,30 @@ feature: default ## Signature -```> uniq-by {flags} ...rest``` +`> uniq-by {flags} ...rest` ## Flags - - `--count, -c`: Return a table containing the distinct input values together with their counts - - `--repeated, -d`: Return the input values that occur more than once - - `--ignore-case, -i`: Ignore differences in case when comparing input values - - `--unique, -u`: Return the input values that occur once only +- `--count, -c`: Return a table containing the distinct input values together with their counts +- `--repeated, -d`: Return the input values that occur more than once +- `--ignore-case, -i`: Ignore differences in case when comparing input values +- `--unique, -u`: Return the input values that occur once only ## Parameters - - `...rest`: The column(s) to filter by. - +- `...rest`: The column(s) to filter by. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | -| table | table | +| table | table | + ## Examples Get rows from table filtered by column uniqueness + ```nu > [[fruit count]; [apple 9] [apple 2] [pear 3] [orange 7]] | uniq-by fruit ╭───┬────────┬───────╮ diff --git a/commands/docs/uniq.md b/src/content/docs/commands/docs/uniq.md similarity index 82% rename from commands/docs/uniq.md rename to src/content/docs/commands/docs/uniq.md index fbbd6254dbb..827dbea8223 100644 --- a/commands/docs/uniq.md +++ b/src/content/docs/commands/docs/uniq.md @@ -9,6 +9,7 @@ usage: | Return the distinct values in the input. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,25 +18,25 @@ feature: default ## Signature -```> uniq {flags} ``` +`> uniq {flags} ` ## Flags - - `--count, -c`: Return a table containing the distinct input values together with their counts - - `--repeated, -d`: Return the input values that occur more than once - - `--ignore-case, -i`: Compare input values case-insensitively - - `--unique, -u`: Return the input values that occur once only - +- `--count, -c`: Return a table containing the distinct input values together with their counts +- `--repeated, -d`: Return the input values that occur more than once +- `--ignore-case, -i`: Compare input values case-insensitively +- `--unique, -u`: Return the input values that occur once only ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | ## Examples Return the distinct values of a list/table (remove duplicates so that each value occurs once only) + ```nu > [2 3 3 4] | uniq ╭───┬───╮ @@ -47,6 +48,7 @@ Return the distinct values of a list/table (remove duplicates so that each value ``` Return the input values that occur more than once + ```nu > [1 2 2] | uniq -d ╭───┬───╮ @@ -56,6 +58,7 @@ Return the input values that occur more than once ``` Return the input values that occur once only + ```nu > [1 2 2] | uniq --unique ╭───┬───╮ @@ -65,6 +68,7 @@ Return the input values that occur once only ``` Ignore differences in case when comparing input values + ```nu > ['hello' 'goodbye' 'Hello'] | uniq --ignore-case ╭───┬─────────╮ @@ -75,6 +79,7 @@ Ignore differences in case when comparing input values ``` Return a table containing the distinct input values together with their counts + ```nu > [1 2 2] | uniq --count ╭───┬───────┬───────╮ diff --git a/commands/docs/update.md b/src/content/docs/commands/docs/update.md similarity index 80% rename from commands/docs/update.md rename to src/content/docs/commands/docs/update.md index 73907d1b901..e619d1a357e 100644 --- a/commands/docs/update.md +++ b/src/content/docs/commands/docs/update.md @@ -9,6 +9,7 @@ usage: | Update an existing column to have a new value. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,24 +18,25 @@ feature: default ## Signature -```> update {flags} (field) (replacement value)``` +`> update {flags} (field) (replacement value)` ## Parameters - - `field`: The name of the column to update. - - `replacement value`: The new value to give the cell(s), or a closure to create the value. - +- `field`: The name of the column to update. +- `replacement value`: The new value to give the cell(s), or a closure to create the value. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | -| record | record | -| table | table | +| record | record | +| table | table | + ## Examples Update a column value + ```nu > {'name': 'nu', 'stars': 5} | update name 'Nushell' ╭───────┬─────────╮ @@ -44,6 +46,7 @@ Update a column value ``` Use a closure to alter each value in the 'authors' column to a single string + ```nu > [[project, authors]; ['nu', ['Andrés', 'JT', 'Yehuda']]] | update authors {|row| $row.authors | str join ',' } ╭───┬─────────┬──────────────────╮ @@ -55,6 +58,7 @@ Use a closure to alter each value in the 'authors' column to a single string ``` You can also use a simple command to update 'authors' to a single string + ```nu > [[project, authors]; ['nu', ['Andrés', 'JT', 'Yehuda']]] | update authors { str join ',' } ╭───┬─────────┬──────────────────╮ @@ -66,6 +70,7 @@ You can also use a simple command to update 'authors' to a single string ``` Update a value at an index in a list + ```nu > [1 2 3] | update 1 4 ╭───┬───╮ @@ -77,6 +82,7 @@ Update a value at an index in a list ``` Use a closure to compute a new value at an index + ```nu > [1 2 3] | update 1 {|i| $i + 2 } ╭───┬───╮ @@ -87,9 +93,8 @@ Use a closure to compute a new value at an index ``` - ## Subcommands: -| name | type | usage | -| ------------------------------------------------ | ------- | ----------------------- | -| [`update cells`](/commands/docs/update_cells.md) | Builtin | Update the table cells. | +| name | type | usage | +| --------------------------------------------- | ------- | ----------------------- | +| [`update cells`](/commands/docs/update_cells) | Builtin | Update the table cells. | diff --git a/commands/docs/update_cells.md b/src/content/docs/commands/docs/update_cells.md similarity index 92% rename from commands/docs/update_cells.md rename to src/content/docs/commands/docs/update_cells.md index 15103c34e98..803f7cffa50 100644 --- a/commands/docs/update_cells.md +++ b/src/content/docs/commands/docs/update_cells.md @@ -9,28 +9,28 @@ usage: | Update the table cells. feature: extra --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters <div class='command-title'>{{ $frontmatter.filters }}</div> - -::: warning - Command `update cells` was not included in the official binaries by default, you have to build it with `--features=extra` flag +:::caution[warning] +Command `update cells` was not included in the official binaries by default, you have to build it with `--features=extra` flag ::: + ## Signature -```> update cells {flags} (closure)``` +`> update cells {flags} (closure)` ## Flags - - `--columns, -c {list<any>}`: list of columns to update +- `--columns, -c {list<any>}`: list of columns to update ## Parameters - - `closure`: the closure to run an update for each cell - +- `closure`: the closure to run an update for each cell ## Input/output types: @@ -41,6 +41,7 @@ feature: extra ## Examples Update the zero value cells to empty strings. + ```nu > [ ["2021-04-16", "2021-06-10", "2021-09-18", "2021-10-15", "2021-11-16", "2021-11-17", "2021-11-18"]; @@ -61,6 +62,7 @@ Update the zero value cells to empty strings. ``` Update the zero value cells to empty strings in 2 last columns. + ```nu > [ ["2021-04-16", "2021-06-10", "2021-09-18", "2021-10-15", "2021-11-16", "2021-11-17", "2021-11-18"]; diff --git a/commands/docs/upsert.md b/src/content/docs/commands/docs/upsert.md similarity index 87% rename from commands/docs/upsert.md rename to src/content/docs/commands/docs/upsert.md index 8479d85f820..92e79468480 100644 --- a/commands/docs/upsert.md +++ b/src/content/docs/commands/docs/upsert.md @@ -9,6 +9,7 @@ usage: | Update an existing column to have a new value, or insert a new column. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,24 +18,25 @@ feature: default ## Signature -```> upsert {flags} (field) (replacement value)``` +`> upsert {flags} (field) (replacement value)` ## Parameters - - `field`: The name of the column to update or insert. - - `replacement value`: The new value to give the cell(s), or a closure to create the value. - +- `field`: The name of the column to update or insert. +- `replacement value`: The new value to give the cell(s), or a closure to create the value. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | -| record | record | -| table | table | +| record | record | +| table | table | + ## Examples Update a record's value + ```nu > {'name': 'nu', 'stars': 5} | upsert name 'Nushell' ╭───────┬─────────╮ @@ -44,6 +46,7 @@ Update a record's value ``` Insert a new entry into a record + ```nu > {'name': 'nu', 'stars': 5} | upsert language 'Rust' ╭──────────┬──────╮ @@ -54,6 +57,7 @@ Insert a new entry into a record ``` Update each row of a table + ```nu > [[name lang]; [Nushell ''] [Reedline '']] | upsert lang 'Rust' ╭───┬──────────┬──────╮ @@ -66,6 +70,7 @@ Update each row of a table ``` Insert a new column with values computed based off the other columns + ```nu > [[foo]; [7] [8] [9]] | upsert bar {|row| $row.foo * 2 } ╭───┬─────┬─────╮ @@ -79,6 +84,7 @@ Insert a new column with values computed based off the other columns ``` Upsert into a list, updating an existing value at an index + ```nu > [1 2 3] | upsert 0 2 ╭───┬───╮ @@ -90,6 +96,7 @@ Upsert into a list, updating an existing value at an index ``` Upsert into a list, inserting a new value at the end + ```nu > [1 2 3] | upsert 3 4 ╭───┬───╮ diff --git a/src/content/docs/commands/docs/url.md b/src/content/docs/commands/docs/url.md new file mode 100644 index 00000000000..655dd6d3d00 --- /dev/null +++ b/src/content/docs/commands/docs/url.md @@ -0,0 +1,41 @@ +--- +title: url +categories: | + network +version: 0.90.0 +network: | + Various commands for working with URLs. +usage: | + Various commands for working with URLs. +feature: default +--- + +<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> + +# <code>{{ $frontmatter.title }}</code> for network + +<div class='command-title'>{{ $frontmatter.network }}</div> + +## Signature + +`> url {flags} ` + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes + +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | type | usage | +| --------------------------------------------------- | ------- | --------------------------------------------------------------------- | +| [`url build-query`](/commands/docs/url_build-query) | Builtin | Converts record or table into query string applying percent-encoding. | +| [`url decode`](/commands/docs/url_decode) | Builtin | Converts a percent-encoded web safe string to a string. | +| [`url encode`](/commands/docs/url_encode) | Builtin | Converts a string to a percent encoded web safe string. | +| [`url join`](/commands/docs/url_join) | Builtin | Converts a record to url. | +| [`url parse`](/commands/docs/url_parse) | Builtin | Parses a url. | diff --git a/commands/docs/url_build-query.md b/src/content/docs/commands/docs/url_build-query.md similarity index 96% rename from commands/docs/url_build-query.md rename to src/content/docs/commands/docs/url_build-query.md index 5f5aae5ee50..59299fb4fd7 100644 --- a/commands/docs/url_build-query.md +++ b/src/content/docs/commands/docs/url_build-query.md @@ -9,6 +9,7 @@ usage: | Converts record or table into query string applying percent-encoding. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for network @@ -17,8 +18,7 @@ feature: default ## Signature -```> url build-query {flags} ``` - +`> url build-query {flags} ` ## Input/output types: @@ -26,21 +26,25 @@ feature: default | ------ | ------ | | record | string | | table | string | + ## Examples Outputs a query string representing the contents of this record + ```nu > { mode:normal userid:31415 } | url build-query mode=normal&userid=31415 ``` Outputs a query string representing the contents of this 1-row table + ```nu > [[foo bar]; ["1" "2"]] | url build-query foo=1&bar=2 ``` Outputs a query string representing the contents of this record + ```nu > {a:"AT&T", b: "AT T"} | url build-query a=AT%26T&b=AT+T diff --git a/commands/docs/url_decode.md b/src/content/docs/commands/docs/url_decode.md similarity index 80% rename from commands/docs/url_decode.md rename to src/content/docs/commands/docs/url_decode.md index 6852db4ab2c..6cab3f37a61 100644 --- a/commands/docs/url_decode.md +++ b/src/content/docs/commands/docs/url_decode.md @@ -9,6 +9,7 @@ usage: | Converts a percent-encoded web safe string to a string. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,30 +18,32 @@ feature: default ## Signature -```> url decode {flags} ...rest``` +`> url decode {flags} ...rest` ## Parameters - - `...rest`: For a data structure input, url decode strings at the given cell paths. - +- `...rest`: For a data structure input, url decode strings at the given cell paths. ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples Decode a url with escape characters + ```nu > 'https://example.com/foo%20bar' | url decode https://example.com/foo bar ``` Decode multiple urls with escape characters in list + ```nu > ['https://example.com/foo%20bar' 'https://example.com/a%3Eb' '%E4%B8%AD%E6%96%87%E5%AD%97/eng/12%2034'] | url decode ╭───┬─────────────────────────────╮ diff --git a/commands/docs/url_encode.md b/src/content/docs/commands/docs/url_encode.md similarity index 78% rename from commands/docs/url_encode.md rename to src/content/docs/commands/docs/url_encode.md index 2525e32935e..bd91ab2d740 100644 --- a/commands/docs/url_encode.md +++ b/src/content/docs/commands/docs/url_encode.md @@ -9,6 +9,7 @@ usage: | Converts a string to a percent encoded web safe string. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for strings @@ -17,34 +18,36 @@ feature: default ## Signature -```> url encode {flags} ...rest``` +`> url encode {flags} ...rest` ## Flags - - `--all, -a`: encode all non-alphanumeric chars including `/`, `.`, `:` +- `--all, -a`: encode all non-alphanumeric chars including `/`, `.`, `:` ## Parameters - - `...rest`: For a data structure input, check strings at the given cell paths, and replace with result. - +- `...rest`: For a data structure input, check strings at the given cell paths, and replace with result. ## Input/output types: -| input | output | -| ------------ | ------------ | +| input | output | +| -------------- | -------------- | | list\<string\> | list\<string\> | -| record | record | -| string | string | -| table | table | +| record | record | +| string | string | +| table | table | + ## Examples Encode a url with escape characters + ```nu > 'https://example.com/foo bar' | url encode https://example.com/foo%20bar ``` Encode multiple urls with escape characters in list + ```nu > ['https://example.com/foo bar' 'https://example.com/a>b' '中文字/eng/12 34'] | url encode ╭───┬─────────────────────────────────────────╮ @@ -56,6 +59,7 @@ Encode multiple urls with escape characters in list ``` Encode all non alphanumeric chars with all flag + ```nu > 'https://example.com/foo bar' | url encode --all https%3A%2F%2Fexample%2Ecom%2Ffoo%20bar diff --git a/commands/docs/url_join.md b/src/content/docs/commands/docs/url_join.md similarity index 98% rename from commands/docs/url_join.md rename to src/content/docs/commands/docs/url_join.md index 68327bbb7b0..fc9e799cc0e 100644 --- a/commands/docs/url_join.md +++ b/src/content/docs/commands/docs/url_join.md @@ -9,6 +9,7 @@ usage: | Converts a record to url. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for network @@ -17,8 +18,7 @@ feature: default ## Signature -```> url join {flags} ``` - +`> url join {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Outputs a url representing the contents of this record + ```nu > { "scheme": "http", @@ -49,6 +50,7 @@ http://www.pixiv.net/member_illust.php?mode=medium&illust_id=99260204 ``` Outputs a url representing the contents of this record + ```nu > { "scheme": "http", @@ -63,6 +65,7 @@ http://user:pwd@www.pixiv.net:1234?test=a ``` Outputs a url representing the contents of this record + ```nu > { "scheme": "http", diff --git a/commands/docs/url_parse.md b/src/content/docs/commands/docs/url_parse.md similarity index 95% rename from commands/docs/url_parse.md rename to src/content/docs/commands/docs/url_parse.md index bc7ee295c91..5a27f7afef2 100644 --- a/commands/docs/url_parse.md +++ b/src/content/docs/commands/docs/url_parse.md @@ -9,6 +9,7 @@ usage: | Parses a url. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for network @@ -17,12 +18,11 @@ feature: default ## Signature -```> url parse {flags} ...rest``` +`> url parse {flags} ...rest` ## Parameters - - `...rest`: Optionally operate by cell path. - +- `...rest`: Optionally operate by cell path. ## Input/output types: @@ -31,9 +31,11 @@ feature: default | record | record | | string | record | | table | table | + ## Examples Parses a url + ```nu > 'http://user123:pass567@www.example.com:8081/foo/bar?param1=section&p2=&f[name]=vldc#hello' | url parse ╭──────────┬─────────────────────────────────╮ diff --git a/commands/docs/use.md b/src/content/docs/commands/docs/use.md similarity index 88% rename from commands/docs/use.md rename to src/content/docs/commands/docs/use.md index a30b58fe7f2..dede5b175ef 100644 --- a/commands/docs/use.md +++ b/src/content/docs/commands/docs/use.md @@ -9,6 +9,7 @@ usage: | Use definitions from a module, making them available in your shell. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,13 +18,12 @@ feature: default ## Signature -```> use {flags} (module) ...rest``` +`> use {flags} (module) ...rest` ## Parameters - - `module`: Module or module file. - - `...rest`: Which members of the module to import. - +- `module`: Module or module file. +- `...rest`: Which members of the module to import. ## Input/output types: @@ -34,44 +34,51 @@ feature: default ## Examples Define a custom command in a module and call it + ```nu > module spam { export def foo [] { "foo" } }; use spam foo; foo foo ``` Define a custom command that participates in the environment in a module and call it + ```nu > module foo { export def --env bar [] { $env.FOO_BAR = "BAZ" } }; use foo bar; bar; $env.FOO_BAR BAZ ``` Use a plain module name to import its definitions qualified by the module name + ```nu > module spam { export def foo [] { "foo" }; export def bar [] { "bar" } }; use spam; (spam foo) + (spam bar) foobar ``` -Specify * to use all definitions in a module +Specify \* to use all definitions in a module + ```nu > module spam { export def foo [] { "foo" }; export def bar [] { "bar" } }; use spam *; (foo) + (bar) foobar ``` To use commands with spaces, like subcommands, surround them with quotes + ```nu > module spam { export def 'foo bar' [] { "baz" } }; use spam 'foo bar'; foo bar baz ``` To use multiple definitions from a module, wrap them in a list + ```nu > module spam { export def foo [] { "foo" }; export def 'foo bar' [] { "baz" } }; use spam ['foo', 'foo bar']; (foo) + (foo bar) foobaz ``` ## Notes + See `help std` for the standard library module. See `help modules` to list all available modules. This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html \ No newline at end of file +https://www.nushell.sh/book/thinking_in_nu.html diff --git a/commands/docs/values.md b/src/content/docs/commands/docs/values.md similarity index 95% rename from commands/docs/values.md rename to src/content/docs/commands/docs/values.md index f2e02d4e99a..23066c66b07 100644 --- a/commands/docs/values.md +++ b/src/content/docs/commands/docs/values.md @@ -9,6 +9,7 @@ usage: | Given a record or table, produce a list of its columns' values. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,18 +18,19 @@ feature: default ## Signature -```> values {flags} ``` - +`> values {flags} ` ## Input/output types: -| input | output | -| ------ | --------- | +| input | output | +| ------ | ----------- | | record | list\<any\> | | table | list\<any\> | + ## Examples Get the values from the record (produce a list) + ```nu > { mode:normal userid:31415 } | values ╭───┬────────╮ @@ -39,6 +41,7 @@ Get the values from the record (produce a list) ``` Values are ordered by the column order of the record + ```nu > { f:250 g:191 c:128 d:1024 e:2000 a:16 b:32 } | values ╭───┬──────╮ @@ -54,6 +57,7 @@ Values are ordered by the column order of the record ``` Get the values from the table (produce a list of lists) + ```nu > [[name meaning]; [ls list] [mv move] [cd 'change directory']] | values ╭───┬──────────────────────────╮ @@ -72,4 +76,5 @@ Get the values from the table (produce a list of lists) ``` ## Notes -This is a counterpart to `columns`, which produces a list of columns' names. \ No newline at end of file + +This is a counterpart to `columns`, which produces a list of columns' names. diff --git a/commands/docs/version.md b/src/content/docs/commands/docs/version.md similarity index 95% rename from commands/docs/version.md rename to src/content/docs/commands/docs/version.md index b6ae1ab81f9..35832a3901e 100644 --- a/commands/docs/version.md +++ b/src/content/docs/commands/docs/version.md @@ -9,6 +9,7 @@ usage: | Display Nu version, and its build configuration. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,8 +18,7 @@ feature: default ## Signature -```> version {flags} ``` - +`> version {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Display Nu version + ```nu > version diff --git a/commands/docs/view.md b/src/content/docs/commands/docs/view.md similarity index 51% rename from commands/docs/view.md rename to src/content/docs/commands/docs/view.md index ea5305ba5c9..3728ec6add9 100644 --- a/commands/docs/view.md +++ b/src/content/docs/commands/docs/view.md @@ -9,6 +9,7 @@ usage: | Various commands for viewing debug information. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for debug @@ -17,8 +18,7 @@ feature: default ## Signature -```> view {flags} ``` - +`> view {flags} ` ## Input/output types: @@ -27,12 +27,13 @@ feature: default | nothing | string | ## Notes + You must use one of the following subcommands. Using this command as-is will only produce this help message. ## Subcommands: -| name | type | usage | -| ---------------------------------------------- | ------- | ---------------------------------------------------------- | -| [`view files`](/commands/docs/view_files.md) | Builtin | View the files registered in nushell's EngineState memory. | -| [`view source`](/commands/docs/view_source.md) | Builtin | View a block, module, or a definition. | -| [`view span`](/commands/docs/view_span.md) | Builtin | View the contents of a span. | \ No newline at end of file +| name | type | usage | +| ------------------------------------------- | ------- | ---------------------------------------------------------- | +| [`view files`](/commands/docs/view_files) | Builtin | View the files registered in nushell's EngineState memory. | +| [`view source`](/commands/docs/view_source) | Builtin | View a block, module, or a definition. | +| [`view span`](/commands/docs/view_span) | Builtin | View the contents of a span. | diff --git a/commands/docs/view_files.md b/src/content/docs/commands/docs/view_files.md similarity index 90% rename from commands/docs/view_files.md rename to src/content/docs/commands/docs/view_files.md index 7238bd2802e..ab4304663c6 100644 --- a/commands/docs/view_files.md +++ b/src/content/docs/commands/docs/view_files.md @@ -9,6 +9,7 @@ usage: | View the files registered in nushell's EngineState memory. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for debug @@ -17,28 +18,30 @@ feature: default ## Signature -```> view files {flags} ``` - +`> view files {flags} ` ## Input/output types: -| input | output | -| ------- | -------------------------------------------------------- | +| input | output | +| ------- | ---------------------------------------------------------- | | nothing | table\<filename: string, start: int, end: int, size: int\> | ## Examples View the files registered in Nushell's EngineState memory + ```nu > view files ``` View how Nushell was originally invoked + ```nu > view files | get 0 ``` ## Notes -These are files parsed and loaded at runtime. \ No newline at end of file + +These are files parsed and loaded at runtime. diff --git a/commands/docs/view_source.md b/src/content/docs/commands/docs/view_source.md similarity index 95% rename from commands/docs/view_source.md rename to src/content/docs/commands/docs/view_source.md index 81fcba2bfda..209bafd09e2 100644 --- a/commands/docs/view_source.md +++ b/src/content/docs/commands/docs/view_source.md @@ -9,6 +9,7 @@ usage: | View a block, module, or a definition. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for debug @@ -17,12 +18,11 @@ feature: default ## Signature -```> view source {flags} (item)``` +`> view source {flags} (item)` ## Parameters - - `item`: Name or block to view. - +- `item`: Name or block to view. ## Input/output types: @@ -33,36 +33,42 @@ feature: default ## Examples View the source of a code block + ```nu > let abc = {|| echo 'hi' }; view source $abc {|| echo 'hi' } ``` View the source of a custom command + ```nu > def hi [] { echo 'Hi!' }; view source hi def hi [] { echo 'Hi!' } ``` View the source of a custom command, which participates in the caller environment + ```nu > def --env foo [] { $env.BAR = 'BAZ' }; view source foo def foo [] { $env.BAR = 'BAZ' } ``` View the source of a custom command with flags and arguments + ```nu > def test [a?:any --b:int ...rest:string] { echo 'test' }; view source test def test [ a?: any --b: int ...rest: string] { echo 'test' } ``` View the source of a module + ```nu > module mod-foo { export-env { $env.FOO_ENV = 'BAZ' } }; view source mod-foo export-env { $env.FOO_ENV = 'BAZ' } ``` View the source of an alias + ```nu > alias hello = echo hi; view source hello echo hi diff --git a/commands/docs/view_span.md b/src/content/docs/commands/docs/view_span.md similarity index 88% rename from commands/docs/view_span.md rename to src/content/docs/commands/docs/view_span.md index d362ac8458d..60d01004adf 100644 --- a/commands/docs/view_span.md +++ b/src/content/docs/commands/docs/view_span.md @@ -9,6 +9,7 @@ usage: | View the contents of a span. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for debug @@ -17,13 +18,12 @@ feature: default ## Signature -```> view span {flags} (start) (end)``` +`> view span {flags} (start) (end)` ## Parameters - - `start`: Start of the span. - - `end`: End of the span. - +- `start`: Start of the span. +- `end`: End of the span. ## Input/output types: @@ -34,13 +34,15 @@ feature: default ## Examples View the source of a span. 1 and 2 are just example values. Use the return of debug --raw to get the actual values + ```nu > some | pipeline | or | variable | debug --raw; view span 1 2 ``` ## Notes + This command is meant for debugging purposes. It allows you to view the contents of nushell spans. One way to get spans is to pipe something into 'debug --raw'. -Then you can use the Span { start, end } values as the start and end values for this command. \ No newline at end of file +Then you can use the Span { start, end } values as the start and end values for this command. diff --git a/commands/docs/watch.md b/src/content/docs/commands/docs/watch.md similarity index 60% rename from commands/docs/watch.md rename to src/content/docs/commands/docs/watch.md index fe4d74c9225..02c0bc4c66d 100644 --- a/commands/docs/watch.md +++ b/src/content/docs/commands/docs/watch.md @@ -9,6 +9,7 @@ usage: | Watch for file changes and execute Nu code when they happen. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filesystem @@ -17,20 +18,19 @@ feature: default ## Signature -```> watch {flags} (path) (closure)``` +`> watch {flags} (path) (closure)` ## Flags - - `--debounce-ms, -d {int}`: Debounce changes for this many milliseconds (default: 100). Adjust if you find that single writes are reported as multiple events - - `--glob, -g {string}`: Only report changes for files that match this glob pattern (default: all files) - - `--recursive, -r {bool}`: Watch all directories under `<path>` recursively. Will be ignored if `<path>` is a file (default: true) - - `--verbose, -v`: Operate in verbose mode (default: false) +- `--debounce-ms, -d {int}`: Debounce changes for this many milliseconds (default: 100). Adjust if you find that single writes are reported as multiple events +- `--glob, -g {string}`: Only report changes for files that match this glob pattern (default: all files) +- `--recursive, -r {bool}`: Watch all directories under `<path>` recursively. Will be ignored if `<path>` is a file (default: true) +- `--verbose, -v`: Operate in verbose mode (default: false) ## Parameters - - `path`: The path to watch. Can be a file or directory. - - `closure`: Some Nu code to run whenever a file changes. The closure will be passed `operation`, `path`, and `new_path` (for renames only) arguments in that order. - +- `path`: The path to watch. Can be a file or directory. +- `closure`: Some Nu code to run whenever a file changes. The closure will be passed `operation`, `path`, and `new_path` (for renames only) arguments in that order. ## Input/output types: @@ -41,24 +41,28 @@ feature: default ## Examples Run `cargo test` whenever a Rust file changes + ```nu > watch . --glob=**/*.rs {|| cargo test } ``` Watch all changes in the current directory + ```nu > watch . { |op, path, new_path| $"($op) ($path) ($new_path)"} ``` Log all changes in a directory + ```nu > watch /foo/bar { |op, path| $"($op) - ($path)(char nl)" | save --append changes_in_bar.log } ``` Note: if you are looking to run a command every N units of time, this can be accomplished with a loop and sleep + ```nu > loop { command; sleep duration } diff --git a/commands/docs/where.md b/src/content/docs/commands/docs/where.md similarity index 89% rename from commands/docs/where.md rename to src/content/docs/commands/docs/where.md index 3314d82c886..5262c36d371 100644 --- a/commands/docs/where.md +++ b/src/content/docs/commands/docs/where.md @@ -9,6 +9,7 @@ usage: | Filter values based on a row condition. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,23 +18,24 @@ feature: default ## Signature -```> where {flags} (row_condition)``` +`> where {flags} (row_condition)` ## Parameters - - `row_condition`: Filter condition. - +- `row_condition`: Filter condition. ## Input/output types: -| input | output | -| --------- | --------- | +| input | output | +| ----------- | ----------- | | list\<any\> | list\<any\> | -| range | any | -| table | table | +| range | any | +| table | table | + ## Examples Filter rows of a table according to a condition + ```nu > [{a: 1} {a: 2}] | where a > 1 ╭───┬───╮ @@ -45,6 +47,7 @@ Filter rows of a table according to a condition ``` Filter items of a list according to a condition + ```nu > [1 2] | where {|x| $x > 1} ╭───┬───╮ @@ -54,48 +57,56 @@ Filter items of a list according to a condition ``` List all files in the current directory with sizes greater than 2kb + ```nu > ls | where size > 2kb ``` List only the files in the current directory + ```nu > ls | where type == file ``` List all files with names that contain "Car" + ```nu > ls | where name =~ "Car" ``` List all files that were modified in the last two weeks + ```nu > ls | where modified >= (date now) - 2wk ``` Find files whose filenames don't begin with the correct sequential number + ```nu > ls | where type == file | sort-by name --natural | enumerate | where {|e| $e.item.name !~ $'^($e.index + 1)' } | each {|| get item } ``` Find case-insensitively files called "readme", without an explicit closure + ```nu > ls | where ($it.name | str downcase) =~ readme ``` same as above but with regex only + ```nu > ls | where name =~ '(?i)readme' ``` ## Notes + This command works similar to 'filter' but allows extra shorthands for working with tables, known as "row conditions". On the other hand, reading the condition from a variable is -not supported. \ No newline at end of file +not supported. diff --git a/commands/docs/which.md b/src/content/docs/commands/docs/which.md similarity index 80% rename from commands/docs/which.md rename to src/content/docs/commands/docs/which.md index d11d4f507e6..c8b12cc3ef6 100644 --- a/commands/docs/which.md +++ b/src/content/docs/commands/docs/which.md @@ -9,6 +9,7 @@ usage: | Finds a program file, alias or custom command. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for system @@ -17,17 +18,16 @@ feature: default ## Signature -```> which {flags} (application) ...rest``` +`> which {flags} (application) ...rest` ## Flags - - `--all, -a`: list all executables +- `--all, -a`: list all executables ## Parameters - - `application`: Application. - - `...rest`: Additional applications. - +- `application`: Application. +- `...rest`: Additional applications. ## Input/output types: @@ -38,6 +38,7 @@ feature: default ## Examples Find if the 'myapp' application is available + ```nu > which myapp diff --git a/commands/docs/while.md b/src/content/docs/commands/docs/while.md similarity index 84% rename from commands/docs/while.md rename to src/content/docs/commands/docs/while.md index d579d3cd0ba..b27b29fe9b8 100644 --- a/commands/docs/while.md +++ b/src/content/docs/commands/docs/while.md @@ -9,6 +9,7 @@ usage: | Conditionally run a block in a loop. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for core @@ -17,13 +18,12 @@ feature: default ## Signature -```> while {flags} (cond) (block)``` +`> while {flags} (cond) (block)` ## Parameters - - `cond`: Condition to check. - - `block`: Block to loop if check succeeds. - +- `cond`: Condition to check. +- `block`: Block to loop if check succeeds. ## Input/output types: @@ -34,6 +34,7 @@ feature: default ## Examples Loop while a condition is true + ```nu > mut x = 0; while $x < 10 { $x = $x + 1 } diff --git a/commands/docs/whoami.md b/src/content/docs/commands/docs/whoami.md similarity index 96% rename from commands/docs/whoami.md rename to src/content/docs/commands/docs/whoami.md index 4f771cbfb51..d6d3d3ed7cb 100644 --- a/commands/docs/whoami.md +++ b/src/content/docs/commands/docs/whoami.md @@ -9,6 +9,7 @@ usage: | Get the current username using uutils/coreutils whoami. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for platform @@ -17,8 +18,7 @@ feature: default ## Signature -```> whoami {flags} ``` - +`> whoami {flags} ` ## Input/output types: @@ -29,6 +29,7 @@ feature: default ## Examples Get the current username + ```nu > whoami diff --git a/commands/docs/window.md b/src/content/docs/commands/docs/window.md similarity index 88% rename from commands/docs/window.md rename to src/content/docs/commands/docs/window.md index 0534b910875..8c802ddc513 100644 --- a/commands/docs/window.md +++ b/src/content/docs/commands/docs/window.md @@ -9,6 +9,7 @@ usage: | Creates a sliding window of `window_size` that slide by n rows/elements across input. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,27 +18,27 @@ feature: default ## Signature -```> window {flags} (window_size)``` +`> window {flags} (window_size)` ## Flags - - `--stride, -s {int}`: the number of rows to slide over between windows - - `--remainder, -r`: yield last chunks even if they have fewer elements than size +- `--stride, -s {int}`: the number of rows to slide over between windows +- `--remainder, -r`: yield last chunks even if they have fewer elements than size ## Parameters - - `window_size`: The size of each window. - +- `window_size`: The size of each window. ## Input/output types: -| input | output | -| --------- | --------------- | +| input | output | +| ----------- | ------------------- | | list\<any\> | list\<list\<any\>\> | ## Examples A sliding window of two elements + ```nu > [1 2 3 4] | window 2 ╭───┬───────────╮ @@ -58,6 +59,7 @@ A sliding window of two elements ``` A sliding window of two elements, with a stride of 3 + ```nu > [1, 2, 3, 4, 5, 6, 7, 8] | window 2 --stride 3 ╭───┬───────────╮ @@ -78,6 +80,7 @@ A sliding window of two elements, with a stride of 3 ``` A sliding window of equal stride that includes remainder. Equivalent to chunking + ```nu > [1, 2, 3, 4, 5] | window 3 --stride 3 --remainder ╭───┬───────────╮ diff --git a/commands/docs/with-env.md b/src/content/docs/commands/docs/with-env.md similarity index 85% rename from commands/docs/with-env.md rename to src/content/docs/commands/docs/with-env.md index 9adfdb2cba2..b0f0333f886 100644 --- a/commands/docs/with-env.md +++ b/src/content/docs/commands/docs/with-env.md @@ -9,6 +9,7 @@ usage: | Runs a block with an environment variable set. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for env @@ -17,13 +18,12 @@ feature: default ## Signature -```> with-env {flags} (variable) (block)``` +`> with-env {flags} (variable) (block)` ## Parameters - - `variable`: The environment variable to temporarily set. - - `block`: The block to run once the variable is set. - +- `variable`: The environment variable to temporarily set. +- `block`: The block to run once the variable is set. ## Input/output types: @@ -34,24 +34,28 @@ feature: default ## Examples Set the MYENV environment variable + ```nu > with-env [MYENV "my env value"] { $env.MYENV } my env value ``` Set by primitive value list + ```nu > with-env [X Y W Z] { $env.X } Y ``` Set by single row table + ```nu > with-env [[X W]; [Y Z]] { $env.W } Z ``` Set by key-value record + ```nu > with-env {X: "Y", W: "Z"} { [$env.X $env.W] } ╭───┬───╮ diff --git a/commands/docs/wrap.md b/src/content/docs/commands/docs/wrap.md similarity index 86% rename from commands/docs/wrap.md rename to src/content/docs/commands/docs/wrap.md index ec8a8855960..61c52f0f586 100644 --- a/commands/docs/wrap.md +++ b/src/content/docs/commands/docs/wrap.md @@ -9,6 +9,7 @@ usage: | Wrap the value into a column. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,23 +18,24 @@ feature: default ## Signature -```> wrap {flags} (name)``` +`> wrap {flags} (name)` ## Parameters - - `name`: The name of the column. - +- `name`: The name of the column. ## Input/output types: -| input | output | -| --------- | ------ | -| any | record | +| input | output | +| ----------- | ------ | +| any | record | | list\<any\> | table | -| range | table | +| range | table | + ## Examples Wrap a list into a table with a given column name + ```nu > [1 2 3] | wrap num ╭───┬─────╮ @@ -47,6 +49,7 @@ Wrap a list into a table with a given column name ``` Wrap a range into a table with a given column name + ```nu > 1..3 | wrap num ╭───┬─────╮ diff --git a/commands/docs/zip.md b/src/content/docs/commands/docs/zip.md similarity index 90% rename from commands/docs/zip.md rename to src/content/docs/commands/docs/zip.md index d1856d9ea00..5857eb2cdce 100644 --- a/commands/docs/zip.md +++ b/src/content/docs/commands/docs/zip.md @@ -9,6 +9,7 @@ usage: | Combine a stream with the input. feature: default --- + <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # <code>{{ $frontmatter.title }}</code> for filters @@ -17,22 +18,23 @@ feature: default ## Signature -```> zip {flags} (other)``` +`> zip {flags} (other)` ## Parameters - - `other`: The other input. - +- `other`: The other input. ## Input/output types: -| input | output | -| --------- | --------------- | +| input | output | +| ----------- | ------------------- | | list\<any\> | list\<list\<any\>\> | -| range | list\<list\<any\>\> | +| range | list\<list\<any\>\> | + ## Examples Zip two lists + ```nu > [1 2] | zip [3 4] ╭───┬───────────╮ @@ -49,6 +51,7 @@ Zip two lists ``` Zip two ranges + ```nu > 1..3 | zip 4..6 ╭───┬───────────╮ @@ -69,6 +72,7 @@ Zip two ranges ``` Rename .ogg files to match an existing list of filenames + ```nu > glob *.ogg | zip ['bang.ogg', 'fanfare.ogg', 'laser.ogg'] | each {|| mv $in.0 $in.1 } diff --git a/contributor-book/README.md b/src/content/docs/contributor-book/README.md similarity index 98% rename from contributor-book/README.md rename to src/content/docs/contributor-book/README.md index 687674ebc3a..2715f0a4619 100644 --- a/contributor-book/README.md +++ b/src/content/docs/contributor-book/README.md @@ -2,8 +2,6 @@ title: Introduction --- -# Introduction - Hello and welcome to the Nushell Contributor Book. Nushell, or Nu as its often called, is a modern shell written in Rust. You can learn more about Nu and how to use it in the [Nu book](https://www.nushell.sh/book/). In this book, we'll be looking at how to contribute to the Nu project itself, how Nu's code is organized, and the core concepts behind its design. Contributing to Nu will require at least some basic programmer experience, and it's helpful to have some experience with Rust. That said, we've had people contribute to Nu who have never written a line of Rust before writing their submission. If you are interested in contributing, there's a growing community of people who would like to help you succeed. diff --git a/contributor-book/commands.md b/src/content/docs/contributor-book/commands.md similarity index 95% rename from contributor-book/commands.md rename to src/content/docs/contributor-book/commands.md index 3a1950d6695..7572d907def 100644 --- a/contributor-book/commands.md +++ b/src/content/docs/contributor-book/commands.md @@ -2,17 +2,15 @@ title: Commands --- -# Commands - Commands are the building blocks for pipelines in Nu. They do the action of the pipeline, whether creating data, changing data as it flows from inputs to outputs, or viewing data once it has exited the pipeline. There are two types of commands: internal commands, those commands built to run inside of Nu, and external commands, commands that are outside of Nu and communicate with standard Unix-style `stdin`/`stdout`. ## Internal commands -All commands inside of Nu, including plugins, are internal commands. Internal commands communicate with each other using [`PipelineData`](https://docs.rs/nu-protocol/latest/nu_protocol/enum.PipelineData.html). +All commands inside of Nu, including plugins, are internal commands. Internal commands communicate with each other using [`PipelineData`](https://docs.rs/nu-protocol/latest/nu_protocol/enum.PipelineData). ### Signature -Commands use a light typechecking pass to ensure that arguments passed to them can be handled correctly. To enable this, each [`Command`](https://docs.rs/nu-protocol/latest/nu_protocol/engine/trait.Command.html) provides a [`Signature`](https://docs.rs/nu-protocol/latest/nu_protocol/struct.Signature.html) which tells Nu: +Commands use a light typechecking pass to ensure that arguments passed to them can be handled correctly. To enable this, each [`Command`](https://docs.rs/nu-protocol/latest/nu_protocol/engine/trait.Command) provides a [`Signature`](https://docs.rs/nu-protocol/latest/nu_protocol/struct.Signature) which tells Nu: - The name of the command - The positional arguments (e.g. in `start x y` the `x` and `y` are positional arguments) diff --git a/contributor-book/philosophy.md b/src/content/docs/contributor-book/philosophy.md similarity index 99% rename from contributor-book/philosophy.md rename to src/content/docs/contributor-book/philosophy.md index a0fa0a54a2d..b676ed0e0fd 100644 --- a/contributor-book/philosophy.md +++ b/src/content/docs/contributor-book/philosophy.md @@ -2,8 +2,6 @@ title: Philosophy --- -# Philosophy - ## Core Values Nu's core value is that working in a shell should be fun. To support this, we believe that: diff --git a/contributor-book/philosophy_0_80.md b/src/content/docs/contributor-book/philosophy_0_80.md similarity index 99% rename from contributor-book/philosophy_0_80.md rename to src/content/docs/contributor-book/philosophy_0_80.md index 19f06e9a2bb..2e1aa17df74 100644 --- a/contributor-book/philosophy_0_80.md +++ b/src/content/docs/contributor-book/philosophy_0_80.md @@ -2,8 +2,6 @@ title: Philosophy (0.80) --- -# Nushell design philosophy - ## Core philosophy Nushell is "A shell-first scripting language for working with structured data flowing through pipelines". diff --git a/contributor-book/plugins.md b/src/content/docs/contributor-book/plugins.md similarity index 99% rename from contributor-book/plugins.md rename to src/content/docs/contributor-book/plugins.md index dc0c00b8dee..ebd546cf401 100644 --- a/contributor-book/plugins.md +++ b/src/content/docs/contributor-book/plugins.md @@ -2,8 +2,6 @@ title: Plugins --- -# Plugins - ## Protocol Plugins are executable applications that communicate with Nu by exchanging serialized data over stdin and stdout (much in the same way VSCode plugins do). The protocol is split into two stages. diff --git a/cookbook/direnv.md b/src/content/docs/cookbook/direnv.md similarity index 97% rename from cookbook/direnv.md rename to src/content/docs/cookbook/direnv.md index 582e60a7aa7..692977cbe39 100644 --- a/cookbook/direnv.md +++ b/src/content/docs/cookbook/direnv.md @@ -2,8 +2,6 @@ title: Direnv --- -# Direnv - Many people use [direnv](https://direnv.net) to load an environment upon entering a directory as well as unloading it when exiting the directory. Configuring direnv to work with nushell requires nushell version 0.66 or later. @@ -27,7 +25,7 @@ $env.config = { } ``` -::: tip Note +:::note you can follow the [`nu_scripts` of Nushell](https://github.com/nushell/nu_scripts/blob/main/hooks/direnv/config.nu) for the always up-to-date version of the hook above ::: diff --git a/cookbook/external_completers.md b/src/content/docs/cookbook/external_completers.md similarity index 86% rename from cookbook/external_completers.md rename to src/content/docs/cookbook/external_completers.md index 3c53eac8310..9bd181914e6 100644 --- a/cookbook/external_completers.md +++ b/src/content/docs/cookbook/external_completers.md @@ -2,8 +2,6 @@ title: External Completers --- -# External Completers - ## Completers ### Carapace completer @@ -51,16 +49,18 @@ This completer is not usable for almost every other command, so it's recommended } ``` -> **Note** -> Zoxide sets an alias (`z` by default) that calls the `__zoxide_z` function. -> If [alias completions](#alias-completions) are supported, the following snippet can be used instead: -> -> ```nu -> { -> __zoxide_z => $zoxide_completer -> __zoxide_zi => $zoxide_completer -> } -> ``` +:::note +Zoxide sets an alias (`z` by default) that calls the `__zoxide_z` function. +If [alias completions](#alias-completions) are supported, the following snippet can be used instead: + +```nu +{ + __zoxide_z => $zoxide_completer + __zoxide_zi => $zoxide_completer +} +``` + +::: ### Multiple completer @@ -76,11 +76,13 @@ let multiple_completers = {|spans| } ``` -> **Note** -> In the example above, `$spans.0` is the command being run at the time. The completer will match the desired completer, and fallback to `$default_completer`. -> -> - If we try to autocomplete `git <tab>`, `spans` will be `[git ""]`. `match $spans.0 { ... }` will return the `$git_completer`. -> - If we try to autocomplete `other_command <tab>`, `spans` will be `[other_command ""]`. The match will fallback to the default case (`_`) and return the `$default_completer`. +:::note +In the example above, `$spans.0` is the command being run at the time. The completer will match the desired completer, and fallback to `$default_completer`. + +- If we try to autocomplete `git <tab>`, `spans` will be `[git ""]`. `match $spans.0 { ... }` will return the `$git_completer`. +- If we try to autocomplete `other_command <tab>`, `spans` will be `[other_command ""]`. The match will fallback to the default case (`_`) and return the `$default_completer`. + +::: ## Troubleshooting diff --git a/cookbook/files.md b/src/content/docs/cookbook/files.md similarity index 99% rename from cookbook/files.md rename to src/content/docs/cookbook/files.md index d2a63408a76..8b5b9f14841 100644 --- a/cookbook/files.md +++ b/src/content/docs/cookbook/files.md @@ -2,8 +2,6 @@ title: Files --- -# Files - ### Editing a file and then saving the changes Here we are making edits to `Cargo.toml`. We increase the patch version of the crate using `inc` and then save it back to the file. diff --git a/cookbook/git.md b/src/content/docs/cookbook/git.md similarity index 99% rename from cookbook/git.md rename to src/content/docs/cookbook/git.md index 3dca47bced2..5c376a267c2 100644 --- a/cookbook/git.md +++ b/src/content/docs/cookbook/git.md @@ -2,8 +2,6 @@ title: Git --- -# Git - Nu can help with common `Git` tasks like removing all local branches which have been merged into master. ### Delete git merged branches diff --git a/src/content/docs/cookbook/help.md b/src/content/docs/cookbook/help.md new file mode 100644 index 00000000000..7fe71a562d8 --- /dev/null +++ b/src/content/docs/cookbook/help.md @@ -0,0 +1,69 @@ +--- +title: Help +--- + +The `help` command is a good way to become familiar with all that Nu has to offer. + +### How to see all supported commands: + +```nu +help commands +``` + +--- + +### Specific information on a command + +To find more specific information on a command, use `help <COMMAND>`. This works for regular commands (i.e. `http`) and subcommands (i.e. `http get`): + +```nu +help http get +``` + +Output: + +```nu +Fetch the contents from a URL. + +Performs HTTP GET operation. + +Search terms: network, fetch, pull, request, download, curl, wget + +Usage: + > http get {flags} <URL> + +Flags: + -h, --help - Display the help message for this command + -u, --user <Any> - the username when authenticating + -p, --password <Any> - the password when authenticating + -m, --max-time <Int> - timeout period in seconds + -H, --headers <Any> - custom headers you want to add + -r, --raw - fetch contents as text rather than a table + -k, --insecure - allow insecure server connections when using SSL + -f, --full - returns the full response instead of only the body + -e, --allow-errors - do not fail if the server returns an error code + -R, --redirect-mode <String> - What to do when encountering redirects. Default: 'follow'. Valid options: 'follow' ('f'), 'manual' ('m'), 'error' ('e'). + +Parameters: + URL <string>: The URL to fetch the contents from. + +Input/output types: + ╭───┬─────────┬────────╮ + │ # │ input │ output │ + ├───┼─────────┼────────┤ + │ 0 │ nothing │ any │ + ╰───┴─────────┴────────╯ + +Examples: + Get content from example.com + > http get https://www.example.com + + Get content from example.com, with username and password + > http get --user myuser --password mypass https://www.example.com + + Get content from example.com, with custom header + > http get --headers [my-header-key my-header-value] https://www.example.com + + Get content from example.com, with custom headers + > http get --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com +``` diff --git a/cookbook/http.md b/src/content/docs/cookbook/http.md similarity index 99% rename from cookbook/http.md rename to src/content/docs/cookbook/http.md index d3fb48c4500..d01b7c2e83b 100644 --- a/cookbook/http.md +++ b/src/content/docs/cookbook/http.md @@ -2,8 +2,6 @@ title: HTTP --- -# HTTP - ### Fetching JSON from a url ```nu diff --git a/cookbook/README.md b/src/content/docs/cookbook/index.md similarity index 66% rename from cookbook/README.md rename to src/content/docs/cookbook/index.md index 76b391a1ca6..6560be0c9b1 100644 --- a/cookbook/README.md +++ b/src/content/docs/cookbook/index.md @@ -1,4 +1,10 @@ -# Cookbook +--- +title: Cookbook +author: Jonathan Turner +author_site: https://twitter.com/jntrnr +author_image: https://www.nushell.sh/blog/images/jonathandturner.jpg +description: Today, we're introducing a new shell, written in Rust. It draws inspiration from the classic Unix philosophy of pipelines, the structured data approach of PowerShell, functional programming, systems programming, and more. +--- In this section we have put together a bunch of useful tips to get you started with Nushell. These are simple commands that will help you ease your diff --git a/cookbook/jq_v_nushell.md b/src/content/docs/cookbook/jq_v_nushell.md similarity index 97% rename from cookbook/jq_v_nushell.md rename to src/content/docs/cookbook/jq_v_nushell.md index a98d33cc099..af17b48c2c7 100644 --- a/cookbook/jq_v_nushell.md +++ b/src/content/docs/cookbook/jq_v_nushell.md @@ -2,8 +2,6 @@ title: jq vs Nushell --- -# jq vs Nushell - Both [`jq`](https://jqlang.github.io/jq/) and `nu` have the ability to transform data in a composable way. This cookbook will walk you through common data manipulation tasks with the aim of building a solid mental model for using Nushell effectively. All examples will stick to JSON to keep parity between examples. @@ -34,7 +32,7 @@ Output: ╰──────────────────┴───────────────╯ ``` -The output for `jq` is a JSON string whereas in `nu` it's a Nushell value. To get the output of any pipeline as JSON, simply apply a [`to json`](/commands/docs/to_json.html) at the end: +The output for `jq` is a JSON string whereas in `nu` it's a Nushell value. To get the output of any pipeline as JSON, simply apply a [`to json`](/commands/docs/to_json) at the end: ```nu '[{"name": "Alice", "age": 30}, {"name": "Bob", "age": 25}]' @@ -45,13 +43,19 @@ The output for `jq` is a JSON string whereas in `nu` it's a Nushell value. To ge Output: ```json -{ - "title": "jq vs Nushell", - "publication_date": "2023-11-20" -} +[ + { + "name": "Alice", + "age": 30 + }, + { + "name": "Bob", + "age": 25 + } +] ``` -When your JSON data is stored in a file, you can use [open](/commands/docs/open.html) instead of [from json](/commands/docs/from_json.html). +When your JSON data is stored in a file, you can use [open](/commands/docs/open) instead of [from json](/commands/docs/from_json). Before we get into the examples, the following glossary can help familiarise yourself with how Nushell data types map to jq data types. @@ -339,7 +343,7 @@ Output: ╰───┴───╯ ``` -Alternatively, you can use [`compact`](/commands/docs/compact.html): +Alternatively, you can use [`compact`](/commands/docs/compact): ```nu '[1, null, 3, null, 5]' @@ -371,7 +375,7 @@ Output: Name: Alice, Name: 30 ``` -This approach is a bit involved but if we [install the full version](https://github.com/nushell/nushell/releases) which includes the _extra commands_ we can benefit from the [`format`](/commands/docs/format.html): +This approach is a bit involved but if we [install the full version](https://github.com/nushell/nushell/releases) which includes the _extra commands_ we can benefit from the [`format`](/commands/docs/format): ```nu '{"name": "Alice", "age": 30}' @@ -443,7 +447,7 @@ echo '{"data": [{"values": [1, 2, 3]}, {"values": [4, 5, 6]}]}' | jq -r '.data[].values[] | select(. > 3)' ``` -In `nu` we can take advantage of the fact that [a list of records is in fact a table](/book/types_of_data.html#tables) and simply do: +In `nu` we can take advantage of the fact that [a list of records is in fact a table](/book/types_of_data#tables) and simply do: ```nu '{"data": [{"values": [1, 2, 3]}, {"values": [4, 5, 6]}]}' @@ -577,7 +581,7 @@ In `nu` we do: | group-by --to-table category ``` -Note that `--to-table` was added to Nushell in [version 0.87.0](blog/2023-11-14-nushell_0_87_0.html). Before that you had to [`transpose`](/commands/docs/transpose) the record resulting from `group-by` which was substantially slower for large sets. +Note that `--to-table` was added to Nushell in [version 0.87.0](blog/2023-11-14-nushell_0_87_0). Before that you had to [`transpose`](/commands/docs/transpose) the record resulting from `group-by` which was substantially slower for large sets. Output: @@ -732,7 +736,7 @@ Note that if what you are after is computing a histogram, you can benefit from t ## Appendix: Custom commands -This section provides the implementation of the custom commands used in this cookbook. Note that they are illustrative and in no way optimised for large inputs. If you are interested in that, [plugins](/book/plugins.html) will likely be the answer as they can be written in general purpose languages such as Rust or Python. +This section provides the implementation of the custom commands used in this cookbook. Note that they are illustrative and in no way optimised for large inputs. If you are interested in that, [plugins](/book/plugins) will likely be the answer as they can be written in general purpose languages such as Rust or Python. ```nu > use toolbox.nu * @@ -749,8 +753,7 @@ This section provides the implementation of the custom commands used in this coo ╰──────┴─────────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────╯ ``` -```nu -# toolbox.nu +```nu title="toolbox.nu" use std assert # A command for cherry-picking values from a record key recursively diff --git a/cookbook/parsing.md b/src/content/docs/cookbook/parsing.md similarity index 98% rename from cookbook/parsing.md rename to src/content/docs/cookbook/parsing.md index 9285bd2fe83..168924d8be4 100644 --- a/cookbook/parsing.md +++ b/src/content/docs/cookbook/parsing.md @@ -2,9 +2,7 @@ title: Parsing --- -# Parsing - -*Nu* offers the ability to do some basic parsing, with different ways to achieve the same goal. +_Nu_ offers the ability to do some basic parsing, with different ways to achieve the same goal. Builtin-functions that can be used include: diff --git a/cookbook/parsing_git_log.md b/src/content/docs/cookbook/parsing_git_log.md similarity index 99% rename from cookbook/parsing_git_log.md rename to src/content/docs/cookbook/parsing_git_log.md index 6314854dc07..be9940535a1 100644 --- a/cookbook/parsing_git_log.md +++ b/src/content/docs/cookbook/parsing_git_log.md @@ -2,9 +2,7 @@ title: Parsing Git Log --- -# Parsing Git Log - -# Let's parse git log +## Let's parse git log This `git log` command is interesting but you can't do a lot with it like this. diff --git a/cookbook/pattern_matching.md b/src/content/docs/cookbook/pattern_matching.md similarity index 92% rename from cookbook/pattern_matching.md rename to src/content/docs/cookbook/pattern_matching.md index 57c79c27670..dfbf92762bd 100644 --- a/cookbook/pattern_matching.md +++ b/src/content/docs/cookbook/pattern_matching.md @@ -2,11 +2,9 @@ title: Pattern Matching --- -# Pattern Matching - ## Using the `match` keyword -Like many other languages, nu offers a [`match`](https://www.nushell.sh/commands/docs/match.html#frontmatter-title-for-core) keyword. Usually this is used as a slightly more ergonomic version of `if-else` statements if you have many branches +Like many other languages, nu offers a [`match`](https://www.nushell.sh/commands/docs/match#frontmatter-title-for-core) keyword. Usually this is used as a slightly more ergonomic version of `if-else` statements if you have many branches ```nu [black red yellow green purple blue indigo] | each {|c| @@ -71,7 +69,7 @@ Output: ## Pattern matching on types -You can use the [`describe`](https://www.nushell.sh/commands/docs/describe.html) command to get more info about the types of values. For example: +You can use the [`describe`](https://www.nushell.sh/commands/docs/describe) command to get more info about the types of values. For example: ```nu {one: 1 two: 2} | describe diff --git a/cookbook/polars_v_pandas_v_nushell.md b/src/content/docs/cookbook/polars_v_pandas_v_nushell.md similarity index 99% rename from cookbook/polars_v_pandas_v_nushell.md rename to src/content/docs/cookbook/polars_v_pandas_v_nushell.md index a7124effe73..0eccfaf648b 100644 --- a/cookbook/polars_v_pandas_v_nushell.md +++ b/src/content/docs/cookbook/polars_v_pandas_v_nushell.md @@ -2,8 +2,6 @@ title: Polars vs Pandas vs Nushell --- -# Polars vs Pandas vs Nushell - A dataframe example based on https://studioterabyte.nl/en/blog/polars-vs-pandas ## 1. Opening the file and show the shape of the DataFrame diff --git a/cookbook/setup.md b/src/content/docs/cookbook/setup.md similarity index 96% rename from cookbook/setup.md rename to src/content/docs/cookbook/setup.md index 9688eee096b..84b0d587d15 100644 --- a/cookbook/setup.md +++ b/src/content/docs/cookbook/setup.md @@ -2,8 +2,6 @@ title: Setup --- -# Setup - To get the most out of nu, it is important to setup your path and env for easy access. There are other ways to view these values and variables, however setting up your nu configuration will make it much easier as these have cross-platform support. @@ -19,7 +17,7 @@ Alternately, if you want to append a folder to your `PATH` environment variable $env.PATH = ($env.PATH | split row (char esep) | append "some/other/path") ``` -For more detailed instructions, see the documentation about [environment variables](/book/environment.html#setting-environment-variables) and [PATH configuration](/book/configuration.html#path-configuration). +For more detailed instructions, see the documentation about [environment variables](/book/environment#setting-environment-variables) and [PATH configuration](/book/configuration#path-configuration). ### How to list your environment variables @@ -126,11 +124,11 @@ To be most compatible, the `starship` binary will run every prompt render and is absolute stateless. Nushell, however, is very stateful in a single instance. -[Hooks](https://www.nushell.sh/book/hooks.html#hooks) allow registration of +[Hooks](https://www.nushell.sh/book/hooks#hooks) allow registration of custom callback functions. In this case, the `pre_prompt` hook is very useful. With it, we can export state information as an environment variable, for -example, what [overlays](https://www.nushell.sh/book/overlays.html) are +example, what [overlays](https://www.nushell.sh/book/overlays) are currently activated. ```nu diff --git a/cookbook/ssh_agent.md b/src/content/docs/cookbook/ssh_agent.md similarity index 97% rename from cookbook/ssh_agent.md rename to src/content/docs/cookbook/ssh_agent.md index ccaf3927e6a..20a686d2d7f 100644 --- a/cookbook/ssh_agent.md +++ b/src/content/docs/cookbook/ssh_agent.md @@ -2,11 +2,9 @@ title: ssh-agent --- -# Manage SSH passphrases - `eval` is not available in nushell, so run: -```nushell +```nu ^ssh-agent -c | lines | first 2 @@ -16,7 +14,7 @@ title: ssh-agent | load-env ``` -::: warning +:::caution[warning] Adding this to your `env.nu` will however start a new ssh-agent process every time you start a new terminal. See the workarounds. ::: @@ -25,7 +23,7 @@ See the workarounds. You can work around this behavior by checking if a ssh-agent is already running on your user, and start one if none is: -```nushell +```nu do --env { let ssh_agent_file = ( $nu.temp-path | path join $"ssh-agent-($env.USER? | default $env.USERNAME).nuon" @@ -77,6 +75,6 @@ However, if you're using a different service manager, please refer its own docum To enable Nushell to access this socket, you need to add its path as `$env.SSH_AUTH_SOCK` like so: -```nushell +```nu $env.SSH_AUTH_SOCK = $"($env.XDG_RUNTIME_DIR)/ssh-agent.socket" ``` diff --git a/cookbook/system.md b/src/content/docs/cookbook/system.md similarity index 68% rename from cookbook/system.md rename to src/content/docs/cookbook/system.md index 3349c61ef62..902fbdec588 100644 --- a/cookbook/system.md +++ b/src/content/docs/cookbook/system.md @@ -2,8 +2,6 @@ title: System --- -# System - Nu offers many commands that help interface with the filesystem and control your operating system. ### View all files in the current directory @@ -75,14 +73,14 @@ ps | where cpu > 0 | sort-by cpu | reverse Output -``` -───┬───────┬────────────────────┬───────┬─────────┬───────── - # │ pid │ name │ cpu │ mem │ virtual -───┼───────┼────────────────────┼───────┼─────────┼───────── - 0 │ 11928 │ nu.exe │ 32.12 │ 47.7 MB │ 20.9 MB - 1 │ 11728 │ Teams.exe │ 10.71 │ 53.8 MB │ 50.8 MB - 2 │ 21460 │ msedgewebview2.exe │ 8.43 │ 54.0 MB │ 36.8 MB -───┴───────┴────────────────────┴───────┴─────────┴───────── +```nu +╭────┬──────┬──────┬─────────────────────────────────┬─────────┬──────┬───────────┬───────────╮ +│ # │ pid │ ppid │ name │ status │ cpu │ mem │ virtual │ +├────┼──────┼──────┼─────────────────────────────────┼─────────┼──────┼───────────┼───────────┤ +│ 0 │ 4677 │ 4675 │ nu │ Running │ 9.17 │ 31.0 MiB │ 391.4 GiB │ +│ 1 │ 4674 │ 1 │ Terminal │ Sleep │ 8.34 │ 87.5 MiB │ 391.0 GiB │ +│ 2 │ 5783 │ 1811 │ Arc Helper (Renderer) │ Sleep │ 2.55 │ 231.1 MiB │ 1.5 TiB │ + ``` --- @@ -92,31 +90,23 @@ Output Sometimes a process doesn't shut down correctly. Using `ps` it's fairly easy to find the pid of this process: ```nu -ps | where name == Notepad2.exe +ps | where name == Notes ``` Output -``` -───┬──────┬──────────────┬──────┬─────────┬───────── - # │ pid │ name │ cpu │ mem │ virtual -───┼──────┼──────────────┼──────┼─────────┼───────── - 0 │ 9268 │ Notepad2.exe │ 0.00 │ 32.0 MB │ 9.8 MB -───┴──────┴──────────────┴──────┴─────────┴───────── +```nu +╭───┬──────┬──────┬───────┬────────┬──────┬───────────┬───────────╮ +│ # │ pid │ ppid │ name │ status │ cpu │ mem │ virtual │ +├───┼──────┼──────┼───────┼────────┼──────┼───────────┼───────────┤ +│ 0 │ 1306 │ 1 │ Notes │ Sleep │ 0.00 │ 108.4 MiB │ 395.3 GiB │ +╰───┴──────┴──────┴───────┴────────┴──────┴───────────┴───────────╯ ``` This process can be sent the kill signal in a one-liner: ```nu -ps | where name == Notepad2.exe | get pid.0 | kill $in -``` - -Output - -``` -───┬──────────────────────────────────────────────────────────────── - 0 │ SUCCESS: Sent termination signal to the process with PID 9268. -───┴──────────────────────────────────────────────────────────────── +ps | where name == Notes | get pid.0 | kill $in ``` Notes: diff --git a/cookbook/tables.md b/src/content/docs/cookbook/tables.md similarity index 86% rename from cookbook/tables.md rename to src/content/docs/cookbook/tables.md index 334abb8f123..9c863900eed 100644 --- a/cookbook/tables.md +++ b/src/content/docs/cookbook/tables.md @@ -2,11 +2,9 @@ title: Advanced table workflows --- -# Advanced table workflows - ### Merging tables of different size -Examples shown in [`Working with tables`](../book/working_with_tables.md) work fine when our tables have equal amount of rows but what if we want to merge tables of different sizes? +Examples shown in [`Working with tables`](../book/working_with_tables) work fine when our tables have equal amount of rows but what if we want to merge tables of different sizes? ```nu let first = [[a b]; [1 2] [3 4]] @@ -26,7 +24,7 @@ Output: ───┴───┴───┴───┴─── ``` -Second row in columns `c` and `d` is empty because our `second` table only contained a single row so nushell has nothing to fill the remaining rows with. But what if we wanted the smaller table to 'wrap around' and keep filling the rows? For that we can use the [`group`](/commands/docs/group.md) command to split the larger table into subtables, merge each of them with the smaller table and then combine the merged tables together using [`flatten`](/commands/docs/flatten.md) command like this: +Second row in columns `c` and `d` is empty because our `second` table only contained a single row so nushell has nothing to fill the remaining rows with. But what if we wanted the smaller table to 'wrap around' and keep filling the rows? For that we can use the [`group`](/commands/docs/group) command to split the larger table into subtables, merge each of them with the smaller table and then combine the merged tables together using [`flatten`](/commands/docs/flatten) command like this: ```nu let first = [[a b]; [1 2] [3 4]] @@ -79,7 +77,7 @@ Output: ───┴───┴───┴───┴───┴───┴─── ``` -Or just like last time we could use the [`reduce`](../book/docs/reduce.md) command to merge tables together recursively: +Or just like last time we could use the [`reduce`](../book/docs/reduce) command to merge tables together recursively: ```nu [$first_table $second_table $third_table] diff --git a/de/book/advanced.md b/src/content/docs/de/book/advanced.md similarity index 96% rename from de/book/advanced.md rename to src/content/docs/de/book/advanced.md index 3a44d130f04..65031b856f0 100644 --- a/de/book/advanced.md +++ b/src/content/docs/de/book/advanced.md @@ -1,4 +1,6 @@ -# (Nicht nur für) Fortgeschrittene +--- +title: (Nicht nur für) Fortgeschrittene +--- Der Titel "Fortgeschritten" mag abschrecken und zum Überspringen des Kapitels animieren, doch tatsächlich sind einige der interessantesten und mächtigsten Merkmale hier zu finden. diff --git a/de/book/metadata.md b/src/content/docs/de/book/advanced/metadata.md similarity index 98% rename from de/book/metadata.md rename to src/content/docs/de/book/advanced/metadata.md index aa2a9ecbe9c..7b50ce65631 100644 --- a/de/book/metadata.md +++ b/src/content/docs/de/book/advanced/metadata.md @@ -1,4 +1,6 @@ -# Metadaten +--- +title: Metadaten +--- Bei der Verwendung von Nu ist es Ihnen vielleicht schon einmal passiert, dass Sie das Gefühl hatten, dass hinter den Kulissen noch etwas anderes vor sich geht. Nehmen wir zum Beispiel an, Sie versuchen, eine Datei zu öffnen, die Nu unterstützt, und vergessen es dann und versuchen erneut, sie zu konvertieren: diff --git a/de/book/plugins.md b/src/content/docs/de/book/advanced/plugins.md similarity index 95% rename from de/book/plugins.md rename to src/content/docs/de/book/advanced/plugins.md index b4f3aac7a37..61f8e00b936 100644 --- a/de/book/plugins.md +++ b/src/content/docs/de/book/advanced/plugins.md @@ -1,4 +1,6 @@ -# Plugins +--- +title: Plugins +--- Die Funktionen von Nushell können mittels Plugins erweitert werden. Diese Plugins können einen Großteil der selben Operationen ausführen, wie die internen Befehle. Noch dazu haben Plugins den Vorteil, dass sie separat und flexibel zu Nushell hinzugefügt werden können. @@ -6,12 +8,12 @@ Um ein Plugin hinzuzufügen, muss es erstellt werden und dann der Befehl `regist Ein Beispiel: -``` +```nu > register ./my_plugins/nu-plugin-inc -e capnp ``` Wenn der Befehl registriert wurde, kann er als Teil der internen Befehle verwendet werden. -``` +```nu > inc --help ``` diff --git a/src/content/docs/de/book/coming-to-nu/coming_from_bash.md b/src/content/docs/de/book/coming-to-nu/coming_from_bash.md new file mode 100644 index 00000000000..683ac78a445 --- /dev/null +++ b/src/content/docs/de/book/coming-to-nu/coming_from_bash.md @@ -0,0 +1,53 @@ +--- +title: Vergleich zu Bash +--- + +Hinweis: Diese Tabelle geht von Nu 0.59 oder neuer aus. + +| Bash | Nu | Funktion | +| ------------------------------------ | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `ls` | `ls` | Auflisten der Dateien des aktuellen Pfads | +| `ls <dir>` | `ls <dir>` | Auflisten der Dateien am angegebenen Pfad | +| `ls pattern*` | `ls pattern*` | Auflisten von Dateien, die dem gegebenen Schema/Pattern folgen | +| `ls -la` | `ls --long --all` or `ls -la` | Auflisten aller Dateien (inklusive versteckte) mit allen verfügbaren Informationen | +| `ls -d */` | `ls \| where type == Dir` | Auflisten von Ordnern | +| `find . -name *.rs` | `ls **/*.rs` | Rekursives auflisten aller Dateien, die zum gegebenen Schema/Pattern passen | +| `cd <directory>` | `cd <directory>` | Wechseln an den angegebenen Pfad | +| `cd` | `cd` | Wechseln in den HOME-Ordner | +| `cd -` | `cd -` | Wechseln an den vorherigen Pfad | +| `mkdir <path>` | `mkdir <path>` | Erzeugen des angegebenen Pfads | +| `mkdir -p <path>` | `mkdir <path>` | Erzeugen des angegebenen Pfads und weiterer Ordner wenn nötig | +| `touch test.txt` | `touch test.txt` | Erstellen einer Datei | +| `> <path>` | `\| save <path>` | Speichern eines String in eine Datei | +| `>> <path>` | `\| save --append <path>` | Anhängen eines Strings an eine Datei | +| `cat <path>` | `open --raw <path>` | Einlesen des Inhalts der angegebenen Datei (in Textform) | +| | `open <path>` | Einlesen einer Datei in Form von strukturierten Daten | +| `mv <source> <dest>` | `mv <source> <dest>` | Bewegen einer Datei an einen neuen Ort | +| `cp <source> <dest>` | `cp <source> <dest>` | Kopieren einer Datei an einen Ort | +| `cp -r <source> <dest>` | `cp -r <source> <dest>` | Kopieren eines Ordners an einen Ort (rekursiv) | +| `rm <path>` | `rm <path>` | Entfernen der angegebenen Datei | +| | `rm -t <path>` | Angegebene Datei in den Papierkorb des Systems werfen | +| `rm -rf <path>` | `rm -r <path>` | Entfernen des angegebenen Pfads rekursiv | +| `chmod` | `<Noch nicht möglich>` | Ändern von Dateiattributen | +| `date -d <date>` | `"<date>" \| into datetime -f <format>` | Datum ausgeben ([Dokumentation des Formats](https://docs.rs/chrono/0.4.15/chrono/format/strftime/index.html)) | +| `sed` | `str find-replace` | Suchen und ersetzen eines Pattern in einem String | +| `grep <pattern>` | `where $it =~ <substring>` or `find <substring>` | Filtern von Strings die den Substring beinhalten | +| `man <command>` | `help <command>` | Hilfe zu einem Befehl ansehen | +| | `help commands` | Alle verfügbaren Befehle anzeigen | +| | `help --find <string>` | Nach einem Text in allen verfügbaren Befehlen suchen | +| `command1 && command2` | `command1; command2` | Ausführen eines Befehls und wenn Ausführung erfolgreich wird ein weiterer Befehl ausgeführt | +| `stat $(which git)` | `stat (which git).path` | Ausgabe eines Befehls als Eingabe für einen anderen Befehl verwenden | +| `echo $PATH` | `echo $env.PATH` | Aktuelle PATH-Variable anzeigen | +| `<update ~/.bashrc>` | `vim $nu.config-path` | PATH permanent ändern | +| `export PATH = $PATH:/usr/other/bin` | `$env.PATH = ($env.PATH \| append /usr/other/bin)` | PATH temporär ändern | +| `export` | `echo $env` | Anzeigen der aktuellen Umgebungsvariablen | +| `<update ~/.bashrc>` | `vim $nu.config-path` | Umgebungsvariablen permanent ändern | +| `FOO=BAR ./bin` | `FOO=BAR ./bin` | Umgebungsvariablen temporär ändern | +| `export FOO=BAR` | `$env.FOO = BAR` | Umgebungsvariable für aktuelle Sitzung setzen | +| `echo $FOO` | `echo $env.FOO` | Umgebungsvariablen nutzen | +| `unset FOO` | `hide FOO` | Umgebungsvariable für aktuelle Sitzung verbergen | +| `alias s="git status -sb"` | `alias s = git status -sb` | Alias temporär definieren | +| `<update ~/.bashrc>` | `vim $nu.config-path` | Alias permanent hinzufügen und ändern (für neue Shells) | +| `bash -c <commands>` | `nu -c <commands>` | Ausführen einer Pipeline an Befehlen (benötigt 0.9.1 oder neuer) | +| `bash <script file>` | `nu <script file>` | Ausführen einer Skriptdatei (benötigt 0.9.1 oder neuer) | +| `\` | `(` gefolgt von `)` | Fortsetzen von Zeilen | diff --git a/de/book/coming_to_nu.md b/src/content/docs/de/book/coming_to_nu.md similarity index 96% rename from de/book/coming_to_nu.md rename to src/content/docs/de/book/coming_to_nu.md index 70caedd5310..9395930ac2b 100644 --- a/de/book/coming_to_nu.md +++ b/src/content/docs/de/book/coming_to_nu.md @@ -1,4 +1,6 @@ -# Wechsel zu Nu +--- +title: Wechsel zu Nu +--- Sind andere Shells oder Programmiersprachen ein Begriff, so finden sich in diesem Kapitel einige Informationen um schneller Fuss zu fassen in Nu. diff --git a/de/book/command_reference.md b/src/content/docs/de/book/command_reference.md similarity index 94% rename from de/book/command_reference.md rename to src/content/docs/de/book/command_reference.md index ee304277799..c039cf06be8 100644 --- a/de/book/command_reference.md +++ b/src/content/docs/de/book/command_reference.md @@ -1,4 +1,6 @@ -# Command Reference +--- +title: Befehlsreferenz +--- <script> import pages from '@temp/pages' diff --git a/book/design_notes.md b/src/content/docs/de/book/design_notes.md similarity index 96% rename from book/design_notes.md rename to src/content/docs/de/book/design_notes.md index c155e0e0e26..659cd47817a 100644 --- a/book/design_notes.md +++ b/src/content/docs/de/book/design_notes.md @@ -1,4 +1,6 @@ -# Design Notes +--- +title: Design Notes +--- This chapter intends to give more in-depth overview of certain aspects of Nushell's design. The topics are not necessary for a basic usage, but reading them will help you understand how Nushell works and why. diff --git a/de/book/installation.md b/src/content/docs/de/book/getting-started/installation.mdx similarity index 71% rename from de/book/installation.md rename to src/content/docs/de/book/getting-started/installation.mdx index 80e79028350..fe2a7f30772 100644 --- a/de/book/installation.md +++ b/src/content/docs/de/book/getting-started/installation.mdx @@ -1,4 +1,25 @@ -# Nu installieren +--- +title: Nu installieren +--- + +import { Code } from "@astrojs/starlight/components"; +import runNu from "../../../snippets/installation/run_nu.nu?raw"; +import rustupChooseRustVersion from "../../../snippets/installation/rustup_choose_rust_version.nu?raw"; +import installPkgConfigLibsslDev from "../../../snippets/installation/install_pkg_config_libssl_dev.nu?raw"; +import installRhelDependencies from "../../../snippets/installation/install_rhel_dependencies.nu?raw"; +import macosDeps from "../../../snippets/installation/macos_deps.nu?raw"; +import cargoInstallNu from "../../../snippets/installation/cargo_install_nu.nu?raw"; +import cargoInstallNuMoreFeatures from "../../../snippets/installation/cargo_install_nu_more_features.nu?raw"; +import gitCloneNu from "../../../snippets/installation/git_clone_nu.nu?raw"; +import buildNuFromSource from "../../../snippets/installation/build_nu_from_source.nu?raw"; +import buildNuFromSourceRelease from "../../../snippets/installation/build_nu_from_source_release.nu?raw"; +import useRawkeyAndClipboard from "../../../snippets/installation/use_rawkey_and_clipboard.nu?raw"; +import chshInvalidShellError from "../../../snippets/installation/chsh_invalid_shell_error.nu?raw"; +import windowsTerminalDefaultShell from "../../../snippets/installation/windows_terminal_default_shell.nu?raw"; +import windowsChangeDefaultProfile from "../../../snippets/installation/windows_change_default_profile.nu?raw"; +import windowsExampleExtractionLocation from "../../../snippets/installation/windows_example_extraction_location.nu?raw"; +import windowsRunNu from "../../../snippets/installation/windows_run_nu.nu?raw"; +import buildNuYourself from "../../../snippets/installation/build_nu_yourself.nu?raw"; Der aktuell beste Weg Nu zu bekommen ist, es von [crates.io](https://crates.io) zu installieren, Binärdateien von unserer [Release-Seite](https://github.com/nushell/nushell/releases) herunterzuladen oder es selbst zu kompilieren. @@ -12,19 +33,19 @@ Von der [Release-Seite](https://github.com/nushell/nushell/releases) kann Nushel Die aktuelle, veröffentlichte `.zip`-Datei von der [Release-Seite](https://github.com/nushell/nushell/releases) herunterladen und den Inhalt extrahieren nach: -@[code](@snippets/installation/windows_example_extraction_location.sh) +<Code code={windowsExampleExtractionLocation} lang="sh" /> Danach den `nu` beinhaltenden Ordner der Umgebungsvariable PATH hinzufügen. Wenn das passiert ist, kann `nu` wie folgt gestartet werden: -@[code](@snippets/installation/windows_run_nu.sh) +<Code code={windowsRunNu} lang="sh" /> Für Nutzer des [Windows Terminal](https://github.com/microsoft/terminal) kann `nu` als Standard-Shell gesetzt werden, indem: -@[code](@snippets/installation/windows_terminal_default_shell.sh) +<Code code={windowsTerminalDefaultShell} lang="sh" /> zu `"profiles"` in den Terminal Einstellungen (JSON-Datei) hinzufügt wird. Zu guter Letzt, muss nur noch `"defaultProfile"` angepasst werden: -@[code](@snippets/installation/windows_change_default_profile.sh) +<Code code={windowsChangeDefaultProfile} lang="sh" /> Jetzt sollte sich `nu` beim Start von Windows Terminal öffnen. @@ -48,7 +69,7 @@ Wenn Rust noch nicht auf dem System installiert ist, ist [rustup](https://rustup Nu benötigt aktuell die **latest stable (1.55 oder neuer)** Version von Rust. Der einfachste Weg ist es, `rustup` die korrekte Version für finden zu lassen. Wenn `rustup` zum ersten Mal gestartet wird, wird nachgefragt, welche Version installiert werden soll: -@[code](@snippets/installation/rustup_choose_rust_version.sh) +<Code code={rustupChooseRustVersion} lang="sh" /> Wenn Sie bereit sind, drücken Sie `1` und dann `Enter`. @@ -60,59 +81,59 @@ Wenn Rust nicht via `rustup` installiert werden soll, können auch andere Method Es müssen die Pakete `pkg-config` und `libssl-dev` installiert werden: -@[code](@snippets/installation/install_pkg_config_libssl_dev.sh) +<Code code={installPkgConfigLibsslDev} lang="sh" /> Linux-Nutzer die die optionalen Funktionen `rawkey` und `clipboard` verwenden möchten, müssen außerdem die Pakete `libx11-dev` und `libxcb-composite0-dev` installieren: -@[code](@snippets/installation/use_rawkey_and_clipboard.sh) +<Code code={useRawkeyAndClipboard} lang="sh" /> ### RHEL basierte Distributionen Für RHEL basierte Distributionen müssen die Pakete `libxcb`, `openssl-devel` und `libX11-devel` installiert werden: -@[code](@snippets/installation/install_rhel_dependencies.sh) +<Code code={installRhelDependencies} lang="sh" /> ### macOS Mittels [Homebrew](https://brew.sh/), müssen die Pakete `openssl` und `cmake` über folgenden Befehl installiert werden: -@[code](@snippets/installation/macos_deps.sh) +<Code code={macosDeps} lang="sh" /> ## Installieren von [crates.io](https://crates.io) Wenn alle die Abhängigkeitenn, die für Nu benötigt werden, installiert sind, kann `cargo` verwendet werden um Nu zu installieren. -@[code](@snippets/installation/cargo_install_nu.sh) +<Code code={cargoInstallNu} lang="sh" /> Das war's! Cargo wird Nu und seine anderen Abhängigkeiten herunterladen, kompilieren und schließlich im cargo `bin` Pfad installieren, damit es benutzt werden kann. Wenn mehr Funktionalitäten installiert werden sollen, kann der folgende Befehl verwendet werden: -@[code](@snippets/installation/cargo_install_nu_more_features.sh) +<Code code={cargoInstallNuMoreFeatures} lang="sh" /> Um alle verfügbaren Funktionalitäten zu bekommen, ist es am einfachsten einen Checkout durchzuführen und es selbst mit Hilfe der Rust-Tools zu kompilieren: -@[code](@snippets/installation/build_nu_yourself.sh) +<Code code={buildNuYourself} lang="sh" /> Damit das funktioniert, sollte sichergestellt werden, dass alle oben genannten Abhängigkeiten auf dem System installiert sind. Wenn Nu schließlich installiert ist, kann die Shell mit dem `nu`-Befehl gestartet werden: -@[code](@snippets/installation/run_nu.sh) +<Code code={runNu} lang="sh" /> ## Kompilieren von Quelldateien Nu kann auch direkt aus den Quelldateien, die auf GitHub verfügbar sind, kompiliert werden. Das stellt unmittelbar die neuesten Funktionen und Fehlerbehebungen von Nu zur Verfügung. -@[code](@snippets/installation/git_clone_nu.sh) +<Code code={gitCloneNu} lang="sh" /> Git clont das main nushell Repo. Von da aus, kann Nu, wenn `rustup` verwendet wird, wie folgt kompiliert und gestartet werden: -@[code](@snippets/installation/build_nu_from_source.sh) +<Code code={buildNuFromSource} lang="sh" /> Nu kann auch in "release" Modus kompiliert und gestartet werden: -@[code](@snippets/installation/build_nu_from_source_release.sh) +<Code code={buildNuFromSourceRelease} lang="sh" /> Leute, die sich mit Rust auskennen, wundern sich womöglich, warum hier sowohl ein `build` als auch ein `run` durchgeführt wird, obwohl `run` standardmäßig auch einen Build durchführt. Das ist nötig, um ein Problem mit der neuen `default-run`-Option von Cargo zu umgehen, damit alle Plugins kompiliert werden. Dies wird unter Umständen in Zukunft nicht mehr nötig sein. @@ -123,7 +144,7 @@ Leute, die sich mit Rust auskennen, wundern sich womöglich, warum hier sowohl e Um die Login-Shell festzulegen, kann der Befehl [`chsh`](https://linux.die.net/man/1/chsh) verwendet werden. Manche Linux-Distributionen haben eine Liste von erlaubten Shells in `/etc/shells` und verbieten es die Shell zu ändern, bis Nu in der Whitelist ist. Wenn die `shells`-Datei nicht abgeändert wurde, erscheint vielleicht einen ähnlichen Fehler, wie: -@[code](@snippets/installation/chsh_invalid_shell_error.sh) +<Code code={chshInvalidShellError} lang="sh" /> Nu kann zur Liste der erlaubte Shells hinzugefügt werden, indem der Pfad von `nu` der `shells`-Datei angefügt wird. Der Pfad, der hinzugefügt werden muss, kann mit dem Befehl `which nu` herausgefunden werden. Normalerweise ist es `$HOME/.cargo/bin/nu`. diff --git a/de/book/README.md b/src/content/docs/de/book/getting-started/introduction.mdx similarity index 74% rename from de/book/README.md rename to src/content/docs/de/book/getting-started/introduction.mdx index 87ceeb43031..d9d2d1a0ce6 100644 --- a/de/book/README.md +++ b/src/content/docs/de/book/getting-started/introduction.mdx @@ -1,4 +1,20 @@ -# Einführung +--- +title: Einführung +--- + +import { Code } from "@astrojs/starlight/components"; +import lsExample from "../../../snippets/introduction/ls_example.nu?raw"; +import lsSortByReverseExample from "../../../snippets/introduction/ls_sort_by_reverse_example.nu?raw"; +import lsWhereExample from "../../../snippets/introduction/ls_where_example.nu?raw"; +import psExample from "../../../snippets/introduction/ps_example.nu?raw"; +import psWhereExample from "../../../snippets/introduction/ps_where_example.nu?raw"; +import dateExample from "../../../snippets/introduction/date_example.nu?raw"; +import dateTableExample from "../../../snippets/introduction/date_table_example.nu?raw"; +import sysExample from "../../../snippets/introduction/sys_example.nu?raw"; +import sysGetExample from "../../../snippets/introduction/sys_get_example.nu?raw"; +import sysGetNestedExample from "../../../snippets/introduction/sys_get_nested_example.nu?raw"; +import sysGetExternalEchoExample from "../../../snippets/introduction/sys_get_external_echo_example.nu?raw"; +import helpExample from "../../../snippets/introduction/help_example.nu?raw"; Hallo und herzlich Willkommen beim Nushell Projekt. Das Ziel diese Projekts ist es, die Philosophie von Unix Shells, wo Pipes einfache Befehle miteinander verbinden, mit modernen Ansätzen zu verbinden. @@ -12,51 +28,51 @@ Der einfachste Weg zu verstehen, was Nu alles leisten kann, ist entlang von Beis Das Erste was auffällt, wenn ein Befehl wie `ls` ausgeführt wird, ist, dass anstatt eines Blocks von Text eine strukturierte Tabelle als Ausgabe erscheint. -@[code](@snippets/introduction/ls_example.sh) +<Code code={lsExample} lang="nu" /> Diese Tabelle ist mehr als nur eine andere Darstellungsform. Wie Tabellen in Spreadsheets erlaubt es diese Tabelle mit den Daten interaktiver zu arbeiten. Um das zu demonstrieren, wird der Inhalt der Tabelle zunächst nach der Größe sortiert. Um das zu realisieren, wird die Ausgabe von `ls` genommen und in ein Befehl gegeben, der Tabellen auf Basis von Daten in einer Spalte neu anordnen kann. -@[code](@snippets/introduction/ls_sort_by_reverse_example.sh) +<Code code={lsSortByReverseExample} lang="nu" /> Um das Ganze zu realisieren, mussten hierzu nicht Argumente an `ls` übergeben werden. Stattdessen wird der `sort-by` Befehl verwendet, den Nu bereitstellt, um Daten zu sortieren. Damit die größten Dateien oben erscheinen wurde zusätzlich die Option `reverse` angegeben. Nu stellt sehr viele Befehle bereit, die mit Tabellen arbeiten können. Beispielsweise kann die Ausgabe von `ls` auch derart gefiltert werden, dass nur Datei mit einer Größe von mehr als einem Kilobyte angezeigt werden: -@[code](@snippets/introduction/ls_where_example.sh) +<Code code={lsWhereExample} lang="nu" /> Wie in der Unix-Philosophie, erlauben Befehle, die untereinander Daten austauschen können, viele verschiedene Kombinationen um Aufgaben zu lösen. Wie in folgendem Beispiel: -@[code](@snippets/introduction/ps_example.sh) +<Code code={psExample} lang="nu" /> Der `ps` Befehl erlaubt es auf Linux-Systemen alle laufenden Prozesse, deren Status und Name abzufragen. Des Weiteren gibt er Informationen zu CPU-Last der einzelnen Prozesse an. Was macht man, wenn man nur Prozesse sehen möchte, die aktuelle aktiv die CPU nutzen? Wie zuvor beim `ls` Befehl, kann mit der durch `ps` zurückgegebenen Tabelle gearbeitet werden: -@[code](@snippets/introduction/ps_where_example.sh) +<Code code={psWhereExample} lang="nu" /> Bis jetzt wurden `ls` und `ps` genutzt, um Dateien und Prozesse aufzulisten. Nu besitzt aber noch viele weitere Befehle die nützliche Informationen in Tabellenform ausgeben. Dazu wird nun ein Block auf die Befehle `date` und `sys` geworfen. Wenn `date now` aufgerufen wird, werden Informationen zum aktuellen Datum und der aktuellen Uhrzeit ausgegeben. -@[code](@snippets/introduction/date_example.sh) +<Code code={dateExample} lang="nu" /> Um das Datum in Tabellenform zu bekommen, kann es zusätzlich in `date to-table` gegeben werden: -@[code](@snippets/introduction/date_table_example.sh) +<Code code={dateTableExample} lang="nu" /> Der Aufruf von `sys` gibt Informationen zum System aus, auf dem Nu läuft: -@[code](@snippets/introduction/sys_example.sh) +<Code code={sysExample} lang="nu" /> Diese Ausgabe unterscheidet sich nun von den vorherigen. Der `sys` Befehl gibt eine Tabelle zurück, die selbst strukturierte Tabellen in den Zellen enthält anstatt nur einfache Werte. Um auf die Daten zuzugreifen, wird der _get_ Befehl verwendet: -@[code](@snippets/introduction/sys_get_example.sh) +<Code code={sysGetExample} lang="nu" /> Der `get` Befehl erlaubt es, in die Inhalte einer Tabellenzelle einzutauchen. Hier wird beispielsweise die Spalte "host" näher betrachtet, die Informationen über den Host, auf dem Nu läuft, enthält. Der Name des Betriebssystem (OS), die CPU und mehr. Nun sollen die Namen der Nutzer auf dem System ausgegeben werden: -@[code](@snippets/introduction/sys_get_nested_example.sh) +<Code code={sysGetNestedExample} lang="nu" /> Aktuelle existiert nur ein Nutzer namens "jt". Wie zu sehen ist, kann ein ganzer Pfad für Spalten angegeben werden - nicht nur der Name der Spalte. Nu wird den Pfad nehmen und durch die entsprechenden Daten in der Tabelle gehen. @@ -64,10 +80,10 @@ Und noch etwas anderes ist anders. Anstatt einer Tabelle mit Daten wurde nur ein Nun soll aufgezeigt werden, wie mit Strings außerhalb von Nu gearbeitet wird. Dazu wird das vorige Beispiel erweitert. Die Daten werden an den externen `echo` Befehl weitergegeben (das `^` teilt Nu mit, dass nicht der eingebaute `echo` Befehl verwendet werden soll): -@[code](@snippets/introduction/sys_get_external_echo_example.sh) +<Code code={sysGetExternalEchoExample} lang="nu" /> Das sieht jetzt genau gleich aus wie die Ausgabe zuvor. Was soll das? Es ist ähnlich aber mit einem entscheidenden Unterschied: `^echo` wurde aufgerufen. Das erlaubt es uns Daten aus Nu heraus an beliebige Befehle außerhalb von Nu zu geben wie `echo` oder `git`. _Hinweis: Hilfe zu allen in Nu eingebauten Befehlen kann mit dem Befehl `help` angezeigt werden_: -@[code](@snippets/introduction/help_example.sh) +<Code code={helpExample} lang="nu" /> diff --git a/de/book/moving_around.md b/src/content/docs/de/book/getting-started/moving_around.mdx similarity index 65% rename from de/book/moving_around.md rename to src/content/docs/de/book/getting-started/moving_around.mdx index 0bb670533ca..23a77f07d63 100644 --- a/de/book/moving_around.md +++ b/src/content/docs/de/book/getting-started/moving_around.mdx @@ -1,34 +1,47 @@ -# Im System navigieren +--- +title: Im System navigieren +--- + +import { Code } from "@astrojs/starlight/components"; +import lsExample from "../../../snippets/moving_around/ls_example.nu?raw"; +import lsShallowGlobExample from "../../../snippets/moving_around/ls_shallow_glob_example.nu?raw"; +import lsDeepGlobExample from "../../../snippets/moving_around/ls_deep_glob_example.nu?raw"; +import cdExample from "../../../snippets/moving_around/cd_example.nu?raw"; +import cdWithoutCommandExample from "../../../snippets/moving_around/cd_without_command_example.nu?raw"; +import mvExample from "../../../snippets/moving_around/mv_example.nu?raw"; +import cpExample from "../../../snippets/moving_around/cp_example.nu?raw"; +import rmExample from "../../../snippets/moving_around/rm_example.nu?raw"; +import mkdirExample from "../../../snippets/moving_around/mkdir_example.nu?raw"; Traditionelle Shells erlauben es im Dateisystem zu navigieren und Befehle auszuführen. So auch Nu. Hier die gängigsten Befehle, die beim Interagieren mit dem System am häufigsten benutzt werden. ## Verzeichnisinhalt ansehen -@[code](@snippets/moving_around/ls_example.sh) +<Code code={lsExample} lang="nu" /> Wie im anderen Kapitel bereits gezeigt wurde, ist [`ls`](/commands/docs/ls.md) der Befehl um den Inhalt eines Pfades anzuzeigen. Der Output wird als Tabelle dargestellt. Der [`ls`](/commands/docs/ls.md) Befehl nimmt auch ein optionales Argument entgegen, um die Ansicht zu verändern. Zum Beispiel um nur ".md" Dateien an zu zeigen. -@[code](@snippets/moving_around/ls_shallow_glob_example.sh) +<Code code={lsShallowGlobExample} lang="nu" /> Der Asterisk (\*) im obigen Beispiel "\*.md" wird auch als Wildcard oder glob bezeichnet. Es kann für jedes Zeichen stehen. Man kann "\*.md" auch als "entspricht jeder Datei, die mit '.md' aufhört" lesen. Nu verwendet auch moderne globs, mit welchen man auch tiefer liegende Verzeichnisse erreichen kann. -@[code](@snippets/moving_around/ls_deep_glob_example.sh) +<Code code={lsDeepGlobExample} lang="nu" /> Hier werden alle ".md" Dateien ausgegeben, die "in jedem tiefer liegenden Verzeichnis" von hier aus liegen. ## Wechseln des aktuellen Verzeichnisses -@[code](@snippets/moving_around/cd_example.sh) +<Code code={cdExample} lang="nu" /> Um vom aktuellen Verzeichnis in ein neues zu gelangen, wird der [`cd`](/commands/docs/cd.md) Befehl verwendet. Wie in jeder anderen Shell, kann entweder der Name des Verzeichnisses angeben, oder mit `..` ein Verzeichnis hochgesprungen werden. Es kann jedoch auch das Verzeichnis gewechselt werden ohne [`cd`](/commands/docs/cd.md) angeben zu müssen, indem einfach der neue Pfad angegeben wird: -@[code](@snippets/moving_around/cd_without_command_example.sh) +<Code code={cdWithoutCommandExample} lang="nu" /> **Hinweis** wenn mit [`cd`](/commands/docs/cd.md) das Verzeichnis gewechselt wird, ändert sich die `PWD` Umgebungsvariable. Das heisst der Wechsel bleibt für den aktuellen Block bestehen. Beim Verlassen des Blocks, wird wieder ins vorherige Verzeichnis gewechselt. Mehr zu dieser Funktionsweise findet sich im Kapitel [environment chapter](./environment.md). @@ -39,18 +52,18 @@ Nu stellt auch einige Dateisystem Basis-Befehle zur Verfügung, die auf allen Pl Ein Objekt von einem Ort an einen anderen verschieben mit [`mv`](/commands/docs/mv.md): -@[code](@snippets/moving_around/mv_example.sh) +<Code code={mvExample} lang="nu" /> Ein Objekt kopieren von einem an den nächsten Ort: -@[code](@snippets/moving_around/cp_example.sh) +<Code code={cpExample} lang="nu" /> Ein Objekt löschen: -@[code](@snippets/moving_around/rm_example.sh) +<Code code={rmExample} lang="nu" /> Diese drei Befehle können auch von der glob Fähigkeit profitieren, wie beim [`ls`](/commands/docs/ls.md). Zu guter Letzt wird ein neues Verzeichnis angelegt mit dem [`mkdir`](/commands/docs/mkdir.md) Befehl: -@[code](@snippets/moving_around/mkdir_example.sh) +<Code code={mkdirExample} lang="nu" /> diff --git a/de/book/thinking_in_nushell.md b/src/content/docs/de/book/getting-started/thinking_in_nushell.md similarity index 98% rename from de/book/thinking_in_nushell.md rename to src/content/docs/de/book/getting-started/thinking_in_nushell.md index 30b5f8ff82c..c6b61cb9f07 100644 --- a/de/book/thinking_in_nushell.md +++ b/src/content/docs/de/book/getting-started/thinking_in_nushell.md @@ -1,4 +1,6 @@ -# Denken in Nushell +--- +title: Denken in Nushell +--- Um Nushell besser zu verstehen und das Beste aus ihr herauszuholen, ist dieses Kapitel "Denken in Nushell" zusammengestellt worden. Denken in Nushell und Verstehen ihres zugrundeliegenden Modells, hilft beim Einstieg und auf dem Weg zum Erfolg. @@ -10,21 +12,21 @@ Was bedeutet denn nun Denken in Nushell? Hier einige Themen, die für neue Benut Nushell ist sowohl eine Programmiersprache, als auch eine Shell. Deswegen hat sie ihre eigene Art mit Dateien, Verzeichnissen, Webseite und mehr umzugehen. Einiges ist jedoch so modelliert, wie es auch von anderen Shells her bekannt ist. Zum Beispiel Pipelines verbinden zwei Befehle: -``` +```nu > ls | length ``` Nushell hat auch andere Fähigkeiten, wie, aufnehmen des exit codes eines zuvor ausgeführten Befehls. Trotz dieser Vorzüge ist Nushell nicht Bash. In einer Bash, oder bei POSIX kompatiblen Shells ganz generell, verwendet man z.B.: -``` +```nu > echo "hello" > output.txt ``` In Nushell is das `>` ein grösser-als Operator, was eher dem Programmiersprachen Aspekt von Nushell entspricht. Stattdessen wird eine Pipe zu einem Befehl geführt, der die Aufgabe des Speicherns übernimmt: -``` +```nu > echo "hello" | save output.txt ``` @@ -39,7 +41,7 @@ Das heisst alle Befehle, aber auch Dateien müssen bekannte Pfade sein, ähnlich Zum Beispiel macht folgendes in Nushell keinen Sinn und wird einen Fehler erzeugen: -``` +```nu echo "def abc [] { 1 + 2 }" | save output.nu source "output.nu" abc @@ -51,7 +53,7 @@ bevor sie ausgeführt werden kann, können die drei Zeilen nicht im voraus `komp Ein anderes Problem ist, einen Dateinamen dynamisch erzeugen zu wollen um ihn auszuführen: -``` +```nu > source $"($my_path)/common.nu" ``` @@ -77,7 +79,7 @@ Nur weil in Nushell die Variablen unveränderbar sind bedeutet jedoch nicht, das Shadowing oder "Beschattung" bedeutet, eine neue Variable erstellen, mit dem gleichen Namen einer zuvor deklarierten Variablen. Zum Beispiel wenn eine Variable `$x` in den Gültigkeitsbereich geholt wird, und eine neue `$x` um 1 grösser definiert werden soll: -``` +```nu let x = $x + 1 ``` @@ -87,14 +89,14 @@ auch wenn es keine Voraussetzung ist. Schleifenzähler sind ein anderes häufiges Muster für veränderliche Variablen und sind in die meisten iterativen Befehle eingebaut. Zum Beispiel kann sowohl jedes Element wie auch dessen Index mit dem `-n` Flag von [`each`](/commands/docs/each.md) erreicht werden: -``` +```nu > ls | enumerate | each { |it| $"Number ($it.index) is size ($it.item.size)" } ``` Mit dem [`reduce`](/commands/docs/reduce.md) kann eine ähnliche Funktionalität erreicht werden wie man es von Variablen in Schleifen kennt. Zum Beispiel, wenn der längste Text in einer Liste von Texten gesucht wird: -``` +```nu > [one, two, three, four, five, six] | reduce {|curr, max| if ($curr | str length) > ($max | str length) { $curr @@ -118,7 +120,7 @@ In Nushell kontrollieren Blöcke die Umgebung. Änderungen an der Umgebung gelte In der Praxis ist damit präziserer Code möglich, um zum Beispiel mit Unterverzeichnissen zu arbeiten. Wie hier, wenn jedes Sub-Projekt des aktuellen Verzeichnisses erstellt werden soll: -``` +```nu > ls | each { |it| cd $it.name make diff --git a/de/book/getting_started.md b/src/content/docs/de/book/getting_started.md similarity index 95% rename from de/book/getting_started.md rename to src/content/docs/de/book/getting_started.md index c3cce903887..72b0eed1c9f 100644 --- a/de/book/getting_started.md +++ b/src/content/docs/de/book/getting_started.md @@ -1,4 +1,6 @@ -# Fangen wir an +--- +title: Fangen wir an +--- Lasst uns anfangen! :elephant: diff --git a/de/book/3rdpartyprompts.md b/src/content/docs/de/book/nu-as-a-shell/3rdpartyprompts.md similarity index 98% rename from de/book/3rdpartyprompts.md rename to src/content/docs/de/book/nu-as-a-shell/3rdpartyprompts.md index acafab58c49..99a149d8c3e 100644 --- a/de/book/3rdpartyprompts.md +++ b/src/content/docs/de/book/nu-as-a-shell/3rdpartyprompts.md @@ -1,4 +1,6 @@ -# Konfiguration von Drittanbieter-Prompts +--- +title: Konfiguration von Drittanbieter-Prompts +--- ## nerdfonts diff --git a/de/book/background_task.md b/src/content/docs/de/book/nu-as-a-shell/background_task.md similarity index 98% rename from de/book/background_task.md rename to src/content/docs/de/book/nu-as-a-shell/background_task.md index 0c89c6bddfd..6f5a3da70d2 100644 --- a/de/book/background_task.md +++ b/src/content/docs/de/book/nu-as-a-shell/background_task.md @@ -1,4 +1,6 @@ -# Hintergrund-Tasks in Nu +--- +title: Hintergrund-Tasks in Nu +--- Aktuell besitzt Nushell kein eingebautes Hintergrund-Task Feature. Mit einigen Werkzeugen kann sie jedoch Hintergrund-Tasks unterstützen. @@ -17,6 +19,7 @@ Den Status von Tasks erhält man sehr einfach. Hier ein einfaches Beispiel wie ein [nushell module](https://github.com/nushell/nu_scripts/tree/main/background_task) mit pueu zusammenarbeitet. Das Setup umfasst: + 1. installiere pueue 2. führe `pueued` mit der default Konfiguration aus. Siehe unter [start-the-daemon page](https://github.com/Nukesor/pueue/wiki/Get-started#start-the-daemon) für mehr Informationen. 3. speichere die [job.nu](https://github.com/nushell/nu_scripts/blob/main/modules/background_task/job.nu) Datei unter `$env.NU_LIB_DIRS`. diff --git a/de/book/coloring_and_theming.md b/src/content/docs/de/book/nu-as-a-shell/coloring_and_theming.md similarity index 99% rename from de/book/coloring_and_theming.md rename to src/content/docs/de/book/nu-as-a-shell/coloring_and_theming.md index 8a8b766afea..b7cf46ba057 100644 --- a/de/book/coloring_and_theming.md +++ b/src/content/docs/de/book/nu-as-a-shell/coloring_and_theming.md @@ -1,4 +1,6 @@ -# Farben und Themen in Nu +--- +title: Farben und Themen in Nu +--- In vielen Teilen von Nushells Oberfläche sind die Farben anpassbar. Dies wird in der Konfigurationsdatei `config.nu` erstellt. Ein Hashtag in der Konfigurationsdatei kommentiert den danach folgenden Text aus. diff --git a/de/book/configuration.md b/src/content/docs/de/book/nu-as-a-shell/configuration.md similarity index 98% rename from de/book/configuration.md rename to src/content/docs/de/book/nu-as-a-shell/configuration.md index 2748bdac60d..56da4d9a9f0 100644 --- a/de/book/configuration.md +++ b/src/content/docs/de/book/nu-as-a-shell/configuration.md @@ -1,4 +1,6 @@ -# Konfiguration +--- +title: Konfiguration +--- ## Nushell Konfiguration mittels `config.nu` @@ -10,7 +12,7 @@ Ein Beispiel für eine Nushell `config.nu` kann [hier](https://github.com/nushel Die zentralen Konfigurationen von Nushell sind in der globalen `$config` Variable festgehalten. Dieser Eintrag kann wie folgt erstellt werden: -``` +```nu $env.config = { ... } @@ -18,7 +20,7 @@ $env.config = { Es ist auch möglich `$config` zu überschreiben und zu ändern: -``` +```nu $env.config = ($config | update <field name> <field value>) ``` @@ -44,7 +46,7 @@ Um Nushell als Login-Shell zu verwenden, muss die `$env` Variable konfiguriert w Der komplette Satz an Umgebungsvariablen kann erzeugt werden, wenn Nu in einer anderen Shell, wie beispielsweise Bash, ausgeführt wird. In diese Nu-Sitzung kann ein Befehl wie der folgende verwendet werden, um `$env` zu setzen: -``` +```nu > env | each { echo $"$env.($it.name) = '($it.raw)'" } | str join (char nl) ``` @@ -52,7 +54,7 @@ Das gibt Zeilen aus um `$env` in `env.nu` zu setzen - eine für jede Umgebungsva Als nächstes, muss auf manchen Distributionen sichergestellt werden, dass Nu in der Liste der Shells in /etc/shells ist: -``` +```nu > cat /etc/shells # /etc/shells: valid login shells /bin/sh @@ -80,7 +82,7 @@ Manche Tools (z.B. Emacs) vertrauen darauf, dass `open` Dateien auf dem Mac öff Da Nushell einen eigenen `open` Befehl hat, der eine andere Semantik hat und `/usr/bin/open` verbirgt, werden diese Tools einen Fehler werfen, wenn sie verwendet werden. Eine Möglichkeit, dieses Problem zu umgehen, ist es, einen eigenen Befehl und einen `alias` in `config.nu` zu definieren: -``` +```nu def nuopen [arg, --raw (-r)] { if $raw { open -r $arg } else { open $arg } } alias open = ^open ``` @@ -90,7 +92,7 @@ alias open = ^open Die Konfiguration der Prompt wird durch das Setzen der Umgebungsvariable `PROMPT_COMMAND` bzw. `PROMPT_COMMAND_RIGHT` durchgeführt. Diese akzeptieren entweder einen String oder einen Codeblock der ausgeführt wird. -``` +```nu $env.PROMPT_COMMAND = "Hallo Nu" # Die Hauptprompt auf einen festen String setzen $env.PROMPT_COMMAND_RIGHT = {pwd} # Den rechte Promptteil mit dem aktuellen Verzeichnis anzeigen ``` diff --git a/de/book/custom_completions.md b/src/content/docs/de/book/nu-as-a-shell/custom_completions.md similarity index 98% rename from de/book/custom_completions.md rename to src/content/docs/de/book/nu-as-a-shell/custom_completions.md index 45d7ccb990f..92d94ce5033 100644 --- a/de/book/custom_completions.md +++ b/src/content/docs/de/book/nu-as-a-shell/custom_completions.md @@ -1,4 +1,6 @@ -# Eigene Vervollständigungen +--- +title: Eigene Vervollständigungen +--- Eigene Vervollständigungen kombinieren zwei Merkmale von Nushell: Eigene Befehle und Vervollständigungen. Mit ihnen können Befehle erzeugt werden, @@ -12,7 +14,7 @@ Dem Befehl, der die Vervollständigung bereitstellt, und die Verknüpfung mit de Hier ein Beispiel: -``` +```nu > def tiere [] { ["katze", "hund", "aal" ] } > def my-command [tier: string@tiere] { print $tier } >| my-command @@ -28,14 +30,13 @@ Die Form des Arguments um den Typ überprüfen zu können, sowie die Vervollstä Auf der dritten Zeile wird der Name des zu vevollständigenden Befehls `my-command` eingegeben gefolgt von der `<tab>` Taste. Dies führt die Vervollständigung aus. Eigene Vervollständigungen funktionieren identisch zu anderen Vervollständigungen. Wird `a` gefolgt von der `<tab>` Taste gedrückt, wird automatisch "aal" ausgegeben. - ## Module und eigene Vervollständigung Es empfiehlt sich die eigenen Vervollständigungen von der öffentlichen API zu trennen. Dafür bieten sich Module an. Hier das Beispiel von oben in einem Modul: -``` +```nu module commands { def tiere [] { ["katze", "hund", "aal" ] @@ -58,7 +59,7 @@ Es ist möglich den Kontext einer Vervollständigung mit zu geben. Dies ist nüt Bezogen auf das obige Beispiel sieht dies so aus: -``` +```nu module commands { def tiere [] { ["katze", "hund", "aal" ] @@ -80,9 +81,10 @@ module commands { } } ``` + Der Befehl `tier-name` gibt die entsprechende Liste der Namen zurück. Dies funktioniert, weil der Wert der `$context` Variablen, dem Text entspricht, der bis zu dem Zeitpunkt eingegeben wurde. -``` +```nu >| my-command katze hund aal >| my-command hund @@ -100,7 +102,7 @@ Erstellen der Vervollständigung und anbinden an ein Positions- oder Markierungs In der Default Konfiguration finden sich ebenfalls Vervollständigungen: -``` +```nu export extern "git push" [ remote?: string@"nu-complete git remotes", # the name of the remote refspec?: string@"nu-complete git branches" # the branch / refspec @@ -114,7 +116,7 @@ Die Vervollständigung erfüllt hier die gleiche Rolle wie in den Beispielen zuv Alternativ zu einer Liste von Strings, kann eine Vervollständigung auch einen Record aus einem `value` und einer `description` zurückgeben. -``` +```nu def my_commits [] { [ { value: "5c2464", description: "Add .gitignore" }, @@ -132,7 +134,7 @@ def my_commits [] { > print $commit > } > ``` -> +> > aufgepasst, auch wenn die Vervollständigung folgendes zeigt > > ```nu diff --git a/de/book/environment.md b/src/content/docs/de/book/nu-as-a-shell/environment.md similarity index 98% rename from de/book/environment.md rename to src/content/docs/de/book/nu-as-a-shell/environment.md index 3e40c657e98..6636069fa62 100644 --- a/de/book/environment.md +++ b/src/content/docs/de/book/nu-as-a-shell/environment.md @@ -1,4 +1,6 @@ -# Environment +--- +title: Environment +--- Eine häufige Aufgabe in einer Shell ist die Kontrolle der Umgebung, in der die externen Programme laufen. Dies wird meist automatisch geschehen, da die Umgebung dem externen programm mitgegeben wird, wenn es gestartet wird. Manchmal jedoch will man eine genauere Kontrolle darüber, @@ -6,7 +8,7 @@ welche Umgebungsvariablen ein Programm sehen kann. Die aktuellen Umbegungsvariablen werden mit dem [`env`](/commands/docs/env.md) Befehl ausgegeben: -``` +```nu # name type value raw ────────────────────────────────────────────────────────────────────────────────────────── 16 DISPLAY string :0 :0 @@ -29,13 +31,13 @@ Umgebungsvariablen werden als Felder der Variable `$env` gesetzt. Um die Umgebungsvariable `FOO` zu setzen kann direkt der Wert zu `$env.FOO` zugewiesen werden. -``` +```nu > $env.FOO = 'BAR' ``` Um zum Beispiel die `PATH` Variable zu ergänzen, wird folgendes eingegeben: -``` +```nu $env.PATH = ($env.PATH | prepend '/pfad/der/hinzu/kommt') ``` @@ -47,7 +49,7 @@ Soll der Pfad ans Ende angehängt werden, so wird `append` verwendet. Wenn mehrere Umgebungsvariablen gesetzt werden sollen, so kann `load-env` eine ganze Tabelle mitgegeben werden. Diese besteht aus name/value Paaren, welche alle auf einmal geladen werden: -``` +```nu > load-env { "BOB": "FOO", "JAY": "BAR" } ``` @@ -70,7 +72,7 @@ Wenn eine Umgebungsvariable gesetzt wird, ist sie nur in ihrem Gültigkeitsberei Hier ein kleines Beispiel um den Gültigkeitsbereich zu demonstrieren: -``` +```nu > $env.FOO = "BAR" > do { $env.FOO = "BAZ" @@ -91,14 +93,14 @@ Dies wiederum folgt den gleichen Regeln wie das setzen anderer Umgebungsvariable Eine praktische Möglichkeit eine Umgebungsvariable einmalig zu setzen, ist inspiriert von Bash und anderen Shells: -``` +```nu > FOO=BAR echo $env.FOO BAR ``` Es kann auch [`with-env`](/commands/docs/with-env.md) verwendet werden um expliziter zu sein: -``` +```nu > with-env { FOO: BAR } { echo $env.FOO } BAR ``` @@ -111,8 +113,7 @@ Umgebungsvariablen können beim Start von Nushell gesetzt werden. Dafür werden und sind dann für die gesamte Laufzeit von Nushell verfügbar. Zum Beispiel: -``` -# In config.nu +```nu title="config.nu" $env.FOO = 'BAR' ``` @@ -122,7 +123,7 @@ Aufgrund der Gültigkeitsregeln ist eine Umgebungsvariable, welche innerhalb ein Wird sie jedoch mit [`def --env`](/commands/docs/def.md) anstatt [`def`](/commands/docs/def.md) gesetzt, so wird sie beim verlassen des Blocks erhalten bleiben. (Gilt auch für `export def`, siehe [Modules](modules.md)) -``` +```nu > def --env foo [] { $env.FOO = 'BAR' } @@ -147,7 +148,7 @@ Die Konvertierung von Wert -> String erfolgt mit `to_string` innerhalb `ENV_CONV Zur Illustration hier ein Beispiel. Diese Zeilen gehören in config.nu: -``` +```nu $env.ENV_CONVERSIONS = { # ... you might have Path and PATH already there, add: FOO : { @@ -159,7 +160,7 @@ $env.ENV_CONVERSIONS = { In einer Nushell Instanz gilt nun: -``` +```nu > with-env { FOO : 'a-b-c' } { nu } # runs Nushell with FOO env. var. set to 'a-b-c' > $env.FOO @@ -171,13 +172,13 @@ In einer Nushell Instanz gilt nun: Wie zu sehen ist `$env.FOO` nun eine Liste in einer neuen Nushell Instanz mit der neuen config. Die Konvertierung kann auch manuell getestet werden mit: -``` +```nu > do $env.ENV_CONVERSIONS.FOO.from_string 'a-b-c' ``` Um die Konvertierun list -> string zu testen: -``` +```nu > nu -c '$env.FOO' a-b-c ``` @@ -201,7 +202,7 @@ Alle Umgebungsvariablen in env.nu und config.nu sind immer noch Strings solange Umgebungsvariablen können im aktuellen Gültigkeitsbereich entfernt werden via [`hide`](/commands/docs/hide.md): -``` +```nu > $env.FOO = 'BAR' ... > hide FOO @@ -209,7 +210,7 @@ Umgebungsvariablen können im aktuellen Gültigkeitsbereich entfernt werden via Dieses Verstecken im Gültigkeitsbereich erlaubt es gleichzeitig temporär eine Variabel zu entfernen ohne dass man die höher gelegene Umgebung modifiziert wird: -``` +```nu > $env.FOO = 'BAR' > do { hide FOO diff --git a/de/book/escaping.md b/src/content/docs/de/book/nu-as-a-shell/escaping.md similarity index 89% rename from de/book/escaping.md rename to src/content/docs/de/book/nu-as-a-shell/escaping.md index 031d3124c7b..7901e995d49 100644 --- a/de/book/escaping.md +++ b/src/content/docs/de/book/nu-as-a-shell/escaping.md @@ -1,15 +1,17 @@ -# Aufruf von Systembefehlen +--- +title: Aufruf von Systembefehlen +--- Nushell stellt einen identischen Satz an Befehlen für verschiedene Systeme zur Verfügung, die überall dieselbe Syntax und Funktionalität haben. Manchmal ist es jedoch nötig, den gleichnamigen, vom System selbst bereitgestellten, Befehl aufzurufen. Um beispielsweise den `ls` oder `date` Befehl des Systems auszuführen, wird das Zirkumflex (`^`) dem Befehl vorangestellt: Nushell Befehl: -``` +```nu > ls ``` Aufruf des Systembefehls: -``` +```nu > ^ls ``` diff --git a/de/book/hooks.md b/src/content/docs/de/book/nu-as-a-shell/hooks.md similarity index 95% rename from de/book/hooks.md rename to src/content/docs/de/book/nu-as-a-shell/hooks.md index 5a63362ab79..e8d20a6bba0 100644 --- a/de/book/hooks.md +++ b/src/content/docs/de/book/nu-as-a-shell/hooks.md @@ -1,285 +1,290 @@ -# Hooks - -Hooks ermöglichen es, einen Code-Snippet in vordefinierten Situationen auszuführen. -Sie sind nur im interaktiven Modus verfügbar [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop), sie funktionieren nicht, wenn eine Nushell mit einem Skript `(nu script.nu`) oder dem Befehl `(nu -c "print foo`") Argument ausgefüht wird. - -Derzeit unterstützen wir diese Arten von Hooks: - -- `pre_prompt` : Ausgelöst bevor die Eingabeaufforderung gezeichnet wird -- `pre_execution` : Ausgelöst vor dem Ausführen der Zeileneingabe -- `env_change`: Ausgelöst, wenn sich eine Umgebungsvariable ändert -- `display_output` : Ein Block, an den die Ausgabe weitergeleitet wird (experimental.) -- `command_not_found` : Ausgelöst, wenn ein Befehl nicht gefunden wird. - -Der Nushell Ausführungszyklus macht es klarer. -Die Schritte zur Auswertung einer Zeile im REPL-Modus sind wie folgt: - -1. Prüfe auf `pre_prompt` Hooks und führe diese aus. -1. Prüfe auf `env_change` Hooks und führe diese aus. -1. Stelle die Eingabeaufforderung dar und warte auf eine Benutzer-Eingabe. -1. Nachdem der Benutzer etwas eingegeben und "Enter" gedrückt hat: Prüfe auf `pre_execution` Hooks und führe diese aus. -1. Parse und werte die Benutzer Eingabe aus. -1. Wurde ein Befehl nicht gefunden: Prüfe auf `command_not_found` Hooks. Wenn dieser Text zurückgibt, zeige ihn. -1. Wenn `display_output` definiert ist, verwende diesen um die Ausgabe zu erstellen. -1. Beginne wieder mit 1. - -## Grundsätzliches zu Hooks - -Um Hooks zu aktivieren, werden sie in der [config](configuration.md) definiert: - -``` -$env.config = { - # ...other config... - - hooks: { - pre_prompt: { print "pre prompt hook" } - pre_execution: { print "pre exec hook" } - env_change: { - PWD: {|before, after| print $"changing directory from ($before) to ($after)" } - } - } -} -``` - -Bewegen wir uns mit obiger Konfiguration im Dateisystem, wird beim Ändern eines Verzeichnisses die `PWD` Umgebungsvariable verändert. -Die Änderung löst den Hook aus und tauscht die entsprechenden Werte in `before` und `after` aus. - -Anstatt nur einen einzigen Hook pro Trigger zu definieren, ist es möglich, eine *Liste von Hooks* zu definieren, die nacheinander durchlaufen werden: - -``` -$env.config = { - ...other config... - - hooks: { - pre_prompt: [ - { print "pre prompt hook" } - { print "pre prompt hook2" } - ] - pre_execution: [ - { print "pre exec hook" } - { print "pre exec hook2" } - ] - env_change: { - PWD: [ - {|before, after| print $"changing directory from ($before) to ($after)" } - {|before, after| print $"changing directory from ($before) to ($after) 2" } - ] - } - } -} -``` - -Auch könnte es praktischer sein, die bestehende Konfiguration mit neuen Hooks zu aktualisieren, -anstatt die gesamte Konfiguration von Grund auf neu zu definieren: - -``` -$env.config = ($env.config | upsert hooks { - pre_prompt: ... - pre_execution: ... - env_change: { - PWD: ... - } -}) -``` - -## Changing Environment - -Eine Besonderheit der Hooks ist, dass sie die Umgebung bewahren. -Umgebungsvariablen im Hook **Block** werden in ähnlicher Weise wie [`def --env`](environment.md#defining-environment-from-custom-commands) erhalten. -Folgendes Beispiel zeigt dies: - -``` -> $env.config = ($env.config | upsert hooks { - pre_prompt: { $env.SPAM = "eggs" } -}) - -> $env.SPAM -eggs -``` - -Die Hookblöcke folgen ansonsten den allgemeinen Scoping-Regeln, d.h. Befehle, Aliase, etc., die innerhalb des Blocks definiert sind, -werden verworfen, sobald der Block endet. - -## Conditional Hooks - -Nun wäre es verlockend eine Umgebung zu aktivieren wenn in ein Verzeichnis eingestiegen wird: - -``` -$env.config = ($env.config | upsert hooks { - env_change: { - PWD: [ - {|before, after| - if $after == /some/path/to/directory { - load-env { SPAM: eggs } - } - } - ] - } -}) -``` - -Dies wird jedoch nicht funktionieren, weil die Umgebung nur innerhalb des Blocks [`if`](/Befehle/docs/if.md) aktiv ist. -In diesem Fall könnte es als `load-env` neu geschrieben werden (`load-env (if $after == ... { ... } else { {} })`), -aber dieses Muster ist ziemlich häufig und später werden wir sehen, dass nicht alle Fälle so geschrieben werden können. - -Um das obige Problem zu lösen, führen wir eine neue Möglichkeit ein, einen Hook zu definieren -- **einen record**: - -``` -$env.config = ($env.config | upsert hooks { - env_change: { - PWD: [ - { - condition: {|before, after| $after == /some/path/to/directory } - code: {|before, after| load-env { SPAM: eggs } } - } - ] - } -}) -``` -Wird der Hook getriggert, wird der `condition` Block ausgewertet. -Wenn dieser `true` zurückgibt, wird der `code` Block ausgewertet. -Wenn er `false`zurückgibt, passiert nichts. -Gibt er etwas anderes zurück, wird ein Fehler generiert. -Das `condition` Feld kann auch weggelassen werden, womit der Hook immer ausgewertet wird. - -Die `pre_prompt` und `pre_execution` Hook Typen unterstützen die Conditional Hooks, jedoch nicht die `before` und `after` Parameter. - -## Hooks als Strings - -Bisher wurde ein Hook als Block definiert, der nur die Umgebung bewahrt, aber nichts anderes. -Um Befehle oder Aliase definieren zu können, ist es möglich, das Codefeld **als string** zu definieren. -Dies funktioniert, als ob der String in den REPL eingeben und Enter gedrückt wird. -So kann der Hook aus dem vorherigen Abschnitt auch geschrieben werden als: - -``` -> $env.config = ($env.config | upsert hooks { - pre_prompt: '$env.SPAM = "eggs"' -}) - -> $env.SPAM -eggs -``` -Dieses Feature kann z.B. verwendet werden, um abhängig vom aktuellen Verzeichnis Definitionen einzubringen: - -``` -$env.config = ($env.config | upsert hooks { - env_change: { - PWD: [ - { - condition: {|_, after| $after == /some/path/to/directory } - code: 'def foo [] { print "foo" }' - } - { - condition: {|before, _| $before == /some/path/to/directory } - code: 'hide foo' - } - ] - } -}) -``` - -Wird ein Hook als String definiert, werden die `$before` und `$after` Variablen auf die vorherigen und aktuellen Umgebungsvariablen gesetzt, -analog dem vorherigen Beispiel: - -``` -$env.config = ($env.config | upsert hooks { - env_change: { - PWD: { - code: 'print $"changing directory from ($before) to ($after)"' - } - } -} -``` - -## Beispiele - -### Einen einzelnen Hook zur bestehenden Konfiguration hinzufügen - -Beispiel eines PWD env Wechsel Hooks: - -``` -$env.config = ($env.config | upsert hooks.env_change.PWD {|config| - let val = ($config | get -i hooks.env_change.PWD) - - if $val == $nothing { - $val | append {|before, after| print $"changing directory from ($before) to ($after)" } - } else { - [ - {|before, after| print $"changing directory from ($before) to ($after)" } - ] - } -}) -``` - -### Automatisch eine Umgebung aktivieren, wenn ein Verzeichnis betreten wird - -Dieses Beispiel sucht nach einem `test-env.nu` in einem Verzeichnis - -``` -$env.config = ($env.config | upsert hooks.env_change.PWD { - [ - { - condition: {|_, after| - ($after == '/path/to/target/dir' - and ($after | path join test-env.nu | path exists)) - } - code: "overlay use test-env.nu" - } - { - condition: {|before, after| - ('/path/to/target/dir' not-in $after - and '/path/to/target/dir' in $before - and 'test-env' in (overlay list)) - } - code: "overlay hide test-env --keep-env [ PWD ]" - } - ] -}) -``` -### Filtern oder Umlenken des Befehl-Outputs - -Der `display_output` Hook kann verwendet werden, um die Ausgabe von Befehlen umzuleiten. -Ein Block sollte so definiert werden, dass er mit allen Werttypen funktioniert. -Die Ausgabe externer Befehle wird nicht durch `display_output` gefiltert. - -Dieser Hook kann die Ausgabe in einem separaten Fenster anzeigen, -vielleicht als HTML-Text. Hier ist die Grundidee, wie dies erreicht wird: - -``` -$env.config = ($env.config | upsert hooks { - display_output: { to html --partial --no-color | save --raw /tmp/nu-output.html } -}) -``` - -Das Ergebnis wird in der Datei:///tmp/nu-output.html ersichtlich in einem Webbrowser. -Natürlich ist dies nicht sehr praktisch, es sei denn, der Browser wird automatisch neu geladen, wenn sich die Datei ändert. -Anstelle des Befehls [`save`](/commands/docs/save.md) würde normalerweise der HTML-Ausgang an ein gewünschtes Fenster gesendet. - -### `command_not_found` Hook in _Arch Linux_ - -Der folgende Hook verwendet den `pkgfile` Befehl, um in _Arch Linux_ herauzufinden, zu welchem Packet ein Befehl gehört. - -``` -$env.config = { - ...other config... - - hooks: { - ...other hooks... - - command_not_found: { - |cmd_name| ( - try { - let pkgs = (pkgfile --binaries --verbose $cmd_name) - if ($pkgs | is-empty) { - return null - } - ( - $"(ansi $env.config.color_config.shape_external)($cmd_name)(ansi reset) " + - $"may be found in the following packages:\n($pkgs)" - ) - } - ) - } - } -} -``` +--- +title: Hooks +--- + +Hooks ermöglichen es, einen Code-Snippet in vordefinierten Situationen auszuführen. +Sie sind nur im interaktiven Modus verfügbar [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop), sie funktionieren nicht, wenn eine Nushell mit einem Skript `(nu script.nu`) oder dem Befehl `(nu -c "print foo`") Argument ausgefüht wird. + +Derzeit unterstützen wir diese Arten von Hooks: + +- `pre_prompt` : Ausgelöst bevor die Eingabeaufforderung gezeichnet wird +- `pre_execution` : Ausgelöst vor dem Ausführen der Zeileneingabe +- `env_change`: Ausgelöst, wenn sich eine Umgebungsvariable ändert +- `display_output` : Ein Block, an den die Ausgabe weitergeleitet wird (experimental.) +- `command_not_found` : Ausgelöst, wenn ein Befehl nicht gefunden wird. + +Der Nushell Ausführungszyklus macht es klarer. +Die Schritte zur Auswertung einer Zeile im REPL-Modus sind wie folgt: + +1. Prüfe auf `pre_prompt` Hooks und führe diese aus. +1. Prüfe auf `env_change` Hooks und führe diese aus. +1. Stelle die Eingabeaufforderung dar und warte auf eine Benutzer-Eingabe. +1. Nachdem der Benutzer etwas eingegeben und "Enter" gedrückt hat: Prüfe auf `pre_execution` Hooks und führe diese aus. +1. Parse und werte die Benutzer Eingabe aus. +1. Wurde ein Befehl nicht gefunden: Prüfe auf `command_not_found` Hooks. Wenn dieser Text zurückgibt, zeige ihn. +1. Wenn `display_output` definiert ist, verwende diesen um die Ausgabe zu erstellen. +1. Beginne wieder mit 1. + +## Grundsätzliches zu Hooks + +Um Hooks zu aktivieren, werden sie in der [config](configuration.md) definiert: + +```nu +$env.config = { + # ...other config... + + hooks: { + pre_prompt: { print "pre prompt hook" } + pre_execution: { print "pre exec hook" } + env_change: { + PWD: {|before, after| print $"changing directory from ($before) to ($after)" } + } + } +} +``` + +Bewegen wir uns mit obiger Konfiguration im Dateisystem, wird beim Ändern eines Verzeichnisses die `PWD` Umgebungsvariable verändert. +Die Änderung löst den Hook aus und tauscht die entsprechenden Werte in `before` und `after` aus. + +Anstatt nur einen einzigen Hook pro Trigger zu definieren, ist es möglich, eine _Liste von Hooks_ zu definieren, die nacheinander durchlaufen werden: + +```nu +$env.config = { + ...other config... + + hooks: { + pre_prompt: [ + { print "pre prompt hook" } + { print "pre prompt hook2" } + ] + pre_execution: [ + { print "pre exec hook" } + { print "pre exec hook2" } + ] + env_change: { + PWD: [ + {|before, after| print $"changing directory from ($before) to ($after)" } + {|before, after| print $"changing directory from ($before) to ($after) 2" } + ] + } + } +} +``` + +Auch könnte es praktischer sein, die bestehende Konfiguration mit neuen Hooks zu aktualisieren, +anstatt die gesamte Konfiguration von Grund auf neu zu definieren: + +```nu +$env.config = ($env.config | upsert hooks { + pre_prompt: ... + pre_execution: ... + env_change: { + PWD: ... + } +}) +``` + +## Changing Environment + +Eine Besonderheit der Hooks ist, dass sie die Umgebung bewahren. +Umgebungsvariablen im Hook **Block** werden in ähnlicher Weise wie [`def --env`](environment.md#defining-environment-from-custom-commands) erhalten. +Folgendes Beispiel zeigt dies: + +```nu +> $env.config = ($env.config | upsert hooks { + pre_prompt: { $env.SPAM = "eggs" } +}) + +> $env.SPAM +eggs +``` + +Die Hookblöcke folgen ansonsten den allgemeinen Scoping-Regeln, d.h. Befehle, Aliase, etc., die innerhalb des Blocks definiert sind, +werden verworfen, sobald der Block endet. + +## Conditional Hooks + +Nun wäre es verlockend eine Umgebung zu aktivieren wenn in ein Verzeichnis eingestiegen wird: + +```nu +$env.config = ($env.config | upsert hooks { + env_change: { + PWD: [ + {|before, after| + if $after == /some/path/to/directory { + load-env { SPAM: eggs } + } + } + ] + } +}) +``` + +Dies wird jedoch nicht funktionieren, weil die Umgebung nur innerhalb des Blocks [`if`](/Befehle/docs/if.md) aktiv ist. +In diesem Fall könnte es als `load-env` neu geschrieben werden (`load-env (if $after == ... { ... } else { {} })`), +aber dieses Muster ist ziemlich häufig und später werden wir sehen, dass nicht alle Fälle so geschrieben werden können. + +Um das obige Problem zu lösen, führen wir eine neue Möglichkeit ein, einen Hook zu definieren -- **einen record**: + +```nu +$env.config = ($env.config | upsert hooks { + env_change: { + PWD: [ + { + condition: {|before, after| $after == /some/path/to/directory } + code: {|before, after| load-env { SPAM: eggs } } + } + ] + } +}) +``` + +Wird der Hook getriggert, wird der `condition` Block ausgewertet. +Wenn dieser `true` zurückgibt, wird der `code` Block ausgewertet. +Wenn er `false`zurückgibt, passiert nichts. +Gibt er etwas anderes zurück, wird ein Fehler generiert. +Das `condition` Feld kann auch weggelassen werden, womit der Hook immer ausgewertet wird. + +Die `pre_prompt` und `pre_execution` Hook Typen unterstützen die Conditional Hooks, jedoch nicht die `before` und `after` Parameter. + +## Hooks als Strings + +Bisher wurde ein Hook als Block definiert, der nur die Umgebung bewahrt, aber nichts anderes. +Um Befehle oder Aliase definieren zu können, ist es möglich, das Codefeld **als string** zu definieren. +Dies funktioniert, als ob der String in den REPL eingeben und Enter gedrückt wird. +So kann der Hook aus dem vorherigen Abschnitt auch geschrieben werden als: + +```nu +> $env.config = ($env.config | upsert hooks { + pre_prompt: '$env.SPAM = "eggs"' +}) + +> $env.SPAM +eggs +``` + +Dieses Feature kann z.B. verwendet werden, um abhängig vom aktuellen Verzeichnis Definitionen einzubringen: + +```nu +$env.config = ($env.config | upsert hooks { + env_change: { + PWD: [ + { + condition: {|_, after| $after == /some/path/to/directory } + code: 'def foo [] { print "foo" }' + } + { + condition: {|before, _| $before == /some/path/to/directory } + code: 'hide foo' + } + ] + } +}) +``` + +Wird ein Hook als String definiert, werden die `$before` und `$after` Variablen auf die vorherigen und aktuellen Umgebungsvariablen gesetzt, +analog dem vorherigen Beispiel: + +```nu +$env.config = ($env.config | upsert hooks { + env_change: { + PWD: { + code: 'print $"changing directory from ($before) to ($after)"' + } + } +} +``` + +## Beispiele + +### Einen einzelnen Hook zur bestehenden Konfiguration hinzufügen + +Beispiel eines PWD env Wechsel Hooks: + +```nu +$env.config = ($env.config | upsert hooks.env_change.PWD {|config| + let val = ($config | get -i hooks.env_change.PWD) + + if $val == $nothing { + $val | append {|before, after| print $"changing directory from ($before) to ($after)" } + } else { + [ + {|before, after| print $"changing directory from ($before) to ($after)" } + ] + } +}) +``` + +### Automatisch eine Umgebung aktivieren, wenn ein Verzeichnis betreten wird + +Dieses Beispiel sucht nach einem `test-env.nu` in einem Verzeichnis + +```nu +$env.config = ($env.config | upsert hooks.env_change.PWD { + [ + { + condition: {|_, after| + ($after == '/path/to/target/dir' + and ($after | path join test-env.nu | path exists)) + } + code: "overlay use test-env.nu" + } + { + condition: {|before, after| + ('/path/to/target/dir' not-in $after + and '/path/to/target/dir' in $before + and 'test-env' in (overlay list)) + } + code: "overlay hide test-env --keep-env [ PWD ]" + } + ] +}) +``` + +### Filtern oder Umlenken des Befehl-Outputs + +Der `display_output` Hook kann verwendet werden, um die Ausgabe von Befehlen umzuleiten. +Ein Block sollte so definiert werden, dass er mit allen Werttypen funktioniert. +Die Ausgabe externer Befehle wird nicht durch `display_output` gefiltert. + +Dieser Hook kann die Ausgabe in einem separaten Fenster anzeigen, +vielleicht als HTML-Text. Hier ist die Grundidee, wie dies erreicht wird: + +```nu +$env.config = ($env.config | upsert hooks { + display_output: { to html --partial --no-color | save --raw /tmp/nu-output.html } +}) +``` + +Das Ergebnis wird in der Datei:///tmp/nu-output.html ersichtlich in einem Webbrowser. +Natürlich ist dies nicht sehr praktisch, es sei denn, der Browser wird automatisch neu geladen, wenn sich die Datei ändert. +Anstelle des Befehls [`save`](/commands/docs/save.md) würde normalerweise der HTML-Ausgang an ein gewünschtes Fenster gesendet. + +### `command_not_found` Hook in _Arch Linux_ + +Der folgende Hook verwendet den `pkgfile` Befehl, um in _Arch Linux_ herauzufinden, zu welchem Packet ein Befehl gehört. + +```nu +$env.config = { + ...other config... + + hooks: { + ...other hooks... + + command_not_found: { + |cmd_name| ( + try { + let pkgs = (pkgfile --binaries --verbose $cmd_name) + if ($pkgs | is-empty) { + return null + } + ( + $"(ansi $env.config.color_config.shape_external)($cmd_name)(ansi reset) " + + $"may be found in the following packages:\n($pkgs)" + ) + } + ) + } + } +} +``` diff --git a/de/book/loading_data.md b/src/content/docs/de/book/nu-fundamentals/loading_data.mdx similarity index 94% rename from de/book/loading_data.md rename to src/content/docs/de/book/nu-fundamentals/loading_data.mdx index 7e444d0d8fc..938cddbe788 100644 --- a/de/book/loading_data.md +++ b/src/content/docs/de/book/nu-fundamentals/loading_data.mdx @@ -1,4 +1,11 @@ -# Laden von Daten +--- +title: Laden von Daten +--- + +import { Code } from "@astrojs/starlight/components"; +import vscode from "../../../snippets/loading_data/vscode.nu?raw"; +import cargoToml from "../../../snippets/loading_data/cargo_toml.nu?raw"; +import rustLangFeed from "../../../snippets/loading_data/rust_lang_feed.nu?raw"; Im letzten Kapitel wurden Befehle wie [`ls`](/commands/docs/ls.md), [`ps`](/commands/docs/ps.md), [`date`](/commands/docs/date.md), and [`sys`](/commands/docs/sys.md) vorgestellt um Informationen @@ -12,7 +19,7 @@ Einer der mächtigsten Befehle in Nu um mir Daten zu arbeite ist der [`open`](/c Er ist ein Multi-Werkzeug, welcher mit verschiedensten Datenformaten umgehen kann. Hier zum Beispiel was passiert, wenn eine json Datei geöffnet wird: -@[code](@snippets/loading_data/vscode.sh) +<Code code={vscode} lang="nu" /> Ähnlich wie beim [`ls`](/commands/docs/ls.md) Befehl, bekommen wir mehr als nur Text (oder einen Stream von bytes) zurück, wenn wir einen Dateityp öffnen, den Nu versteht. @@ -22,7 +29,7 @@ und parst die Daten in eine Tabelle. Soll nur die Version aus dem Projekt angezeigt werden, kann mit dem [`get`](/commands/docs/get.md) direkt diese Information herausgelesen werden. -``` +```nu > open editors/vscode/package.json | get version 1.0.0 ``` @@ -47,7 +54,7 @@ Nu unterstützt aktuell die folgenden Formate um Daten direkt als Tabelle zu öf Was aber passiert, wenn eine Text Datei geladen wird, die keinem der angegebenen Formate entspricht? -``` +```nu > open README.md ``` @@ -63,7 +70,7 @@ Oft werden diese Daten als String repräsentiert. Zum Beispiel wie in dieser Datei: -``` +```nu > open people.txt Octavia | Butler | Writer Bob | Ross | Painter @@ -76,7 +83,7 @@ weshalb diese Datei von Hand geparst werden muss. Zuerst wird die Datei so geladen, dass jede Zeile für sich verarbeitet werden kann: -``` +```nu > open people.txt | lines ───┬────────────────────────────── 0 │ Octavia | Butler | Writer @@ -92,7 +99,7 @@ kann damit ein String durch ein Trennzeichen aufgesplittet oder aufgetrennt werd Mit dem `column` Unterbefehl wird der Inhalt über mehrere Spalten aufgeteilt. Als Parameter reicht das Trennzeichen, der Rest ist automatisch: -``` +```nu > open people.txt | lines | split column "|" ───┬──────────┬───────────┬─────────── # │ column1 │ column2 │ column3 @@ -106,7 +113,7 @@ Als Parameter reicht das Trennzeichen, der Rest ist automatisch: Das sieht _fast_ korrekt aus.Es sieht so aus, als ob sich noch eine zusätzliche Lücke eingeschlichen hat. Mit dem [`trim`](/commands/docs/str_trim.md) Befehl wird dieser beseitigt: -``` +```nu > open people.txt | lines | split column "|" | str trim ───┬─────────┬─────────┬────────── # │ column1 │ column2 │ column3 @@ -120,7 +127,7 @@ Mit dem [`trim`](/commands/docs/str_trim.md) Befehl wird dieser beseitigt: Nicht schlecht. Der [`split`](/commands/docs/split.md) Befehl gibt nicht nur brauchbare Daten zurück, sondern bezeichnet auch noch standardmässig die Spaltennamen: -``` +```nu > open people.txt | lines | split column "|" | str trim | get column1 ───┬───────── 0 │ Octavia @@ -131,7 +138,7 @@ sondern bezeichnet auch noch standardmässig die Spaltennamen: Die Spalten können jedoch auch benannt werden: -``` +```nu > open people.txt | lines | split column "|" first_name last_name job | str trim ───┬────────────┬───────────┬────────── # │ first_name │ last_name │ job @@ -145,7 +152,7 @@ Die Spalten können jedoch auch benannt werden: Jetzt da die Daten in einer Tabelle sind, können alle Befehle, die wir davor schon auf Tabellen angewendet haben wiederverwenden: -``` +```nu > open people.txt | lines | split column "|" first_name last_name job | str trim | sort-by first_name ───┬────────────┬───────────┬────────── # │ first_name │ last_name │ job @@ -165,7 +172,7 @@ Weitere Befehle, mit denen Texte aus Strings bearbeitet werden können sind: Es gibt ausserdem einige Hilfsbefehle, die verwendet werden können um mit Daten umzugehen, die Nu eigentlich verstehen sollte. Zum Beispiel wenn eine Rust lock Datei geöffnet wird: -``` +```nu > open Cargo.lock # This file is automatically @generated by Cargo. # It is not intended for manual editing. @@ -177,7 +184,7 @@ version = "0.1.2" Eine "Cargo.lock" Datei ist eigentlich eine .toml Datei, aber die Dateiendung ist nicht .toml. Das ist ok, denn mit dem `from` und seinem Unterbefehl `toml` können wir dies explizit angeben: -@[code](@snippets/loading_data/cargo-toml.sh) +<Code code={cargoToml} lang="nu" /> Der `from` Befehl kann für jedes strukturierte Datenformat, welches Nu versteht, verwendet werden, indem das Format als entsprechender Unterbefehl verwendet wird. @@ -188,7 +195,7 @@ Auch wenn es hilfreich ist, beim Öffnen einer Datei direkt eine Tabelle zu erha ist dies nicht immer gewünscht. Um den darunter liegenden Text zu erhalten, kann dem [`open`](/commands/docs/open.md) Befehl das Flag `--raw` mitgegeben werden: -``` +```nu > open Cargo.toml --raw [package] name = "nu" version = "0.1.3" @@ -202,4 +209,4 @@ license = "MIT" Zusätzlich zum Laden von Dateien vom Dateisystem, können auch URLs mit dem [`http get`](/commands/docs/fetch.md) Befehl geladen werden. Dies wird den Inhalt der URL aus dem Netz abrufen und zurückgeben: -@[code](@snippets/loading_data/rust-lang-feed.sh) +<Code code={rustLangFeed} lang="nu" /> diff --git a/de/book/pipeline.md b/src/content/docs/de/book/nu-fundamentals/pipeline.md similarity index 98% rename from de/book/pipeline.md rename to src/content/docs/de/book/nu-fundamentals/pipeline.md index 37690d06e41..f1181b7e132 100644 --- a/de/book/pipeline.md +++ b/src/content/docs/de/book/nu-fundamentals/pipeline.md @@ -1,4 +1,6 @@ -# Pipelines +--- +title: Pipelines +--- Eine der grundlegenden Funktionen in Nu ist die Pipeline. Ein Konzept, welches seine Wurzeln tief in der Unix Philosophie hat. So wie Nu die Arbeit mit Texten als dem Basis Datentyp in Unix erweitert, erweitert sie auch die Idee der Pipeline, um mehr als nur Text zu verarbeiten. @@ -7,7 +9,7 @@ So wie Nu die Arbeit mit Texten als dem Basis Datentyp in Unix erweitert, erweit Eine Pipeline besteht aus drei Teilen: Dem Input, dem Filter und dem Output. -``` +```nu > open "Cargo.toml" | inc package.version --minor | save "Cargo_new.toml" ``` @@ -24,7 +26,7 @@ Andere Arten von Output geben die Daten aus der Pipeline zum Beispiel auf der Ko Die `$in` Variable sammelt die Daten in der Pipeline in einen Wert, um den ganzen Strom als Parameter verwenden zu können: -```nushell +```nu > echo 1 2 3 | $in.1 * $in.2 6 ``` @@ -33,7 +35,7 @@ Die `$in` Variable sammelt die Daten in der Pipeline in einen Wert, um den ganze Wenn eine Pipeline etwas lange wird für eine Zeile, kann sie mit `(` und `)` zu Unterausdrücken unterteilt werden: -```nushell +```nu ( "01/22/2021" | parse "{month}/{day}/{year}" | @@ -72,13 +74,13 @@ Nu fügt diesen Output automatisch hinzu, indem sie den Befehl [`table`](/comman Der [`table`](/commands/docs/table.md) Befehl wird an jede Pipeline angefügt, die keinen eigenen Output besitzen. Dies erlaubt es den Output in dieser Form zu sehen. Tatsächlich ist der Befehl: -``` +```nu > ls ``` und die Pipeline, -``` +```nu > ls ``` diff --git a/de/book/types_of_data.md b/src/content/docs/de/book/nu-fundamentals/types_of_data.md similarity index 99% rename from de/book/types_of_data.md rename to src/content/docs/de/book/nu-fundamentals/types_of_data.md index cd82eed4275..c805851b71a 100644 --- a/de/book/types_of_data.md +++ b/src/content/docs/de/book/nu-fundamentals/types_of_data.md @@ -1,4 +1,6 @@ -# Datentypen +--- +title: Datentypen +--- Traditionellerweise haben Unix Shell Befehle immer über Text Zeichenketten kommuniziert. Eine Befehlsausgabe erfolgte als Text an den Standard Output (oft als `stout` bezeichnet), der nächste Befehl hat wiederum von Standard Input gelesen (oder `stdin`), was den beiden Befehlen die Kommunikation ermöglicht hat. @@ -26,7 +28,7 @@ Eine Zeichenfolge die einen Text repräsentiert. Es gibt mehrere Möglichkeiten **Doppelte Anführungszeichen** -``` +```nu "Mein Text" ``` @@ -34,7 +36,7 @@ Doppelte Anführungszeichen werden am häufigsten verwendet und finden sich übe **Einfache Anführungszeichen** -``` +```nu 'Mein Text' ``` @@ -44,12 +46,12 @@ Einfache Anführungszeichen ergeben ebenfalls einen Text zurück. Der Unterschie **Text Erweiterung** (interpolation) Nushell unterstützt Text Erweiterung, was es erlaubt, Unterausdrücke innerhalb eines Textes zu verwenden. Diese werden mit `$` ausgedrückt: -``` +```nu > echo $"6 x 7 = (6 * 7)" 6 x 7 = 42 ``` -``` +```nu > ls | each { |it| echo $"($it.name) is ($it.size)" } ───┬───────────────────── 0 │ genawait is 4.1 KB @@ -60,7 +62,7 @@ Nushell unterstützt Text Erweiterung, was es erlaubt, Unterausdrücke innerhalb **blosse Texte** -``` +```nu > echo hello ``` @@ -68,7 +70,7 @@ Eine spezielle Eigenschaft von Nushell ist, dass ein Text mit nur einem Wort auc Der Text oben ist das selbe als wäre geschrieben: -``` +```nu > echo "hello" ``` @@ -186,7 +188,7 @@ Binärdaten wie der Inhalt einer Bilddatei entspricht einer Gruppe von rohen (ra Binär kann explizit wörtlich geschrieben werden in einer der Formen `0x[...]`, `0b[...]`, or `0o[...]`: -``` +```nu > 0x[1F FF] # Hexadecimal > 0b[1 1010] # Binary > 0o[377] # Octal @@ -206,7 +208,7 @@ records, lists und tables. Wertepaare werden auch als key-value pairs bezeichnet, ähnlich wie sie von JSON Objekten bekannt sind. Da diese manchmal viele Felder haben können, werden Wertepaar von oben unten anstatt links-rechts dargestellt: -``` +```nu > echo {name: sam, rank: 10} ╭──────┬─────╮ │ name │ sam │ @@ -216,7 +218,7 @@ werden Wertepaar von oben unten anstatt links-rechts dargestellt: Über Wertepaare kann iteriert werden wenn sie zuerst in eine Tabelle transponiert werden: -``` +```nu > echo {name: sam, rank: 10} | transpose key value ╭───┬──────┬───────╮ │ # │ key │ value │ @@ -233,7 +235,7 @@ was man eine Tabelle (table) nennt. Beispiel: Eine Liste von Texten -``` +```nu > echo [sam fred george] ───┬──────── 0 │ sam @@ -249,7 +251,7 @@ Eine Tabelle besteht immer aus Zeilen und Spalten. Eine Tabelle wird ähnlich erstellt wie eine Liste. Weil diese auch Spalten und nicht nur Werte enthält, geben wir die Spalten zuerst an: -``` +```nu > echo [[column1, column2]; [Value1, Value2]] ───┬─────────┬───────── # │ column1 │ column2 @@ -260,7 +262,7 @@ Eine Tabelle wird ähnlich erstellt wie eine Liste. Weil diese auch Spalten und Eine Tabelle mit mehreren Zeilen sieht dann so aus: -``` +```nu > echo [[column1, column2]; [Value1, Value2] [Value3, Value4]] ───┬─────────┬───────── # │ column1 │ column2 @@ -272,7 +274,7 @@ Eine Tabelle mit mehreren Zeilen sieht dann so aus: Oder aus einer Liste von Wertepaaren: -``` +```nu > echo [{name: sam, rank: 10}, {name: bob, rank: 7}] ╭───┬──────┬──────╮ │ # │ name │ rank │ @@ -293,7 +295,7 @@ zu benutzen, aber nicht zwingend. `each { |x| echo $x }`funktioniert gleich wie In diesem Beispiel: -``` +```nu foo { line1 line2; line3 | line4 diff --git a/de/book/working_with_lists.md b/src/content/docs/de/book/nu-fundamentals/working_with_lists.md similarity index 99% rename from de/book/working_with_lists.md rename to src/content/docs/de/book/nu-fundamentals/working_with_lists.md index cd8d7aeb0a4..e424979a92b 100644 --- a/de/book/working_with_lists.md +++ b/src/content/docs/de/book/nu-fundamentals/working_with_lists.md @@ -1,4 +1,6 @@ -# Mit Listen arbeiten +--- +title: Mit Listen arbeiten +--- ## Listen erstellen diff --git a/de/book/working_with_strings.md b/src/content/docs/de/book/nu-fundamentals/working_with_strings.md similarity index 99% rename from de/book/working_with_strings.md rename to src/content/docs/de/book/nu-fundamentals/working_with_strings.md index 681cc486835..4bf8f9accd0 100644 --- a/de/book/working_with_strings.md +++ b/src/content/docs/de/book/nu-fundamentals/working_with_strings.md @@ -1,4 +1,6 @@ -# Mit Text arbeiten +--- +title: Mit Text arbeiten +--- Texte können ganz verschiedene Formen von Daten annehmen. Es können Dateinamen, Verzeichniss-Pfade, Spaltennamen und vieles mehr sein. diff --git a/de/book/working_with_tables.md b/src/content/docs/de/book/nu-fundamentals/working_with_tables.md similarity index 98% rename from de/book/working_with_tables.md rename to src/content/docs/de/book/nu-fundamentals/working_with_tables.md index 22d42d8f38e..30ac1bfb8ac 100644 --- a/de/book/working_with_tables.md +++ b/src/content/docs/de/book/nu-fundamentals/working_with_tables.md @@ -1,11 +1,13 @@ -# Mit Tabellen arbeiten +--- +title: Mit Tabellen arbeiten +--- Eine der häufigsten Arten mit Daten zu arbeiten geschieht in Nu durch Tabelle. Nu stellt diverse Befehle zur Verfügung, um mit Tabelle auf einfache Art die Daten zu finden und zu filtern, die benötigt werden. Um zu starten, wird eine Tabelle benötigt wie diese: -``` +```nu > ls ───┬───────────────┬──────┬─────────┬──────────── # │ name │ type │ size │ modified @@ -25,7 +27,7 @@ Um zu starten, wird eine Tabelle benötigt wie diese: Um eine Tabelle zu sortieren, wird der [`sort-by`](/commands/docs/sort-by.md) Befehl verwendet, dem mitgeteilt wird, nach welcher Spalte sortiert werden soll. Hier wird sortiert nach der Grösse der Dateien: -``` +```nu > ls | sort-by size ───┬───────────────┬──────┬─────────┬──────────── # │ name │ type │ size │ modified @@ -48,7 +50,7 @@ Das Beispiel oben hätte auch nach "name", "accessed" oder "modified" sortiert w Von einer Tabelle können einzelne Spalten und Zeilen ausgewählt werden. Mit dem [`select`](/commands/docs/select.md) Befehl werden hier einige Spalten gewählt. -``` +```nu > ls | select name size ───┬───────────────┬───────── # │ name │ size @@ -66,7 +68,7 @@ Mit dem [`select`](/commands/docs/select.md) Befehl werden hier einige Spalten g Damit wird eine Tabelle kreiert, die sich auf das Wesentliche beschränkt. Als nächstes sollen nur die 5 kleinsten Dateien aus diesem Verzeichnis enthalten sein: -``` +```nu > ls | sort-by size | first 5 ───┬──────────────┬──────┬────────┬──────────── # │ name │ type │ size │ modified @@ -83,7 +85,7 @@ Zuerst wird die Tabelle nach grösse sortiert, um die kleinsten Dateien zuoberst Mit `skip` können ebenfalls Zeilen entfernt werden, die unerwünscht sind. Hier die ersten 2 der 5 aus dem obigen Beispiel: -``` +```nu > ls | sort-by size | first 5 | skip 2 ───┬───────────┬──────┬────────┬──────────── # │ name │ type │ size │ modified @@ -99,7 +101,7 @@ So konnten die 3 Zeilen extrahiert werden, die uns interessieren. In allen Tabellen sind die Zeilen nummeriert. Dies ermöglicht eine einfache Art, die einzelnen Zeilen verwenden zu können. Im folgenden wird zuerst nach dem Namen sortiert, und dann die 5. Zeile mit dem `select` Befehl über die Zeilennummer ausgewählt: -``` +```nu > ls | sort-by name ───┬───────────────┬──────┬─────────┬──────────── # │ name │ type │ size │ modified @@ -127,7 +129,7 @@ Bisher wurde die Tabelle auf die benötigten Inhalte getrimmt. Im nächsten Schritt soll angeschaut werden, wie wir den Inhalt anstelle der Tabelle herausziehen können. Zum Beispiel wenn eine Liste der Namen aller Dateien erstellt werden soll. Dafür steht der [`get`](/commands/docs/get.md) Befehl bereit: -``` +```nu > ls | get name ───┬─────────────── 0 │ files.rs @@ -144,7 +146,7 @@ Damit erhalten wir die Werte aller Dateinamen als Liste. Dies sieht fast so aus, wie der [`select`](/commands/docs/select.md) Befehl weiter oben, deshalb hier die beiden nebeneinander: -``` +```nu > ls | select name ───┬─────────────── # │ name @@ -178,7 +180,7 @@ In Nu wird dadurch nicht die Tabelle direkt geändert, sondern jeder Befehl gene Mit [`append`](/commands/docs/append.md) können Spalten gleichen Namens zusammengeführt werden: -``` +```nu > let $first = [[a b]; [1 2]] > let $second = [[a b]; [3 4]] > $first | append $second @@ -194,7 +196,7 @@ Mit [`append`](/commands/docs/append.md) können Spalten gleichen Namens zusamme Mit dem [`merge`](/commands/docs/merge.md) Befehl werden zwei oder mehr Tabellen zusammengeführt. -``` +```nu > let $first = [[a b]; [1 2]] > let $second = [[c d]; [3 4]] > $first | merge { $second } @@ -207,13 +209,13 @@ Mit dem [`merge`](/commands/docs/merge.md) Befehl werden zwei oder mehr Tabellen Wird eine dritte Tabelle generiert: -``` +```nu > let $third = [[e f]; [5 6]] ``` Können nun alle drei Tabellen zusammengeführt werden wie hier: -``` +```nu > $first | merge { $second } | merge { $third } ───┬───┬───┬───┬───┬───┬─── # │ a │ b │ c │ d │ e │ f @@ -224,7 +226,7 @@ Können nun alle drei Tabellen zusammengeführt werden wie hier: Oder mit dem [`reduce`](/commands/docs/reduce.md) Befehl alle dynamisch gemerged: -``` +```nu > [$first $second $third] | reduce {|it, acc| $acc|merge { $it }} ───┬───┬───┬───┬───┬───┬─── # │ a │ b │ c │ d │ e │ f @@ -238,7 +240,7 @@ Oder mit dem [`reduce`](/commands/docs/reduce.md) Befehl alle dynamisch gemerged Mit dem [`insert`](/commands/docs/insert.md) Befehl wird eine neue Spalte hinzugefügt. Wie zum Beispiel: -``` +```nu > open rustfmt.toml ─────────┬────── edition │ 2018 @@ -247,7 +249,7 @@ Wie zum Beispiel: wird eine Spalte namens "next_edition" mit dem Wert 2021 hinzugefügt: -``` +```nu > open rustfmt.toml | insert next_edition 2021 ──────────────┬────── edition │ 2018 @@ -257,7 +259,7 @@ wird eine Spalte namens "next_edition" mit dem Wert 2021 hinzugefügt: Öffnen wir die originale Datei erneut, bleibt der Inhalt der alte: -``` +```nu > open rustfmt.toml ─────────┬────── edition │ 2018 @@ -268,7 +270,7 @@ wird eine Spalte namens "next_edition" mit dem Wert 2021 hinzugefügt: Es ist deshalb möglich, mehrere Änderungen in der Pipeline vorzunehmen, bevor diese bereit sind um gesichert zu werden. Zum Sichern können wir, wie in diesem Beispiel, den [`save`](/commands/docs/save.md) Befehl verwenden: -``` +```nu > open rustfmt.toml | insert next_edition 2021 | save rustfmt2.toml > open rustfmt2.toml ──────────────┬────── @@ -282,7 +284,7 @@ Zum Sichern können wir, wie in diesem Beispiel, den [`save`](/commands/docs/sav Ähnlich dem [`insert`](/commands/docs/insert.md) Befehl, kann mit [`update`](/commands/docs/update.md) der Inhalt einer Spalte geändert werden. Auf die selbe Datei angewendet, sieht das so aus: -``` +```nu > open rustfmt.toml ─────────┬────── edition │ 2018 @@ -291,7 +293,7 @@ Auf die selbe Datei angewendet, sieht das so aus: Und nun das Update auf die nächste Edition, die unterstützt werden soll: -``` +```nu > open rustfmt.toml | update edition 2021 ─────────┬────── edition │ 2021 @@ -305,7 +307,7 @@ Mit dem [`upsert`](/commands/docs/upsert.md) Befehl wird der Wert enweder eingef Mit [`move`](/commands/docs/move.md) werden Spalten in de Tabelle verschoben. Um zum Bespiel die Spalte "name" von "ls" nach der Spalte "size" erschienen zu lassen, schreibt man: -``` +```nu > ls | move name --after size ╭────┬──────┬─────────┬───────────────────┬──────────────╮ │ # │ type │ size │ name │ modified │ @@ -323,7 +325,7 @@ erschienen zu lassen, schreibt man: Um Spalten einen neuen Name zu geben, wird der Befehl [`rename`](/commands/docs/rename.md) verwendet. Wie zum Beispiel hier nach der Verwendung von `ls`. -``` +```nu > ls | rename filename filetype filesize date ╭────┬───────────────────┬──────────┬──────────┬──────────────╮ │ # │ filename │ filetype │ filesize │ date │ diff --git a/de/book/nu_as_a_shell.md b/src/content/docs/de/book/nu_as_a_shell.md similarity index 95% rename from de/book/nu_as_a_shell.md rename to src/content/docs/de/book/nu_as_a_shell.md index 71f84767287..a3b19cd210a 100644 --- a/de/book/nu_as_a_shell.md +++ b/src/content/docs/de/book/nu_as_a_shell.md @@ -1,4 +1,6 @@ -# Nu als Shell +--- +title: Nushell als Shell +--- Die Kapitel [Nu Grundlagen](nu_fundamentals.md) und [Programmieren in Nu](programming_in_nu.md) fokusieren sich vor allem auf den Programmiersprach-Aspekt von Nushell. @@ -25,6 +27,6 @@ Es ist auch möglich, eigene [Signaturen für externe Befehle](externs.md) zu de [Farben und Themen in Nu](coloring_and_theming.md)) geht ins Detail zum Thema, wie Nushells Aussehen konfiguriert werden kann. -Sind einige Befehle geplant , die im Hintergrund ablaufen sollen, so kann darüber in [Hintergrund Tasks in Nu](background_task.md) nachgelesen werden. +Sind einige Befehle geplant , die im Hintergrund ablaufen sollen, so kann darüber in [Hintergrund Tasks in Nu](background_task.md) nachgelesen werden. Schliesslich erklärt [Hooks](hooks.md) wie Fragmente von Nushell Code beim Auftreten gewisser Ereignisse ausgeführt werden kann. diff --git a/de/book/nu_fundamentals.md b/src/content/docs/de/book/nu_fundamentals.md similarity index 98% rename from de/book/nu_fundamentals.md rename to src/content/docs/de/book/nu_fundamentals.md index 998b5d69e98..428c3b2acb8 100644 --- a/de/book/nu_fundamentals.md +++ b/src/content/docs/de/book/nu_fundamentals.md @@ -1,4 +1,6 @@ -# Nu Grundlagen +--- +title: Nu Grundlagen +--- In diesem Kapitel sind die Grundlagen der Nushell Programmiersprache erklärt. Damit sollte es möglich sein, einfache Nushell Programme zu schreiben. diff --git a/de/book/aliases.md b/src/content/docs/de/book/programming-in-nu/aliases.md similarity index 93% rename from de/book/aliases.md rename to src/content/docs/de/book/programming-in-nu/aliases.md index a197100ac1b..c98057da6e1 100644 --- a/de/book/aliases.md +++ b/src/content/docs/de/book/programming-in-nu/aliases.md @@ -1,22 +1,24 @@ -# Aliase +--- +title: Aliase +--- Aliase in Nushell bieten eine einfache Möglichkeit, um Texte zur ersetzen. Damit ist es möglich, einen Kurznamen für längere Befehle zu definieren - inklusive der Argumente. Beispielsweise kann ein Alias namens `ll` definiert werden, der den längeren Befehl `ls -l` ersetzt: -``` +```nu > alias ll = ls -l ``` Nun kann der Alias aufgerufen werden: -``` +```nu > ll ``` Wenn das getan wird, wirkt es, als sei `ls -l` aufgerufen worden. Das bietet auch die Möglichkeit weitere Parameter anzugeben. So kann auch geschrieben werden: -``` +```nu > ll -a ``` @@ -33,9 +35,9 @@ Um Aliase dauerhaft zu speichern muss man sie nur in die Datei _config.nu_ einf ## Shell pipes in Aliases Achtung: Der Alias `alias uuidgen = uuidgen | tr A-F a-f` (um das verhalten von `uuidgen` auf Mac an Linux anzugleichen) funktioniert nicht. -Die Lösung ist einen parameterlosen Befehl zu definieren, der das Systemprogramm `uuidgen` mit Hilfe von `^` aufruft. +Die Lösung ist einen parameterlosen Befehl zu definieren, der das Systemprogramm `uuidgen` mit Hilfe von `^` aufruft. -``` +```nu def uuidgen [] { ^uuidgen | tr A-F a-f } ``` @@ -43,7 +45,7 @@ Mehr dazu im Kapitel [Eigene Befehle](custom_commands.md). Oder ein etwas idiomatischeres Beispiel von nushell internen Befehlen -``` +```nu def lsg [] { ls | sort-by type name -i | grid -c | str trim } ``` diff --git a/de/book/command_signature.md b/src/content/docs/de/book/programming-in-nu/command_signature.md similarity index 96% rename from de/book/command_signature.md rename to src/content/docs/de/book/programming-in-nu/command_signature.md index d01e1afdbfc..68c22d67ae5 100644 --- a/de/book/command_signature.md +++ b/src/content/docs/de/book/programming-in-nu/command_signature.md @@ -1,8 +1,10 @@ -# Befehls Signatur +--- +title: Befehls Signatur +--- Nu Befehle enthalten einen Signatur Abschnitt. Zum Beispiel wie hier in [`str distance`](/commands/docs/str_distance.md): -``` +```nu Signatures(Cell paths are supported): <string> | str distance <string> -> <int> ``` @@ -12,7 +14,7 @@ Der erste Typenname vor dem `|` beschreibt den Typ der Eingangs-Pipeline. Nach d Hier ein weiteres Beispiel, [`str join`](/commands/docs/str_join.md): -``` +```nu Signatures: list<string> | str join <string?> -> <string> ``` diff --git a/de/book/custom_commands.md b/src/content/docs/de/book/programming-in-nu/custom_commands.md similarity index 97% rename from de/book/custom_commands.md rename to src/content/docs/de/book/programming-in-nu/custom_commands.md index 61e8da6258b..81a412b3c61 100644 --- a/de/book/custom_commands.md +++ b/src/content/docs/de/book/programming-in-nu/custom_commands.md @@ -1,4 +1,6 @@ -# Eigene Befehle +--- +title: Eigene Befehle +--- Die Fähigkeit von Nu, lange Pipelines zu verarbeiten, erlauben es große Kontrolle über Daten und das System zu haben. Das Ganze kommt allerdings zum Preis von viel Tipparbeit. Idealerweise sollte es eine Möglichkeit geben, mühsam gebaute Pipelines zu speichern und wieder und wieder auszuführen. @@ -6,7 +8,7 @@ Hier kommen eigene Befehle ins Spiel. Eine beispielhafte Definition eines eigenen Befehls sieht wie folgt aus: -```nushell +```nu def greet [name] { echo "hello" $name } @@ -16,13 +18,13 @@ In dieser Definition, wird ein Befehl `greet` beschrieben, der einen Parameter ` Um den obigen Befehl auszuführen wird er wie ein eingebauter Befehl aufgerufen: -``` +```nu > greet "world" ``` Wenn das getan wird, wird eine Ausgabe erzeugt, die wie die der eingebauten Befehle aussieht: -``` +```nu ───┬─────── 0 │ hello 1 │ world @@ -39,7 +41,7 @@ _Hinweis: Es wird empfohlen Worte in Befehlen mit `-` zur besseren Lesbarkeit zu Es ist auch möglich Unterbefehle zu definieren. Dazu wird der Unterbefehl vom Superbefehl durch ein Leerzeichen getrennt. Wenn beispielsweise der Befehl `str` durch einen Unterbefehl `mycommand` erweitert werden soll, funktioniert das wie folgt: -```nushell +```nu def "str mycommand" [] { echo hello } @@ -47,7 +49,7 @@ def "str mycommand" [] { Jetzt kann der eigene Unterbefehl aufgerufen werden, als ob er ein eingebauter Befehl von `str` wäre: -``` +```nu > str mycommand ``` @@ -55,7 +57,7 @@ Jetzt kann der eigene Unterbefehl aufgerufen werden, als ob er ein eingebauter B Wenn eigene Befehle definiert werden, kann optional auch der Typ jedes Parameters angegeben werden. Das obige Beispiel kann beispielsweise wie folgt abgeändert werden: -```nushell +```nu def greet [name: string] { echo "hello" $name } @@ -65,7 +67,7 @@ Die Typen der Parameter anzugeben ist optional. Nushell erlaubt es diese wegzula Beispielhaft soll nur noch ein `int` als Typ erlaubt sein: -```nushell +```nu def greet [name: int] { echo "hello" $name } @@ -75,7 +77,7 @@ greet world Wenn versucht wird, den oberen Code auszuführen, wird Nu darauf aufmerksam machen, dass die Typen nicht passen und die Ausführung stoppen: -``` +```nu error: Type Error ┌─ shell:6:7 │ @@ -116,7 +118,7 @@ Zusätzlich zu den obigen Parametern, können auch namenabhängige Parameter ver Zum Beispiel: -```nushell +```nu def greet [ name: string --age: int @@ -129,19 +131,19 @@ In der obigen Definition von `greet`, werden ein fester Parameter `name` und ein Das obige Beispiel kann wie folgt aufgerufen werden: -``` +```nu > greet world --age 10 ``` Oder: -``` +```nu > greet --age 10 world ``` Oder gleich ganz ohne Flag: -``` +```nu > greet world ``` @@ -149,7 +151,7 @@ Flags können auch so definiert werden, dass es eine Kurzform gibt. Das erlaubt Das Beispiel wird hier, um eine Kurzform für die Flag `age` erweitert: -```nushell +```nu def greet [ name: string --age (-a): int @@ -162,7 +164,7 @@ _Hinweis:_ Flags sind benannt nach der langen Form des Namens. Im obigen Beispie Nun kann diese neue Version von `greet` wie folgt aufgerufen werden: -``` +```nu > greet -a 10 hello ``` @@ -172,7 +174,7 @@ Um Nutzern eines eigenen Befehls zu helfen, können diese und ihre Parameter mit Es wird weiterhin das obige Beispiel verwendet: -```nushell +```nu def greet [ name: string --age (-a): int @@ -183,7 +185,7 @@ def greet [ Wenn der Befehl definiert ist kann `help greet` aufgerufen werden, um Informationen zum Befehl zu erhalten: -``` +```nu Usage: > greet <name> {flags} @@ -199,7 +201,7 @@ Wie zu sehen ist, werden der Parameter und die Flag, die definiert wurden, aufge Um diese Hilfe zu verbessern, können Beschreibungen zur Definition hinzugefügt werden: -```nushell +```nu # A greeting command that can greet the caller def greet [ name: string # The name of the person to greet @@ -213,7 +215,7 @@ Diese Kommentare, die zur Definition und den Parametern hinzugefügt wurden, wer Wenn jetzt `help greet` ausgeführt wird, wird ein hilfreicherer Text angezeigt: -``` +```nu A greeting command that can greet the caller Usage: @@ -231,13 +233,13 @@ Flags: Eigene Befehle streamen ihre Ausgabe gleich wie eingebaute Befehle. Beispielsweise soll die folgende Pipeline umgebaut werden: -```nushell +```nu > ls | get name ``` `ls` soll jetzt in einen neuen, eigenen Befehl verschoben werden: -```nushell +```nu def my-ls [] { ls } ``` @@ -260,7 +262,7 @@ Eigene Befehle können, wie andere Befehle, auch Eingaben verarbeiten. Diese Ein Hier soll nun beispielhaft ein eigener echo-Befehl definiert werden, der eine weitere Zeile nach jeder Zeile der Eingabe ausgibt: -```nushell +```nu def my-echo [] { each { echo $it "--" @@ -270,7 +272,7 @@ def my-echo [] { Wenn dieser neue Befehl nun in einer Pipeline aufgerufen wird, sieht die Ausgabe wie folgt aus: -``` +```nu > echo foo bar | my-echo ───┬───── 0 │ foo diff --git a/de/book/operators.md b/src/content/docs/de/book/programming-in-nu/operators.md similarity index 91% rename from de/book/operators.md rename to src/content/docs/de/book/programming-in-nu/operators.md index b66218db677..8148d714605 100644 --- a/de/book/operators.md +++ b/src/content/docs/de/book/programming-in-nu/operators.md @@ -1,39 +1,40 @@ -# Operatoren +--- +title: Operatoren +--- Nushell unterstützt folgende Operatoren für gängige Mathematik, Logik und Text Operationen: -| Operator | Beschreibung | -| ------------- | ------------------------------------------------------- | -| `+` | addieren | -| `-` | subtrahieren | -| `*` | multiplizieren | -| `/` | dividieren | -| `//` | Abrundungs Division | -| `mod` | Modulo | -| `**` | potenzieren | -| `==` | gleich | -| `!=` | ungleich | -| `<` | kleiner als | -| `<=` | kleiner gleich | -| `>` | grösser als | -| `>=` | grösser gleich | -| `=~` | regex Vergleich / Text enthält | -| `!~` | inverser regex Vergleich / Text enthält *nicht* | -| `in` | Wert in Liste enthalten | -| `not-in` | Wert nicht in Liste enthalten | -| `not` | Logisches Nein | -| `and` | und zweier bool Ausdrücke (short-circuits) | -| `or` | oder zweier bool Ausdrücke (short-circuits) | -| `xor` | exclusives oder zweier bool Ausdrücke | -| `bit-or` | bitweises oder | -| `bit-xor` | bitweises xor | -| `bit-and` | bitweises und | -| `bit-shl` | bitweises shift links | -| `bit-shr` | bitweises shift rechts | -| `starts-with` | Text startet mit | -| `ends-with` | Text endet mit | -| `++` | an Listen anfügen | - +| Operator | Beschreibung | +| ------------- | ----------------------------------------------- | +| `+` | addieren | +| `-` | subtrahieren | +| `*` | multiplizieren | +| `/` | dividieren | +| `//` | Abrundungs Division | +| `mod` | Modulo | +| `**` | potenzieren | +| `==` | gleich | +| `!=` | ungleich | +| `<` | kleiner als | +| `<=` | kleiner gleich | +| `>` | grösser als | +| `>=` | grösser gleich | +| `=~` | regex Vergleich / Text enthält | +| `!~` | inverser regex Vergleich / Text enthält _nicht_ | +| `in` | Wert in Liste enthalten | +| `not-in` | Wert nicht in Liste enthalten | +| `not` | Logisches Nein | +| `and` | und zweier bool Ausdrücke (short-circuits) | +| `or` | oder zweier bool Ausdrücke (short-circuits) | +| `xor` | exclusives oder zweier bool Ausdrücke | +| `bit-or` | bitweises oder | +| `bit-xor` | bitweises xor | +| `bit-and` | bitweises und | +| `bit-shl` | bitweises shift links | +| `bit-shr` | bitweises shift rechts | +| `starts-with` | Text startet mit | +| `ends-with` | Text endet mit | +| `++` | an Listen anfügen | Klammern können verwendet werden, um mathematische Ausdrücke zu gruppieren. Das erlaubt es `(1 + 2) * 3` zu verwenden, um beispielsweise die Addition vor der Multiplikation auszuführen. @@ -55,7 +56,7 @@ Mathematische Operationen werden in der folgenden Reihenfolge ausgewertet (von d - Logisches oder (`||`, `or`) - Zuweisungs Operationen -``` +```nu > 3 * (1 + 2) 9 ``` @@ -64,7 +65,8 @@ Mathematische Operationen werden in der folgenden Reihenfolge ausgewertet (von d Nicht alle Operationen ergeben für alle Datentypen Sinn. Wenn eine Operation auf einen nicht kompatiblen Datentyp angewendet werden soll, wird ein Fehler ausgegeben, der erklären soll, was falsch gelaufen ist: -``` + +```nu > "spam" - 1 Error: nu::parser::unsupported_operation (link) diff --git a/de/book/overlays.md b/src/content/docs/de/book/programming-in-nu/overlays.md similarity index 97% rename from de/book/overlays.md rename to src/content/docs/de/book/programming-in-nu/overlays.md index c5d6400ff01..eede37d5aa3 100644 --- a/de/book/overlays.md +++ b/src/content/docs/de/book/programming-in-nu/overlays.md @@ -1,5 +1,6 @@ -# Überlagerungen - +--- +title: Überlagerungen +--- Überlagerungen operieren als "Schichten" von Definitionen (Eigene Befehle, Aliase, Umgebungsvariablen), welche aktiviert und deaktiviert werden können. @@ -15,7 +16,7 @@ Am Anfang sollte dort der die Standard-Überlagerung gelistet sein. Um eine neue Überlagerung zu kreieren, wird zuerst ein Modul benötigt: -``` +```nu > module spam { export def foo [] { "foo" @@ -33,7 +34,7 @@ Dieses Modul wird im ganzen Kapitel verwendet, also wenn immer `overlay use spam Um die Überlagerung zu generieren, wird [`overlay use`](/commands/docs/overlay_use.md) aufgerufen: -``` +```nu > overlay use spam > foo @@ -55,7 +56,7 @@ baz Dies hat die Definition des Moduls in den aktuellen Gültigkeitsbereich gebracht und den [`export-env`](/commands/docs/export-env.md) Block ausgewertet. Genau so wie dies auch der [`use`](/commands/docs/use.md) Befehl tut. (see [Modules](modules.md#environment-variables) chapter) -::: tip +:::tip Im folgenden Abschnitt wird der `>` prompt mit dem Namen des zuletzt aktivierten Überlagerung vorangestellt. `(spam)> some-command` bedeutet, die `spam` Überlagerung ist die zuletzt aktive Überlagerung wenn der Befehl eingegeben wurde. ::: @@ -64,7 +65,7 @@ Im folgenden Abschnitt wird der `>` prompt mit dem Namen des zuletzt aktivierten Wenn die Überlagerung nicht mehr benötigt wird, entfernt sie der Befehl [`overlay hide`](/commands/docs/overlay_remove.md): -``` +```nu (spam)> overlay hide spam (zero)> foo @@ -79,7 +80,7 @@ Error: Can't run executable... Überlagerungen haben ebenfalls einen Gültigkeitsbereich. Jede hinzugefügte Überlagerung wird entfernt, wenn der Gütligkeitsbereich endet: -``` +```nu (zero)> do { overlay use spam; foo } # Überlagerung ist aktiv innerhalb des Blocks foo @@ -95,7 +96,7 @@ Wird der Befehl [`overlay hide`](/commands/docs/overlay_remove.md) ohne Argument Eine neue Definition (Befehl, Alias, Umgebungsvariable) wird in der zuletzt aktivierten Überlagerung aufgezeichnet: -``` +```nu (zero)> overlay use spam (spam)> def eggs [] { "eggs" } @@ -104,7 +105,7 @@ Eine neue Definition (Befehl, Alias, Umgebungsvariable) wird in der zuletzt akti Der `eggs` Befehl gehört zur `spam` Überlagerung. Wird diese entfernt, ist auch der Befehl nicht mehr aufrufbar: -``` +```nu (spam)> overlay hide spam (zero)> eggs @@ -113,7 +114,7 @@ Error: Can't run executable... Er ist jedoch nicht verloren! -``` +```nu (zero)> overlay use spam (spam)> eggs @@ -123,11 +124,11 @@ eggs Überlagerungen speichern die Informationen, die ihnen übergeben werden, auch wenn die Überlagerung entfernt wird. So kann mehrfach zwischen verschiedenen Kontexten gewechselt werden. -::: tip +:::tip Es gibt Momente, in denen Definitionen nicht zu einer Überlagerung hinzugefügt werden sollen. Die Lösung dafür ist, eine leere Überlagerung zu erstellen und die Definitionen temporär nur dort zu speichern: -``` +```nu (zero)> overlay use spam (spam)> module scratchpad { } @@ -141,7 +142,7 @@ Der `eggs` Befehl wird zu `scratchpad` hinzugefügt, während `spam` intakt blei Um dies weniger wortreich zu machen, reicht der Befehl [`overlay new`](/commands/docs/overlay_new.md): -``` +```nu (zero)> overlay use spam (spam)> overlay new scratchpad @@ -157,7 +158,7 @@ Der [`overlay use`](/commands/docs/overlay_use.md) Befehl übernimmt alle Befehl Sie können jedoch auch als Unterbefehl hinter dem Modulnamen stehen. Dafür ist das `--prefix` Argument da: -``` +```nu (zero)> module spam { export def foo [] { "foo" } } @@ -174,7 +175,7 @@ Dies gilt jedoch nicht für Umgebungsvariablen. Der Name einer Überlagerung kann mit `as` geändert werden: -``` +```nu (zero)> module spam { export def foo [] { "foo" } } (zero)> overlay use spam as eggs @@ -194,7 +195,7 @@ um dieser einen Namen zu geben, der sie besser beschreibt. Manchmal ist es nicht gewünscht, dass Definitionen, die in einer Überlagerungen gemacht wurden, verloren gehen, wenn diese entfernt wird: -``` +```nu (zero)> overlay use spam (spam)> def eggs [] { "eggs" } @@ -210,7 +211,7 @@ Das `--keep-custom` Argument macht genau das. Es ist auch möglich, eine Liste von Umgebungsvariablen, welche in der Überlagerung definiert wurden, zu behalten, und den Rest zu entfernen. Dafür wird das `--keep-env` Argument verwendet: -``` +```nu (zero)> module spam { export def foo [] { "foo" } export-env { $env.FOO = "foo" } @@ -233,7 +234,7 @@ foo Wenn mehrere Überlagerungen die gleiche Definition enthalten, z.B. `foo`, dann wird die der zuletzt aktivierten verwendet. Um eine Überlagerung im Stapel nach oben zu bringen, wird einfach der Befehl [`overlay use`](/commands/docs/overlay_use.md) nochmals aufgerufen: -``` +```nu (zero)> def foo [] { "foo-in-zero" } (zero)> overlay use spam diff --git a/de/book/scripts.md b/src/content/docs/de/book/programming-in-nu/scripts.md similarity index 95% rename from de/book/scripts.md rename to src/content/docs/de/book/programming-in-nu/scripts.md index b6b4e47720e..33d1adabb36 100644 --- a/de/book/scripts.md +++ b/src/content/docs/de/book/programming-in-nu/scripts.md @@ -1,23 +1,24 @@ -# Skripte +--- +title: Skripte +--- In Nushell können Skripte geschrieben und ausgeführt werden, welche in der Nushell Sprache geschrieben sind. Um ein Skript auszuführen, wird es dem Befehl `nu` als Argument übergeben: -``` +```nu > nu myscript.nu ``` Dies wird das Skript bis zum Ende in einer neuen Nuinstanz ausführen. Das Skript kann auch in der _aktuellen_ Instanz ausgeführt werden mit dem [`source`](/commands/docs/source.md) Befehl: -``` +```nu > source myscript.nu ``` Hier ein Beispiel einer Skript Datei: -``` -# myscript.nu +```nu title="myscript.nu" def greet [name] { echo "hello" $name } @@ -29,7 +30,7 @@ Eine Skriptdatei definiert eigene Befehle genauso wie die Main Routine, welche a Im obigen Beispiel wird `greet` zuerst definiert vom Nushell Interpreter. Dies erlaubt den späteren Aufruf der Definition. Das Skript hätte auch geschrieben werden können als: -``` +```nu greet "world" def greet [name] { @@ -50,7 +51,7 @@ Nachdem die Definitionen ausgeführt wurden, werden von oben nach unten alle Bef Um besser zu verstehen wie Nushell die Linien im Code versteht, hier ein Beispiel: -``` +```nu a b; c | d ``` @@ -66,15 +67,13 @@ Argumente werden an ein Skript übergeben indem sie nach dem Skriptnamen angefü Zum Beispiel: -```nu -# myscript.nu - +```nu title="myscript.nu" def main [x: int] { $x + 10 } ``` -``` +```nu > nu myscript.nu 100 110 ``` @@ -85,12 +84,12 @@ Auf Linux und macOS kann optional ein [shebang](<https://en.wikipedia.org/wiki/S um dem OS mitzuteilen, wie die Datei interpretiert werden will. Hier zum Beispiel in einer Datei mit dem Damen `myscript`: -``` +```nu #!/usr/bin/env nu echo "Hello World!" ``` -``` +```nu > ./myscript Hello World! ``` diff --git a/de/book/variables_and_subexpressions.md b/src/content/docs/de/book/programming-in-nu/variables_and_subexpressions.md similarity index 97% rename from de/book/variables_and_subexpressions.md rename to src/content/docs/de/book/programming-in-nu/variables_and_subexpressions.md index 9f60586f4e1..4b56c598194 100644 --- a/de/book/variables_and_subexpressions.md +++ b/src/content/docs/de/book/programming-in-nu/variables_and_subexpressions.md @@ -1,4 +1,6 @@ -# Variablen und Unterausdrücke +--- +title: Variablen und Unterausdrücke +--- Es gibt zwei Arten von auszuwertenden Ausdrücken in Nushell: Variablen und Unterausdrücke. Diese werden durch das Dollar Symbol (`$`) eingeleitet. Das gibt den Hinweis, dass Nushell an dieser Stelle einen Ausdruck auswerten muss, um einen Wert zu erhalten, der für die Ausführung eines gesamten Befehls benötigt wird. Beide Formen des Ausdrucks haben eine einfache Variante und eine 'Pfad'-Variante, wenn mit komplexeren Daten gearbeitet wird. @@ -8,7 +10,7 @@ Die einfachere Variante der auszuwertenden Ausdrücke ist die Variable. Während Wenn eine Variable erzeugt wurde, kann der Inhalt dieser Variable ausgegeben werden, indem `$` vor dem Variablennamen verwendet wird: -``` +```nu > let my_value = 4 > echo $my_value 4 @@ -18,13 +20,13 @@ Wenn eine Variable erzeugt wurde, kann der Inhalt dieser Variable ausgegeben wer Ein Pfad einer Variable funktioniert ähnlich wie ein strukturierter Datentyp. Es kann mittels Referenzen auf den Inhalt der Variable beziehungsweise die Spalten in der Variable zugegriffen werden, um final bei einem bestimmten Wert zu landen. Wenn beispielsweise anstatt der `4` im obigen Beispiel, der Variablen eine Tabelle zugewiesen wurde: -``` +```nu > let my_value = [[name]; [testuser]] ``` Hier kann ein Pfad der Variable `$my_value` verwendet werden, um den Wert der Spalte `name` in nur einem Schritt zu bekommen: -``` +```nu > echo $my_value.name testuser ``` @@ -37,7 +39,7 @@ Die Klammern enthalten eine Pipeline, die bis zum Ende durchlaufen wird und dere Unterausdrücke können auch ganze Pipelines statt nur einzelner Befehle enthalten. Um eine Liste von Dateien mit einer Größe größer als 10 Kilobytes zu bekommen, kann die folgende Pipeline verwendet und einer Variable zugewiesen werden: -``` +```nu > let names_of_big_files = (ls | where size > 10kb) > echo $names_of_big_files ───┬────────────┬──────┬──────────┬────────────── @@ -52,13 +54,13 @@ Unterausdrücke können auch ganze Pipelines statt nur einzelner Befehle enthalt Unterausdrücke unterstützen auch Pfade. Um beispielsweise eine Liste der Dateinamen im aktuellen Ordner zu bekommen, kann diese Pipeline verwendet werden: -``` +```nu > ls | get name ``` Dasselbe Ergebnis kann auch in nur einem Schritt erreicht werden, indem ein Unterausdruck mit Pfad verwendet wird: -``` +```nu > echo (ls).name ``` @@ -68,13 +70,13 @@ Welcher Stil gewählt wird, hängt vom Anwendungsfall und den persönlichen Vorl Nushell erlaubt den Zugriff auf Spalten in Tabellen in Unterausdrücken durch einfache Short-Hands. Wenn beispielsweise nur Zeilen in `ls` angezeigt werden sollen, in der die Größe der Datei größer als 10 Kilobytes ist, kann der folgende Befehl verwendet werden: -``` +```nu > ls | where size > 10kb ``` `where size > 10kb` ist ein Befehl mit zwei Teilen: Dem Befehlsnamen `where` und dem short-hand Ausdruck `size > 10kb`. Hier wird auch klar, warum das Ganze short-hand heißt: `size` ist hier die gekürzte Version von `$it.size`. Das Ganze könnte auch mit einer der folgenden ausführlicheren Varianten erreicht werden: -``` +```nu > ls | where $it.size > 10kb > ls | where ($it.size > 10kb) > ls | where {|$it| $it.size > 10kb } diff --git a/de/book/programming_in_nu.md b/src/content/docs/de/book/programming_in_nu.md similarity index 98% rename from de/book/programming_in_nu.md rename to src/content/docs/de/book/programming_in_nu.md index 29371228d39..13161afb3c6 100644 --- a/de/book/programming_in_nu.md +++ b/src/content/docs/de/book/programming_in_nu.md @@ -1,4 +1,6 @@ -# Programmieren in Nu +--- +title: Programmieren in Nu +--- Dieses Kapitel geht mehr ins Detail, wie mit Nushell programmiert werden kann. Jedes grössere Sprach-Merkmal hat sein eigenes Kapitel. diff --git a/src/content/docs/de/index.mdx b/src/content/docs/de/index.mdx new file mode 100644 index 00000000000..6b7a6b66e93 --- /dev/null +++ b/src/content/docs/de/index.mdx @@ -0,0 +1,49 @@ +--- +title: Nushell +description: Eine neue Art von Shell +template: splash +editUrl: true +lastUpdated: false +hero: + tagline: Eine neue Art von Shell + actions: + - text: Get Started + link: /introduction/ + icon: right-arrow + variant: primary + - text: View on GitHub + link: https://github.com/nushell/nushell.github.io + icon: external +--- + +import { Card, CardGrid } from "@astrojs/starlight/components"; + +<CardGrid> + <Card title="Pipelines um jedes Betriebssystem zu steuern"> + Nu läuft auf Linux, macOS und Windows. Einmal lernen - überall verwenden. + </Card> + <Card title="Alles sind Daten"> + Pipelines in Nu nutzen strukturierte Daten die einfach ausgewählt, gefiltert + und sortiert werden können. Nie wieder Strings parsen, sondern direkt + anfangen Probleme zu lösen. + </Card> + <Card title="Leistungsfähige Plugins"> + Nu kann dank des leistungsfähigen Plugin-Systems einfach erweitert werden. + </Card> +</CardGrid> + +<br /> + + + +### Nu funktioniert mit existierenden Daten + +Nu versteht [JSON, YAML, XML, Excel und noch mehr](/book/loading_data.md). Es ist einfach Daten in eine Nu Pipeline zu laden ganz egal ob diese in einer Datei, einer Datenbank oder einer Web-API liegen: + + + +### Nu hat tolle Fehlermeldungen + +Nu arbeitet mit typisierten Daten, wodurch Fehler abgefangen werden, die andere Shells nicht erkennen. Und falls etwas schiefgeht bekommt genau mitgeteilt wo und weshalb: + + diff --git a/src/content/docs/es/book/advanced/explore.md b/src/content/docs/es/book/advanced/explore.md new file mode 100644 index 00000000000..1065ac7af09 --- /dev/null +++ b/src/content/docs/es/book/advanced/explore.md @@ -0,0 +1,93 @@ +--- +title: Explorando el sistema +--- + +Shells de antes permiten explorar el sistema de archivos y ejecutar comandos. Shells modernas como Nu permiten hacer lo mismo. Miremos algunos comandos comunes que puedas usar cuando interactues con el sistema. + +## Ver contenido de un directorio + +```nu +ls +``` + +Cómo hemos visto en otros capítulos, `ls` es un comando para mirar el contenido de una ruta. Nu devolverá el contenido en una tabla que podemos usar. + +El comando `ls` también recibe un argumento opcional para cambiar qué te gustaría ver. Por ejemplo, podemos enumerar los archivos que terminan en ".md" + +```nu +> ls *.md +───┬────────────────────┬──────┬─────────┬──────────── + # │ name │ type │ size │ modified +───┼────────────────────┼──────┼─────────┼──────────── + 0 │ CODE_OF_CONDUCT.md │ File │ 3.4 KB │ 5 days ago + 1 │ CONTRIBUTING.md │ File │ 886 B │ 5 days ago + 2 │ README.md │ File │ 15.0 KB │ 5 days ago + 3 │ TODO.md │ File │ 1.6 KB │ 5 days ago +───┴────────────────────┴──────┴─────────┴──────────── +``` + +El asterisco (\*) en el argumento que pasamos "\*.md" a veces se llama comodín o glob. Nos permite complementar cualquier cosa. Puedes leer el glob "\*.md" como "complementa cualquier archivo siempre y cuando termine en '.md'" + +Nu también usa globs modernos permitiendo acceder directorios más profundos. + +```nu +ls **/*.md +──┬───────────────────────────────────────────┬──────┬─────────┬─────────── +# │ name │ type │ size │ modified +──┼───────────────────────────────────────────┼──────┼─────────┼─────────── +0 │ CODE_OF_CONDUCT.md │ File │ 3.4 KB │ 5 days ago +1 │ CONTRIBUTING.md │ File │ 886 B │ 5 days ago +2 │ README.md │ File │ 15.0 KB │ 5 days ago +3 │ TODO.md │ File │ 1.6 KB │ 5 days ago +4 │ crates/nu-source/README.md │ File │ 1.7 KB │ 5 days ago +5 │ docker/packaging/README.md │ File │ 1.5 KB │ 5 days ago +6 │ docs/commands/README.md │ File │ 929 B │ 5 days ago +7 │ docs/commands/alias.md │ File │ 1.7 KB │ 5 days ago +8 │ docs/commands/append.md │ File │ 1.4 KB │ 5 days ago +``` + +Aquí, buscamos cualquier archivo que termine con ".md", y los dos asteriscos dicen además "en cualquier directorio que comience desde aquí". + +## Cambiar el directorio actual + +```nu +cd new_directory +``` + +Para cambiar del directorio actual a uno nuevo usamos el comando `cd`. Al igual que en otras shells, podemos usar tanto el nombre del directorio o si deseamos subir a un directorio podemos usar el acceso directo `..`. + +También se puede cambiar el directorio si se omite `cd` y se proporciona una ruta por si sola: + +```nu +./new_directory +``` + +## Comandos del sistema de archivos + +Nu también proporciona algunos comandos básicos del sistema de archivos que funcionan multiplataforma. + +Podemos mover un item de un lugar a otro usando el comando `mv`: + +```nu +mv item location +``` + +Podemos copiar un item de un lugar a otro: + +```nu +cp item location +``` + +Podemos eliminar un item. + +```nu +rm item +``` + +Los tres comandos también pueden usar las capacidades de glob que vimos previamente con `ls`. + +Finalmente, podemos crear un directorio usando el comando `mkdir`: + +```nu +mkdir new_directory +``` diff --git a/es/book/metadatos.md b/src/content/docs/es/book/advanced/metadata.md similarity index 97% rename from es/book/metadatos.md rename to src/content/docs/es/book/advanced/metadata.md index f2fe6c8cafc..6cbf1ff2ea1 100644 --- a/es/book/metadatos.md +++ b/src/content/docs/es/book/advanced/metadata.md @@ -1,8 +1,10 @@ -# Metadatos +--- +title: Metadatos +--- Al usar Nu es posible que hayan momentos que has encontrado como si algo extra sucediera detrás de escenas. Por ejemplo digamos que intentas abrir un archivo soportado por Nu para luego olvidarte e intentar convertir nuevamente: -``` +```nu > open Cargo.toml | from toml error: Expected a string from pipeline - shell:1:18 @@ -19,7 +21,7 @@ Valores que fluyen a través de la tubería en Nu comúnmente disponen de inform Nuevamente ejecutemos el comando `open` pero esta vez observaremos las etiquetas que nos devuelve: -``` +```nu > open Cargo.toml | tags ----------+------------------------------------------ span | anchor @@ -32,7 +34,7 @@ Actualmente rastreamos dos pedazos de metadatos de los valores en la tubería. P También hay lapso (span). Miremos más de cerca a eso: -``` +```nu > open Cargo.toml | tags | get span -------+----- start | end diff --git a/es/book/plugins.md b/src/content/docs/es/book/advanced/plugins.md similarity index 96% rename from es/book/plugins.md rename to src/content/docs/es/book/advanced/plugins.md index 7545ef02174..c68418ccd1f 100644 --- a/es/book/plugins.md +++ b/src/content/docs/es/book/advanced/plugins.md @@ -1,4 +1,6 @@ -# Complementos (plugins) +--- +title: Complementos (plugins) +--- Se puede ampliar la funcionalidad de Nu a través de complementos. Los complementos pueden realizar muchas de las mismas operaciones que los comandos integrados de Nu con el beneficio adicional de que se pueden agregar separado de Nu. diff --git a/src/content/docs/es/book/coming-to-nu/coming_from_bash.md b/src/content/docs/es/book/coming-to-nu/coming_from_bash.md new file mode 100644 index 00000000000..fa113127291 --- /dev/null +++ b/src/content/docs/es/book/coming-to-nu/coming_from_bash.md @@ -0,0 +1,52 @@ +--- +title: Llegando desde Bash +--- + +Nota: Esta tabla asume Nushell 0.14.1 or posterior. + +| Bash | Nu | Task | +| ------------------------------------ | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | +| `ls` | `ls` | Lists the files in the current directory | +| `ls <dir>` | `ls <dir>` | Lists the files in the given directory | +| `ls pattern*` | `ls pattern*` | Lists files that match a given pattern | +| `ls -la` | `ls --long --all` or `ls -la` | List files with all available information, including hidden files | +| `ls -d */` | `ls \| where type == Dir` | List directories | +| `find . -name *.rs` | `ls **/*.rs` | Find recursively all files that match a given pattern | +| `cd <directory>` | `cd <directory>` | Change to the given directory | +| `cd` | `cd` | Change to the home directory | +| `mkdir <path>` | `mkdir <path>` | Creates the given path | +| `mkdir -p <path>` | `mkdir <path>` | Creates the given path, creating parents as necessary | +| `touch test.txt` | `touch test.txt` | Create a file | +| `> <path>` | `\| save --raw <path>` | Save string into a file | +| `cat <path>` | `open --raw <path>` | Display the contents of the given file | +| | `open <path>` | Read a file as structured data | +| `mv <source> <dest>` | `mv <source> <dest>` | Move file to new location | +| `cp <source> <dest>` | `cp <source> <dest>` | Copy file to new location | +| `cp -r <source> <dest>` | `cp -r <source> <dest>` | Copy directory to a new location, recursively | +| `rm <path>` | `rm <path>` | Remove the given file | +| | `rm -t <path>` | Move the given file to the system trash | +| `rm -rf <path>` | `rm -r <path>` | Recursively removes the given path | +| `chmod` | `<not yet possible>` | Changes the file attributes | +| `date -d <date>` | `echo <date> \| str to-datetime -f <format>` | Parse a date ([format documentation](https://docs.rs/chrono/0.4.15/chrono/format/strftime/index.html)) | +| `sed` | `str find-replace` | Find and replace a pattern in a string | +| `grep <pattern>` | `where $it =~ <substring>` | Filter strings that contain the substring | +| `man <command>` | `help <command>` | Get the help for a given command | +| | `help commands` | List all available commands | +| | `help --find <string>` | Search for match in all available commands | +| `command1 && command2` | `command1; command2` | Run a command, and if it's successful run a second | +| `stat $(which git)` | `stat (which git).path` | Use command output as argument for other command | +| `echo $PATH` | `echo $nu.path` | See the current path | +| `<update ~/.bashrc>` | `config set path [<dir1> <dir2> ...]` | Update PATH permanently | +| `export PATH = $PATH:/usr/other/bin` | `pathvar add <path>` | Update PATH temporarily | +| `export` | `echo $nu.env` | List the current environment variables | +| `<update ~/.bashrc>` | `echo $nu.env \| insert var value \| config set_into env` | Update environment variables permanently | +| `FOO=BAR ./bin` | `FOO=BAR ./bin` | Update environment temporarily | +| `export FOO=BAR` | `$env.FOO = BAR` | Set environment variable for current session | +| `unset FOO` | `$env.FOO = $nothing` | Unset environment variable for current session | +| `alias s="git status -sb"` | `alias s = git status -sb` | Define an alias temporarily | +| `<update ~/.bashrc>` | `config set [startup ["alias myecho [msg] { echo Hello $msg }"]]` | Add a first alias permanently (for new shells) | +| `<update ~/.bashrc>` | `config get startup \| append "alias s [] { git status -sb }" \| config set_into startup` | Add an additional alias permanently (for new shells) | +| `<update ~/.bashrc>` | `<update nu/config.toml>` | Add and edit alias permanently (for new shells), find path for the file with `config path` | +| `bash -c <commands>` | `nu -c <commands>` | Run a pipeline of commands (requires 0.9.1 or later) | +| `bash <script file>` | `nu <script file>` | Run a script file (requires 0.9.1 or later) | +| `\` | `<not yet possible>` | Line continuation is not yet supported. | diff --git a/es/book/mapa_nushell.md b/src/content/docs/es/book/coming-to-nu/nushell_map.md similarity index 99% rename from es/book/mapa_nushell.md rename to src/content/docs/es/book/coming-to-nu/nushell_map.md index ef7f6ce9693..fec4303d9e1 100644 --- a/es/book/mapa_nushell.md +++ b/src/content/docs/es/book/coming-to-nu/nushell_map.md @@ -1,4 +1,6 @@ -# Mapa nushell de otras shells y lenguajes DSLs +--- +title: Mapa nushell de otras shells y lenguajes DSLs +--- La idea detrás de esta tabla is ayudarte a entender como los comandos internos y plugins en Nu se relacionan con otras shells conocidas y lenguajes de dominio específicos. Hemos intentado producir un mapa de los comandos internos y sus equivalentes en otros lenguajes. Contribuciones son bienvenidas. diff --git a/es/book/mapa_funcional_nushell.md b/src/content/docs/es/book/coming-to-nu/nushell_map_functional.md similarity index 99% rename from es/book/mapa_funcional_nushell.md rename to src/content/docs/es/book/coming-to-nu/nushell_map_functional.md index 28adf3dc28d..033564e78e3 100644 --- a/es/book/mapa_funcional_nushell.md +++ b/src/content/docs/es/book/coming-to-nu/nushell_map_functional.md @@ -1,4 +1,6 @@ -# Mapa nushell de lenguajes funcionales +--- +title: Mapa nushell de lenguajes funcionales +--- La idea detrás de esta tabla is ayudarte a entender como los comandos internos y plugins en Nu se relacionan con lenguajes funcionales. Hemos intentado producir un mapa de los comandos internos y sus equivalentes en otros lenguajes. Contribuciones son bienvenidas. diff --git a/es/book/mapa_imperativo_nushell.md b/src/content/docs/es/book/coming-to-nu/nushell_map_imperative.md similarity index 99% rename from es/book/mapa_imperativo_nushell.md rename to src/content/docs/es/book/coming-to-nu/nushell_map_imperative.md index ff3e154f610..54788cd9351 100644 --- a/es/book/mapa_imperativo_nushell.md +++ b/src/content/docs/es/book/coming-to-nu/nushell_map_imperative.md @@ -1,4 +1,6 @@ -# Mapa nushell de lenguajes imperativos +--- +title: Mapa nushell de lenguajes imperativos +--- La idea detrás de esta tabla is ayudarte a entender como los comandos internos y plugins en Nu se relacionan con lenguajes imperativos. Hemos intentado producir un mapa de los comandos internos y sus equivalentes en otros lenguajes. Contribuciones son bienvenidas. diff --git a/es/book/mapa_operador_nushell.md b/src/content/docs/es/book/coming-to-nu/nushell_operator_map.md similarity index 98% rename from es/book/mapa_operador_nushell.md rename to src/content/docs/es/book/coming-to-nu/nushell_operator_map.md index 0a9f2627d55..88f400dca75 100644 --- a/es/book/mapa_operador_nushell.md +++ b/src/content/docs/es/book/coming-to-nu/nushell_operator_map.md @@ -1,4 +1,6 @@ -# Mapa de operadores en Nushell +--- +title: Mapa de operadores en Nushell +--- La idea detrás de esta tabla is ayudarte a entender como los operadores en Nu se relacionan con operadores de otros lenguajes. Hemos intentado producir un mapa de los operadores y sus equivalentes en otros lenguajes. Contribuciones son bienvenidas. diff --git a/es/book/instalacion.md b/src/content/docs/es/book/getting-started/installation.mdx similarity index 75% rename from es/book/instalacion.md rename to src/content/docs/es/book/getting-started/installation.mdx index 8c817b1cd27..f6c1fb2953d 100644 --- a/es/book/instalacion.md +++ b/src/content/docs/es/book/getting-started/installation.mdx @@ -1,4 +1,23 @@ -# Instalando Nu +--- +title: Instalando Nu +--- + +import { Code } from "@astrojs/starlight/components"; +import runNu from "../../../snippets/installation/run_nu.nu?raw"; +import rustupChooseRustVersion from "../../../snippets/installation/rustup_choose_rust_version.nu?raw"; +import installPkgConfigLibsslDev from "../../../snippets/installation/install_pkg_config_libssl_dev.nu?raw"; +import installRhelDependencies from "../../../snippets/installation/install_rhel_dependencies.nu?raw"; +import macosDeps from "../../../snippets/installation/macos_deps.nu?raw"; +import cargoInstallNu from "../../../snippets/installation/cargo_install_nu.nu?raw"; +import cargoInstallNuMoreFeatures from "../../../snippets/installation/cargo_install_nu_more_features.nu?raw"; +import gitCloneNu from "../../../snippets/installation/git_clone_nu.nu?raw"; +import buildNuFromSource from "../../../snippets/installation/build_nu_from_source.nu?raw"; +import buildNuFromSourceRelease from "../../../snippets/installation/build_nu_from_source_release.nu?raw"; +import useRawkeyAndClipboard from "../../../snippets/installation/use_rawkey_and_clipboard.nu?raw"; +import chshInvalidShellError from "../../../snippets/installation/chsh_invalid_shell_error.nu?raw"; +import windowsTerminalDefaultShell from "../../../snippets/installation/windows_terminal_default_shell.nu?raw"; +import windowsChangeDefaultProfile from "../../../snippets/installation/windows_change_default_profile.nu?raw"; +import windowsExampleExtractionLocation from "../../../snippets/installation/windows_example_extraction_location.nu?raw"; La mejor manera actualmente para poner en marcha Nu es instalándolo a través de [crates.io](https://crates.io), descargando desde [nuestra página](https://github.com/nushell/nushell/releases), y compilar desde la fuente. @@ -12,33 +31,22 @@ Puedes descargar Nu compilado desde [nuestra página](https://github.com/nushell Descarga el archivo actual `.zip` [de la página de releases](https://github.com/nushell/nushell/releases) y extráelo por ejemplo a: -``` - C:\Program Files -``` +<Code code={windowsExampleExtractionLocation} lang="sh" /> y posteriormente agrega Nu a la variable de entorno `PATH`. Una vez que hagamos eso, podemos ejecutar Nu usando el comando `nu`: -``` +```nu > nu C:\Users\user> ``` Si te encuentras usando [Windows Terminal](https://github.com/microsoft/terminal) puedes establecer `nu` como la shell por defecto añadiendo: -``` -{ - "guid": "{2b372ca1-1ee2-403d-a839-6d63077ad871}", - "hidden": false, - "name": "Nu Shell", - "commandline": "nu.exe" -} -``` +<Code code={windowsTerminalDefaultShell} lang="sh" /> a `"profiles"` en las preferencias de tu Terminal (archivo JSON). Lo último que tienes que hacer es cambiar `"defaultProfile"` a: -``` -"defaultProfile": "{2b372ca1-1ee2-403d-a839-6d63077ad871}", -``` +<Code code={windowsChangeDefaultProfile} lang="sh" /> Ahora `nu` debería cargar al inicio de la Terminal de Windows. @@ -66,17 +74,7 @@ En el caso de que no dispongamos de Rust en nuestro sistema la mejor manera de i Nu actualmente requiere la versión **estable más reciente (1.55 o posterior)** de Rust. La mejor manera de `rustup` inferir la versión correcta para ti. En el momento de abrir `rustup` te solicitará qué versión de Rust deseas instalar: -``` -Current installation options: - - default host triple: x86_64-unknown-linux-gnu - default toolchain: stable - modify PATH variable: yes - -1) Proceed with installation (default) -2) Customize installation -3) Cancel installation -``` +<Code code={rustupChooseRustVersion} lang="sh" /> Una vez que estamos listos, presionamos 1 y luego enter. @@ -88,86 +86,74 @@ Si prefieres no instalar Rust mediante `rustup`, también puedes instalar a trav Vas a necesitar instalar "pkg-config" y "libssl-dev": -<<< @/snippets/installation/install_pkg_config_libssl_dev.sh +<Code code={installPkgConfigLibsslDev} lang="sh" /> Usuarios de Linux que desean usar las funcionalidades opcionales `rawkey` o `clipboard` necesitarán instalar los paquetes "libx11-dev" y "libxcb-composite0-dev": -<<< @/snippets/installation/use_rawkey_and_clipboard.sh +<Code code={useRawkeyAndClipboard} lang="sh" /> ### Distribuciones basadas en RHEL Vas a necesitar instalar "libxcb", "openssl-devel" and "libX11-devel": -<<< @/snippets/installation/install_rhel_dependencies.sh +<Code code={installRhelDependencies} lang="sh" /> ### macOS Usando [homebrew](https://brew.sh/), vas a necesitar instalar la fórmula "openssl": -``` -brew install openssl cmake -``` +<Code code={macosDeps} lang="sh" /> ## Instalando desde [crates.io](https://crates.io) Una vez instaladas las depependencias que Nu necesita, podemos instalarla usando el comando `cargo` que viene con el compilador Rust. -``` -> cargo install nu -``` +<Code code={cargoInstallNuMoreFeatures} lang="sh" /> ¡Eso es todo! Cargo hará el trabajo de descarga Nu junto con sus dependencias, construirla e instalarla en el bin path de cargo para que podamos arrancarlo. Si deseas instalar con más funcionalidades, puedes hacer: -``` +```nu > cargo install nu --features=stable ``` Para todas las funcionalidades disponibles, la manera más fácil es descargar la fuente de Nu y construírlo usted mismo usando las herramientas de Rust: -``` +```nu > git clone https://github.com/nushell/nushell.git > cd nushell nushell> cargo install --path . --force --features=stable +``` Para que esto funcione, asegúrate de tener todas las dependencias instaladas (que se muestran arriba) en el sistema. Finalizada la instalación podemos ejecutar Nu usando el comando `nu`: -``` - +```nu $ nu /home/jonathan/Source> - ``` ## Construyendo desde la fuente También podemos contruir nuestro propio Nu directamente desde github. Esto nos da acceso inmediato a las últimas funcionalidades y corrección de bugs. -``` - -> git clone https://github.com/nushell/nushell.git - -``` +<Code code={gitCloneNu} lang="sh" /> Git nos clonará el repositorio principal de Nu. Partiendo de ahí podemos contruir y arrancar Nu si estamos usando `rustup` con: -``` - +```nu > cd nushell > nushell> cargo build --workspace --features=stable; cargo run --features=stable - ``` También puedes construir y arrancar Nu en modo release: -``` - +```nu nushell> cargo build --release --workspace --features=stable; cargo run --release --features=stable - ``` + Gente familiarizada con Rust se preguntará la razón por la que hacemos un paso "build" y otro paso "run" si "run" construye por defecto. Esto es para evitar una deficiencia de la nueva opción `default-run` en Cargo y asegurar que todos los plugins se construyan aunque puede que esto no sea necesario en el futuro. **Nota:** Si te encuentras trabajando tanto en modo debug y release, asegúrate de ejecutar `cargo clean` cuando cambies entre ellas. Nu buscará plugins en los directorios tanto de debug así como release y puede suceder que cargue versiones de un plugin que no tienes intenciones de usar. @@ -179,11 +165,6 @@ Gente familiarizada con Rust se preguntará la razón por la que hacemos un paso Para configurar la shell de inicio de sesión, puedes usra el comando [`chsh`](https://linux.die.net/man/1/chsh). En algunas distribuciones de Linux se encuentra una lista válida de shells en `/etc/shells` y no permitirá cambiar la shell hasta que Nu esté en la lista blanca. Es posible que vea un error similar al siguiente si no ha actualizado el archivo `shells`: -``` - -chsh: /home/username/.cargo/bin/nu is an invalid shell - -``` +<Code code={chshInvalidShellError} lang="sh" /> Puedes agregar Nu a la lista de shells válidas añadiendo el binario al archivo `shells`. La ruta para agregar puedes encontrarla con el comando `which nu`, usualmente es `$HOME/.cargo/bin/nu`. -``` diff --git a/es/book/README.md b/src/content/docs/es/book/getting-started/introduction.mdx similarity index 74% rename from es/book/README.md rename to src/content/docs/es/book/getting-started/introduction.mdx index ec46830056f..95ca0fb40cb 100644 --- a/es/book/README.md +++ b/src/content/docs/es/book/getting-started/introduction.mdx @@ -1,4 +1,20 @@ -# Introducción +--- +title: Introducción +--- + +import { Code } from "@astrojs/starlight/components"; +import lsExample from "../../../snippets/introduction/ls_example.nu?raw"; +import lsSortByReverseExample from "../../../snippets/introduction/ls_sort_by_reverse_example.nu?raw"; +import lsWhereExample from "../../../snippets/introduction/ls_where_example.nu?raw"; +import psExample from "../../../snippets/introduction/ps_example.nu?raw"; +import psWhereExample from "../../../snippets/introduction/ps_where_example.nu?raw"; +import dateExample from "../../../snippets/introduction/date_example.nu?raw"; +import dateTableExample from "../../../snippets/introduction/date_table_example.nu?raw"; +import sysExample from "../../../snippets/introduction/sys_example.nu?raw"; +import sysGetExample from "../../../snippets/introduction/sys_get_example.nu?raw"; +import sysGetNestedExample from "../../../snippets/introduction/sys_get_nested_example.nu?raw"; +import sysGetExternalEchoExample from "../../../snippets/introduction/sys_get_external_echo_example.nu?raw"; +import helpExample from "../../../snippets/introduction/help_example.nu?raw"; Hola, y bienvenido al proyecto Nushell. El objetivo de este proyecto es tomar la filosofía Unix de shells, dónde tuberías _-pipes-_ conectan comandos simples juntos y llevarlos al estilo moderno de desarrollo. @@ -12,51 +28,51 @@ La manera más facil de ver qué puede hacer Nu es con ejemplos, iniciemos. Lo primero que notarás al ejercutar un comando como `ls` es que en lugar de un bloque de texto que regresa, recibirás una tabla estructurada. -@[code](@snippets/introduction/ls_example.sh) +<Code code={lsExample} lang="nu" /> La tabla no solamente muestra lo que hay en el directorio de una manera distinta sino algo más. Como las tablas de una hoja de cálculo *-*spreadsheet*-*, esta tabla te permite trabajar con los datos más interactivamente. Lo primero que vamos hacer es ordenar nuestra tabla por tamaño. Para poder hacerlo tomaremos la salida de `ls` y la alimentaremos al comando que ordena tablas basado en los valores de una columna (para este ejemplo sería la columna `size`). -@[code](@snippets/introduction/ls_sort_by_reverse_example.sh) +<Code code={lsSortByReverseExample} lang="nu" /> Puedes observar que para lograrlo no tuvimos que pasar argumentos al comando `ls`. En cambio, nosotros usamos el comando `sort-by` que proporciona Nu para ordenar la salida del comando `ls`. Para ver los archivos más grandes en las primeras filas usamos el comando `reverse`. Nu proporciona muchos comandos que trabajan con tablas. Por ejemplo, podemos filtrar los contenidos de la tabla de `ls` para únicamente mostrar archivos superiores a 1 kilobytes: -@[code](@snippets/introduction/ls_where_example.sh) +<Code code={lsWhereExample} lang="nu" /> Al igual que en la filosofía Unix, poder hacer que los comandos hablen entre ellos nos da maneras de mezclar y combinar de formas distintas. Miremos otro ejemplo: -@[code](@snippets/introduction/ps_example.sh) +<Code code={psExample} lang="nu" /> Es posible que estés familiarizado con el comando `ps` si has utilizado Linux. Con dicho comando, podemos tener una lista de los procesos actuales que ejecuta el sistema, qué estado tienen y sus nombres. También podemos ver la carga CPU del proceso. ¿Qué tal si quisiéramos mostrar los procesos que activamente usan el CPU? Así como hicimos con el comando `ls` previamente, también podemos trabajar con la tabla que nos devuelve `ps`: -@[code](@snippets/introduction/ps_where_example.sh) +<Code code={psWhereExample} lang="nu" /> Hasta ahora, hemos visto el uso de `ls` y `ps` para enumerar archivos y procesos. Nu también ofrece otros comandos que pueden crear tablas con información de gran utilidad. Exploremos `date` y `sys`. Ejecutando `date now` nos proporciona información del día y tiempo: -@[code](@snippets/introduction/date_example.sh) +<Code code={dateExample} lang="nu" /> Para obtener una tabla podemos alimentar la salida a `date to-table` -@[code](@snippets/introduction/date_table_example.sh) +<Code code={dateTableExample} lang="nu" /> Ejecutando `sys` devuelve información sobre el sistema en el que se ejecuta Nu: -@[code](@snippets/introduction/sys_example.sh) +<Code code={sysExample} lang="nu" /> Esta tabla se ve un poco diferente con las que ya hemos trabajado. El comando `sys` nos regresa una tabla que también contiene tablas estructuradas en las celdas en vez de valores simples. Para explorar esos datos, necesitamos _obtener_ la columna deseada para mostrar: -@[code](@snippets/introduction/sys_get_example.sh) +<Code code={sysGetExample} lang="nu" /> El comando `get` nos permite ir directo al valor de una columa de la tabla. Aquí estamos mirando la columna "host" que contiene información del host dónde se está ejecutando Nu. El nombre del sistema operativo, hostname, CPU, y más. Miremos los nombres de los usuarios en el sistema: -@[code](@snippets/introduction/sys_get_nested_example.sh) +<Code code={sysGetNestedExample} lang="nu" /> En este momento, solo hay un usuario en el sistema llamado "jt". Notarás que podemos pasar una ruta de columna *-*column path*-* y no únicamente el nombre de una columna. Nu tomará esta ruta de columna e irá a los datos correspondientes en la tabla. @@ -64,10 +80,10 @@ Es posible que hayas notado algo más diferente también. En lugar de tener una Miremos en acción cómo funcionan las cadenas fuera de Nu. Tomaremos el ejemplo anterior y ejecutaremos el comando externo `echo` (el carácter `^` le informa a Nu que no se desea usar el comando _interno_ también llamado `echo`): -@[code](@snippets/introduction/sys_get_external_echo_example.sh) +<Code code={sysGetExternalEchoExample} lang="nu" /> Si esto se parece mucho a lo que teníamos antes, ¡tienes buen ojo! Es similar, pero con una diferencia importante: hemos llamado `echo` con el valor que vimos antes. Esto nos permite pasar datos fuera de Nu a `echo` (o cualquier comando fuera de Nu, como `git` por ejemplo) _Nota: Para texto de ayuda de los comandos internos de Nu, puedes descubrirlos con el comando `help`_: -@[code](@snippets/introduction/help_example.sh) +<Code code={helpExample} lang="nu" /> diff --git a/es/book/matematicas.md b/src/content/docs/es/book/matematicas.md similarity index 97% rename from es/book/matematicas.md rename to src/content/docs/es/book/matematicas.md index fdbe6e40973..5cb9cfc7a98 100644 --- a/es/book/matematicas.md +++ b/src/content/docs/es/book/matematicas.md @@ -1,10 +1,12 @@ -# Matemáticas +--- +title: Matemáticas +--- Hay veces que simplemente necesitas sumar un par de números cuando te encuentras resolviendo problemas. Nu ofrece un conjunto de operaciones matemáticas básicas que puedes utilizar. Expresiones matemáticas se encuentran disponibles cuando llamas a un comando. ## Sumar, Restar, Mupltiplicar, Dividir -``` +```nu > 1 + 3 4 ``` @@ -19,12 +21,12 @@ Puedes usar paréntesis para agrupar expresiones matemáticas en modo `math`. Es Puedes revisar si un valor se encuentra dentro de un conjunto de valores o no, usando los operadores `in` y `not-in`. -``` +```nu > 1 in [1 2 3] true ``` -``` +```nu > 1 not-in [1 2 3] false ``` @@ -33,12 +35,12 @@ false Puedes revisar si una cadena se encuentra dentro de otra cadena o no, usando `=~` y `!~`. -``` +```nu > "gallinagallo" =~ "gallo" true ``` -``` +```nu > "gallinagallo" !~ "pollito" true ``` @@ -66,7 +68,7 @@ Las operaciones matemáticas son evaluadas de la siguiente manera (de mayor prec - Multiplicación (`*`) y División (`/`) - Suma (`+`) y Resta (`-`) -``` +```nu > 3 * (1 + 2) 9 ``` @@ -77,13 +79,13 @@ Hay una variación abreviada "short-hand" en modo matemático incluída en Nushe Es probable que ya la usaste antes. Por ejemplo, supongamos que deseamos ver filas de `ls` donde para cada uno por lo menos tenga 10 kilobytes, podemos escribir: -``` +```nu > ls | where size > 10kb ``` El comando `where memoria > 10kb` tiene dos partes: El nombre del comando `where` y su abreviación expresión matemática `size > 10kb`. Indicamos `abreviada` debido a que `size` es una versión acortada de escribir `$it.size`. Si observamos su forma completamente expandida, veríamos: -``` +```nu > ls | where {|$it| $it.size > 10kb } ``` diff --git a/es/book/configuracion.md b/src/content/docs/es/book/nu-as-a-shell/configuration.md similarity index 98% rename from es/book/configuracion.md rename to src/content/docs/es/book/nu-as-a-shell/configuration.md index 8b4c6413f87..262d9f22da2 100644 --- a/es/book/configuracion.md +++ b/src/content/docs/es/book/nu-as-a-shell/configuration.md @@ -1,4 +1,6 @@ -# Configuración +--- +title: Configuración +--- Nu tiene un número pequeño, pero creciente, de variables internas que puedes establecer cambios en su aspecto y funcionamiento. A continuación una lista de las variables actuales, sus tipos, y una descripción de cómo se utilizan: @@ -22,7 +24,7 @@ Nu tiene un número pequeño, pero creciente, de variables internas que puedes e Para establecer una de estas variables, puedes usar `config set`. Por ejemplo: -``` +```nu > config set edit_mode "vi" ``` @@ -30,7 +32,7 @@ Para establecer una de estas variables, puedes usar `config set`. Por ejemplo: Hay una manera adicional de establecer una variable, y es usar el contenido de la tubería como el valor deseado para la variable. Para esto usa la bandera `set-into`: -``` +```nu > echo "bar" | config set_into foo ``` @@ -40,7 +42,7 @@ Esto es de utilidad cuando se trabaja con las variables `env` y `path`. Ejecutando el comando `config` sin argumentos mostrará una tabla de las preferencias de configuración actuales: -``` +```nu > config ━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━ edit_mode │ env │ path │ table_mode @@ -55,7 +57,7 @@ Nota: si por el momento no has establecido variables de configuración, puede es Usando la bandera `get`, puedes conseguir el valor de una variable: -``` +```nu > config get edit_mode ``` @@ -63,7 +65,7 @@ Usando la bandera `get`, puedes conseguir el valor de una variable: Para eliminar una variable de la configuración, usa la bandera `remove`: -``` +```nu > config remove edit_mode ``` @@ -71,7 +73,7 @@ Para eliminar una variable de la configuración, usa la bandera `remove`: Si deseas borrar toda la configuración y empezar de cero, puedes usar la bandera `clear`. Por supuesto, tenga precaución con esto ya que una vez ejecutado el archivo de configuración también se eliminará. -``` +```nu > config clear ``` @@ -79,7 +81,7 @@ Si deseas borrar toda la configuración y empezar de cero, puedes usar la bander El archivo de configuración se carga desde una ubicación predeterminada. Para encontrar esta ubicación en el sistema, puedes solicitarla usando la bandera `path`: -``` +```nu config path ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ <value> @@ -92,7 +94,7 @@ config path Es posible que desees cargar la configuración desde una ubicación distinta a la predeterminada. Para hacerlo, usa la bandera `load`: -``` +```nu > config load myconfiguration.toml ``` @@ -102,7 +104,7 @@ Para usar Nu como shell de inicio de sesión, necesitarás configurar las variab Antes de cambiarlo, ejecuta Nu dentro de otra shell, como Bash. Luego, obtén el entorno y PATH desde esa shell con los siguientes comandos: -``` +```nu > config set path $nu.path > config set env $nu.env ``` @@ -111,7 +113,7 @@ Antes de cambiarlo, ejecuta Nu dentro de otra shell, como Bash. Luego, obtén el A continuación, en algunas distribuciones también deberás asegurarte de que Nu esté en la lista en `/etc/shells`: -``` +```nu ❯ cat /etc/shells # /etc/shells: valid login shells /bin/sh @@ -129,7 +131,7 @@ Con esto, deberías de poder hacer `chsh` y establecer Nu como la shell de inici Actualmente, la configuración del prompt es manejada instalando Nu con el soporte prompt proporcionado con [starship](https://github.com/starship/starship). -``` +```nu nushell on 📙 master [$] is 📦 v0.5.1 via 🦀 v1.40.0-nightly ❯ ``` diff --git a/es/book/entorno.md b/src/content/docs/es/book/nu-as-a-shell/environment.md similarity index 97% rename from es/book/entorno.md rename to src/content/docs/es/book/nu-as-a-shell/environment.md index 3398005ff75..8ea1c73d638 100644 --- a/es/book/entorno.md +++ b/src/content/docs/es/book/nu-as-a-shell/environment.md @@ -1,10 +1,12 @@ -# Entorno +--- +title: Entorno +--- Una tarea común al usar una shell es controlar el ambiente de entorno que aplicaciones externas usarán. Comúnmente esto sucede automáticamente, a medida que el entorno se empaqueta y se entrega a la aplicación externa cuando se inicia. Sin embargo, hay veces que vamos a desear tener control más preciso sobre qué variables de entorno una aplicación pueda ver. Puedes ver las variables de entorno actuales que se enviarán a las aplicaciones explorando `#nu.env`: -``` +```nu > echo $nu.env ──────────────────────────┬────────────────────────────── COLORTERM │ truecolor @@ -17,7 +19,7 @@ El ambiente es creador a través de los ajustes en la configuración de Nu y a p También puedes temporalmente actualizar una variable de entorno cuando ejecutas un comando o tubería de comandos. -``` +```nu > with-env [MI_VARIABLE VALOR] { echo $nu.env.MI_VARIABLE } VALOR ``` @@ -28,7 +30,7 @@ A common shorthand, inspired by Bash and others, is also available. You can writ Una atajo común, inspirada en Bash y otros, también está disponible. Puedes escribir el ejemplo anterior como: -``` +```nu > MI_VARIABLE=VALOR echo $nu.env.MI_VARIABLE VALOR ``` diff --git a/es/book/escapando.md b/src/content/docs/es/book/nu-as-a-shell/escaping.md similarity index 89% rename from es/book/escapando.md rename to src/content/docs/es/book/nu-as-a-shell/escaping.md index f3b247c9ea4..3a3daa423a3 100644 --- a/es/book/escapando.md +++ b/src/content/docs/es/book/nu-as-a-shell/escaping.md @@ -1,15 +1,17 @@ -# Escapando al sistema +--- +title: Escapando al sistema +--- Nu proporciona una serie de comandos que puedes utilitar en diferentes sistemas operativos y tener esta consistencia es de gran ayuda. Sin embargo, a veces, quieres ejecutar un comando que también tiene el mismo nombre de los comandos de Nu. Para ejecutar el comando local `ls` o `date` fuera de Nu por ejemplo, usa el comando de intercalación (^). Comando de Nu: -``` +```nu > ls ``` Escapa al comando local: -``` +```nu > ^ls ``` diff --git a/es/book/shells_en_shells.md b/src/content/docs/es/book/nu-as-a-shell/shells_in_shells.md similarity index 98% rename from es/book/shells_en_shells.md rename to src/content/docs/es/book/nu-as-a-shell/shells_in_shells.md index 3af7cc04a77..212c79a0e00 100644 --- a/es/book/shells_en_shells.md +++ b/src/content/docs/es/book/nu-as-a-shell/shells_in_shells.md @@ -1,4 +1,6 @@ -# Shells en shells +--- +title: Shells en shells +--- ## Trabajando con múltiples directorios @@ -6,7 +8,7 @@ Mientras es común trabajar en un directorio puede ser beneficioso trabajar en m Para empezar entremos a un directorio: -``` +```nu /home/jonathan/Source/nushell(master)> enter ../lark /home/jonathan/Source/lark(master)> ls ----+----------------+-----------+----------+---------+---------------+--------------- @@ -19,7 +21,7 @@ Para empezar entremos a un directorio: Entrar es similar a cambiar directorios (como vimos previamente con el comando `cd`). Esto permite saltar al directorio para trabajar dentro del mismo. En lugar de cambiar de directorio, ahora estamos en dos directorios. Para ver esto con más claridad podemos usar el comando `shells` que enumera los directorios actualmente activos: -``` +```nu /home/jonathan/Source/lark(master)> shells ---+---+------------+------------------------------- # | | name | path @@ -33,7 +35,7 @@ El comando `shells` nos muestra que hay dos shells activos: nuestro directorio f Podemos saltar entre estas shells con los accesos directos `n` y `p`, cortos de siguiente "next" y previo "previous": -``` +```nu /home/jonathan/Source/lark(master)> n /home/jonathan/Source/nushell(master)> p /home/jonathan/Source/lark(master)> @@ -55,7 +57,7 @@ Para ver cómo funciona haremos el siguiente ejercicio. Actualmente en Nu tenemo Entraremos al archivo "Cargo.toml" del código fuente de Nu: -``` +```nu /Users/andresrobalino/Code/nushell(master)> enter Cargo.toml /> ls ------------+--------------+------------------+----------+---------- @@ -69,7 +71,7 @@ Por el momento solo hemos entrado al archivo y podemos observar en la tabla devu Antes de continuar revisemos las shells activas: -``` +```nu /> shells ---+---+-------------------------------------------------+------------------------------------ # | | name | path @@ -82,7 +84,7 @@ Antes de continuar revisemos las shells activas: Observamos que hay dos activas indicándonos que nos encontramos dentro de "Cargo.toml" en la ruta predeterminada "/". Revisemos el listado de nuevo: -``` +```nu /> ls ------------+--------------+------------------+----------+---------- bin | dependencies | dev-dependencies | lib | package @@ -93,7 +95,7 @@ Observamos que hay dos activas indicándonos que nos encontramos dentro de "Carg Puede que los complementos se encuentren en "bin", vamos ahí: -``` +```nu > cd bin /bin> ls ----+----------------------+--------------------------- @@ -115,13 +117,13 @@ Puede que los complementos se encuentren en "bin", vamos ahí: Notar que siempre podemos saltar de vuelta al directorio en el que estuvimos trabajando usando `p` (para previo). -``` +```nu /bin> p ``` Verifiquemos las shells: -``` +```nu /Users/andresrobalino/Code/nushell(master)> shells ---+---+-------------------------------------------------+------------------------------------ # | | name | path @@ -134,7 +136,7 @@ Verifiquemos las shells: Nos encontramos ahora en la shell donde estuvimos antes de entrar al archivo "Cargo.toml", vamos al directorio donde se encuentra el código fuente de los complementos (plugins): -``` +```nu /Users/andresrobalino/Code/nushell(master)> cd src/plugins/ /Users/andresrobalino/Code/nushell/src/plugins(master)> ls ----+---------------+------+----------+---------+------------+------------ diff --git a/es/book/cargando_datos.md b/src/content/docs/es/book/nu-fundamentals/loading_data.mdx similarity index 82% rename from es/book/cargando_datos.md rename to src/content/docs/es/book/nu-fundamentals/loading_data.mdx index 99a2f0531b3..1f31dca1691 100644 --- a/es/book/cargando_datos.md +++ b/src/content/docs/es/book/nu-fundamentals/loading_data.mdx @@ -1,4 +1,9 @@ -# Cargando datos +--- +title: Cargando datos +--- + +import { Code } from "@astrojs/starlight/components"; +import vscode from "../../../snippets/loading_data/vscode.nu?raw"; Hemos visto como puedes usar comandos como `ls`, `ps`, `date`, y `sys` para cargar información sobre los archivos, procesos, hora de fecha, y del mismo sistema. Cada comando nos entrega una tabla de información que podemos explorar. Hay otras maneras de cargar datos en una tabla de datos para trabajar. @@ -6,24 +11,13 @@ Hemos visto como puedes usar comandos como `ls`, `ps`, `date`, y `sys` para carg Una de las funciones más destacadas de Nu para trabajar con datos es el comando `open`. Es una multi-herramienta que puede trabajar con varios formatos de datos. Para ver qué significa esto intentemos abrir un archivo en formato json: -``` -> open editors/vscode/package.json -------+----------+----------+---------+---------+----------+----------+----------+----------+----------+----------+----------+----------+----------+---------- - name | descript | author | license | version | reposito | publishe | categori | keywords | engines | activati | main | contribu | scripts | devDepen - | ion | | | | ry | r | es | | | onEvents | | tes | | dencies -------+----------+----------+---------+---------+----------+----------+----------+----------+----------+----------+----------+----------+----------+---------- - lark | Lark | Lark | MIT | 1.0.0 | [object] | vscode | [0 | [1 item] | [object] | [1 item] | ./out/ex | [object] | [object] | [object] - | support | develope | | | | | items] | | | | tension | | | - | for VS | rs | | | | | | | | | | | | - | Code | | | | | | | | | | | | | -------+----------+----------+---------+---------+----------+----------+----------+----------+----------+----------+----------+----------+----------+---------- -``` +<Code code={vscode} lang="nu" /> De manera similar a `ls`, abrir un tipo de archivo que Nu entienda nos devolverá algo más que solo texto (o una secuencia de bytes). Aquí abrimos el archivo "package.json" de un proyecto de JavaScript. Nu puede reconocer y abrir el texto en JSON y devolvernos una tabla de datos. Si deseamos revisar la versión del proyecto que estamos mirando podemos usar el comando `get`. -``` +```nu > open editors/vscode/package.json | get version 1.0.0 ``` @@ -39,7 +33,7 @@ Actualmente Nu soporta los siguiente formatos para cargar datos directamente a t ¿Pero qué sucede si cargas un archivo de texto que no sea de estos? Probemos: -``` +```nu > open README.md ``` @@ -53,7 +47,7 @@ Una parte importante de trabajar con datos llegando fuera de Nu es que no siempr Imaginemos que nos proporcionan estos datos de archivo: -``` +```nu > open gente.txt Octavia | Butler | Writer Bob | Ross | Painter @@ -64,7 +58,7 @@ Cada pedazo de dato que deseamos está separada por el símbolo de tubería (pip Lo primero que queremos hacer al cargar el archivo es trabajarlo línea por línea: -``` +```nu > open gente.txt | lines ---+------------------------------ # | value @@ -77,7 +71,7 @@ Lo primero que queremos hacer al cargar el archivo es trabajarlo línea por lín Podemos darnos cuenta que estamos trabajando con las líneas porque estamos de vuelta a una lista. Nuestro próximo paso es mirar si podemos dividir las filas a algo más útil. Para eso, usaremos el comando `split`. `split`, como implica el nombre, nos da una manera de dividir una cadena delimitada. Usaremos el subcomando `column` para dividir el contenido a varias columnas. Indicamos cuál es el delimitador y se hace el resto: -``` +```nu > open gente.txt | lines | split column "|" ---+----------+-----------+----------- # | Column1 | Column2 | Column3 @@ -90,7 +84,7 @@ Podemos darnos cuenta que estamos trabajando con las líneas porque estamos de v Casi se ve correcto. Parece que hay espacio extra ahí. Cambiemos nuestro delimitador: -``` +```nu > open gente.txt | lines | split column " | " ---+---------+---------+---------- # | Column1 | Column2 | Column3 @@ -103,7 +97,7 @@ Casi se ve correcto. Parece que hay espacio extra ahí. Cambiemos nuestro delimi Nada mal. El comando `split` nos da datos que podemos usar. Adicionalmente nos crea nombres de columnas predeterminadas: -``` +```nu > open gente.txt | lines | split column " | " | get Column1 ---+--------- # | value @@ -116,7 +110,7 @@ Nada mal. El comando `split` nos da datos que podemos usar. Adicionalmente nos c También podemos nombrar nuestras columnas en vez de usar nombres predeterminados: -``` +```nu > open gente.txt | lines | split column " | " primer_nombre apellido trabajo ---+---------------+-----------+---------- # | primer_nombre | apellido | trabajo @@ -129,7 +123,7 @@ También podemos nombrar nuestras columnas en vez de usar nombres predeterminado Ahora que tenemos nuestros datos en una tabla podemos usar todos los comandos que hemos usado en tablas antes: -``` +```nu > open gente.txt | lines | split column " | " primer_nombre apellido trabajo | sort-by primer_nombre ---+---------------+-----------+---------- # | primer_nombre | apellido | trabajo @@ -148,7 +142,7 @@ Hay otros comandos que puedes usar para trabajar con cadenas: También hay un conjunto de comandos auxiliares que podemos llamar si conocemos de antemano que los datos tienen una estructura que Nu debería de entender. Por ejemplo, abramos un Rust archivo lock: -``` +```nu > open Cargo.lock # This file is automatically @generated by Cargo. # It is not intended for manual editing. @@ -161,7 +155,7 @@ The `from` command can be used for each of the structured data text formats that El archivo "Cargo.lock" es un archivo en formato .toml pero la extensión del archivo no es .toml. Está bien, podemos usar el comando `from` usando el subcomando `toml`: -``` +```nu > open Cargo.lock | from toml ----------+------------- metadata | package @@ -176,7 +170,7 @@ El comando `from` se puede usar para cada dato estructurado de formatos de texto Mientras es útil poder abrir un archivo e inmediatamente trabajar con una tabla de sus datos, esto no siempre es lo que deseas hacer. Para llegar al texto subyacente, el comando `open` puede tomar una bandera opcional: -``` +```nu > open Cargo.toml --raw [package] name = "nu" @@ -190,7 +184,7 @@ license = "MIT" Además de cargar archivos desde tu archivos de sistema, también puedes usar el comando `http get` proporcionando una URL. Se cargará el contenido de la URL por internet y devolverá: -``` +```nu > http get http://www.andresrobalino.com/feed.xml ---------- rss diff --git a/es/book/pipeline.md b/src/content/docs/es/book/nu-fundamentals/pipeline.md similarity index 98% rename from es/book/pipeline.md rename to src/content/docs/es/book/nu-fundamentals/pipeline.md index 5ef57677c9d..3b44d55b6fa 100644 --- a/es/book/pipeline.md +++ b/src/content/docs/es/book/nu-fundamentals/pipeline.md @@ -1,4 +1,6 @@ -# El pipeline +--- +title: El pipeline +--- Uno de los diseños centrales de Nu es la tubería (pipeline), una idea de diseño que rastrea sus raíces décadas atrás hasta parte de la filosofía original detrás de Unix. Así como Nu extiende desde un solo dato tipo de cadena de Unix, Nu también extiende la idea de tuberías (pipelines) para incluir más que solo texto. @@ -6,7 +8,7 @@ Uno de los diseños centrales de Nu es la tubería (pipeline), una idea de dise Una tubería (pipeline) es construída con tres partes: la entrada, el filtro, y la salida. -``` +```nu > open "Cargo.toml" | inc package.version | save "Cargo_new.toml" ``` @@ -38,13 +40,13 @@ Es posible que te hayas preguntado como miramos una tabla si `ls` es una entrada En efecto, el comando: -``` +```nu > ls ``` y la tubería: -``` +```nu > ls | autoview ``` diff --git a/es/book/tipos_de_datos.md b/src/content/docs/es/book/nu-fundamentals/types_of_data.md similarity index 99% rename from es/book/tipos_de_datos.md rename to src/content/docs/es/book/nu-fundamentals/types_of_data.md index 0ca80a69c2f..caeda3f6c14 100644 --- a/es/book/tipos_de_datos.md +++ b/src/content/docs/es/book/nu-fundamentals/types_of_data.md @@ -1,4 +1,6 @@ -# Tipos de datos +--- +title: Tipos de datos +--- Tradicionalmente, comandos shell de Unix se han comunidado entre ellos usando cadenas de texto. Un comando generaría de salida texto a través de la salida estándar (comúnmente abreviada 'stdout') y el otro leer texto a través de la entrada estándar (o 'stdin'). diff --git a/es/book/trabajando_con_tablas.md b/src/content/docs/es/book/nu-fundamentals/working_with_tables.md similarity index 98% rename from es/book/trabajando_con_tablas.md rename to src/content/docs/es/book/nu-fundamentals/working_with_tables.md index c86fb3d842d..0eb37a9be93 100644 --- a/es/book/trabajando_con_tablas.md +++ b/src/content/docs/es/book/nu-fundamentals/working_with_tables.md @@ -1,10 +1,12 @@ -# Trabajando con tablas +--- +title: Trabajando con tablas +--- Una de las maneras comunes de mirar datos en Nu es a través de una tabla. Nu viene con una serie de comandos que trabajan con tablas para que pueda ser más conveniente encontrar lo que estás buscando y para limitar los datos a solo lo que necesites. Para empezar, consigamos una tabla que podamos usar: -``` +```nu > ls ---+---------------+------+----------+---------+------------+------------ # | name | type | readonly | size | accessed | modified @@ -26,7 +28,7 @@ Para empezar, consigamos una tabla que podamos usar: Podemos ordenar la tabla llamando el comando `sort-by` e indicándole qué columnas queremos usar al ordenar. Digamos que deseamos ordenar nuestra tabla por tamaño de archivo: -``` +```nu > ls | sort-by size ---+---------------+------+----------+---------+------------+------------ # | name | type | readonly | size | accessed | modified @@ -50,7 +52,7 @@ Podemos ordenar una tabla con cualquier columna que pueda ser comparada. Por eje Podemos seleccionar datos de una tabla seleccionando columnas o filas específicas. Escojamos algunas columnas de nuestra tabla para usar: -``` +```nu > ls | select name size ---+---------------+--------- # | name | size @@ -70,7 +72,7 @@ Podemos seleccionar datos de una tabla seleccionando columnas o filas específic Esto ayuda a crear una table más enfocada para lo que necesitamos. Siguiente, digamos que queremos ver los 5 archivos más livianos de este directorio: -``` +```nu > ls | sort-by size | first 5 ---+---------+------+----------+--------+------------+------------ # | name | type | readonly | size | accessed | modified @@ -87,7 +89,7 @@ Notarás que primero ordenamos la tabla por tamaño para llegar hasta el archivo También puedes saltarte filas con `skip` que no deseas. Saltemos las primeras dos de las 5 filas que obtuvimos arriba: -``` +```nu > ls | sort-by size | first 5 | skip 2 ---+---------+------+----------+--------+------------+------------ # | name | type | readonly | size | accessed | modified @@ -102,7 +104,7 @@ Hemos reducido a tres filas que nos interesa. Veamos algunos otros comandos para seleccionar datos. Es posible que te hayas preguntado por qué las filas de la tabla son números. Esto actúa como una forma práctica de llegar a una sola fila. Ordenemos nuestra tabla por el nombre del archivo y luego escojamos una de las filas con el comando `n-th` usando el número de fila: -``` +```nu > ls | sort-by name ---+---------------+------+----------+---------+------------+------------ # | name | type | readonly | size | accessed | modified @@ -131,7 +133,7 @@ Veamos algunos otros comandos para seleccionar datos. Es posible que te hayas pr Hasta ahora hemos trabajado con tablas reduciendo la tabla a solo lo que necesitamos. A veces es posible que queramos ir un paso más allá y solo mirar los valores en las celdas en lugar the tomar una columna completa. Digamos, por ejemplo, que queramos obtener una lista de los nombres de los archivos. Para esto usamos el comando `get`: -``` +```nu > ls | get name ---+--------------- # | value @@ -153,7 +155,7 @@ Ahora tenemos los valores de cada nombre de los archivos. Puede parecerse al comando `select` que vimos previamente, probemos `select` para comparar los dos: -``` +```nu > ls | select name ---+--------------- # | name @@ -188,7 +190,7 @@ Además de seleccionar datos de una tabla, también podemos actualizar lo que co Podemos utilizar el comando `add` para agregar una nueva columna a la tabla. Veamos un ejemplo: -``` +```nu > open rustfmt.toml --------- edition @@ -199,7 +201,7 @@ Podemos utilizar el comando `add` para agregar una nueva columna a la tabla. Vea Agreguemos una columna llamada "next_edition" con el valor 2021: -``` +```nu > open rustfmt.toml | add next_edition 2021 ---------+-------------- edition | next_edition @@ -210,7 +212,7 @@ Agreguemos una columna llamada "next_edition" con el valor 2021: Observa que si abrimos el archivo original el contenido permanece igual: -``` +```nu > open rustfmt.toml --------- edition @@ -221,7 +223,7 @@ Observa que si abrimos el archivo original el contenido permanece igual: Los cambios en Nu son cambios funcionales, lo que significa que funcionan en los valores mismos en vez de causar cambios permanentes. Esto nos permite realizar diferentes tipos de trabajo en nuestra tubería hasta que estemos listos para grabar los resultados con cualquier cambio que nos gustaría si así decidimos. Aquí podríamos grabar los resultados usando el comando `save`: -``` +```nu > open rustfmt.toml | add next_edition 2021 | save rustfmt2.toml /home/jonathan/Source/nushell(master)> open rustfmt2.toml ---------+-------------- @@ -235,7 +237,7 @@ Los cambios en Nu son cambios funcionales, lo que significa que funcionan en los Similarmente al comando `add`, también podemos usar el comando `edit` para cambiar el contenido de una columna a un nuevo valor. Abramos el mismo archivo para verlo en acción: -``` +```nu open rustfmt.toml --------- edition @@ -246,7 +248,7 @@ open rustfmt.toml y ahora, actualizemos la edición y que apunte a la siguiente edición que esperamos soportar: -``` +```nu > open rustfmt.toml | edit edition 2021 --------- edition @@ -259,7 +261,7 @@ y ahora, actualizemos la edición y que apunte a la siguiente edición que esper Hay un comando más en Nu que nos ayudará a trabajar con números y versiones: `inc`. -``` +```nu > open rustfmt.toml --------- edition @@ -276,7 +278,7 @@ Hay un comando más en Nu que nos ayudará a trabajar con números y versiones: Como el valor en "edition" es un número, podemos usar `inc` para actualizarlo. `inc` realmente brilla cuando trabajamos con versiones: -``` +```nu > open Cargo.toml | get package.version 0.1.3 > open Cargo.toml | inc package.version --minor | get package.version diff --git a/es/book/aliases.md b/src/content/docs/es/book/programming-in-nu/aliases.md similarity index 97% rename from es/book/aliases.md rename to src/content/docs/es/book/programming-in-nu/aliases.md index 59e7a205639..53932c33ce6 100644 --- a/es/book/aliases.md +++ b/src/content/docs/es/book/programming-in-nu/aliases.md @@ -1,4 +1,6 @@ -# Aliases +--- +title: Aliases +--- La habilidad de Nu para componer tuberías largas permite tener bastante control de su sistema y datos, pero a costas de tipear mucho. Sería ideal que puedas grabar las tuberías bien elaboradas para hacer uso de esas las veces que quieras. @@ -8,7 +10,7 @@ Un alias te permite crear un nombre corto para un bloque de comandos. Cuando se Ejemplo: -``` +```nu > alias ls-nombres [] { ls | select name } > ls-nombres ────┬──────────────────── @@ -25,7 +27,7 @@ Ejemplo: También pueden tomar parámetros opcionales que son pasadas al bloque. Cada parámetro se convierte en una variable en el bloque. -``` +```nu > alias decir [mensaje] { echo $mensaje } > decir "¡hola!" ¡hola! diff --git a/es/book/variables_y_subexpresiones.md b/src/content/docs/es/book/programming-in-nu/variables_and_subexpressions.md similarity index 97% rename from es/book/variables_y_subexpresiones.md rename to src/content/docs/es/book/programming-in-nu/variables_and_subexpressions.md index 10ba0429e41..aa23e8ad51a 100644 --- a/es/book/variables_y_subexpresiones.md +++ b/src/content/docs/es/book/programming-in-nu/variables_and_subexpressions.md @@ -1,4 +1,6 @@ -# Variables y Subexpresiones +--- +title: Variables y Subexpresiones +--- En Nushell hay dos tipos de expresiones de evaluación: variables y subexpresiones. Cuando lees expresiones que empiezan con el signo dólar (`$`) sabes que trabajas con una expresión de evaluación. Esto indica que cuando Nushell toma el valor en esta posición, necesitará ejecutar un paso de evaluación para procesar la expresión y posterioremente usar el valor del resultado. Ambas formas de expresión de evaluación soportan un modo simple y una forma ruta (`path`) para trabajar con datos más complejos. @@ -8,7 +10,7 @@ La variable es el más simple de ambas expresiones de evaluación. Durante la ev Si creamos una variable, podemos imprimir su contenido al usar `$` para referir a la misma: -``` +```nu > let mi_valor = 4 > echo $mi_valor 4 @@ -18,13 +20,13 @@ Si creamos una variable, podemos imprimir su contenido al usar `$` para referir Una variable ruta funciona al llegar dentro del contenido de una variable, navegando columnas dentro de la misma para alcanzar un valor final. Supongamos que en vez de `4`, hayamos asignado una tabla como valor: -``` +```nu > let mi_valor = [[nombre]; [pruebausuario]] ``` Podemos usar variables ruta para evaluar la variable `$mi_valor` y obtener el valor de la columna `nombre` con un solo paso: -``` +```nu > echo $mi_valor.nombre pruebausuario ``` @@ -37,7 +39,7 @@ Los paréntesis contienen una tubería que se ejecutará hasta completar, y su v Subexpresiones también pueden ser tuberías y no solamente comandos individuales. Si desearamos una lista de nombres de archivos superiores a diez kilobytes, podemos utilizar subexpresiones para ejecutar una tubería y asignar el resultado a una variable: -``` +```nu > let nombres_de_archivos_grandes = (ls | where size > 10kb) > echo $nombres_de_archivos_grandes ───┬────────────┬──────┬──────────┬────────────── @@ -52,13 +54,13 @@ Subexpresiones también pueden ser tuberías y no solamente comandos individuale Subexpresiones también soportan rutas. Por ejemplo, supongamos que queremos una lista de nombres de archivos en el directorio actual. Una manera de hacerlo es con una tubería: -``` +```nu > ls | get name ``` Pero también podemos hacer una acción similar con un solo paso usando una subexpresión de ruta: -``` +```nu > echo (ls).name ``` diff --git a/src/content/docs/es/index.mdx b/src/content/docs/es/index.mdx new file mode 100755 index 00000000000..a51e0591a7a --- /dev/null +++ b/src/content/docs/es/index.mdx @@ -0,0 +1,52 @@ +--- +title: Nushell +description: Un nuevo tipo de shell. +template: splash +editUrl: true +lastUpdated: false +hero: + tagline: Un nuevo tipo de shell + actions: + - text: Empezar + link: /introduction/ + icon: right-arrow + variant: primary + - text: GitHub + link: https://github.com/nushell/nushell.github.io + icon: external +--- + +import { Card, CardGrid } from "@astrojs/starlight/components"; + +<CardGrid> + <Card title="Pipelines potentes para controlar tu sistema"> + Pipelines permiten trabajar con tu sistema como nunca antes. Tienes el + control del sistema, listo para tu siguiente comando. + </Card> + <Card title="Todo es data"> + En lugar de tener la necesidad de recordar todos los parámetros de todos los + comandos, podemos usar los mismos, independientemente de su procedencia. + </Card> + <Card title="Plugins"> + Nu no puede incluir todo lo que quieras hacer con él, por lo que puedes + extenderlo usando su sistema fuerte de plugins. + </Card> +</CardGrid> + +<br /> + + + +## Nu works with existing data + +Nu speaks [JSON, YAML, SQLite, Excel, and more](https://www.nushell.sh/book/loading_data) out of the box. It's easy to bring data into a Nu pipeline whether it's in a file, a database, or a web API: + + + +## Nu has great error messages + +Nu operates on typed data, so it catches bugs that other shells don't. And when things break, Nu tells you exactly where and why: + + + +Sugerencias o propuestas de cambios son bienvenidas. Escríbenos diff --git a/src/content/docs/index.mdx b/src/content/docs/index.mdx new file mode 100644 index 00000000000..5f56dc86110 --- /dev/null +++ b/src/content/docs/index.mdx @@ -0,0 +1,49 @@ +--- +title: Nushell +description: A new type of shell +template: splash +editUrl: true +lastUpdated: false +hero: + tagline: A new type of shell + actions: + - text: Get Started + link: /book/getting-started/introduction/ + icon: right-arrow + variant: primary + - text: View on GitHub + link: https://github.com/nushell/nushell.github.io + icon: external +--- + +import { Card, CardGrid } from "@astrojs/starlight/components"; + +<CardGrid> + <Card title="Pipelines to control any OS"> + Nu works on Linux, macOS, BSD, and Windows. Learn it once, then use it + anywhere. + </Card> + <Card title="Everything is data"> + Nu pipelines use structured data so you can safely select, filter, and sort + the same way every time. Stop parsing strings and start solving problems. + </Card> + <Card title="Powerful plugins"> + It's easy to extend Nu using a powerful plugin system. + </Card> +</CardGrid> + +<br /> + + + +## Nu works with existing data + +Nu speaks [JSON, YAML, SQLite, Excel, and more](https://www.nushell.sh/book/loading_data) out of the box. It's easy to bring data into a Nu pipeline whether it's in a file, a database, or a web API: + + + +## Nu has great error messages + +Nu operates on typed data, so it catches bugs that other shells don't. And when things break, Nu tells you exactly where and why: + + diff --git a/ja/book/metadata.md b/src/content/docs/ja/book/advanced/metadata.md similarity index 98% rename from ja/book/metadata.md rename to src/content/docs/ja/book/advanced/metadata.md index 6dbe823bff3..70875b01448 100644 --- a/ja/book/metadata.md +++ b/src/content/docs/ja/book/advanced/metadata.md @@ -1,8 +1,10 @@ -# メタデータ +--- +title: メタデータ +--- Nu を使用していると裏でなにか特別なことがおきているのではないかと思うことがあるでしょう。例えば、Nu がサポートしているファイル形式を忘れていて、余計に変換しようとしてしまったとしましょう。 -``` +```nu > open Cargo.toml | from toml error: Expected a string from pipeline - shell:1:18 @@ -19,7 +21,7 @@ Nu のパイプラインを流れる値には、多くの場合、メタデー もう一度`open`コマンドを実行してみましょう、ただし今回は、返されるタグを確認します。 -``` +```nu > open Cargo.toml | tags ────────┬─────────────────────────────────────────── span │ [row end start] @@ -31,7 +33,7 @@ Nu のパイプラインを流れる値には、多くの場合、メタデー 今度は span をみてみましょう。 -``` +```nu > open Cargo.toml | tags | get span ───────┬──── start │ 5 diff --git a/ja/book/plugins.md b/src/content/docs/ja/book/advanced/plugins.md similarity index 97% rename from ja/book/plugins.md rename to src/content/docs/ja/book/advanced/plugins.md index 658768b3c45..133d72592db 100644 --- a/ja/book/plugins.md +++ b/src/content/docs/ja/book/advanced/plugins.md @@ -1,4 +1,6 @@ -# プラグイン +--- +title: プラグイン +--- プラグインを用いることで Nu の機能を拡張することができます。プラグインは、Nu の組み込みコマンドと同じ操作の多くを実行することができ、Nu 本体とは別に追加できるという利点もあります。 diff --git a/ja/book/command_reference.md b/src/content/docs/ja/book/command_reference.md similarity index 92% rename from ja/book/command_reference.md rename to src/content/docs/ja/book/command_reference.md index cb237001533..0b8ed870411 100644 --- a/ja/book/command_reference.md +++ b/src/content/docs/ja/book/command_reference.md @@ -1,4 +1,6 @@ -# Command Reference +--- +title: コマンドリファレンス +--- <script> import pages from '@temp/pages' diff --git a/src/content/docs/ja/book/comming-to-nu/coming_from_bash.md b/src/content/docs/ja/book/comming-to-nu/coming_from_bash.md new file mode 100644 index 00000000000..fce71f545dc --- /dev/null +++ b/src/content/docs/ja/book/comming-to-nu/coming_from_bash.md @@ -0,0 +1,51 @@ +--- +title: Bash から来た人向け +--- + +注: このテーブルは Nu 1.14.1 以降を想定しています。 + +| Bash | Nu | Task | +| ------------------------------------ | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | +| `ls` | `ls` | Lists the files in the current directory | +| `ls <dir>` | `ls <dir>` | Lists the files in the given directory | +| `ls pattern*` | `ls pattern*` | Lists files that match a given pattern | +| `ls -la` | `ls --long --all` or `ls -la` | List files with all available information, including hidden files | +| `ls -d */` | `ls \| where type == Dir` | List directories | +| `find . -name *.rs` | `ls **/*.rs` | Find recursively all files that match a given pattern | +| `cd <directory>` | `cd <directory>` | Change to the given directory | +| `cd` | `cd` | Change to the home directory | +| `mkdir <path>` | `mkdir <path>` | Creates the given path | +| `mkdir -p <path>` | `mkdir <path>` | Creates the given path, creating parents as necessary | +| `touch test.txt` | `touch test.txt` | Create a file | +| `> <path>` | `\| save --raw <path>` | Save string into a file | +| `cat <path>` | `open --raw <path>` | Display the contents of the given file | +| | `open <path>` | Read a file as structured data | +| `mv <source> <dest>` | `mv <source> <dest>` | Move file to new location | +| `cp <source> <dest>` | `cp <source> <dest>` | Copy file to new location | +| `cp -r <source> <dest>` | `cp -r <source> <dest>` | Copy directory to a new location, recursively | +| `rm <path>` | `rm <path>` | Remove the given file | +| | `rm -t <path>` | Move the given file to the system trash | +| `rm -rf <path>` | `rm -r <path>` | Recursively removes the given path | +| `chmod` | `<not yet possible>` | Changes the file attributes | +| `date -d <date>` | `echo <date> \| str to-datetime -f <format>` | Parse a date ([format documentation](https://docs.rs/chrono/0.4.15/chrono/format/strftime/index.html)) | +| `sed` | `str find-replace` | Find and replace a pattern in a string | +| `grep <pattern>` | `where $it =~ <substring>` | Filter strings that contain the substring | +| `man <command>` | `help <command>` | Get the help for a given command | +| | `help commands` | List all available commands | +| | `help --find <string>` | Search for match in all available commands | +| `command1 && command2` | `command1; command2` | Run a command, and if it's successful run a second | +| `stat $(which git)` | `stat (which git).path` | Use command output as argument for other command | +| `echo $PATH` | `echo $nu.path` | See the current path | +| `<update ~/.bashrc>` | `config set path [<dir1> <dir2> ...]` | Update PATH permanently | +| `export PATH = $PATH:/usr/other/bin` | `pathvar add <path>` | Update PATH temporarily | +| `export` | `echo $nu.env` | List the current environment variables | +| `<update ~/.bashrc>` | `echo $nu.env \| insert var value \| config set_into env` | Update environment variables permanently | +| `FOO=BAR ./bin` | `FOO=BAR ./bin` | Update environment temporarily | +| `export FOO=BAR` | `$env.FOO = BAR` | Set environment variable for current session | +| `unset FOO` | `$env.FOO = $nothing` | Unset environment variable for current session | +| `alias s="git status -sb"` | `alias s = git status -sb` | Define an alias temporarily | +| `<update ~/.bashrc>` | `alias --save myecho [msg] { echo Hello $msg }` | Define an alias for all sessions (persist it in startup config) | +| `<update ~/.bashrc>` | `<update nu/config.toml>` | Add and edit alias permanently (for new shells), find path for the file with `config path` | +| `bash -c <commands>` | `nu -c <commands>` | Run a pipeline of commands (requires 0.9.1 or later) | +| `bash <script file>` | `nu <script file>` | Run a script file (requires 0.9.1 or later) | +| `\` | `<not yet possible>` | Line continuation is not yet supported. | diff --git a/ja/book/nushell_map.md b/src/content/docs/ja/book/comming-to-nu/nushell_map.md similarity index 99% rename from ja/book/nushell_map.md rename to src/content/docs/ja/book/comming-to-nu/nushell_map.md index f69b7b26f26..9c4135502ae 100644 --- a/ja/book/nushell_map.md +++ b/src/content/docs/ja/book/comming-to-nu/nushell_map.md @@ -1,4 +1,6 @@ -# 他のシェルと DSL から Nu への対応表 +--- +title: 他のシェルと DSL から Nu への対応表 +--- このテーブルは Nu の組込みコマンドやプラグインと他のシェルや DLS(Domain Specific Languages)との対応関係を理解することを助けるためのものです。ここでは全ての Nu コマンドとそのコマンドが他の言語でどう使われているかをマッピングしています。コントリビューション歓迎です。 diff --git a/ja/book/nushell_map_functional.md b/src/content/docs/ja/book/comming-to-nu/nushell_map_functional.md similarity index 99% rename from ja/book/nushell_map_functional.md rename to src/content/docs/ja/book/comming-to-nu/nushell_map_functional.md index ad292f845e3..09aff5a9432 100644 --- a/ja/book/nushell_map_functional.md +++ b/src/content/docs/ja/book/comming-to-nu/nushell_map_functional.md @@ -1,4 +1,6 @@ -# 関数型言語から Nu への対応表 +--- +title: 関数型言語から Nu への対応表 +--- このテーブルは Nu の組込みコマンドやプラグインと他の関数型言語との対応関係を理解することを助けるためのものです。ここでは全ての Nu コマンドとそのコマンドが他の言語でどう使われているかをマッピングしています。コントリビューション歓迎です。 diff --git a/ja/book/nushell_map_imperative.md b/src/content/docs/ja/book/comming-to-nu/nushell_map_imperative.md similarity index 98% rename from ja/book/nushell_map_imperative.md rename to src/content/docs/ja/book/comming-to-nu/nushell_map_imperative.md index 9fecae66120..01334243904 100644 --- a/ja/book/nushell_map_imperative.md +++ b/src/content/docs/ja/book/comming-to-nu/nushell_map_imperative.md @@ -1,4 +1,6 @@ -# 命令形言語から Nu への対応表 +--- +title: 命令形言語から Nu への対応表 +--- このテーブルは Nu の組込みコマンドやプラグインと他の命令型言語との対応関係を理解することを助けるためのものです。ここでは全ての Nu コマンドとそのコマンドが他の言語でどう使われているかをマッピングしています。コントリビューション歓迎です。 @@ -39,7 +41,7 @@ | help | help | | | | | histogram | | | | | | history | | | | | -| http(`*`) | urllib.request.urlopen | | | | +| http(`*`) | urllib.request.urlopen | | | | | inc(`*`) | x += 1 | x++ | x++ | x += 1 | | insert | list.insert | | | | | is_empty | is None | isEmpty | empty | is_empty | diff --git a/ja/book/nushell_operator_map.md b/src/content/docs/ja/book/comming-to-nu/nushell_operator_map.md similarity index 98% rename from ja/book/nushell_operator_map.md rename to src/content/docs/ja/book/comming-to-nu/nushell_operator_map.md index 9a736fa97c4..1a14c6f3a98 100644 --- a/ja/book/nushell_operator_map.md +++ b/src/content/docs/ja/book/comming-to-nu/nushell_operator_map.md @@ -1,4 +1,6 @@ -# Nushell 演算子対応表 +--- +title: Nushell 演算子対応表 +--- このテーブルは Nu の演算子と他言語の演算子の対応関係を理解するのを助けるためのものです。ここでは全ての Nu の演算子とその演算子が他の言語でどう使われているかをマッピングしています。コントリビューション歓迎です。 diff --git a/ja/book/README.md b/src/content/docs/ja/book/get_started.md similarity index 99% rename from ja/book/README.md rename to src/content/docs/ja/book/get_started.md index b935d7b9404..493cbbc3d10 100644 --- a/ja/book/README.md +++ b/src/content/docs/ja/book/get_started.md @@ -1,4 +1,6 @@ -# はじめに +--- +title: はじめに +--- こんにちは、Nushellプロジェクトへようこそ。 diff --git a/ja/book/installation.md b/src/content/docs/ja/book/getting-started/installation.mdx similarity index 79% rename from ja/book/installation.md rename to src/content/docs/ja/book/getting-started/installation.mdx index 9d61ab94303..00380ea8a5f 100644 --- a/ja/book/installation.md +++ b/src/content/docs/ja/book/getting-started/installation.mdx @@ -1,10 +1,24 @@ -# Nu のインストール +--- +title: Nu のインストール +--- + +import { Code } from "@astrojs/starlight/components"; +import runNu from "../../../snippets/installation/run_nu.nu?raw"; +import rustupChooseRustVersion from "../../../snippets/installation/rustup_choose_rust_version.nu?raw"; +import installPkgConfigLibsslDiv from "../../../snippets/installation/install_pkg_config_libssl_dev.nu?raw"; +import installRhelDependencies from "../../../snippets/installation/install_rhel_dependencies.nu?raw"; +import macosDeps from "../../../snippets/installation/macos_deps.nu?raw"; +import cargoInstallNu from "../../../snippets/installation/cargo_install_nu.nu?raw"; +import cargoInstallNuMoreFeatures from "../../../snippets/installation/cargo_install_nu_more_features.nu?raw"; +import gitCloneNu from "../../../snippets/installation/git_clone_nu.nu?raw"; +import buildNuFromSource from "../../../snippets/installation/build_nu_from_source.nu?raw"; +import buildNuFromSourceRelease from "../../../snippets/installation/build_nu_from_source_release.nu?raw"; Nu を入手して実行するには多くの方法があります。[リリースページ](https://github.com/nushell/nushell/releases) からビルド済みのバイナリーをダウンロードすることもできますし、 [あなたの好きなパッケージマネージャーを使う](https://repology.org/project/nushell/versions) ことも、あるいはソースからビルドする方法もあります。 Nushell のメインのバイナリーは `nu` (Windowsでは `nu.exe`) という名前です。インストールが済めば、 `nu` と打って起動することができます。 -@[code](@snippets/installation/run_nu.sh) +<Code code={runNu} lang="nu" /> ## ビルド済みのバイナリー @@ -50,7 +64,7 @@ Nu は現在、 **最新の stable (1.66.1 or later)** バージョンの Rust `rustup`で正しい version を選択するのが良い方法です。 最初に"rustup"を実行すると、インストールする Rust のバージョンを尋ねられます。 -@[code](@snippets/installation/rustup_choose_rust_version.sh) +<Code code={rustupChooseRustVersion} lang="nu" /> 準備ができたら、1 を押してからエンターを押します。 @@ -63,45 +77,45 @@ Nu は現在、 **最新の stable (1.66.1 or later)** バージョンの Rust "pkg-config"および"libssl-dev"パッケージをインストールしてください。 -@[code](@snippets/installation/install_pkg_config_libssl_dev.sh) +<Code code={installPkgConfigLibsslDiv} lang="nu" /> #### RHEL ベースのディストロ "libxcb", "openssl-devel"および"libX11-devel"パッケージをインストールする必要があります。 -@[code](@snippets/installation/install_rhel_dependencies.sh) +<Code code={installRhelDependencies} lang="nu" /> #### macOS [Homebrew](https://brew.sh/)を利用して、"openssl"と"cmake"をインストールしてください。 -@[code](@snippets/installation/macos_deps.sh) +<Code code={macosDeps} lang="nu" /> ### [crates.io](https://crates.io) を利用してのビルド Nu はソースの形で、Rust で人気のパッケージレジストリ [crates.io](https://crates.io/) にリリースされています。これにより、`cargo` を使って簡単に最新の Nu リリースをビルド、インストールすることができます。 -@[code](@snippets/installation/cargo_install_nu.sh) +<Code code={cargoInstallNu} lang="nu" /> これでおしまいです!`cargo`は Nu のソースコードとその依存関係をダウンロードしてビルドし、`cargo`のバイナリーパスにインストールすることで Nu を実行できるようにします。 もし [dataframes](book/dataframes.md) サポートをともにインストールしたいなら、 `--features=dataframe` フラグを使ってインストールすることができます。 -@[code](@snippets/installation/cargo_install_nu_more_features.sh) +<Code code={cargoInstallNuMoreFeatures} lang="nu" /> ### GitHub リポジトリからのビルド GitHub の最新のソースから直接ビルドすることもできます。こうすることで、最新の機能やバグ修正にすぐにアクセスすることができます。まず、リポジトリをクローンします。 -@[code](@snippets/installation/git_clone_nu.sh) +<Code code={gitCloneNu} lang="nu" /> これで、Nu をビルドして実行できます。 -@[code](@snippets/installation/build_nu_from_source.sh) +<Code code={buildNuFromSource} lang="nu" /> さらに最適化されたリリースモードで Nu をビルドし実行することもできます。 -@[code](@snippets/installation/build_nu_from_source_release.sh) +<Code code={buildNuFromSourceRelease} lang="nu" /> Rust に慣れている人は、"run"がデフォルトでビルドを行うのに、なぜ"build"と"run"の両方を行うのか疑問に思うかもしれません。 これは Cargo の新しい`default-run`オプションの欠点を回避し、全てのプラグインがビルドされるようにするためですが、将来的には必要なくなるかもしれません。 diff --git a/ja/book/introduction.md b/src/content/docs/ja/book/getting-started/introduction.mdx similarity index 77% rename from ja/book/introduction.md rename to src/content/docs/ja/book/getting-started/introduction.mdx index 87cee7715b7..8b8c9b50043 100644 --- a/ja/book/introduction.md +++ b/src/content/docs/ja/book/getting-started/introduction.mdx @@ -1,4 +1,20 @@ -# はじめに +--- +title: はじめに +--- + +import { Code } from "@astrojs/starlight/components"; +import lsExample from "../../../snippets/introduction/ls_example.nu?raw"; +import lsSortByReverseExample from "../../../snippets/introduction/ls_sort_by_reverse_example.nu?raw"; +import lsWhereExample from "../../../snippets/introduction/ls_where_example.nu?raw"; +import psExample from "../../../snippets/introduction/ps_example.nu?raw"; +import psWhereExample from "../../../snippets/introduction/ps_where_example.nu?raw"; +import dateExample from "../../../snippets/introduction/date_example.nu?raw"; +import dateTableExample from "../../../snippets/introduction/date_table_example.nu?raw"; +import sysExample from "../../../snippets/introduction/sys_example.nu?raw"; +import sysGetExample from "../../../snippets/introduction/sys_get_example.nu?raw"; +import sysGetNestedExample from "../../../snippets/introduction/sys_get_nested_example.nu?raw"; +import sysGetExternalEchoExample from "../../../snippets/introduction/sys_get_external_echo_example.nu?raw"; +import helpExample from "../../../snippets/introduction/help_example.nu?raw"; こんにちは、Nushell プロジェクトへようこそ。このプロジェクトのゴールは、シンプルなコマンドをパイプでつなぎ合わせるというシェルの Unix 哲学を現代の開発スタイルにもちこむことです。 @@ -12,47 +28,47 @@ Nu になにができるかをみるには、実際に使ってみることが `ls`コマンドを実行して最初に気づくことは、テキストブロックではなく、構造化されたテーブルデータが返ってくることです。 -@[code](@snippets/introduction/ls_example.sh) +<Code code={lsExample} lang="nu" /> このテーブルはディレクトリの内容を別の方法で表示しているだけではありません。このテーブルを利用するとスプレッドシートと同じように、よりインタラクティブにデータを操作できます。 最初に行うことはテーブルをサイズでソートすることです。これを行うには`ls`の出力を取得して、カラムの内容に基づいてテーブルをソートするコマンドに入力します。 -@[code](@snippets/introduction/ls_sort_by_reverse_example.sh) +<Code code={lsSortByReverseExample} lang="nu" /> この作業をおこなうために、`ls`にコマンドライン引数を渡していないことがわかります。代わりに、Nu が提供する`sort-by`コマンドを利用して、`ls`コマンドの出力をソートしています。また、一番大きなファイルを表示するために逆順に並び替えています。 Nu にはテーブルを扱うための多くのコマンドが用意されています。例えば、1 キロバイトを超えるファイルのみを表示するように`ls`コマンドの出力をフィルターできます。 -@[code](@snippets/introduction/ls_where_example.sh) +<Code code={lsWhereExample} lang="nu" /> Unix 哲学にあるように、コマンドをつなぎ合わせることで様々な組み合わせを作り出すことができます。別のコマンドをみてみましょう。 -@[code](@snippets/introduction/ps_example.sh) +<Code code={psExample} lang="nu" /> もしあなたが Linux を利用しているなら`ps`コマンドには馴染みがあるでしょう。これを使うと、現在システムが実行しているすべてのプロセスの状態や名前の一覧を取得することができます。プロセスの CPU 負荷も確認することができます。 CPU をアクティブに利用しているプロセスを表示したい場合はどうでしょうか。さきほどの`ls`コマンドと同じように、`ps`コマンドが返すテーブルを利用することができます。 -@[code](@snippets/introduction/ps_where_example.sh) +<Code code={psWhereExample} lang="nu" /> これまで、`ls`と`ps`を利用してファイルやプロセスの一覧を表示しました。Nu はこの他にも便利なテーブルを作り出すコマンドを提供します。次に`date`と`sys`をみてみましょう。 `date now`を実行すると、現在の日時と時間に関する情報が得られます。 -@[code](@snippets/introduction/date_example.sh) +<Code code={dateExample} lang="nu" /> `sys`は Nu が実行されているシステムに関する情報を提供します。 -@[code](@snippets/introduction/sys_example.sh) +<Code code={sysExample} lang="nu" /> これはさきほどまでのテーブルと少し異なります。`sys`コマンドは単純な値ではなくセルに構造化されたテーブルを含むテーブルを提供します。このデータを見るには表示する列を選択する必要があります。 -@[code](@snippets/introduction/sys_get_example.sh) +<Code code={sysGetExample} lang="nu" /> `get`コマンドを利用するとテーブルのカラムの内容を調べることができます。ここでは、Nu が実行されているホストに関する情報を含む"host"列を調べています。OS の名前、ホスト名、CPU などです。システム上のユーザーの名前を取得してみましょう。 -@[code](@snippets/introduction/sys_get_nested_example.sh) +<Code code={sysGetNestedExample} lang="nu" /> 現在、システムには"jonathan"という名前のユーザが1人だけいます。列の名前だけではなくパスも渡せることに気づくでしょう。Nu はパスを受け取るとテーブルの対応するデータを取得します。 @@ -60,10 +76,10 @@ CPU をアクティブに利用しているプロセスを表示したい場合 実際に Nu の外で文字列がどのように機能するか見てみましょう。先ほどの例で外部の`echo`コマンドを実行します。(`^`は組込みの`echo`コマンドを使用しないよう指示しています)。 -@[code](@snippets/introduction/sys_get_external_echo_example.sh) +<Code code={sysGetExternalEchoExample} lang="nu" /> するどい読者にはこれが以前ものと似ていると思われるでしょう。しかし、さきほどの出力で`echo`を呼び出しているという重要な違いがあります。このように、Nu からデータを`echo`(または`git`のような Nu 以外の任意のコマンド)にわたすことができるのです。 注:Nu の組み込みコマンドのヘルプテキストは、`help`コマンドで検出できます。 -@[code](@snippets/introduction/help_example.sh) +<Code code={helpExample} lang="nu" /> diff --git a/ja/book/moving_around.md b/src/content/docs/ja/book/getting-started/moving_around.mdx similarity index 66% rename from ja/book/moving_around.md rename to src/content/docs/ja/book/getting-started/moving_around.mdx index 1b570fdb450..a183a3270ef 100644 --- a/ja/book/moving_around.md +++ b/src/content/docs/ja/book/getting-started/moving_around.mdx @@ -1,34 +1,47 @@ -# システム内の移動 +--- +title: システム内の移動 +--- + +import { Code } from "@astrojs/starlight/components"; +import lsExample from "../../../snippets/moving_around/ls_example.nu?raw"; +import lsShallowGlobExample from "../../../snippets/moving_around/ls_shallow_glob_example.nu?raw"; +import lsDeepGlobExample from "../../../snippets/moving_around/ls_deep_glob_example.nu?raw"; +import cdExample from "../../../snippets/moving_around/cd_example.nu?raw"; +import cdWithoutCommandExample from "../../../snippets/moving_around/cd_without_command_example.nu?raw"; +import mvExample from "../../../snippets/moving_around/mv_example.nu?raw"; +import cpExample from "../../../snippets/moving_around/cp_example.nu?raw"; +import rmExample from "../../../snippets/moving_around/rm_example.nu?raw"; +import mkdirExample from "../../../snippets/moving_around/mkdir_example.nu?raw"; 初期のシェルを使うとシステム内を移動してコマンドを実行することができますが、Nu のような現代的なシェルでも同じことができます。システムを操作する際によく使われるコマンドをいくつか見てみましょう。 ## ディレクトリの内容を確認する -@[code](@snippets/moving_around/ls_example.sh) +<Code code={lsExample} lang="nu" /> 他の章でみてきたように、`ls`はパスの内容を表示するためのコマンドです。Nu はパスの内容をテーブルとして返してくれます。 `ls`コマンドには表示する内容を変更するためにオプションで引数を渡すことができます。例えば".md"で終わるファイルの一覧を表示することができます。glob"\*.md"はファイルが'.md'で終わっていればマッチすると読むことができます。 -@[code](@snippets/moving_around/ls_shallow_glob_example.sh) +<Code code={lsShallowGlobExample} lang="nu" /> 上記のオプション引数"\*.txt"の中で利用されているアスタリスク(\*)はしばしばワイルドカードやグロブと呼ばれ、何にでもマッチします。グロブ"\*.txt"は"'.txt'で終わる任意のファイルにマッチする"と読むことができます。 Nu はより深いディレクトリにアクセスできる最新のグロブも利用します。 -@[code](@snippets/moving_around/ls_deep_glob_example.sh) +<Code code={lsDeepGlobExample} lang="nu" /> ここでは".md"で終わるファイルを探していますが、2つのアスタリスクはさらに"ここから始まる任意のディレクトリにある"という意味です。 ## 現在のディレクトリを変更する -@[code](@snippets/moving_around/cd_example.sh) +<Code code={cdExample} lang="nu" /> 現在のディレクトリを変更するには`cd`コマンドを使います。他のシェルと同じように、ディレクトリの名前か上の階層に移動する場合は`..`ショートカットを利用します。 `cd`を省略してパスだけを指定することでも現在の作業ディレクトリを変更することができます。 -@[code](@snippets/moving_around/cd_without_command_example.sh) +<Code code={cdWithoutCommandExample} lang="nu" /> ## ファイルシステムのコマンド @@ -36,18 +49,18 @@ Nu はクロスプラットフォームで動作するいくつかの基本的 `mv`コマンドを利用すればアイテムをある場所から別の場所へ移動できます。 -@[code](@snippets/moving_around/mv_example.sh) +<Code code={mvExample} lang="nu" /> ある場所から別の場所へアイテムのコピーができます。 -@[code](@snippets/moving_around/cp_example.sh) +<Code code={cpExample} lang="nu" /> アイテムの削除ができます。 -@[code](@snippets/moving_around/rm_example.sh) +<Code code={rmExample} lang="nu" /> 3つのコマンドは`ls`コマンドでみたグロブ機能も利用できます。 最後に、`mkdir`コマンドで新しいディレクトリを作成できます。 -@[code](@snippets/moving_around/mkdir_example.sh) +<Code code={mkdirExample} lang="nu" /> diff --git a/ja/book/quick_tour.md b/src/content/docs/ja/book/getting-started/quick_tour.mdx similarity index 78% rename from ja/book/quick_tour.md rename to src/content/docs/ja/book/getting-started/quick_tour.mdx index d0d41e9494e..ccc29131875 100644 --- a/ja/book/quick_tour.md +++ b/src/content/docs/ja/book/getting-started/quick_tour.mdx @@ -1,54 +1,70 @@ -# クイックツアー +--- +title: クイックツアー +--- + +import { Code } from "@astrojs/starlight/components"; +import lsExample from "../../../snippets/introduction/ls_example.nu?raw"; +import lsSortByReverseExample from "../../../snippets/introduction/ls_sort_by_reverse_example.nu?raw"; +import lsWhereExample from "../../../snippets/introduction/ls_where_example.nu?raw"; +import psExample from "../../../snippets/introduction/ps_example.nu?raw"; +import psWhereExample from "../../../snippets/introduction/ps_where_example.nu?raw"; +import dateExample from "../../../snippets/introduction/date_example.nu?raw"; +import dateTableExample from "../../../snippets/introduction/date_table_example.nu?raw"; +import sysExample from "../../../snippets/introduction/sys_example.nu?raw"; +import sysGetExample from "../../../snippets/introduction/sys_get_example.nu?raw"; +import sysGetNestedExample from "../../../snippets/introduction/sys_get_nested_example.nu?raw"; +import sysGetExternalEchoExample from "../../../snippets/introduction/sys_get_external_echo_example.nu?raw"; +import helpExample from "../../../snippets/introduction/help_example.nu?raw"; Nu で何ができるかを知るための最も簡単な方法は、例をいくつか見ることです。では始めましょう。 [`ls`](/commands/docs/ls.md) などのコマンドを実行してまず気づくことは、テキストブロックの代わりに構造化されたテーブルが返ってくることです。 -@[code](@snippets/introduction/ls_example.sh) +<Code code={lsExample} lang="nu" /> このテーブルは、ただ別の形でディレクトリを表示しているだけではありません。スプレッドシートのように、このテーブルではデータをより対話的に扱うことができます。 はじめに、テーブルをサイズでソートしてみましょう。 [`ls`](/commands/docs/ls.md) の出力を取得し、カラムの値に基づいてテーブルをソートするコマンドに渡してみます。 -@[code](@snippets/introduction/ls_sort_by_reverse_example.sh) +<Code code={lsSortByReverseExample} lang="nu" /> これをするのに、 [`ls`](/commands/docs/ls.md) にコマンドライン引数を渡してはいないことが確認できます。代わりに、 Nu が [`ls`](/commands/docs/ls.md) コマンドの出力をソートするために提供している [`sort-by`](/commands/docs/sort-by.md) コマンドを使用しています。また、最も大きいファイルが一番上に来るように、 [`reverse`](/commands/docs/reverse.md) も使用しています。 Nu はテーブルを操作するコマンドを多数提供しています。例えば、 [`where`](/commands/docs/where.md) を使用して [`ls`](/commands/docs/ls.md) テーブルのコンテンツをフィルターすることができるので、1キロバイトを超えるファイルのみを表示することができます。 -@[code](@snippets/introduction/ls_where_example.sh) +<Code code={lsWhereExample} lang="nu" /> Unix の哲学と同様、互いに対話可能なコマンドにより、さまざまな異なる組み合わせの使用が可能になります。では、別のコマンドを見てみましょう。 -@[code](@snippets/introduction/ps_example.sh) +<Code code={psExample} lang="nu" /> もし Linux を使用したことがあるなら、 [`ps`](/commands/docs/ps.md) コマンドは馴染みがあるでしょう。これを使用して、システム上で現在実行されている全てのプロセスのリストと、それらのステータス、名前を取得することができます。プロセスのCPU使用率を見ることもできます。 いま表示したいのは、CPUをたくさん使用しているプロセスですか? [`ls`](/commands/docs/ls.md) コマンドで以前したのと同じように、 [`ps`](/commands/docs/ps.md) コマンドが返したテーブルに対しても操作することができます。 -@[code](@snippets/introduction/ps_where_example.sh) +<Code code={psWhereExample} lang="nu" /> いま、[`ls`](/commands/docs/ls.md) と [`ps`](/commands/docs/ps.md) を使用してファイルとプロセスのリストを表示しました。Nu はほかにも有用な情報をもつテーブルを作成するコマンドを提供しています。次は、 [`date`](/commands/docs/date.md) と [`sys`](/commands/docs/sys.md) について見てみましょう。 [`date now`](/commands/docs/date_now.md) を実行すると、現在の日時に関する情報が得られます。 -@[code](@snippets/introduction/date_example.sh) +<Code code={dateExample} lang="nu" /> テーブルとして取得したい場合は、これを [`date to-table`](/commands/docs/date_to-table.md) に渡します。 -@[code](@snippets/introduction/date_table_example.sh) +<Code code={dateTableExample} lang="nu" /> [`sys`](/commands/docs/sys.md) を実行すると、 Nu が実行されているシステムに関する情報が得られます。 -@[code](@snippets/introduction/sys_example.sh) +<Code code={sysExample} lang="nu" /> これはいままでに見たテーブルと少し異なります。 [`sys`](/commands/docs/sys.md) コマンドは、単純な値の代わりに構造化されたテーブルをセルに持つテーブルを返します。このデータを覗くには、カラムを _get_ する必要があります。 -@[code](@snippets/introduction/sys_get_example.sh) +<Code code={sysGetExample} lang="nu" /> [`get`](/commands/docs/get.md) コマンドを使用すると、テーブルのカラムの内容にジャンプすることができます。この例では、 Nu が実行されているホストに関する情報が含まれる "host" カラムを見ています。OSの名前、ホスト名、CPUなどです。では、システム上に存在するユーザーの名前を取得してみましょう。 -@[code](@snippets/introduction/sys_get_nested_example.sh) +<Code code={sysGetNestedExample} lang="nu" /> いま、システムには "jt" という名前のユーザー一人だけがいます。ここで、ただのカラム名ではなく、カラムのパス( `host.sessions.name` の部分)を渡していることに気づくでしょう。Nu はカラムのパスを受け取って、テーブル中の対応する部分に移動します。 @@ -56,7 +72,7 @@ Unix の哲学と同様、互いに対話可能なコマンドにより、さま 実際に Nu の外部での文字列の働きを見てみましょう。先程の例にならい、[`echo`](/commands/docs/echo.md) コマンド( `^` は Nu に、ビルトインの [`echo`](/commands/docs/echo.md) コマンドを使用しないことを伝えます)を実行してみます -@[code](@snippets/introduction/sys_get_external_echo_example.sh) +<Code code={sysGetExternalEchoExample} lang="nu" /> これが前に試したものとよく似ているように見えるなら鋭いです!これは似ていますが、一つ重要な違いがあります。先程の値で `^echo` を呼び出しました。これで、データをNu から [`echo`](/commands/docs/echo.md) (あるいは `git` のような、あらゆる Nu の外部のコマンド)に渡すことができるのです。 @@ -64,4 +80,4 @@ Unix の哲学と同様、互いに対話可能なコマンドにより、さま Nu のビルトインコマンド全てのヘルプテキストは、 [`help`](/commands/docs/help.md) で見つけることができます。すべてのコマンドを見たい場合は、 [`help commands`](/commands/docs/help_commands.md) を実行してください。また、 `help -f <topic>` を実行すれば、あるトピックについて検索することもできます。 -@[code](@snippets/introduction/help_example.sh) +<Code code={helpExample} lang="nu" /> diff --git a/ja/book/getting_started.md b/src/content/docs/ja/book/getting_started.md similarity index 95% rename from ja/book/getting_started.md rename to src/content/docs/ja/book/getting_started.md index 6b2915a7039..a1c2df11f4e 100644 --- a/ja/book/getting_started.md +++ b/src/content/docs/ja/book/getting_started.md @@ -1,4 +1,6 @@ -# はじめに +--- +title: はじめに +--- さあ、始めましょう! 🐘 diff --git a/ja/book/math.md b/src/content/docs/ja/book/math.md similarity index 97% rename from ja/book/math.md rename to src/content/docs/ja/book/math.md index 1db1c656e61..e2149d372e1 100644 --- a/ja/book/math.md +++ b/src/content/docs/ja/book/math.md @@ -1,4 +1,6 @@ -# Math +--- +title: Math +--- 何かの作業をしているとき、いくつかの数字を足し算したくなるときがあります。Nu には基本的な数学演算が用意されています。 @@ -6,7 +8,7 @@ ## 四則演算 -``` +```nu > = 1 + 3 4 ``` @@ -21,12 +23,12 @@ math mode では括弧を利用して数式をグループ化できます。こ `in`と`not-in`演算子を使って、値が集合に含まれるかどうかを調べることができます。 -``` +```nu > = 1 in [1 2 3] true ``` -``` +```nu > = 1 not-in [1 2 3] false ``` @@ -35,12 +37,12 @@ false `=~`と`!~`演算子を使って文字列が他の文字列の中にあるかどうかを調べることができます。 -``` +```nu > = "foobar" =~ "foo" true ``` -``` +```nu > = "foobar" !~ "baz" true ``` diff --git a/ja/book/configuration.md b/src/content/docs/ja/book/nu-as-a-shell/configuration.md similarity index 98% rename from ja/book/configuration.md rename to src/content/docs/ja/book/nu-as-a-shell/configuration.md index 7708ae46a03..4d9cdb32469 100644 --- a/ja/book/configuration.md +++ b/src/content/docs/ja/book/nu-as-a-shell/configuration.md @@ -1,4 +1,6 @@ -# 設定 +--- +title: 設定 +--- Nu には、見た目や挙動を変更させるための内部的な変数があります。 以下がそのリストです。 @@ -33,7 +35,7 @@ Nu には、見た目や挙動を変更させるための内部的な変数が 設定したい値をパイプラインを通じて設定することもできます。このためには`set_into`フラグを利用します。 -``` +```nu > echo "bar" | config set_into foo ``` @@ -43,7 +45,7 @@ Nu には、見た目や挙動を変更させるための内部的な変数が `config`コマンドを引数なしで実行すると現在の設定されている変数を表示します。 -``` +```nu > config ─────────────────┬────────────────── completion_mode │ circular @@ -59,7 +61,7 @@ Nu には、見た目や挙動を変更させるための内部的な変数が `get`フラグを利用して特定の変数の値を取得できます。 -``` +```nu > config get edit_mode ``` @@ -67,7 +69,7 @@ Nu には、見た目や挙動を変更させるための内部的な変数が 変数を削除する場合、`remove`フラグを利用します。 -``` +```nu > config remove edit_mode ``` @@ -75,7 +77,7 @@ Nu には、見た目や挙動を変更させるための内部的な変数が 設定全体をクリアして、最初からやりなおしたい場合は`--clear`フラグを利用できます。このコマンドを実行すると設定ファイルもクリアされるので注意してください。 -``` +```nu > config clear ``` @@ -83,7 +85,7 @@ Nu には、見た目や挙動を変更させるための内部的な変数が 設定ファイルはデフォルトの場所から読み込まれます。この場所をみつけるには`-path`フラグを利用します。 -``` +```nu > config path /home/jonathant/.config/nu/config.toml ``` @@ -92,7 +94,7 @@ Nu には、見た目や挙動を変更させるための内部的な変数が デフォルトとは違う設定ファイルを読み込みたい場合は、`load` パラメーターを利用します。 -``` +```nu > config load myconfiguration.toml ``` @@ -102,14 +104,14 @@ Nu をログインシェルとして利用するには、`path`と`env`変数を 切り替える前に、Bash 等の別のシェルから Nu を実行します。そして次のコマンドで環境変数と PATH をシェルから取得します。 -``` +```nu > config set path $nu.path > config set env $nu.env ``` 0.7.2 より以前のバージョンでは -``` +```nu > config --set [path $nu:path] > config --set [env $nu:env] ``` @@ -118,7 +120,7 @@ Nu をログインシェルとして利用するには、`path`と`env`変数を 次にいくつかのディストリビューションでは、Nu が`/etc/shells`のリストに含まれているかを確認する必要があります。 -``` +```nu ❯ cat /etc/shells # /etc/shells: valid login shells /bin/sh @@ -134,16 +136,16 @@ Nu をログインシェルとして利用するには、`path`と`env`変数を ## プロンプトの設定 -プロンプトの設定は`prompt`の値を設定することで行います。 +プロンプトの設定は`prompt`の値を設定することで行います。 例えば、[starship](https://starship.rs)を使うには、ダウンロードして次のコマンドを実行します。(0.18.2 and later) -``` +```nu config set prompt "starship prompt" ``` Nu を再起動すると -``` +```nu nushell on 📙 master [$] is 📦 v0.18.2 via 🦀 v1.48.0-nightly ❯ ``` diff --git a/ja/book/environment.md b/src/content/docs/ja/book/nu-as-a-shell/environment.md similarity index 97% rename from ja/book/environment.md rename to src/content/docs/ja/book/nu-as-a-shell/environment.md index 8c64cd4aeb1..89c6bc40fd4 100644 --- a/ja/book/environment.md +++ b/src/content/docs/ja/book/nu-as-a-shell/environment.md @@ -1,10 +1,14 @@ +--- +title: 環境 +--- + # 環境変数 外部アプリケーションが使用する環境を制御することはシェルの一般的なタスクです。多くの場合、環境はパッケージ化されて外部のアプリケーション起動時に与えられることで自動的に行われます。しかし時には、アプリケーションが利用する環境変数をより正確に制御したい場合があります。 アプリケーションに送られる現在の環境変数は`$nu.env`の値を echo して確認することができます。 -``` +```nu > echo $nu.env ──────────────────────────┬────────────────────────────── COLORTERM │ truecolor @@ -17,7 +21,7 @@ コマンドやパイプラインを実行するときに一時的に環境変数を更新することもできます。 -``` +```nu > with-env [FOO BAR] { echo $nu.env.FOO } BAR ``` @@ -26,7 +30,7 @@ BAR Bash などにヒントを得た一般的な省略記法も用意されています。上の例は次のように書くことができます。 -``` +```nu > FOO=BAR echo $nu.env.FOO BAR ``` diff --git a/ja/book/escaping.md b/src/content/docs/ja/book/nu-as-a-shell/escaping.md similarity index 91% rename from ja/book/escaping.md rename to src/content/docs/ja/book/nu-as-a-shell/escaping.md index ed41126ac3c..0821804f13f 100644 --- a/ja/book/escaping.md +++ b/src/content/docs/ja/book/nu-as-a-shell/escaping.md @@ -1,15 +1,17 @@ -# エスケープ +--- +title: エスケープ +--- Nu は様々な OS で使用できる一連のコマンドを提供します。このような一貫性があると便利です。ただし、ときには Nu コマンドと同じ名前のコマンドを実行したいときがあります。例えば、ローカルの`ls`や`date`コマンドなどです。このような場合にはキャレット(^)コマンドを使用します。 Nu のコマンド: -``` +```nu > ls ``` ローカルコマンドへのエスケープ: -``` +```nu > ^ls ``` diff --git a/ja/book/shells_in_shells.md b/src/content/docs/ja/book/nu-as-a-shell/shells_in_shells.md similarity index 98% rename from ja/book/shells_in_shells.md rename to src/content/docs/ja/book/nu-as-a-shell/shells_in_shells.md index 4552f816a6e..632e2db4af0 100644 --- a/ja/book/shells_in_shells.md +++ b/src/content/docs/ja/book/nu-as-a-shell/shells_in_shells.md @@ -1,4 +1,6 @@ -# シェルの中のシェル +--- +title: シェルの中のシェル +--- ## 複数のディレクトリで作業する @@ -6,7 +8,7 @@ まずはじめに、ディレクトリを入力しましょう。 -``` +```nu /home/jonathan/Source/nushell(main)> enter ../book /home/jonathan/Source/book(main)> ls ────┬────────────────────┬──────┬────────┬───────────── @@ -20,7 +22,7 @@ `enter`はディレクトリの変更に似ています(`cd`コマンドでみたように)。これによりディレクトリにジャンプして作業することができます。ディレクトリを変更するかわりに、今2つのディレクトリの中にいます。このことをより明確にするために、`shells`コマンドを実行して、アクティブな現在のディレクトリの一覧を表示してみましょう。 -``` +```nu /home/jonathan/Source/book(main)> enter ../music /home/jonathan/Source/music(main)> shells ───┬────────┬─────────────────────────────── @@ -36,7 +38,7 @@ "next"、"previous"、"goto"のショートカットである`n`、`p`、`g`を利用して、これらのシェルを行き来できます。 -``` +```nu /home/jonathan/Source/music(main)> p /home/jonathan/Source/book(main)> n /home/jonathan/Source/music(main)> g 0 diff --git a/ja/book/loading_data.md b/src/content/docs/ja/book/nu-fundamentals/loading_data.mdx similarity index 94% rename from ja/book/loading_data.md rename to src/content/docs/ja/book/nu-fundamentals/loading_data.mdx index c0ad08c60c5..931517fd9d1 100644 --- a/ja/book/loading_data.md +++ b/src/content/docs/ja/book/nu-fundamentals/loading_data.mdx @@ -1,4 +1,11 @@ -# データの読み込み +--- +title: データの読み込み +--- + +import { Code } from "@astrojs/starlight/components"; +import vscode from "../../../snippets/loading_data/vscode.nu?raw"; +import cargoToml from "../../../snippets/loading_data/cargo_toml.nu?raw"; +import rustLangFeed from "../../../snippets/loading_data/rust_lang_feed.nu?raw"; これまでに、`ls`、`ps`、`date`、および`sys`コマンドを使って、ファイル、プロセス、日付そしてシステム自身の情報を取得する方法をみてきました。各コマンドはテーブル情報を提供しますが、他にもデータをテーブルに読み込む方法があります。 @@ -6,13 +13,13 @@ データを操作するための Nu の最も強力なコマンドのひとつが`open`コマンドです。これは様々なデータ形式に対応したマルチツールです。これがなにを意味するかをみるために、json ファイルを開いてみましょう。 -@[code](@snippets/loading_data/vscode.sh) +<Code code={vscode} lang="nu" /> `ls`と同様、Nu が理解できるタイプのファイルを開くと、単なるテキスト(またはバイトストリーム)以上のものが返ってきます。ここでは、JavaScript プロジェクト内の"package.json"ファイルを開いています。Nu は JSON テキストを認識し、テーブルデータを返すことができます。 プロジェクトのバージョンを確認したい場合は、`get`コマンドを利用します。 -``` +```nu > open editors/vscode/package.json | get version 1.0.0 ``` @@ -28,7 +35,7 @@ Nu が現在、直接データをテーブルに読み込める形式は次の しかし、これらのいずれでもないテキストファイルを読み込むとどうなるでしょうか、試してみましょう。 -``` +```nu > open README.md ``` @@ -42,7 +49,7 @@ Nu の外からきたデータを Nu がいつも理解できるとは限らな 以下のファイルが与えられたと想定してみましょう。 -``` +```nu > open people.txt Octavia | Butler | Writer Bob | Ross | Painter @@ -53,7 +60,7 @@ Antonio | Vivaldi | Composer ファイルを読み込むときに最初に行うことは、1行ずつ作業することです。 -``` +```nu > open people.txt | lines ───┬────────────────────────────── 0 │ Octavia | Butler | Writer @@ -64,7 +71,7 @@ Antonio | Vivaldi | Composer テーブルにもどってきたので、行を使って作業していることがわかります。次のステップは、行をもうすこし便利なものに分割できるかみてみることです。そのために、`split`コマンドを利用します。名前からわかるように、`split`は区切り文字を含む文字列を列に分割する方法を提供します。`split`の`column`サブコマンドを使って、複数の列に分割するします。必要なのは区切り文字を指定することだけです。 -``` +```nu > open people.txt | lines | split column "|" ───┬──────────┬───────────┬─────────── # │ Column1 │ Column2 │ Column3 @@ -77,7 +84,7 @@ Antonio | Vivaldi | Composer ほとんど正しいように見えますが、余分なスペースを含んでいます。余分なスペースを`trim`してみましょう。 -``` +```nu > open people.txt | lines | split column "|" | str trim ───┬─────────┬─────────┬────────── # │ Column1 │ Column2 │ Column3 @@ -90,7 +97,7 @@ Antonio | Vivaldi | Composer 悪くありません。`split`コマンドは利用可能なデータとデフォルトのカラム名をつけてくれます。 -``` +```nu > open people.txt | lines | split column "|" | str trim | get Column1 ───┬───────── 0 │ Octavia @@ -101,7 +108,7 @@ Antonio | Vivaldi | Composer デフォルトの名前を利用するかわりに、列に名前をつけることもできます。 -``` +```nu > open people.txt | lines | split column "|" first_name last_name job | str trim ───┬────────────┬───────────┬────────── # │ first_name │ last_name │ job @@ -114,7 +121,7 @@ Antonio | Vivaldi | Composer データをテーブルに変換できたので、これまでテーブルに利用してきたすべてのコマンドをつかうことができます。 -``` +```nu > open people.txt | lines | split column "|" first_name last_name job | str trim | sort-by first_name ───┬────────────┬───────────┬────────── # │ first_name │ last_name │ job @@ -133,7 +140,7 @@ Antonio | Vivaldi | Composer データが Nu が理解できる構造をもっていることがわかっている場合に呼び出すことのできるヘルパーコマンドのセットもあります。例えば、Rust のロックファイルを開いてみましょう。 -``` +```nu > open Cargo.lock # This file is automatically @generated by Cargo. # It is not intended for manual editing. @@ -144,7 +151,7 @@ version = "0.1.2" "Cargo.lock"ファイルは実際には.toml ファイルですが、ファイル拡張子が.toml ではありません。でも大丈夫です、`from toml`コマンドが使えます。 -@[code](@snippets/loading_data/cargo-toml.sh) +<Code code={cargoToml} lang="nu" /> `from`コマンドはサポートされているテキストフォーマットをサブコマンドとして渡すことで Nu が扱える構造化データごとに利用できます。 @@ -152,7 +159,7 @@ version = "0.1.2" ファイルを開いてそのデータのテーブルをすぐに操作できると便利ですが、これは必ずしもやりたいことであるとは限りません。テキストをそのまま取得するために、`open`コマンドに`--raw`オプションフラグを渡すことができます。 -``` +```nu > open Cargo.toml --raw [package] name = "nu" version = "0.1.3" @@ -166,4 +173,4 @@ license = "MIT" ファイルシステムからファイルを読み込むことに加えて、`http get`コマンドを利用して URL からリソースを取得できます。 これはインターネットから URL の内容をフェッチして返してくれます。 -@[code](@snippets/loading_data/rust-lang-feed.sh) +<Code code={rustLangFeed} lang="nu" /> diff --git a/ja/book/pipeline.md b/src/content/docs/ja/book/nu-fundamentals/pipeline.md similarity index 98% rename from ja/book/pipeline.md rename to src/content/docs/ja/book/nu-fundamentals/pipeline.md index f49b16d46d0..977b827a54a 100644 --- a/ja/book/pipeline.md +++ b/src/content/docs/ja/book/nu-fundamentals/pipeline.md @@ -1,4 +1,6 @@ -# パイプライン +--- +title: パイプライン +--- Nu のコアデザインのひとつがパイプラインです。パイプラインは Unix の背後にある哲学にまでそのルーツを遡ることができるデザインアイデアです。Nu は、Unix の文字列データを拡張したように、パイプラインの概念も拡張してテキスト以外のものも扱えるようにします。 @@ -6,7 +8,7 @@ Nu のコアデザインのひとつがパイプラインです。パイプラ パイプラインは、入力、フィルター、出力の3つの部分から構成されます。 -``` +```nu > open "Cargo.toml" | inc package.version | save "Cargo_new.toml" ``` @@ -38,13 +40,13 @@ Nu は Bash のような他のシェルと同じように2つの外部コマ 実質的にこのコマンドと -``` +```nu > ls ``` このパイプラインは -``` +```nu > ls | autoview ``` diff --git a/ja/book/types_of_data.md b/src/content/docs/ja/book/nu-fundamentals/types_of_data.md similarity index 99% rename from ja/book/types_of_data.md rename to src/content/docs/ja/book/nu-fundamentals/types_of_data.md index 47932ce3844..6173c483a99 100644 --- a/ja/book/types_of_data.md +++ b/src/content/docs/ja/book/nu-fundamentals/types_of_data.md @@ -1,4 +1,6 @@ -# データ型 +--- +title: データ型 +--- 従来、Unix シェルコマンドは文字列テキストを通じて互いに通信してきました。あるコマンドは標準出力(しばしば'stdout'と略されます)を介してテキストを出力し、他方のコマンドは標準入力(または'stdin')を介してテキストを読み込みます。このようにして、2つのコマンドは通信できます。 @@ -34,7 +36,7 @@ Column paths はテーブルにおける特定のサブテーブル、列、行 ### パターン -"glob"パターンと呼ばれたりもするパターンはシェルでよく利用されるファイル名のマッチング方法です。 +"glob"パターンと呼ばれたりもするパターンはシェルでよく利用されるファイル名のマッチング方法です。 `*`は何にでもマッチし、`?`は一文字にマッチすることを表しています。 例) `ls test*`における`test*`がパターンです。 @@ -95,7 +97,7 @@ row データ型は表の1行のデータで見えるものを表していま Lists は一つ以上の値を保持できます。単純な値だけでなく、rows も保持することができます。rows の lists はしばしばテーブルと呼ばれます。 -``` +```nu > echo [sam fred george] ───┬──────── 0 │ sam diff --git a/ja/book/working_with_tables.md b/src/content/docs/ja/book/nu-fundamentals/working_with_tables.md similarity index 98% rename from ja/book/working_with_tables.md rename to src/content/docs/ja/book/nu-fundamentals/working_with_tables.md index effe6ef2d63..71ff30b5dd0 100644 --- a/ja/book/working_with_tables.md +++ b/src/content/docs/ja/book/nu-fundamentals/working_with_tables.md @@ -1,10 +1,12 @@ -# テーブルを扱う +--- +title: テーブルを扱う +--- Nu でデータを表示する一般的な方法はテーブルを使用することです。Nu には、探しているものを見つけやすくしたり、必要なデータを絞り込んだりするのに便利なテーブルを操作するためのコマンドがたくさん用意されています。 まずはじめに、今回利用するテーブルを確認しましょう。 -``` +```nu > ls ───┬───────────────┬──────┬─────────┬──────────── # │ name │ type │ size │ modified @@ -23,7 +25,7 @@ Nu でデータを表示する一般的な方法はテーブルを使用する ソートに利用する列名を指定して、`sort-by`コマンドを呼びだすことでテーブルをソートできます。ファイルのサイズでテーブルをソートしたいとしましょう。 -``` +```nu > ls | sort-by size ───┬───────────────┬──────┬─────────┬──────────── # │ name │ type │ size │ modified @@ -44,7 +46,7 @@ Nu でデータを表示する一般的な方法はテーブルを使用する 列や行を選択することでテーブルから必要なデータを選択できます。テーブルからいくつかの列を選択してみましょう。 -``` +```nu > ls | select name size ───┬───────────────┬───────── # │ name │ size @@ -61,7 +63,7 @@ Nu でデータを表示する一般的な方法はテーブルを使用する こうすることで、より必要とするデータにフォーカスしたテーブルを作ることができます。次にディレクトリからもっとも小さい 5 つのファイルを表示してみます。 -``` +```nu > ls | sort-by size | first 5 ───┬──────────────┬──────┬────────┬──────────── # │ name │ type │ size │ modified @@ -78,7 +80,7 @@ Nu でデータを表示する一般的な方法はテーブルを使用する 不要な行を`skip`することもできます。上記で返された5行のうち最初の2行をスキップしてみましょう。 -``` +```nu > ls | sort-by size | first 5 | skip 2 ───┬───────────┬──────┬────────┬──────────── # │ name │ type │ size │ modified @@ -93,7 +95,7 @@ Nu でデータを表示する一般的な方法はテーブルを使用する データを選択するための他のコマンドもみてみましょう。テーブルの各行が数字をもつことを疑問に思っているかもしれません。これは単一の行を簡単に指定する方法として機能します。テーブルをファイル名でソートして、`nth`コマンドを利用して n 行目を選択してみましょう。 -``` +```nu > ls | sort-by name ───┬───────────────┬──────┬─────────┬──────────── # │ name │ type │ size │ modified @@ -120,7 +122,7 @@ Nu でデータを表示する一般的な方法はテーブルを使用する これまでは、テーブルを必要なものだけにトリミングする操作を行ってきました。ときには一歩進んで、列全体ではなく、セル自体の値が必要になるかもしれません。たとえば、ファイル名のリストだけを取得したいとしましょう。この場合`get`コマンドを利用することができます。 -``` +```nu > ls | get name ───┬─────────────── 0 │ files.rs @@ -137,7 +139,7 @@ Nu でデータを表示する一般的な方法はテーブルを使用する これはさきほどみた`select`コマンドと同じにみえるかもしれません、比較のために`select`コマンドの出力もみておきましょう。 -``` +```nu > ls | select name ───┬─────────────── # │ name @@ -169,7 +171,7 @@ Nu でデータを表示する一般的な方法はテーブルを使用する `add`コマンドを使用して、新しい列をテーブルに追加できます。例をみてみましょう。 -``` +```nu > open rustfmt.toml ─────────┬────── edition │ 2018 @@ -178,7 +180,7 @@ Nu でデータを表示する一般的な方法はテーブルを使用する 値が 2021 の"next_edition"列を追加してみましょう。 -``` +```nu > open rustfmt.toml | insert next_edition 2021 ──────────────┬────── edition │ 2018 @@ -188,7 +190,7 @@ Nu でデータを表示する一般的な方法はテーブルを使用する 元のファイルは変更されていないことに注意してください。 -``` +```nu > open rustfmt.toml ─────────┬────── edition │ 2018 @@ -197,7 +199,7 @@ Nu でデータを表示する一般的な方法はテーブルを使用する Nu の変更は永続的な変更ではなく、値自体に作用する関数的な変更です。これにより、結果を書き出す準備ができるまでパイプライン上で様々な種類の作業をおこなうことができます。ここでは、`save`コマンドを使用して結果を書き出すことができます。 -``` +```nu > open rustfmt.toml | insert next_edition 2021 | save rustfmt2.toml > open rustfmt2.toml ──────────────┬────── @@ -210,7 +212,7 @@ Nu の変更は永続的な変更ではなく、値自体に作用する関数 `insert`コマンドと同様に、`update`コマンドを利用して列の内容を新しい値に変更することもできます。実際に動作を確認するために同じファイルを開いてみましょう。 -``` +```nu > open rustfmt.toml ─────────┬────── edition │ 2018 @@ -219,7 +221,7 @@ Nu の変更は永続的な変更ではなく、値自体に作用する関数 今度は、サポートした次の edition を指定するよう更新しましょう。 -``` +```nu > open rustfmt.toml | update edition 2021 ─────────┬────── edition │ 2021 @@ -230,7 +232,7 @@ Nu の変更は永続的な変更ではなく、値自体に作用する関数 数字やバージョンを扱う際に便利なコマンドがもうひとつあります、`inc`です。 -``` +```nu > open rustfmt.toml ─────────┬────── edition │ 2018 @@ -243,7 +245,7 @@ Nu の変更は永続的な変更ではなく、値自体に作用する関数 "edition"の値は数字なので、`inc`を使って更新することができます。バージョンを扱う際には`inc`がその真価を発揮します。 -``` +```nu > open Cargo.toml | get package.version 0.1.3 > open Cargo.toml | inc package.version --minor | get package.version diff --git a/ja/book/aliases.md b/src/content/docs/ja/book/programming-in-nu/aliases.md similarity index 97% rename from ja/book/aliases.md rename to src/content/docs/ja/book/programming-in-nu/aliases.md index 26295b21d0f..a457a215b19 100644 --- a/ja/book/aliases.md +++ b/src/content/docs/ja/book/programming-in-nu/aliases.md @@ -1,4 +1,6 @@ -# エイリアス +--- +title: エイリアス +--- Nu ではパイプラインを利用して自由にデータやシステムを操作できますが、その反面多くのタイピングを要してしまいます。一度作成したパイプラインを保存しておき再利用できるようにしておきたいところです。 @@ -8,7 +10,7 @@ Nu ではパイプラインを利用して自由にデータやシステムを 例: -``` +```nu > alias ls-names [] { ls | select name } > ls-names ────┬──────────────────── @@ -25,7 +27,7 @@ Nu ではパイプラインを利用して自由にデータやシステムを エイリアスは、ブロックに渡されるオプションのパラメータをもつことができます。これらはブロック内の新しい変数になります。 -``` +```nu > alias e [msg] { echo $msg } > e "hello world" hello world @@ -37,7 +39,7 @@ hello world デフォルトでは、エイリアスは現在のセッションでのみ有効です。これは一時的なヘルパーや新しいエイリアスをテストするのに便利ですが、エイリアスを有効に活用するには保存しておく必要があります。エイリアスを保存するには、alias を`--save`(もしくは`-s`)つきで実行します。例えば -``` +```nu alias e --save [msg] { echo $msg } ``` @@ -45,6 +47,6 @@ alias e --save [msg] { echo $msg } config.toml ファイルのエイリアスを直接編集することもできます。`vi`を使う場合は -``` +```nu config path | vi $it ``` diff --git a/src/content/docs/ja/index.mdx b/src/content/docs/ja/index.mdx new file mode 100755 index 00000000000..7d4a60d4450 --- /dev/null +++ b/src/content/docs/ja/index.mdx @@ -0,0 +1,47 @@ +--- +title: Nushell +description: 新しいタイプのシェル +template: splash +editUrl: true +lastUpdated: false +hero: + tagline: 新しいタイプのシェル + actions: + - text: Get Started + link: /introduction/ + icon: right-arrow + variant: primary + - text: View on GitHub + link: https://github.com/nushell/nushell.github.io + icon: external +--- + +import { Card, CardGrid } from "@astrojs/starlight/components"; + +<CardGrid> + <Card title="あらゆるOSを制御するパイプライン"> + Nuは、Linux、macOS、Windowsで動作します。一度身に付ければ、どこでも使えるようになります。 + </Card> + <Card title=" すべてはデータである"> + Nuパイプラインは構造化されたデータを使用するため、毎回同じ方法で安全に選択、フィルタリング、ソートを行うことができます。文字列をパースするのをやめて、問題を解決しましょう。 + </Card> + <Card title="強力なプラグイン"> + 強力なプラグインシステムを使って、Nuを簡単に拡張することができます。 + </Card> +</CardGrid> + +<br /> + + + +### Nu は既存のデータとの連携が可能 + +Nu はでは[JSON, YAML, XML, Excel and more](/book/loading_data.md)を標準サポートしています。ファイル、データベース、Web API など、どのようなデータでも簡単に Nu パイプラインに取り込むことができます。 + + + +### Nu のエラーメッセージは非常に分かりやすい + +Nu は型付けされたデータを操作するので、他のシェルでは見つけられないバグを発見することができます。そして、壊れたときには、どこで、なぜ壊れたかを正確に教えてくれます。 + + diff --git a/pt-BR/book/explorando.md b/src/content/docs/pt/book/advanced/explore.mdx similarity index 81% rename from pt-BR/book/explorando.md rename to src/content/docs/pt/book/advanced/explore.mdx index a4e23160bd6..99b2855be42 100644 --- a/pt-BR/book/explorando.md +++ b/src/content/docs/pt/book/advanced/explore.mdx @@ -1,10 +1,20 @@ -# Explorando seu sistema +--- +title: Explorando seu sistema +--- + +import { Code } from "@astrojs/starlight/components"; +import lsExample from "../../../snippets/moving_around/ls_example.nu?raw"; +import cdExample from "../../../snippets/moving_around/cd_example.nu?raw"; +import cpExample from "../../../snippets/moving_around/cp_example.nu?raw"; +import mvExample from "../../../snippets/moving_around/mv_example.nu?raw"; +import rmExample from "../../../snippets/moving_around/rm_example.nu?raw"; +import mkdirExample from "../../../snippets/moving_around/mkdir_example.nu?raw"; Shells mais antigos permitem que você navegue pelo sistema de arquivos e execute comandos. Shells modernos como o Nu permitem que você faça o mesmo. Vamos dar uma olhada em alguns dos comandos comuns que você vai usar quando estiver interagindo com seu sistema. ## Visualizando o conteúdo de directórios -@[code](@snippets/moving_around/ls_example.sh) +<Code code={lsExample} lang="nu" /> Como vimos em outros capítulos, `ls` é um comando para visualizar o conteúdo de um caminho. Nu retorna o conteúdo como uma tabela que podemos usar adiante. @@ -41,9 +51,7 @@ Aqui estamos procurando qualquer arquivo cujo nome termine com ".rs" e os dois a ## Mudando o diretório atual -```nu -> cd new_directory -``` +<Code code={cdExample} lang="nu" /> Para mudar do diretório atual para um outro, usamos o comando `cd`. Assim como em outros shells, podemos usar o nome do diretório ou, se quisermos ir para um diretório acima, podemos usar o atalho `..`. @@ -53,26 +61,18 @@ Nu também fornece alguns comandos básicos de sistemas de arquivos que funciona Podemos mover um item de um lugar para outro usando o comando `mv`. -```nu -> mv item location -``` +<Code code={mvExample} lang="nu" /> Podemos copiar um item de um local para outro: -```nu -> cp item location -``` +<Code code={cpExample} lang="nu" /> Podemos remover um item: -```nu -> rm item -``` +<Code code={rmExample} lang="nu" /> Os três comandos também podem usar os coringas que vimos anteriormente com `ls`. Por fim, podemos criar um novo diretório usando o comando `mkdir`: -```nu -> mkdir new_directory -``` +<Code code={mkdirExample} lang="nu" /> diff --git a/pt-BR/book/metadados.md b/src/content/docs/pt/book/advanced/metadata.md similarity index 98% rename from pt-BR/book/metadados.md rename to src/content/docs/pt/book/advanced/metadata.md index 5f762c5d334..dc64fb00409 100644 --- a/pt-BR/book/metadados.md +++ b/src/content/docs/pt/book/advanced/metadata.md @@ -1,4 +1,6 @@ -# Metadados +--- +title: Metadados +--- Usando o Nu vocë pode se deparar com momentos em que sente como se houvesse algo a mais acontecendo nos bastidores. Por exemplo, digamos que vocë vai tentar abrir um arquivo mas se esquece que ele é suportado pelo Nu e tenta convertê-lo novamente: diff --git a/pt-BR/book/plugins.md b/src/content/docs/pt/book/advanced/plugins.md similarity index 98% rename from pt-BR/book/plugins.md rename to src/content/docs/pt/book/advanced/plugins.md index 65e1f0d9d3a..bc9fd6d4eae 100644 --- a/pt-BR/book/plugins.md +++ b/src/content/docs/pt/book/advanced/plugins.md @@ -1,4 +1,6 @@ -# Plugins +--- +title: Plugins +--- A funcionalidade do Nu pode ser extendida usando plugins. Os plugins podem desenpenhar muitas das mesmas operações que os comandos embutidos do Nu, com o benefício adicional de que eles podem ser incluídos separadamente do Nu em si. diff --git a/pt-BR/book/command_reference.md b/src/content/docs/pt/book/command_reference.md similarity index 94% rename from pt-BR/book/command_reference.md rename to src/content/docs/pt/book/command_reference.md index 939e5b25d55..c503dc39586 100644 --- a/pt-BR/book/command_reference.md +++ b/src/content/docs/pt/book/command_reference.md @@ -1,4 +1,6 @@ -# Command Reference +--- +title: Command Reference +--- <script> import pages from '@temp/pages' diff --git a/pt-BR/book/instalacao.md b/src/content/docs/pt/book/getting-started/installation.md similarity index 99% rename from pt-BR/book/instalacao.md rename to src/content/docs/pt/book/getting-started/installation.md index f0ec874053b..278577b5b51 100644 --- a/pt-BR/book/instalacao.md +++ b/src/content/docs/pt/book/getting-started/installation.md @@ -1,4 +1,6 @@ -# Instalando Nu +--- +title: Instalandu Nu +--- Atualmente, as melhores maneiras de instalar o Nu são a partir do [crates.io](https://crates.io), fazer o download dos binários da nossa [página de releases](https://github.com/nushell/nushell/releases), fazer o build a partir dos fontes ou baixar um container pronto com o Docker. diff --git a/pt-BR/book/introducao.md b/src/content/docs/pt/book/getting-started/introduction.md similarity index 99% rename from pt-BR/book/introducao.md rename to src/content/docs/pt/book/getting-started/introduction.md index d3bab60e393..a3927d1d3ba 100644 --- a/pt-BR/book/introducao.md +++ b/src/content/docs/pt/book/getting-started/introduction.md @@ -1,4 +1,6 @@ -# Introdução +--- +title: Introdução +--- Olá! Seja bem vindo ao projeto Nushell. O objetivo desse projeto é trazer a filosofia de shells do Unix, onde pipes conectam comandos simples, para o estilo moderno de desenvolvimento. diff --git a/pt-BR/book/escapando.md b/src/content/docs/pt/book/nu-as-a-shell/escaping.md similarity index 90% rename from pt-BR/book/escapando.md rename to src/content/docs/pt/book/nu-as-a-shell/escaping.md index ec3f44d4752..d0c1b60df22 100644 --- a/pt-BR/book/escapando.md +++ b/src/content/docs/pt/book/nu-as-a-shell/escaping.md @@ -1,4 +1,6 @@ -# Escapando para o sistema +--- +title: Escapando para o sistema +--- O Nu fornece um conjunto de comandos que você pode usar entre diferentes SOs e contar com essa consistência é útil. Às vezes, porém, você quer executar comando que tem o mesmo nome que um dos comandos do Nu. Para executar os comandos locais `ls` ou `date`, por exemplo, use o comando circunflexo (^). diff --git a/pt-BR/book/line_editor.md b/src/content/docs/pt/book/nu-as-a-shell/line_editor.md similarity index 81% rename from pt-BR/book/line_editor.md rename to src/content/docs/pt/book/nu-as-a-shell/line_editor.md index 7ae31058edf..eaa1c1e9654 100644 --- a/pt-BR/book/line_editor.md +++ b/src/content/docs/pt/book/nu-as-a-shell/line_editor.md @@ -1,13 +1,17 @@ -# Reedline, o editor de linha do Nu +--- +title: Reedline, o editor de linha do Nu +--- O editor de linha Reedline do Nushell é um leitor de linha multiplataforma projetado para ser modular e flexível. O motor é responsável por controlar o histórico de comandos, validações, preenchimentos, dicas e pintura da tela. ## Configuração + ### Modo de edição Reedline permite você editar o texto usando dois modos: vi e emacs. Se não especificado, o modo padrão é o modo emacs. No intuito de selecionar o seu favorito, você precisa modificar o arquivo config e escrever nele seu modo favorito. Por exemplo: + ```nu $env.config = { ... @@ -15,96 +19,102 @@ $env.config = { ... } ``` + ### Padrão da combinação de teclas Cada modo de edição vem com teclas de atalho usuais para edição de texto no vi e emacs. ### Combinação de teclas para Emacs e Vi -| Tecla | Evento | -|---------------|------------------------------| -| Esc | Esc | -| Backspace | Backspace | -| End | Mover para o final da linha | -| End | Completar dica de histórico | -| Home | Mover para o início da linha | -| Ctrl + c | Cancelar linha atual | -| Ctrl + l | Limpar tela | -| Ctrl + r | Pesquisar histórico | -| Ctrl + Right | Completar palavra do histórico| -| Ctrl + Right | Mover palavra para a direita | -| Ctrl + Left | Mover palavra para a esquerda | -| Up | Mover menu para cima | -| Up | Mover para cima | -| Down | Mover menu para baixo | -| Down | Mover para baixo | -| Left | Mover menu para a esquerda | -| Left | Mover para a esquerda | -| Right | Completar dica de histórico | -| Right | Mover menu para a direita | -| Right | Mover para a direita | -| Ctrl + b | Mover menu para a esquerda | -| Ctrl + b | Mover para a esquerda | -| Ctrl + f | Completar dica de histórico | -| Ctrl + f | Mover menu para a direita | -| Ctrl + f | Mover para a direita | -| Ctrl + p | Mover menu para cima | -| Ctrl + p | Mover para cima | -| Ctrl + n | Mover menu para baixo | -| Ctrl + n | Mover para baixo | + +| Tecla | Evento | +| ------------ | ------------------------------ | +| Esc | Esc | +| Backspace | Backspace | +| End | Mover para o final da linha | +| End | Completar dica de histórico | +| Home | Mover para o início da linha | +| Ctrl + c | Cancelar linha atual | +| Ctrl + l | Limpar tela | +| Ctrl + r | Pesquisar histórico | +| Ctrl + Right | Completar palavra do histórico | +| Ctrl + Right | Mover palavra para a direita | +| Ctrl + Left | Mover palavra para a esquerda | +| Up | Mover menu para cima | +| Up | Mover para cima | +| Down | Mover menu para baixo | +| Down | Mover para baixo | +| Left | Mover menu para a esquerda | +| Left | Mover para a esquerda | +| Right | Completar dica de histórico | +| Right | Mover menu para a direita | +| Right | Mover para a direita | +| Ctrl + b | Mover menu para a esquerda | +| Ctrl + b | Mover para a esquerda | +| Ctrl + f | Completar dica de histórico | +| Ctrl + f | Mover menu para a direita | +| Ctrl + f | Mover para a direita | +| Ctrl + p | Mover menu para cima | +| Ctrl + p | Mover para cima | +| Ctrl + n | Mover menu para baixo | +| Ctrl + n | Mover para baixo | ### Vi Bindings Normais -| Tecla | Evento | -|---------------|------------------------------| -| Ctrl + c | Cancelar linha atual | -| Ctrl + l | Limpar tela | -| Up | Mover menu para cima | -| Up | Mover para cima | -| Down | Mover menu para baixo | -| Down | Mover para baixo | -| Left | Mover menu para a esquerda | -| Left | Mover para a esquerda | -| Right | Mover menu para a direita | -| Right | Mover para a direita | + +| Tecla | Evento | +| -------- | -------------------------- | +| Ctrl + c | Cancelar linha atual | +| Ctrl + l | Limpar tela | +| Up | Mover menu para cima | +| Up | Mover para cima | +| Down | Mover menu para baixo | +| Down | Mover para baixo | +| Left | Mover menu para a esquerda | +| Left | Mover para a esquerda | +| Right | Mover menu para a direita | +| Right | Mover para a direita | Além das teclas de atalho anteriores, enquanto estiver no modo normal do Vi, você pode usar o modo clássico do Vi para executar ações selecionando um movimento ou uma ação. As opções disponíveis para as combinações são: ### Vi Movimentos Normais -| Tecla | Movimento | -|-------|-------------------| -| w | Palavra | -| d | Fim da linha | -| 0 | Início da linha | -| $ | Fim da linha | -| f | Direita até char | -| t | Antes à direita char| -| F | À esquerda até char| -| T | Antes à esquerda char| + +| Tecla | Movimento | +| ----- | --------------------- | +| w | Palavra | +| d | Fim da linha | +| 0 | Início da linha | +| $ | Fim da linha | +| f | Direita até char | +| t | Antes à direita char | +| F | À esquerda até char | +| T | Antes à esquerda char | ### Vi Ações Normais -| Tecla | Ação | -|-------|---------------------| -| d | Deletar | -| p | Colar depois | -| P | Colar antes | -| h | Mover para a esquerda| -| l | Mover para a direita | -| j | Mover para baixo | -| k | Mover para cima | -| w | Mover palavra para a direita| -| b | Mover palavra para a esquerda| -| i | Entrar no modo de inserção Vi no caractere atual| -| a | Entrar no modo de inserção Vi após o caractere atual| -| 0 | Mover para o início da linha| -| ^ | Mover para o início da linha| -| $ | Mover para o final da linha| -| u | Desfazer | -| c | Mudar | -| x | Deletar caractere | -| s | Pesquisar histórico | -| D | Deletar até o final | -| A | Anexar ao final | + +| Tecla | Ação | +| ----- | ---------------------------------------------------- | +| d | Deletar | +| p | Colar depois | +| P | Colar antes | +| h | Mover para a esquerda | +| l | Mover para a direita | +| j | Mover para baixo | +| k | Mover para cima | +| w | Mover palavra para a direita | +| b | Mover palavra para a esquerda | +| i | Entrar no modo de inserção Vi no caractere atual | +| a | Entrar no modo de inserção Vi após o caractere atual | +| 0 | Mover para o início da linha | +| ^ | Mover para o início da linha | +| $ | Mover para o final da linha | +| u | Desfazer | +| c | Mudar | +| x | Deletar caractere | +| s | Pesquisar histórico | +| D | Deletar até o final | +| A | Anexar ao final | ## Histórico de comando + Conforme mencionado anteriormente, o Reedline gerencia e armazena todos os comandos que são editados e enviados para o Nushell. Para configurar o número máximo de registros que o Reedline deve armazenar, você precisará ajustar esse valor no seu arquivo de configuração: ```nu @@ -123,7 +133,7 @@ Conforme mencionado anteriormente, o Reedline gerencia e armazena todos os coman O reedline prompt também é altamente customizável. Na ideia de construir o prompt perfeito, você pode definir as próximas variáveis de ambiente no seu arquivo config: -``` nu +```nu # Use nushell functions to define your right and left prompt def create_left_prompt [] { let path_segment = ($env.PWD) @@ -142,8 +152,8 @@ def create_right_prompt [] { $env.PROMPT_COMMAND = { create_left_prompt } $env.PROMPT_COMMAND_RIGHT = { create_right_prompt } ``` ->**DICA** -<br>Você não precisa definir as variáveis de ambiente usando funções do Nushell. Você pode usar strings simples para defini-las. + +> **DICA** > <br>Você não precisa definir as variáveis de ambiente usando funções do Nushell. Você pode usar strings simples para defini-las. Você também pode personalizar o indicador do prompt para o editor de linha modificando as seguintes variáveis de ambiente. @@ -153,10 +163,11 @@ $env.PROMPT_INDICATOR_VI_INSERT = ": " $env.PROMPT_INDICATOR_VI_NORMAL = "〉" $env.PROMPT_MULTILINE_INDICATOR = "::: " ``` ->**DICA** -<br>Os indicadores de prompt são variáveis de ambiente que representam o estado do prompt. + +> **DICA** > <br>Os indicadores de prompt são variáveis de ambiente que representam o estado do prompt. ## Teclas de atalho + Teclas de atalho do Reedline são constructos poderosos que te permitem construir uma cadeia de eventos que pode ser desencadeada com uma específica combinação de teclas. Por exemplo, vamos dizer que você gostaria de mapear o menu de conclusão para a combinação de teclas `Ctrl + t` (o padrão é `tab`). Você pode adicionar a seguinte entrada ao seu arquivo de configuração. @@ -178,36 +189,32 @@ $env.config = { ... } ``` -Após carregar esse novo config.nu, seu novo atalho (`Ctrl + t`) irá abrir o menu de conclusão. + +Após carregar esse novo config.nu, seu novo atalho (`Ctrl + t`) irá abrir o menu de conclusão. Cada atalho requer os seguintes elementos: - name: Nome único para seu atalho para fácil referência for easy reference in `$config.keybindings` - modifier: Uma chave modificadora para o atalho. As opções são: - + none - + control - + alt - + shift - + shift_alt - + alt_shift - + control_alt - + alt_control - + control_shift - + shift_control - + control_alt_shift - + control_shift_alt + - none + - control + - alt + - shift + - shift_alt + - alt_shift + - control_alt + - alt_control + - control_shift + - shift_control + - control_alt_shift + - control_shift_alt - keycode: Representa a tecla a ser apertada. - mode: emacs, vi_insert, vi_normal (uma simples string ou lista. ex: [`vi_insert` `vi_normal`]) --event: O tipo de evento que vai ser associado pelo atalho. As opções são: - + send - + edit - + until + -event: O tipo de evento que vai ser associado pelo atalho. As opções são: + send + edit + until ->**DICA** -<br> Todas as opções disponíveis de modificadores, códigos de teclas e eventos podem ser encontradas com o comando `keybindings list`. +> **DICA** > <br> Todas as opções disponíveis de modificadores, códigos de teclas e eventos podem ser encontradas com o comando `keybindings list`. ->**DICA** -<br>As teclas de atalho adicionadas ao modo `vi_insert` estarão disponíveis quando o editor de linha estiver no modo de inserção (quando você pode escrever texto), e as teclas de atalho marcadas com `vi_normal` estarão disponíveis quando estiver no modo normal (quando o cursor se move usando h, j, k ou l). +> **DICA** > <br>As teclas de atalho adicionadas ao modo `vi_insert` estarão disponíveis quando o editor de linha estiver no modo de inserção (quando você pode escrever texto), e as teclas de atalho marcadas com `vi_normal` estarão disponíveis quando estiver no modo normal (quando o cursor se move usando h, j, k ou l). A seção de evento (event) da entrada de teclas é onde as ações a serem realizadas são definidas. Neste campo, você pode usar tanto um registro (record) quanto uma lista de registros. Algo como: @@ -216,7 +223,8 @@ A seção de evento (event) da entrada de teclas é onde as ações a serem real event: { send: Enter } ... ``` -ou + +ou ```nu ... @@ -226,9 +234,11 @@ ou ] ... ``` + O primeiro exemplo de teclas de atalho mostrado nesta página segue o primeiro caso; um único evento é enviado para o mecanismo. A próxima tecla de atalho é um exemplo de uma série de eventos enviados para o mecanismo. Primeiro, ela limpa o prompt, insere uma string e, em seguida, entra com esse valor. + ```nu $env.config = { ... @@ -252,6 +262,7 @@ A próxima tecla de atalho é um exemplo de uma série de eventos enviados para ... } ``` + Uma desvantagem da tecla de atalho anterior é o fato de que o texto inserido será processado pelo validador e salvo no histórico, tornando a tecla de atalho um pouco mais lenta e populando o histórico de comandos com o mesmo comando. Por esse motivo, existe o tipo de evento `executehostcommand`. O próximo exemplo faz o mesmo que o anterior, de uma maneira mais simples, enviando um único evento para o mecanismo. ```nu @@ -274,21 +285,26 @@ Uma desvantagem da tecla de atalho anterior é o fato de que o texto inserido se ... } ``` + Antes de continuarmos, você deve ter percebido que a sintaxe muda para edições e envios, e por esse motivo é importante explicá-las um pouco mais. Um "send" é todo evento do Reedline que pode ser processado pelo mecanismo, e uma "edit" são todos os EditCommands que podem ser processados pelo mecanismo. ### Tipo de envio + Para encontrar todas as opções disponíveis para o envio, você pode usar: + ```nu keybindings list | where type == events ``` + E a sintaxe para eventos de envio é a seguinte: + ```nu ... event: { send: <NAME OF EVENT FROM LIST> } ... ``` ->**DICA** -<br>Você pode escrever o nome dos eventos em letras maiúsculas. O analisador de teclas de atalho é insensível a maiúsculas e minúsculas. + +> **DICA** > <br>Você pode escrever o nome dos eventos em letras maiúsculas. O analisador de teclas de atalho é insensível a maiúsculas e minúsculas. Há duas exceções a essa regra: o Menu e o ExecuteHostCommand. Esses dois eventos exigem um campo extra para serem completos. O Menu precisa do nome do menu a ser ativado (completion_menu ou history_menu). @@ -300,6 +316,7 @@ Há duas exceções a essa regra: o Menu e o ExecuteHostCommand. Esses dois even } ... ``` + E o ExecuteHostCommand requer um comando válido que será enviado para o mecanismo. ```nu @@ -311,7 +328,8 @@ E o ExecuteHostCommand requer um comando válido que será enviado para o mecani ... ``` -Vale mencionar que na lista de eventos você também verá Edit([]), Multiple([]) e UntilFound([]). Essas opções não estão disponíveis para o analisador, pois são construídas com base na definição da tecla de atalho. Por exemplo, um evento Multiple([]) é construído para você ao definir uma lista de registros no evento da tecla de atalho. Um evento Edit([]) é o mesmo que o tipo de edição mencionado anteriormente. E o evento UntilFound([]) é o mesmo que o tipo until mencionado antes. + +Vale mencionar que na lista de eventos você também verá Edit([]), Multiple([]) e UntilFound([]). Essas opções não estão disponíveis para o analisador, pois são construídas com base na definição da tecla de atalho. Por exemplo, um evento Multiple([]) é construído para você ao definir uma lista de registros no evento da tecla de atalho. Um evento Edit([]) é o mesmo que o tipo de edição mencionado anteriormente. E o evento UntilFound([]) é o mesmo que o tipo until mencionado antes. ### Tipo de edição @@ -320,6 +338,7 @@ O tipo `edit` é a simplificação do evento `Edit([])`. O tipo de evento simpli ```nu keybindings list | where type == edits ``` + A sintaxe usual para uma edição é a seguinte: ```nu @@ -327,6 +346,7 @@ A sintaxe usual para uma edição é a seguinte: event: { edit: <NAME OF EDIT FROM LIST> } ... ``` + A sintaxe para as edições na lista que têm um `()` muda um pouco. Como essas edições exigem um valor extra para serem totalmente definidas. Por exemplo, se quisermos inserir uma string onde o prompt está localizado, então você terá que usar: ```nu @@ -337,7 +357,9 @@ A sintaxe para as edições na lista que têm um `()` muda um pouco. Como essas } ... ``` + Ou digamos que você queira mover para a direita até o primeiro "S": + ```nu ... event: { @@ -346,7 +368,9 @@ Ou digamos que você queira mover para a direita até o primeiro "S": } ... ``` + ### Tipo Until + Para concluir esta explanação sobre teclas de atalho, precisamos discutir o tipo `until` para eventos. Como você viu até agora, você pode enviar um único evento ou uma lista de eventos. E, como vimos, quando uma lista de eventos é enviada, cada um deles é processado. No entanto, pode haver casos em que você deseja atribuir eventos diferentes à mesma tecla de atalho. Isso é especialmente útil com menus do Nushell. Por exemplo, digamos que você ainda queira ativar seu menu de conclusão com Ctrl + t, mas também deseja mover para o próximo elemento no menu assim que ele for ativado, usando a mesma tecla de atalho. @@ -354,6 +378,7 @@ No entanto, pode haver casos em que você deseja atribuir eventos diferentes à Para esses casos, temos a palavra-chave `until`. Os eventos listados dentro do evento `until` serão processados um por um, com a diferença de que assim que um for bem-sucedido, o processamento do evento é interrompido. A próxima tecla de atalho representa esse caso. + ```nu $env.config = { ... @@ -376,11 +401,13 @@ A próxima tecla de atalho representa esse caso. ... } ``` + A tecla de atalho anterior primeiro tentará abrir um menu de conclusão. Se o menu não estiver ativo, ele o ativará e enviará um sinal de sucesso. Se a tecla de atalho for pressionada novamente, como há um menu ativo, o próximo evento enviado será o `MenuNext`, o que significa que moverá o seletor para o próximo elemento no menu. Como você pode ver, a palavra-chave `until` nos permite definir dois eventos para a mesma tecla de atalho. No momento desta redação, apenas os eventos de Menu permitem esse tipo de camada. Os outros tipos de evento não relacionados a menus sempre retornarão um valor de sucesso, significando que o evento `until` será interrompido assim que atingir o comando. Por exemplo, a próxima tecla de atalho sempre enviará um comando "down" porque esse evento é sempre bem-sucedido. + ```nu $env.config = { ... @@ -404,10 +431,13 @@ $env.config = { ... } ``` + ### Removendo o atalho padrão + Se você deseja remover uma determinada tecla de atalho padrão sem substituí-la por uma ação diferente, você pode definir `event: null`. Por exemplo, para desativar a limpeza da tela com Ctrl + l para todos os modos de edição: + ```nu $env.config = { ... @@ -424,6 +454,7 @@ Por exemplo, para desativar a limpeza da tela com Ctrl + l para todos os modos d ... } ``` + ### Resolução de problemas com problemas de teclas de atalho Seu ambiente de terminal nem sempre pode propagar suas combinações de teclas para o Nushell da maneira que você espera. Você pode usar o comando `keybindings listen` para descobrir se determinadas teclas são realmente recebidas pelo Nushell e como. @@ -439,6 +470,7 @@ O menu de ajuda está lá para facilitar sua transição para o Nushell. Suponha Para navegar pelo menu, você pode selecionar o próximo elemento usando a tecla Tab, pode rolar a descrição pressionando para a esquerda ou para a direita e até mesmo colar exemplos de comandos disponíveis na linha. O menu de ajuda pode ser configurado modificando os seguintes parâmetros: + ```nu $env.config = { ... @@ -467,6 +499,7 @@ $env.config = { ] ... ``` + ### Menu de Conclusão O menu de conclusão é um menu sensível ao contexto que apresentará sugestões com base no estado do prompt. Essas sugestões podem variar de sugestões de caminho a alternativas de comando. Ao escrever um comando, você pode ativar o menu para ver as opções de flags disponíveis para um comando interno. Além disso, se você definiu completions personalizados para comandos externos, esses também aparecerão no menu. @@ -506,6 +539,7 @@ O menu de histórico pode ser configurado modificando esses valores no objeto de ] ... ``` + Ao modificar esses parâmetros, você pode personalizar o layout do seu menu de acordo com suas preferências. ### Menu de histórico @@ -538,6 +572,7 @@ $env.config = { ] ... ``` + Quando o menu de histórico é ativado, ele busca registros da história em lotes (`page_size`) e os apresenta no menu. Se houver espaço no terminal, quando você pressiona Ctrl+x novamente, o menu buscará o mesmo número de registros e os acrescentará à página atual. Se não for possível apresentar todos os registros obtidos, o menu criará uma nova página. As páginas podem ser navegadas pressionando Ctrl+z para ir para a página anterior ou Ctrl+x para ir para a próxima página. ### Pesquisando no Histórico @@ -547,11 +582,13 @@ Para pesquisar no seu histórico, você pode começar a digitar palavras-chave p ```nu let a = () ``` + você pode posicionar o cursor dentro dos parênteses `()` e ativar o menu. Você pode filtrar o histórico digitando palavras-chave e assim que selecionar uma entrada, as palavras digitadas serão substituídas. ```nu let a = (ls | where size > 10MiB) ``` + Outra característica interessante do menu é a capacidade de selecionar rapidamente algo dele. Suponha que você tenha ativado o seu menu e ele pareça assim: ```nu @@ -561,6 +598,7 @@ Outra característica interessante do menu é a capacidade de selecionar rapidam 2: ls | where size > 30MiB 3: ls | where size > 40MiB ``` + Em vez de pressionar para baixo para selecionar a quarta entrada, você pode digitar `!3`` e pressionar Enter. Isso irá inserir o texto selecionado na posição do prompt, economizando tempo rolando pelo menu. A pesquisa no histórico e a seleção rápida podem ser usadas juntas. Você pode ativar o menu, fazer uma pesquisa rápida e, em seguida, fazer uma seleção rápida usando o caractere de seleção rápida. @@ -611,6 +649,7 @@ $env.config = { ] ... ``` + Como você pode ver, o novo menu é idêntico ao `history_menu` descrito anteriormente. A única diferença significativa é o novo campo chamado `source`. O campo `source` é uma definição do Nushell dos valores que você deseja exibir no menu. Para este menu, estamos extraindo os dados de `$nu.scope.vars` e estamos usando esses dados para criar registros que serão usados para popular o menu. A estrutura necessária para o registro é a seguinte: @@ -626,6 +665,7 @@ A estrutura necessária para o registro é a seguinte: extra: [string] # Optional. A list of strings that will be displayed with the selected value. Only works with a description menu } ``` + Para que o menu exiba algo, pelo menos o campo value deve estar presente no registro resultante. Para tornar o menu interativo, duas variáveis estão disponíveis no bloco: `$buffer` e `$position`. O `$buffer` contém o valor capturado pelo menu; quando a opção `only_buffer_difference` é verdadeira, `$buffer` é o texto escrito após a ativação do menu. Se `only_buffer_difference` for falso, `$buffer` é toda a string na linha. A variável `$position` pode ser usada para criar spans de substituição com base na ideia que você tinha para o seu menu. O valor de `$position` muda com base em se `only_buffer_difference` é verdadeiro ou falso. Quando é verdadeiro, `$position` é a posição inicial na string onde o texto foi inserido após a ativação do menu. Quando o valor é falso, `$position` indica a posição real do cursor. @@ -669,4 +709,4 @@ $env.config = { ... } -``` \ No newline at end of file +``` diff --git a/pt-BR/book/shells_em_shells.md b/src/content/docs/pt/book/nu-as-a-shell/shells_in_shells.md similarity index 99% rename from pt-BR/book/shells_em_shells.md rename to src/content/docs/pt/book/nu-as-a-shell/shells_in_shells.md index e9fc43a2e89..fd9e50e5235 100644 --- a/pt-BR/book/shells_em_shells.md +++ b/src/content/docs/pt/book/nu-as-a-shell/shells_in_shells.md @@ -1,4 +1,6 @@ -# Shells em shells +--- +title: Shells em shells +--- ## Trabalhando em múltiplos diretórios @@ -33,7 +35,7 @@ O comando `shells` nos mostra que há dois diretórios ativos agora: nosso diret Podemos saltar entre esses shells com os atalhos `n` e `p`, abrevisções para "next" (próximo) e "previous" (anterior): -``` +```nu /home/jonathan/Source/lark(master)> n /home/jonathan/Source/nushell(master)> p /home/jonathan/Source/lark(master)> diff --git a/pt-BR/book/carregando_dados.md b/src/content/docs/pt/book/nu-fundamentals/loading_data.md similarity index 99% rename from pt-BR/book/carregando_dados.md rename to src/content/docs/pt/book/nu-fundamentals/loading_data.md index 620867e6935..38776b90dd9 100644 --- a/pt-BR/book/carregando_dados.md +++ b/src/content/docs/pt/book/nu-fundamentals/loading_data.md @@ -1,4 +1,6 @@ -# Carregando dados +--- +title: Carregando dados +--- Anteriormente vimos como você pode usar comandos como `ls`, `ps`, `date` e `sys` para carregar informações sobre seus arquivos, processos, data e hora e sobre o sistema em si. Cada comando retorna uma tabela de informações que podemos explorar. Há outras maneiras de se carregar uma tabela de dados com a qual trabalhar. diff --git a/pt-BR/book/pipeline.md b/src/content/docs/pt/book/nu-fundamentals/pipeline.md similarity index 99% rename from pt-BR/book/pipeline.md rename to src/content/docs/pt/book/nu-fundamentals/pipeline.md index be4de8c2750..ceef993dc6d 100644 --- a/pt-BR/book/pipeline.md +++ b/src/content/docs/pt/book/nu-fundamentals/pipeline.md @@ -1,4 +1,6 @@ -# O pipeline +--- +title: O pipeline +--- Um dos principais designs do Nu é o pipeline, uma ideia de design que tem suas raízes décadas atrás, na filosofia original por trás do Unix. Assim como Nu se extende a partir do tipo de dado string do Unix, também extende a ideia do pipeline para incluir mais do que apenas texto. diff --git a/pt-BR/book/tipos_de_dados.md b/src/content/docs/pt/book/nu-fundamentals/types_of_data.md similarity index 99% rename from pt-BR/book/tipos_de_dados.md rename to src/content/docs/pt/book/nu-fundamentals/types_of_data.md index 0e11a6bc82a..5b35e074615 100644 --- a/pt-BR/book/tipos_de_dados.md +++ b/src/content/docs/pt/book/nu-fundamentals/types_of_data.md @@ -1,4 +1,6 @@ -# Tipos de dados +--- +title: Tipos de dados +--- Tradicionalmente, comandos de shell do Unix comunicavam-se entre si através de strings de texto. Um comando gerava texto como saída através da saída padrão (normalmente abreviada como 'stdout') e o outro comando lia o texto pela entrada padrão (ou 'stdin'). Desse modo, os dois comandos podiam se comunicar. diff --git a/pt-BR/book/trabalhando_com_tabelas.md b/src/content/docs/pt/book/nu-fundamentals/working_with_tables.md similarity index 99% rename from pt-BR/book/trabalhando_com_tabelas.md rename to src/content/docs/pt/book/nu-fundamentals/working_with_tables.md index e05e8f6d81b..368be48d93b 100644 --- a/pt-BR/book/trabalhando_com_tabelas.md +++ b/src/content/docs/pt/book/nu-fundamentals/working_with_tables.md @@ -1,4 +1,6 @@ -# Trabalhando com tabelas +--- +title: Trabalhando com tabelas +--- Uma forma comum de ver os dados no Nu é por meio de uma tabela. O Nu traz um conjunto de comandos para se trabalhar com tabelas, facilitar a localização do que você procura e restringir os dados apenas ao que você precisa. diff --git a/src/content/docs/pt/index.mdx b/src/content/docs/pt/index.mdx new file mode 100755 index 00000000000..2ac48663eab --- /dev/null +++ b/src/content/docs/pt/index.mdx @@ -0,0 +1,36 @@ +--- +title: Nushell +description: Um novo tipo de shell +template: splash +editUrl: true +lastUpdated: false +hero: + tagline: Um novo tipo de shell + actions: + - text: Get Started + link: /introduction/ + icon: right-arrow + variant: primary + - text: View on GitHub + link: https://github.com/nushell/nushell.github.io + icon: external +--- + +import { Card, CardGrid } from "@astrojs/starlight/components"; + +<CardGrid> + <Card title="Controle seu sistema com pipelines poderosos"> + Pipelines permitem que você comande seu sistema como nunca antes. Seu + sistema pertence a você, e ele aguarda seu comando. + </Card> + <Card title="Tudo é dado"> + Em vez de ter que lembrar todos os parâmetros de todos os comandos, nós + podemos usar apenas os mesmos, independentemente de onde ele veio. + </Card> + <Card title="Plugins Poderosos"> + Nu pode não vir com tudo que você possa querer fazer com ele. Por isso, você + pode extendê-lo com seu poderoso sistema de plugins. + </Card> +</CardGrid> + +<br /> diff --git a/ru/book/README.md b/src/content/docs/ru/book/introduction.md similarity index 99% rename from ru/book/README.md rename to src/content/docs/ru/book/introduction.md index 7efd40a5558..aed62b73ece 100644 --- a/ru/book/README.md +++ b/src/content/docs/ru/book/introduction.md @@ -1,4 +1,6 @@ -# Введение +--- +title: Введение +--- Здравствуйте, добро пожаловать в проект Nushell. Цель этого проекта - взять философию оболочек Unix, где простые команды соединяются с помощью конвейеров, и адаптировать ее к современному стилю разработки. diff --git a/src/content/docs/ru/index.mdx b/src/content/docs/ru/index.mdx new file mode 100644 index 00000000000..5665be488a1 --- /dev/null +++ b/src/content/docs/ru/index.mdx @@ -0,0 +1,50 @@ +--- +title: Nushell +description: Новый тип оболочки +template: splash +editUrl: true +lastUpdated: false +hero: + tagline: Новый тип оболочки + actions: + - text: Get Started + link: /introduction/ + icon: right-arrow + variant: primary + - text: View on GitHub + link: https://github.com/nushell/nushell.github.io + icon: external +--- + +import { Card, CardGrid } from "@astrojs/starlight/components"; + +<CardGrid> + <Card title="Конвейеры для управления любой ОС"> + Nu работает на Linux, macOS, BSD и Windows. Выучите его один раз, а затем + используйте везде. + </Card> + <Card title="Все есть данные"> + Конвейеры Nu используют структурированные данные, поэтому вы можете спокойно + выбирать, фильтровать и сортировать их каждый раз одним и тем же способом. + Перестаньте парсить строки и начните решать проблемы. + </Card> + <Card title="Мощные плагины"> + Nu легко расширяется с помощью мощной системы плагинов. + </Card> +</CardGrid> + +<br /> + + + +### Nu работает с существующими данными + +Nu говорит на языках [JSON, YAML, SQLite, Excel, и других](/book/loading_data.html) из коробки. В конвейер Nu легко внести данные, будь они в файле, базе данных или веб-API: + + + +### Nu имеет отличные сообщения об ошибках + +Nu оперирует типизированными данными, поэтому отлавливает ошибки, которые другие оболочки не могут. А когда что-то ломается, Nu точно сообщает, где и почему: + + diff --git a/snippets/book/std_log.nu b/src/content/docs/snippets/book/std_log.nu similarity index 100% rename from snippets/book/std_log.nu rename to src/content/docs/snippets/book/std_log.nu diff --git a/snippets/installation/build_nu_from_source.sh b/src/content/docs/snippets/installation/build_nu_from_source.nu similarity index 100% rename from snippets/installation/build_nu_from_source.sh rename to src/content/docs/snippets/installation/build_nu_from_source.nu diff --git a/snippets/installation/build_nu_from_source_release.sh b/src/content/docs/snippets/installation/build_nu_from_source_release.nu similarity index 100% rename from snippets/installation/build_nu_from_source_release.sh rename to src/content/docs/snippets/installation/build_nu_from_source_release.nu diff --git a/snippets/installation/build_nu_yourself.sh b/src/content/docs/snippets/installation/build_nu_yourself.nu similarity index 100% rename from snippets/installation/build_nu_yourself.sh rename to src/content/docs/snippets/installation/build_nu_yourself.nu diff --git a/snippets/installation/cargo_install_nu.sh b/src/content/docs/snippets/installation/cargo_install_nu.nu similarity index 100% rename from snippets/installation/cargo_install_nu.sh rename to src/content/docs/snippets/installation/cargo_install_nu.nu diff --git a/snippets/installation/cargo_install_nu_more_features.sh b/src/content/docs/snippets/installation/cargo_install_nu_more_features.nu similarity index 100% rename from snippets/installation/cargo_install_nu_more_features.sh rename to src/content/docs/snippets/installation/cargo_install_nu_more_features.nu diff --git a/snippets/installation/chsh_invalid_shell_error.sh b/src/content/docs/snippets/installation/chsh_invalid_shell_error.nu similarity index 100% rename from snippets/installation/chsh_invalid_shell_error.sh rename to src/content/docs/snippets/installation/chsh_invalid_shell_error.nu diff --git a/snippets/installation/git_clone_nu.sh b/src/content/docs/snippets/installation/git_clone_nu.nu similarity index 100% rename from snippets/installation/git_clone_nu.sh rename to src/content/docs/snippets/installation/git_clone_nu.nu diff --git a/snippets/installation/install_pkg_config_libssl_dev.sh b/src/content/docs/snippets/installation/install_pkg_config_libssl_dev.nu similarity index 100% rename from snippets/installation/install_pkg_config_libssl_dev.sh rename to src/content/docs/snippets/installation/install_pkg_config_libssl_dev.nu diff --git a/snippets/installation/install_rhel_dependencies.sh b/src/content/docs/snippets/installation/install_rhel_dependencies.nu similarity index 100% rename from snippets/installation/install_rhel_dependencies.sh rename to src/content/docs/snippets/installation/install_rhel_dependencies.nu diff --git a/snippets/installation/macos_deps.sh b/src/content/docs/snippets/installation/macos_deps.nu similarity index 100% rename from snippets/installation/macos_deps.sh rename to src/content/docs/snippets/installation/macos_deps.nu diff --git a/snippets/installation/remove_welcome_message.nu b/src/content/docs/snippets/installation/remove_welcome_message.nu similarity index 100% rename from snippets/installation/remove_welcome_message.nu rename to src/content/docs/snippets/installation/remove_welcome_message.nu diff --git a/snippets/installation/run_nu.sh b/src/content/docs/snippets/installation/run_nu.nu similarity index 100% rename from snippets/installation/run_nu.sh rename to src/content/docs/snippets/installation/run_nu.nu diff --git a/snippets/installation/rustup_choose_rust_version.sh b/src/content/docs/snippets/installation/rustup_choose_rust_version.nu similarity index 100% rename from snippets/installation/rustup_choose_rust_version.sh rename to src/content/docs/snippets/installation/rustup_choose_rust_version.nu diff --git a/snippets/installation/use_rawkey_and_clipboard.sh b/src/content/docs/snippets/installation/use_rawkey_and_clipboard.nu similarity index 100% rename from snippets/installation/use_rawkey_and_clipboard.sh rename to src/content/docs/snippets/installation/use_rawkey_and_clipboard.nu diff --git a/snippets/installation/windows_change_default_profile.sh b/src/content/docs/snippets/installation/windows_change_default_profile.nu similarity index 100% rename from snippets/installation/windows_change_default_profile.sh rename to src/content/docs/snippets/installation/windows_change_default_profile.nu diff --git a/snippets/installation/windows_example_extraction_location.sh b/src/content/docs/snippets/installation/windows_example_extraction_location.nu similarity index 100% rename from snippets/installation/windows_example_extraction_location.sh rename to src/content/docs/snippets/installation/windows_example_extraction_location.nu diff --git a/snippets/installation/windows_run_nu.sh b/src/content/docs/snippets/installation/windows_run_nu.nu similarity index 100% rename from snippets/installation/windows_run_nu.sh rename to src/content/docs/snippets/installation/windows_run_nu.nu diff --git a/snippets/installation/windows_terminal_default_shell.sh b/src/content/docs/snippets/installation/windows_terminal_default_shell.nu similarity index 100% rename from snippets/installation/windows_terminal_default_shell.sh rename to src/content/docs/snippets/installation/windows_terminal_default_shell.nu diff --git a/snippets/introduction/date_example.sh b/src/content/docs/snippets/introduction/date_example.nu similarity index 100% rename from snippets/introduction/date_example.sh rename to src/content/docs/snippets/introduction/date_example.nu diff --git a/snippets/introduction/date_table_example.sh b/src/content/docs/snippets/introduction/date_table_example.nu similarity index 100% rename from snippets/introduction/date_table_example.sh rename to src/content/docs/snippets/introduction/date_table_example.nu diff --git a/snippets/introduction/help_example.sh b/src/content/docs/snippets/introduction/help_example.nu similarity index 100% rename from snippets/introduction/help_example.sh rename to src/content/docs/snippets/introduction/help_example.nu diff --git a/snippets/introduction/ls_example.sh b/src/content/docs/snippets/introduction/ls_example.nu similarity index 100% rename from snippets/introduction/ls_example.sh rename to src/content/docs/snippets/introduction/ls_example.nu diff --git a/snippets/introduction/ls_sort_by_reverse_example.sh b/src/content/docs/snippets/introduction/ls_sort_by_reverse_example.nu similarity index 100% rename from snippets/introduction/ls_sort_by_reverse_example.sh rename to src/content/docs/snippets/introduction/ls_sort_by_reverse_example.nu diff --git a/snippets/introduction/ls_where_example.sh b/src/content/docs/snippets/introduction/ls_where_example.nu similarity index 100% rename from snippets/introduction/ls_where_example.sh rename to src/content/docs/snippets/introduction/ls_where_example.nu diff --git a/snippets/introduction/ps_example.sh b/src/content/docs/snippets/introduction/ps_example.nu similarity index 100% rename from snippets/introduction/ps_example.sh rename to src/content/docs/snippets/introduction/ps_example.nu diff --git a/snippets/introduction/ps_where_example.sh b/src/content/docs/snippets/introduction/ps_where_example.nu similarity index 100% rename from snippets/introduction/ps_where_example.sh rename to src/content/docs/snippets/introduction/ps_where_example.nu diff --git a/snippets/introduction/sys_example.sh b/src/content/docs/snippets/introduction/sys_example.nu similarity index 100% rename from snippets/introduction/sys_example.sh rename to src/content/docs/snippets/introduction/sys_example.nu diff --git a/snippets/introduction/sys_get_example.sh b/src/content/docs/snippets/introduction/sys_get_example.nu similarity index 100% rename from snippets/introduction/sys_get_example.sh rename to src/content/docs/snippets/introduction/sys_get_example.nu diff --git a/snippets/introduction/sys_get_external_echo_example.sh b/src/content/docs/snippets/introduction/sys_get_external_echo_example.nu similarity index 100% rename from snippets/introduction/sys_get_external_echo_example.sh rename to src/content/docs/snippets/introduction/sys_get_external_echo_example.nu diff --git a/snippets/introduction/sys_get_nested_example.sh b/src/content/docs/snippets/introduction/sys_get_nested_example.nu similarity index 100% rename from snippets/introduction/sys_get_nested_example.sh rename to src/content/docs/snippets/introduction/sys_get_nested_example.nu diff --git a/snippets/loading_data/cargo-toml.sh b/src/content/docs/snippets/loading_data/cargo_toml.nu similarity index 100% rename from snippets/loading_data/cargo-toml.sh rename to src/content/docs/snippets/loading_data/cargo_toml.nu diff --git a/snippets/loading_data/rust-lang-feed.sh b/src/content/docs/snippets/loading_data/rust_lang_feed.nu similarity index 100% rename from snippets/loading_data/rust-lang-feed.sh rename to src/content/docs/snippets/loading_data/rust_lang_feed.nu diff --git a/snippets/loading_data/vscode.sh b/src/content/docs/snippets/loading_data/vscode.nu similarity index 100% rename from snippets/loading_data/vscode.sh rename to src/content/docs/snippets/loading_data/vscode.nu diff --git a/snippets/moving_around/cd_example.sh b/src/content/docs/snippets/moving_around/cd_example.nu similarity index 100% rename from snippets/moving_around/cd_example.sh rename to src/content/docs/snippets/moving_around/cd_example.nu diff --git a/snippets/moving_around/cd_without_command_example.sh b/src/content/docs/snippets/moving_around/cd_without_command_example.nu similarity index 100% rename from snippets/moving_around/cd_without_command_example.sh rename to src/content/docs/snippets/moving_around/cd_without_command_example.nu diff --git a/snippets/moving_around/cp_example.sh b/src/content/docs/snippets/moving_around/cp_example.nu similarity index 100% rename from snippets/moving_around/cp_example.sh rename to src/content/docs/snippets/moving_around/cp_example.nu diff --git a/snippets/moving_around/ls_deep_glob_example.sh b/src/content/docs/snippets/moving_around/ls_deep_glob_example.nu similarity index 100% rename from snippets/moving_around/ls_deep_glob_example.sh rename to src/content/docs/snippets/moving_around/ls_deep_glob_example.nu diff --git a/snippets/moving_around/ls_example.sh b/src/content/docs/snippets/moving_around/ls_example.nu similarity index 100% rename from snippets/moving_around/ls_example.sh rename to src/content/docs/snippets/moving_around/ls_example.nu diff --git a/snippets/moving_around/ls_shallow_glob_example.sh b/src/content/docs/snippets/moving_around/ls_shallow_glob_example.nu similarity index 61% rename from snippets/moving_around/ls_shallow_glob_example.sh rename to src/content/docs/snippets/moving_around/ls_shallow_glob_example.nu index 47fb2d8bf57..e944ebebe46 100644 --- a/snippets/moving_around/ls_shallow_glob_example.sh +++ b/src/content/docs/snippets/moving_around/ls_shallow_glob_example.nu @@ -1,9 +1,9 @@ > ls *.md ───┬────────────────────┬──────┬─────────┬──────────── - # │ name │ type │ size │ modified + # │ name │ type │ size │ modified ───┼────────────────────┼──────┼─────────┼──────────── - 0 │ CODE_OF_CONDUCT.md │ File │ 3.4 KB │ 5 days ago - 1 │ CONTRIBUTING.md │ File │ 886 B │ 5 days ago - 2 │ README.md │ File │ 15.0 KB │ 5 days ago - 3 │ TODO.md │ File │ 1.6 KB │ 5 days ago + 0 │ CODE_OF_CONDUCT.md │ File │ 3.4 KB │ 5 days ago + 1 │ CONTRIBUTING.md │ File │ 886 B │ 5 days ago + 2 │ README.md │ File │ 15.0 KB │ 5 days ago + 3 │ TODO.md │ File │ 1.6 KB │ 5 days ago ───┴────────────────────┴──────┴─────────┴──────────── diff --git a/snippets/moving_around/mkdir_example.sh b/src/content/docs/snippets/moving_around/mkdir_example.nu similarity index 100% rename from snippets/moving_around/mkdir_example.sh rename to src/content/docs/snippets/moving_around/mkdir_example.nu diff --git a/snippets/moving_around/mv_example.sh b/src/content/docs/snippets/moving_around/mv_example.nu similarity index 100% rename from snippets/moving_around/mv_example.sh rename to src/content/docs/snippets/moving_around/mv_example.nu diff --git a/snippets/moving_around/rm_example.sh b/src/content/docs/snippets/moving_around/rm_example.nu similarity index 100% rename from snippets/moving_around/rm_example.sh rename to src/content/docs/snippets/moving_around/rm_example.nu diff --git a/snippets/types_of_data/cell-paths.sh b/src/content/docs/snippets/types_of_data/cell_paths.nu similarity index 100% rename from snippets/types_of_data/cell-paths.sh rename to src/content/docs/snippets/types_of_data/cell_paths.nu diff --git a/zh-CN/book/command_reference.md b/src/content/docs/zh-CN/book/command_reference.md similarity index 96% rename from zh-CN/book/command_reference.md rename to src/content/docs/zh-CN/book/command_reference.md index ca38599f9a1..1dac2285280 100644 --- a/zh-CN/book/command_reference.md +++ b/src/content/docs/zh-CN/book/command_reference.md @@ -1,4 +1,6 @@ -# 命令索引 +--- +title: 命令索引 +--- 若要查看所有 Nushell 命令, 可以执行 [`help commands`](/commands/docs/help.md)。 diff --git a/zh-CN/book/regular_expressions.md b/src/content/docs/zh-CN/book/regular_expressions.md similarity index 85% rename from zh-CN/book/regular_expressions.md rename to src/content/docs/zh-CN/book/regular_expressions.md index ecf186eef49..a2b0d5ae671 100644 --- a/zh-CN/book/regular_expressions.md +++ b/src/content/docs/zh-CN/book/regular_expressions.md @@ -1,3 +1,5 @@ -# 正则表达式 +--- +title: 正则表达式 +--- Nushell 命令中的正则表达式是由 `rust-lang/regex` 包处理的。如果你想了解更多,请查看 crate 的文档:"[Regex](https://github.com/rust-lang/regex)"。 diff --git a/zh-CN/book/creating_errors.md b/src/content/docs/zh-cn/book/advanced/creating_errors.md similarity index 97% rename from zh-CN/book/creating_errors.md rename to src/content/docs/zh-cn/book/advanced/creating_errors.md index 75973d99ca7..58d1cecf221 100644 --- a/zh-CN/book/creating_errors.md +++ b/src/content/docs/zh-cn/book/advanced/creating_errors.md @@ -1,4 +1,6 @@ -# 创建你自己的错误 +--- +title: 创建你自己的错误 +--- 使用 [元数据](metadata.md) 信息,你可以创建自己的自定义错误,错误信息由多个部分构成: diff --git a/zh-CN/book/dataframes.md b/src/content/docs/zh-cn/book/advanced/dataframes.md similarity index 94% rename from zh-CN/book/dataframes.md rename to src/content/docs/zh-cn/book/advanced/dataframes.md index d33377f6698..237c96617d5 100644 --- a/zh-CN/book/dataframes.md +++ b/src/content/docs/zh-cn/book/advanced/dataframes.md @@ -1,7 +1,9 @@ -# DataFrames +--- +title: 数据框 +--- -::: warning -要使用`DataFrame`支持,您需要使用 `cargo build --features dataframe` 构建一个具有完整功能的版本。从版本 0.72 开始,Nushell 的二进制发布版本中 *不* 包含`DataFrame`。[请参阅安装说明](/book/installation.md) 以获取更多详细信息。 +:::caution +要使用`DataFrame`支持,您需要使用 `cargo build --features dataframe` 构建一个具有完整功能的版本。从版本 0.72 开始,Nushell 的二进制发布版本中 _不_ 包含`DataFrame`。[请参阅安装说明](/book/installation.md) 以获取更多详细信息。 ::: 正如我们到目前为止所看到的,Nushell 把数据处理作为其主要任务。`Lists` 和 `Tables`的存在是为了帮助你循环处理值,以便执行多种操作或轻而易举地找到数据。然而,在某些操作中,基于行的数据布局并不是处理数据的最有效方式,特别是在处理极其庞大的文件时。对于大型数据集的`group-by`或`join`等操作,如果不使用适当的数据格式,会占用大量的内存,并可能耗费大量的计算时间。 @@ -106,7 +108,7 @@ df = pd.read_csv("Data7602DescendingYearOrder.csv") 同样,我们要从 Nushell 的原生命令开始: -::: tip +:::tip 如果你想运行这个例子,请注意接下来的命令将使用大量的内存,在该命令执行期间可能会影响你的系统性能。 ::: @@ -168,7 +170,7 @@ $res 在看到了可以用[`Dataframe`](/commands/categories/dataframe.md)命令完成的事情之后,现在是时候开始测试它们了。首先,让我们创建一个样本 CSV 文件,该文件将成为我们的样本 DataFrame,并与示例一起使用。在你喜欢的编辑器中粘贴下面几行来创建样本 csv 文件: -``` +```nu int_1,int_2,float_1,float_2,first,second,third,word 1,11,0.1,1.0,a,b,c,first 2,12,0.2,1.0,a,b,c,second @@ -192,7 +194,7 @@ int_1,int_2,float_1,float_2,first,second,third,word 这应该会在内存中创建一个值 `$df`,用来存放我们刚刚创建的数据。 -::: tip +:::tip `dfr open` 命令可以读取 **csv** 或 **parquet** 文件。 ::: @@ -231,7 +233,7 @@ int_1,int_2,float_1,float_2,first,second,third,word 有了内存中的 DataFrame,我们就可以开始对 `DataFrame` 进行列操作。 -::: tip +:::tip 如果你想看到所有可用的 DataFrame 命令,你可以使用 `$nu.scope.commands | where category =~ dataframe`。 ::: @@ -265,7 +267,7 @@ int_1,int_2,float_1,float_2,first,second,third,word ❯ let res = ($df | dfr sum | dfr select int_1 int_2 float_1 float_2) ``` -::: tip +:::tip 输入 `let res = ( !! )` 并按回车,这将自动完成之前执行的命令。注意 ( 和 !! 之间的空格。 ::: @@ -289,7 +291,7 @@ int_1,int_2,float_1,float_2,first,second,third,word 也可以用一个列作为参考来连接(`join`)两个 DataFrame。我们将把我们的迷你 DataFrame 与另一个迷你 DataFrame 连接起来。在另一个文件中复制这些行,并创建相应的 DataFrame(在以下例子中,我们将称之为`test_small_a.csv`)。 -``` +```nu int_1,int_2,float_1,float_2,first 9,14,0.4,3.0,a 8,13,0.3,2.0,a @@ -317,7 +319,7 @@ int_1,int_2,float_1,float_2,first ╰───┴───────┴───────┴─────────┴─────────┴───────┴────────┴───────┴────────┴─────────┴───────────┴───────────┴─────────╯ ``` -::: tip +:::tip 在`Nu`中,当一个命令有多个参数,并期望得到多个值时,我们用方括号`[]`来包裹这些值。在[`dfr join`](/commands/docs/dfr_join.md)的情况下,我们可以对多个列进行连接,只要它们具有相同的类型。 ::: @@ -397,7 +399,7 @@ int_1,int_2,float_1,float_2,first ╰───┴───┴───╯ ``` -::: tip +:::tip 目前,并不是所有的 Nushell 基本类型都可以转换为 DataFrame。随着 DataFrame 功能的成熟,这一点将在未来发生变化。 ::: @@ -468,7 +470,7 @@ Nushell 强大的管道语法允许我们通过从其他 DataFrame 中获取数 现在我们有一个新的系列,它是通过对前一个变量进行基本操作而构建的。 -::: tip +:::tip 如果你想看看你在内存中存储了多少变量,你可以使用`$nu.scope.vars`。 ::: @@ -499,7 +501,6 @@ Nushell 强大的管道语法允许我们通过从其他 DataFrame 中获取数 ╰───┴─────────────────╯ ``` - 而且我们可以将它们添加到先前定义的 DataFrames 中: ```nu @@ -682,7 +683,7 @@ Nushell 的管道系统可以帮助你创建非常有趣的工作流程。 ╰───┴───────┴───────┴─────────┴─────────┴───────┴────────┴───────┴────────╯ ``` -命令 [`dfr take`](/commands/docs/dfr_take.md) 非常方便,特别是当我们把它与其他命令混合使用时。 +命令 [`dfr take`](/commands/docs/dfr_take.md) 非常方便,特别是当我们把它与其他命令混合使用时。 假设我们想提取 `first` 列中含有第一个重复的元素的的所有记录。为了做到这一点,我们可以使用 `arg-unique` 命令,如下例所示: ```nu @@ -699,7 +700,7 @@ Nushell 的管道系统可以帮助你创建非常有趣的工作流程。 或者,如果我们想使用一个特定的列来创建一个新的有序 DataFrame,该怎么办?我们可以使用`arg-sort`来完成这个任务。在下一个例子中,我们可以通过`word`列对 DataFrame 进行排序: -::: tip +:::tip 同样的结果也可以用[`sort`](/commands/docs/sort.md)命令来完成。 ::: @@ -940,7 +941,7 @@ $nu.scope.commands | where category =~ lazyframe 下表列出了可用的`DataFrame`命令及其描述,并尽可能显示其类似的 Nushell 命令。 -::: warning +:::caution 此列表可能已过时。要获取最新的命令列表,请参阅 [Dataframe](/commands/categories/dataframe.md) [Lazyframe](/commands/categories/lazyframe.md) 和 @@ -948,55 +949,55 @@ $nu.scope.commands | where category =~ lazyframe 命令类别。 ::: -| 命令名 | 应用于 | 描述 | Nushell 类似命令 | -| --------------- | --------------------------- | -------------------------------------------------- | ----------------------------- | -| aggregate | DataFrame, GroupBy, Series | 在一个 DataFrame、GroupBy 或系列对象上执行聚合操作 | math | -| all-false | Series | 如果所有的值都是假的,则返回真 | | -| all-true | Series | 如果所有的值都是真的,则返回真 | all | -| arg-max | Series | 返回系列中最大值的索引 | | -| arg-min | Series | 返回系列中最小值的索引 | | -| arg-sort | Series | 返回排序后的系列的索引 | | -| arg-true | Series | 返回值为真的索引 | | -| arg-unique | Series | 返回唯一值的索引 | | -| count-null | Series | 计算空值 | | -| count-unique | Series | 计算唯一值 | | -| drop | DataFrame | 通过删除选定的列来创建一个新的 DataFrame | drop | -| drop-duplicates | DataFrame | 删除 DataFrame 中的重复值 | | -| drop-nulls | DataFrame, Series | 丢弃 DataFrame 中的空值 | | -| dtypes | DataFrame | 显示 DataFrame 的数据类型 | | -| filter-with | DataFrame | 使用 Mask 作为参考来过滤 DataFrame | | -| first | DataFrame | 用第一行创建新的 DataFrame | first | -| get | DataFrame | 用选定的列创建 DataFrame | get | -| group-by | DataFrame | 创建一个 GroupBy 对象,可用于其他聚合 | group-by | -| is-duplicated | Series | 创建表示重复值的 Mask | | -| is-in | Series | 检查一个系列的元素是否包含在右边的系列中 | in | -| is-not-null | Series | 创建值为非空的 Mask | | -| is-null | Series | 创建值为空的 Mask | `<column_name> == $nothing` | -| is-unique | Series | 创建表示唯一值的 Mask | | -| join | DataFrame | 使用列作为参考来连接一个 DataFrame | | -| last | DataFrame | 用最后几行创建新的 DataFrame | last | -| ls-df | | 列出已存储的 DataFrame | | -| melt | DataFrame | 将一个 DataFrame 从宽格式转为长格式 | | +| 命令名 | 应用于 | 描述 | Nushell 类似命令 | +| --------------- | --------------------------- | -------------------------------------------------- | ---------------------------------------------------------------------- | +| aggregate | DataFrame, GroupBy, Series | 在一个 DataFrame、GroupBy 或系列对象上执行聚合操作 | math | +| all-false | Series | 如果所有的值都是假的,则返回真 | | +| all-true | Series | 如果所有的值都是真的,则返回真 | all | +| arg-max | Series | 返回系列中最大值的索引 | | +| arg-min | Series | 返回系列中最小值的索引 | | +| arg-sort | Series | 返回排序后的系列的索引 | | +| arg-true | Series | 返回值为真的索引 | | +| arg-unique | Series | 返回唯一值的索引 | | +| count-null | Series | 计算空值 | | +| count-unique | Series | 计算唯一值 | | +| drop | DataFrame | 通过删除选定的列来创建一个新的 DataFrame | drop | +| drop-duplicates | DataFrame | 删除 DataFrame 中的重复值 | | +| drop-nulls | DataFrame, Series | 丢弃 DataFrame 中的空值 | | +| dtypes | DataFrame | 显示 DataFrame 的数据类型 | | +| filter-with | DataFrame | 使用 Mask 作为参考来过滤 DataFrame | | +| first | DataFrame | 用第一行创建新的 DataFrame | first | +| get | DataFrame | 用选定的列创建 DataFrame | get | +| group-by | DataFrame | 创建一个 GroupBy 对象,可用于其他聚合 | group-by | +| is-duplicated | Series | 创建表示重复值的 Mask | | +| is-in | Series | 检查一个系列的元素是否包含在右边的系列中 | in | +| is-not-null | Series | 创建值为非空的 Mask | | +| is-null | Series | 创建值为空的 Mask | `<column_name> == $nothing` | +| is-unique | Series | 创建表示唯一值的 Mask | | +| join | DataFrame | 使用列作为参考来连接一个 DataFrame | | +| last | DataFrame | 用最后几行创建新的 DataFrame | last | +| ls-df | | 列出已存储的 DataFrame | | +| melt | DataFrame | 将一个 DataFrame 从宽格式转为长格式 | | | not | Series Inverts boolean mask | | -| open | | 从 csv 文件中加载 DataFrame | open | -| pivot | GroupBy | 在 GroupBy 对象上执行透视操作 | pivot | -| rename | Dataframe, Series | 重命名一个系列 | rename | -| sample | DataFrame | 创建样本 DataFrame | | -| select | DataFrame | 用选定的列创建一个新的 DataFrame | select | -| set | Series | 在给定的 Mask 为真时设置值 | | -| set-with-idx | Series | 设置给定索引中的值 | | -| shift | Series | 将值移到一个给定的时段 | | -| show | DataFrame | 将 DataFrame 的一个部分转换为一个表或列表值 | | -| slice | DataFrame | 从行的切片中创建新的 DataFrame | | -| sort-by | DataFrame, Series | 创建新的排序 DataFrame 或系列 | sort | -| take | DataFrame, Series | 使用给定的索引创建新的 DataFrame | | -| to csv | DataFrame | 将 DataFrame 保存为 csv 文件 | to csv | -| into df | | 将一个管道里的表或列表转换为 DataFrame | | -| dummies | DataFrame | 创建一个带有假值的新 DataFrame | | -| to parquet | DataFrame | 将 DataFrame 保存到 parquet 文件中 | | -| unique | Series | 返回一个系列中的唯一值 | uniq | -| value-counts | Series | 返回一个带有系列中唯一值的计数的 DataFrame | | -| where | DataFrame | 过滤 DataFrame 以符合条件 | where | +| open | | 从 csv 文件中加载 DataFrame | open | +| pivot | GroupBy | 在 GroupBy 对象上执行透视操作 | pivot | +| rename | Dataframe, Series | 重命名一个系列 | rename | +| sample | DataFrame | 创建样本 DataFrame | | +| select | DataFrame | 用选定的列创建一个新的 DataFrame | select | +| set | Series | 在给定的 Mask 为真时设置值 | | +| set-with-idx | Series | 设置给定索引中的值 | | +| shift | Series | 将值移到一个给定的时段 | | +| show | DataFrame | 将 DataFrame 的一个部分转换为一个表或列表值 | | +| slice | DataFrame | 从行的切片中创建新的 DataFrame | | +| sort-by | DataFrame, Series | 创建新的排序 DataFrame 或系列 | sort | +| take | DataFrame, Series | 使用给定的索引创建新的 DataFrame | | +| to csv | DataFrame | 将 DataFrame 保存为 csv 文件 | to csv | +| into df | | 将一个管道里的表或列表转换为 DataFrame | | +| dummies | DataFrame | 创建一个带有假值的新 DataFrame | | +| to parquet | DataFrame | 将 DataFrame 保存到 parquet 文件中 | | +| unique | Series | 返回一个系列中的唯一值 | uniq | +| value-counts | Series | 返回一个带有系列中唯一值的计数的 DataFrame | | +| where | DataFrame | 过滤 DataFrame 以符合条件 | where | | with-column | DataFrame | 在 DataFrame 中添加一个系列 | `insert <column_name> <value> \| upsert <column_name> { <new_value> }` | ## DataFrames 的未来 diff --git a/zh-CN/book/metadata.md b/src/content/docs/zh-cn/book/advanced/metadata.md similarity index 98% rename from zh-CN/book/metadata.md rename to src/content/docs/zh-cn/book/advanced/metadata.md index 7d5fa4a58d1..c343e211dac 100644 --- a/zh-CN/book/metadata.md +++ b/src/content/docs/zh-cn/book/advanced/metadata.md @@ -1,8 +1,10 @@ -# 元数据 +--- +title: 元数据 +--- 在使用 Nu 的过程中,你可能遇到过这样的情况:你觉得有一些额外的事情在幕后进行。例如,假设你试图打开一个 Nu 支持的文件,但却忘记了它已被 Nu 支持并试图再次转换: -``` +```nu > open Cargo.toml | from toml error: Expected a string from pipeline - shell:1:18 @@ -19,7 +21,7 @@ error: Expected a string from pipeline 让我们再次运行[`open`](/commands/docs/open.md)命令,但这一次,我们将看一下它所反馈的标签: -``` +```nu > metadata (open Cargo.toml) ╭──────┬───────────────────╮ │ span │ {record 2 fields} │ diff --git a/zh-CN/book/parallelism.md b/src/content/docs/zh-cn/book/advanced/parallelism.md similarity index 99% rename from zh-CN/book/parallelism.md rename to src/content/docs/zh-cn/book/advanced/parallelism.md index 0ed0b77678f..cc05f84c7a6 100644 --- a/zh-CN/book/parallelism.md +++ b/src/content/docs/zh-cn/book/advanced/parallelism.md @@ -1,4 +1,6 @@ -# 并行 +--- +title: 并行 +--- Nushell 现在已经初步支持并行运行代码了,这允许你使用更多的计算机硬件资源来处理一个流的各个元素。 diff --git a/zh-CN/book/plugins.md b/src/content/docs/zh-cn/book/advanced/plugins.md similarity index 98% rename from zh-CN/book/plugins.md rename to src/content/docs/zh-cn/book/advanced/plugins.md index df7647662cf..95dbe78cffb 100644 --- a/zh-CN/book/plugins.md +++ b/src/content/docs/zh-cn/book/advanced/plugins.md @@ -1,4 +1,6 @@ -# 插件 +--- +title: 插件 +--- Nu 可以通过插件进行扩展。插件的行为与 Nu 的内置命令很相似,另外的好处是它们可以与 Nu 本身分开添加。 diff --git a/src/content/docs/zh-cn/book/coming-to-nu/coming_from_bash.md b/src/content/docs/zh-cn/book/coming-to-nu/coming_from_bash.md new file mode 100644 index 00000000000..9d8f57b615d --- /dev/null +++ b/src/content/docs/zh-cn/book/coming-to-nu/coming_from_bash.md @@ -0,0 +1,62 @@ +--- +title: 从 Bash 到 Nu +--- + +如果你是来自 Windows 上的`Git Bash`用户,那么你习惯的外部命令(bash、grep 等)在`nu`中默认是不可用的(除非你在 Windows 路径环境变量中明确包含了它们)。 +要使这些命令在`nu`中可用,请在你的`config.nu`中添加以下一行,用`append`或`prepend`。 + +```nu +$env.Path = ($env.Path | prepend 'C:\Program Files\Git\usr\bin') +``` + +注意:本表针对 Nu 0.60.0 或更高版本。 + +| Bash | Nu | Task | +| ------------------------------------ | -------------------------------------------------- | ------------------------------------------------------------------------------------------ | +| `ls` | `ls` | 列出当前目录中的文件 | +| `ls <dir>` | `ls <dir>` | 列出给定目录中的文件 | +| `ls pattern*` | `ls pattern*` | 列出匹配给定模式的文件 | +| `ls -la` | `ls --long --all` or `ls -la` | 列出包含所有可用信息的文件,包括隐藏文件 | +| `ls -d */` | `ls \| where type == dir` | 列出目录 | +| `find . -name *.rs` | `ls **/*.rs` | 递归地查找匹配给定模式的所有文件 | +| `find . -name Makefile \| xargs vim` | `ls \*\*/Makefile \| get name \| vim $in` | 将值作为命令参数传递 | +| `cd <directory>` | `cd <directory>` | 切换到给定目录 | +| `cd` | `cd` | 切换到用户主目录 | +| `cd -` | `cd -` | 切换到前一个目录 | +| `mkdir <path>` | `mkdir <path>` | 创建给定的路径 | +| `mkdir -p <path>` | `mkdir <path>` | 创建给定的路径,如果父目录不存在则自动创建 | +| `touch test.txt` | `touch test.txt` | 新建文件 | +| `> <path>` | `\| save --raw <path>` | 保存字符串到给定文件 | +| `>> <path>` | `\| save --raw --append <path>` | 追加字符串到给定文件 | +| `cat <path>` | `open --raw <path>` | 显示给定文件的内容 | +| | `open <path>` | 将文件作为结构化数据读取 | +| `mv <source> <dest>` | `mv <source> <dest>` | 移动文件到新的位置 | +| `cp <source> <dest>` | `cp <source> <dest>` | 复制文件到新的位置 | +| `cp -r <source> <dest>` | `cp -r <source> <dest>` | 递归地将目录复制到一个新的位置 | +| `rm <path>` | `rm <path>` | 删除给定的文件 | +| | `rm -t <path>` | 将给定的文件移到系统垃圾箱 | +| `rm -rf <path>` | `rm -r <path>` | 递归地删除给定的路径 | +| `date -d <date>` | `"<date>" \| into datetime -f <format>` | 解析日期 ([日期格式文档](https://docs.rs/chrono/0.4.15/chrono/format/strftime/index.html)) | +| `sed` | `str replace` | 查找和替换一个字符串中的模式 | +| `grep <pattern>` | `where $it =~ <substring>` or `find <substring>` | 过滤包含特定字符串的字符串 | +| `man <command>` | `help <command>` | 获得特定命令的帮助信息 | +| | `help commands` | 列出所有可用的命令 | +| | `help --find <string>` | 在所有可用的命令中搜索 | +| `command1 && command2` | `command1; command2` | 运行一条命令,如果成功的话,再运行第二条 | +| `stat $(which git)` | `stat (which git).path` | 使用命令输出作为其他命令的参数 | +| `echo $PATH` | `echo $env.PATH` | 查看当前路径 | +| `<update ~/.bashrc>` | `vim $nu.config-path` | 永久地更新 PATH | +| `export PATH = $PATH:/usr/other/bin` | `$env.PATH = ($env.PATH \| append /usr/other/bin)` | 临时更新 PATH | +| `export` | `echo $env` | 列出当前的环境变量 | +| `<update ~/.bashrc>` | `vim $nu.config-path` | 永久地更新环境变量 | +| `FOO=BAR ./bin` | `FOO=BAR ./bin` | 临时修改环境变量 | +| `export FOO=BAR` | `$env.FOO = BAR` | 为当前会话设置环境变量 | +| `echo $FOO` | `echo $env.FOO` | 使用环境变量 | +| `unset FOO` | `hide FOO` | 取消对当前会话的环境变量设置 | +| `alias s="git status -sb"` | `alias s = git status -sb` | 临时定义一个别名 | +| `type FOO` | `which FOO` | 显示一个命令的信息(内置、别名或可执行) | +| `<update ~/.bashrc>` | `vim $nu.config-path` | 永久添加和编辑别名(新开Shell会话生效) | +| `bash -c <commands>` | `nu -c <commands>` | 运行一组命令(需要0.9.1或更高版本) | +| `bash <script file>` | `nu <script file>` | 运行一个脚本文件(需要0.9.1或更高版本) | +| `\` | `( <command> )` | 当命令被 `(` 和 `)` 包裹的时候可以跨多行 | +| `pwd` | `$env.PWD` | 显示当前目录 | diff --git a/src/content/docs/zh-cn/book/coming-to-nu/nushell_map.md b/src/content/docs/zh-cn/book/coming-to-nu/nushell_map.md new file mode 100644 index 00000000000..9538fca0a0b --- /dev/null +++ b/src/content/docs/zh-cn/book/coming-to-nu/nushell_map.md @@ -0,0 +1,102 @@ +--- +title: 从其他 Shell 或 DSL 到 Nu +--- + +这个表格背后的想法是帮助你了解 Nu 的内置和插件所提供命令与其他已知的 Shell 和特定领域语言(DSL)的关系。我们试图制作一张所有 Nu 命令和它们在其他语言中的对应关系的表。欢迎大家参与贡献。 + +注意:此表针对 Nu 0.43 或更高版本。 + +| Nushell | SQL | .Net LINQ (C#) | PowerShell (without external modules) | Bash | +| ------------------------- | ------------------------------------------------ | ---------------------------------------------------- | ------------------------------------------ | ----------------------------------------------- | +| alias | - | - | alias | alias | +| append | - | Append | -Append | | +| args | - | - | | | +| autoview | - | - | | | +| math avg | avg | Average | Measure-Object, measure | | +| calc, `<math expression>` | math operators | Aggregate, Average, Count, Max, Min, Sum | | bc | +| cd | - | - | Set-Location, cd | cd | +| clear | - | - | Clear-Host | clear | +| compact | | | | | +| config | - | - | $Profile | vi .bashrc, .profile | +| cp | - | - | Copy-Item, cp, copy | cp | +| date | NOW() / getdate() | DateTime class | Get-Date | date | +| debug | | | | | +| default | | | | | +| drop | | | | | +| du | - | - | | du | +| each | cursor | | ForEach-Object, foreach, for | | +| echo | print, union all | - | Write-Output, write | echo | +| enter | - | - | | | +| exit | - | | exit | exit | +| first | top, limit | First, FirstOrDefault | Select-Object -First | head | +| format | | String.Format | String.Format | | +| from | import flatfile, openjson, cast(variable as xml) | - | Import/ConvertFrom-{Csv,Xml,Html,Json} | | +| get | | Select | (cmd).column | | +| group-by | group by | GroupBy, group | Group-Object, group | | +| headers | | | | | +| help | sp_help | - | Get-Help, help, man | man | +| histogram | - | - | | | +| history | - | - | Get-History, history | history | +| http(`*`) | - | HttpClient,WebClient, HttpWebRequest/Response | Invoke-WebRequest | wget | +| inc(`*`) | - | | - | - | +| is_empty | is null | String.InNullOrEmpty | String.InNullOrEmpty | | +| keep, =take | top, limit | Take | Select-Object -First | head | +| keep-until | | | | | +| keep-while | | TakeWhile | | | +| kill | - | - | Stop-Process, kill | kill | +| last | | Last, LastOrDefault | Select-Object -Last | tail | +| length | count | Count | Measure-Object, measure | wc | +| lines | - | - | File.ReadAllLines | | +| ls | - | - | Get-ChildItem, dir, ls | ls | +| match(`*`) | case when | Regex.IsMatch | [regex] | | +| merge | | | | | +| mkdir | - | - | mkdir, md | mkdir | +| mv | - | - | Move-Item, mv, move, mi | mv | +| next | | | | | +| nth | limit x offset y, rownumber = | ElementAt | [x], indexing operator, ElementAt | | +| open | | | Get-Content, gc, cat, type | cat | +| parse | | | | | +| transpose | pivot | - | | | +| post(`*`) | - | HttpClient,WebClient, HttpWebRequest/Response | Invoke-WebRequest | | +| prepend | | | | | +| prev | | | | | +| ps(`*`) | - | - | Get-Process, ps, gps | ps | +| pwd | - | - | Get-Location, pwd | pwd | +| range | | Range | 1..10, 'a'..'f' | | +| reduce | | Aggregate | | | +| reject | | | | | +| rename | - | - | Rename-Item, ren, rni | mv | +| reverse | | Reverse | [Array]::Reverse($var) | | +| rm | - | - | Remove-Item, del, erase, rd, ri, rm, rmdir | rm | +| save | - | - | Write-Output, Out-File | > foo.txt | +| select | select | Select | Select-Object, select | | +| shells | - | - | - | | +| shuffle | | Random | Sort-Object {Get-Random} | - | +| size | | | Measure-Object, measure | wc | +| skip | where row_number() | Skip | Select-Object -Skip | | +| skip until | | | | | +| skip while | | SkipWhile | | | +| sort-by | order by | OrderBy, OrderByDescending, ThenBy, ThenByDescending | Sort-Object, sort | | +| split-by | | Split | Split | | +| split column | | - | | | +| split row | | - | | | +| str(`*`) | string functions | String class | String class | | +| str join | concat_ws | Join | Join-String | | +| str trim | rtrim, ltrim | Trim, TrimStart, TrimEnd | Trim | | +| sum | sum | Sum | Measure-Object, measure | | +| sys(`*`) | - | - | Get-ComputerInfo | uname, lshw, lsblk, lscpu, lsusb, hdparam, free | +| table | | | Format-Table, ft, Format-List, fl | | +| tags | - | - | - | | +| textview(`*`) | - | - | Get-Content, cat | | +| tree(`*`) | - | - | tree | | +| to | - | - | Export/ConvertTo-{Csv,Xml,Html,Json} | | +| touch | - | - | Set-Content | touch | +| uniq | distinct | Distinct | Get-Unique, gu | uniq | +| upsert | As | - | | | +| version | select @@version | - | $PSVersionTable | | +| with_env | - | - | $env:FOO = 'bar' | export foo = "bar" | +| where | where | Where | Where-Object, where, "?" operator | | +| which | - | - | - | which | +| wrap | | | | | + +- `*` - 这些命令是标准插件的一部分 diff --git a/zh-CN/book/nushell_map_functional.md b/src/content/docs/zh-cn/book/coming-to-nu/nushell_map_functional.md similarity index 99% rename from zh-CN/book/nushell_map_functional.md rename to src/content/docs/zh-cn/book/coming-to-nu/nushell_map_functional.md index 6c8c2c3d4a8..7e73a525944 100644 --- a/zh-CN/book/nushell_map_functional.md +++ b/src/content/docs/zh-cn/book/coming-to-nu/nushell_map_functional.md @@ -1,4 +1,6 @@ -# 从函数式语言到 Nu +--- +title: 从函数式语言到 Nu +--- 这个表格的目的是帮助你了解 Nu 的内置和插件所提供命令与函数式语言的关系。我们试图制作一张所有 Nu 命令和它们在其他语言中的映射关系的表。欢迎大家参与贡献。 diff --git a/zh-CN/book/nushell_map_imperative.md b/src/content/docs/zh-cn/book/coming-to-nu/nushell_map_imperative.md similarity index 98% rename from zh-CN/book/nushell_map_imperative.md rename to src/content/docs/zh-cn/book/coming-to-nu/nushell_map_imperative.md index 7341115634c..71e204e1938 100644 --- a/zh-CN/book/nushell_map_imperative.md +++ b/src/content/docs/zh-cn/book/coming-to-nu/nushell_map_imperative.md @@ -1,4 +1,6 @@ -# 从命令式语言到 Nu +--- +title: 从命令式语言到 Nu +--- 这个表格的目的是帮助你了解 Nu 的内置和插件所提供的命令与命令式语言的关系。我们试图制作一张所有 Nu 命令和它们在其他语言中的对应关系的表。欢迎大家参与贡献。 @@ -81,7 +83,7 @@ | split column | | | | | | split row | | | | | | str(`*`) | str functions | String functions | string functions | &str, String functions | -| str join | str.join | joinToString | | join | +| str join | str.join | joinToString | | join | | str trim | strip, rstrip, lstrip | trim, trimStart, trimEnd | regex | trim, trim*{start,end}, strip*{suffix,prefix} | | sum | sum | sum | reduce | sum | | sys(`*`) | sys | | | | diff --git a/zh-CN/book/nushell_operator_map.md b/src/content/docs/zh-cn/book/coming-to-nu/nushell_operator_map.md similarity index 98% rename from zh-CN/book/nushell_operator_map.md rename to src/content/docs/zh-cn/book/coming-to-nu/nushell_operator_map.md index 7588af72cd9..de2a52dd79a 100644 --- a/zh-CN/book/nushell_operator_map.md +++ b/src/content/docs/zh-cn/book/coming-to-nu/nushell_operator_map.md @@ -1,4 +1,6 @@ -# Nushell 运算符 +--- +title: Nushell 运算符 +--- 这个表格的目的是帮助你了解 Nu 运算符与其他语言运算符的关系。我们试图制作一张包含所有 Nushell 运算符的表,以及它们在其他语言中的对应关系。欢迎大家参与贡献。 diff --git a/zh-CN/book/installation.md b/src/content/docs/zh-cn/book/getting-started/installation.mdx similarity index 72% rename from zh-CN/book/installation.md rename to src/content/docs/zh-cn/book/getting-started/installation.mdx index 48a573eb36a..acef84b8132 100644 --- a/zh-CN/book/installation.md +++ b/src/content/docs/zh-cn/book/getting-started/installation.mdx @@ -1,10 +1,28 @@ -# 安装 Nu +--- +title: 安装 Nu +--- + +import { Code } from "@astrojs/starlight/components"; +import runNu from "../../../snippets/installation/run_nu.nu?raw"; +import rustupChooseRustVersion from "../../../snippets/installation/rustup_choose_rust_version.nu?raw"; +import installPkgConfigLibsslDiv from "../../../snippets/installation/install_pkg_config_libssl_dev.nu?raw"; +import installRhelDependencies from "../../../snippets/installation/install_rhel_dependencies.nu?raw"; +import macosDeps from "../../../snippets/installation/macos_deps.nu?raw"; +import cargoInstallNu from "../../../snippets/installation/cargo_install_nu.nu?raw"; +import cargoInstallNuMoreFeatures from "../../../snippets/installation/cargo_install_nu_more_features.nu?raw"; +import gitCloneNu from "../../../snippets/installation/git_clone_nu.nu?raw"; +import buildNuFromSource from "../../../snippets/installation/build_nu_from_source.nu?raw"; +import buildNuFromSourceRelease from "../../../snippets/installation/build_nu_from_source_release.nu?raw"; +import useRawkeyAndClipboard from "../../../snippets/installation/use_rawkey_and_clipboard.nu?raw"; +import chshInvalidShellError from "../../../snippets/installation/chsh_invalid_shell_error.nu?raw"; +import windowsTerminalDefaultShell from "../../../snippets/installation/windows_terminal_default_shell.nu?raw"; +import windowsChangeDefaultProfile from "../../../snippets/installation/windows_change_default_profile.nu?raw"; 有很多方法可以获取并使用 Nu。你可以从我们的 [发布页面](https://github.com/nushell/nushell/releases) 下载预编译的二进制文件,也可以 [使用你喜欢的软件包管理器](https://repology.org/project/nushell/versions),或者从源码构建。 Nushell 的主要二进制文件被命名为 `nu`(或 Windows 下的 `nu.exe`)。安装完成后你可以通过输入 `nu` 来启动它: -@[code](@snippets/installation/run_nu.sh) +<Code code={runNu} lang="nu" /> ## 预编译二进制包 @@ -48,7 +66,7 @@ Nu 可以通过几个软件包管理器获得: Nu 目前需要 **最新(1.66.1 或更高)的稳定** 版本的 Rust。最好的方法是让 `rustup` 为你找到正确的版本。当你第一次打开 `rustup` 时,它会询问你想安装哪个版本的 Rust: -@[code](@snippets/installation/rustup_choose_rust_version.sh) +<Code code={rustupChooseRustVersion} lang="nu" /> 一旦我们准备好了,我们就按 `1`,然后回车。 @@ -60,49 +78,49 @@ Nu 目前需要 **最新(1.66.1 或更高)的稳定** 版本的 Rust。最 你将需要安装 "pkg-config" 和 "libssl-dev" 包: -@[code](@snippets/installation/install_pkg_config_libssl_dev.sh) +<Code code={installPkgConfigLibsslDiv} lang="nu" /> 对于希望使用 "rawkey" 或 "clipboard" 可选功能的 Linux 用户,需要安装 "libx11-dev" 和 "libxcb-composite0-dev" 软件包。 -@[code](@snippets/installation/use_rawkey_and_clipboard.sh) +<Code code={useRawkeyAndClipboard} lang="nu" /> #### 基于 RHEL 的发行版 你需要安装 "libxcb"、"openssl-devel" 和 "libX11-devel": -@[code](@snippets/installation/install_rhel_dependencies.sh) +<Code code={installRhelDependencies} lang="nu" /> #### macOS 使用 [Homebrew](https://brew.sh/),你需要通过如下方式安装 "openssl" 和 "cmake" : -@[code](@snippets/installation/macos_deps.sh) +<Code code={macosDeps} lang="nu" /> ### 使用 [crates.io](https://crates.io) 进行构建 Nu 发行版会作为源码发布到流行的 Rust 包仓库 [crates.io](https://crates.io/)。这使得使用 `cargo` 构建并安装最新的 Nu 版本变得很容易: -@[code](@snippets/installation/cargo_install_nu.sh) +<Code code={cargoInstallNu} lang="nu" /> 如此即可!`cargo` 工具将完成下载 Nu 及其源码依赖,构建并将其安装到 cargo bin 路径中,以便我们能够运行它。 如果你想要安装并支持 [dataframes](/zh-CN/book/dataframes.md) 功能,你可以在安装命令附上 `--features=dataframe`: -@[code](@snippets/installation/cargo_install_nu_more_features.sh) +<Code code={cargoInstallNuMoreFeatures} lang="nu" /> ### 从 GitHub 仓库构建 我们也可以从 GitHub 上的最新源码构建自己的 Nu。这让我们可以立即获得最新的功能和错误修复。首先,克隆源码仓库: -@[code](@snippets/installation/git_clone_nu.sh) +<Code code={gitCloneNu} lang="nu" /> 然后,我们可以用以下方式构建和运行 Nu: -@[code](@snippets/installation/build_nu_from_source.sh) +<Code code={buildNuFromSource} lang="nu" /> 你也可以在**发布**模式下构建和运行 Nu,以获得更多的编译优化: -@[code](@snippets/installation/build_nu_from_source_release.sh) +<Code code={buildNuFromSourceRelease} lang="nu" /> 熟悉 Rust 的人可能会问,如果 `run` 默认会构建,为什么我们还要做 `build` 和 `run` 这两个步骤?这是为了解决 Cargo 中新的 `default-run` 选项的缺陷,并确保所有插件都被构建,尽管这在将来可能不再需要。 @@ -114,7 +132,7 @@ Nu 仍在开发中,对于日常使用可能并不稳定! 要设置登录 Shell,你可以使用 [`chsh`](https://linux.die.net/man/1/chsh) 命令。一些 Linux 发行版有一个位于 `/etc/shells` 的有效 Shell 列表,在 Nu 被列入白名单之前不允许改变 Shell。如果你没有更新 `shells` 文件,你可能会看到类似于下面的错误: -@[code](@snippets/installation/chsh_invalid_shell_error.sh) +<Code code={chshInvalidShellError} lang="nu" /> 你可以通过在 `shells` 文件中添加你的 Nu 二进制文件来把 Nu 添加到允许的 Shells 列表中。添加的路径可以用 `which nu` 命令找到,通常是 `$HOME/.cargo/bin/nu`。 @@ -122,10 +140,10 @@ Nu 仍在开发中,对于日常使用可能并不稳定! 如果你使用的是 [Windows Terminal](https://github.com/microsoft/terminal),你可以通过添加如下内容到你的终端设置 `"profiles"`(JSON 文件)中来设置 `nu` 作为你的默认 Shell: -@[code](@snippets/installation/windows_terminal_default_shell.sh) +<Code code={windowsTerminalDefaultShell} lang="nu" /> 最后需要做的是将 `"defaultProfile"` 改为: -@[code](@snippets/installation/windows_change_default_profile.sh) +<Code code={windowsChangeDefaultProfile} lang="nu" /> 之后,`nu` 应该会在 **Windows Terminal** 启动时被加载。 diff --git a/zh-CN/book/introduction.md b/src/content/docs/zh-cn/book/getting-started/introduction.md similarity index 99% rename from zh-CN/book/introduction.md rename to src/content/docs/zh-cn/book/getting-started/introduction.md index d756b5f41fa..8d56174de12 100644 --- a/zh-CN/book/introduction.md +++ b/src/content/docs/zh-cn/book/getting-started/introduction.md @@ -1,4 +1,6 @@ -# 介绍 +--- +title: 介绍 +--- 大家好,欢迎来到 Nushell 项目。这个项目的目标是彰显 Shell 的 Unix 哲学,就是用管道将简单的命令连接在一起,并且带来现代的开发风格。 @@ -12,7 +14,7 @@ Nu 从许多熟悉的领域中汲取了线索:bash 等传统 shell,PowerShel 当你运行一个类似 `ls` 的命令时,第一个注意到的是所得到的不是一个文本块,而是一个结构化的表。 -``` +```nu > ls ────┬────────────────────┬──────┬────────┬──────────── # │ name │ type │ size │ modified @@ -30,7 +32,7 @@ Nu 从许多熟悉的领域中汲取了线索:bash 等传统 shell,PowerShel 我们做的第一件事是将表格通过尺寸来排序。为了做到这点,我们将会把 `ls` 的输出喂给一个可以根据列的内容来排序表格的命令。 -``` +```nu > ls | sort-by size | reverse ────┬────────────────────┬──────┬────────┬──────────── # │ name │ type │ size │ modified @@ -48,7 +50,7 @@ Nu 从许多熟悉的领域中汲取了线索:bash 等传统 shell,PowerShel Nu 提供了许多可在表格上工作的命令。例如,我们可以过滤 `ls` 表格,只显示大于 1 KB 的文件: -``` +```nu > ls | where size > 1kb ───┬──────────────┬──────┬────────┬──────────── # │ name │ type │ size │ modified @@ -62,7 +64,7 @@ Nu 提供了许多可在表格上工作的命令。例如,我们可以过滤 ` 就像 Unix 哲学所体现的那样,作为可以相互交流的命令,为我们提供了许多种不同的配对。让我们看一个不同的命令: -``` +```nu > ps ─────┬───────┬──────────────────┬─────────┬─────────┬──────────┬───────── # │ pid │ name │ status │ cpu │ mem │ virtual @@ -77,7 +79,7 @@ Nu 提供了许多可在表格上工作的命令。例如,我们可以过滤 ` 如果我们想显示正在使用 CPU 的进程怎么办? 就像我们之前使用 `ls` 命令一样,我们也可以使用 `ps` 命令返回的表: -``` +```nu > ps | where cpu > 10 ───┬──────┬──────────────────┬─────────┬────────┬──────────┬───────── # │ pid │ name │ status │ cpu │ mem │ virtual @@ -91,7 +93,7 @@ Nu 提供了许多可在表格上工作的命令。例如,我们可以过滤 ` 运行 `date` 将给出当前日期与时间的信息: -``` +```nu > date ──────────┬──────── year │ 2020 @@ -106,7 +108,7 @@ Nu 提供了许多可在表格上工作的命令。例如,我们可以过滤 ` 运行 `sys` 将给出 Nu 所运行的系统的信息: -``` +```nu > sys ─────────┬───────────────────────────────────────── host │ [row 7 columns] @@ -120,7 +122,7 @@ Nu 提供了许多可在表格上工作的命令。例如,我们可以过滤 ` 和之前的表有些不一样, `sys` 命令给出的表在单元格内包含了另一些结构化的表格,而非简单的数值。为了查看到这些数据,我们需要选择要看的列: -``` +```nu > sys | get host ──────────┬───────────────────────────────────────────── name │ Linux @@ -135,7 +137,7 @@ Nu 提供了许多可在表格上工作的命令。例如,我们可以过滤 ` `get` 命令让我们跳入表格中一列的内容。这样,我们正在观看 "host" 列,它包含了关于 Nu 所运行的主机的信息。操作系统的名字、主机名、CPU 架构等等。让我们看看系统上的用户名: -``` +```nu > sys | get host.sessions ───┬───────── # │ <value> @@ -150,7 +152,7 @@ Nu 提供了许多可在表格上工作的命令。例如,我们可以过滤 ` 让我们看看字符串如何在 Nu 之外起作用。 我们将从前面的示例开始,并运行外部的 `echo` 命令( `^` 告诉 nu 不要使用内置的 `echo` 命令): -``` +```nu > sys | get host.sessions | ^echo $it jonathan ``` @@ -159,7 +161,7 @@ jonathan _注意:Nu 的内建命令的帮助文本可以用 `help` 来浏览_: -``` +```nu > help config Configuration management. diff --git a/zh-CN/book/moving_around.md b/src/content/docs/zh-cn/book/getting-started/moving_around.mdx similarity index 71% rename from zh-CN/book/moving_around.md rename to src/content/docs/zh-cn/book/getting-started/moving_around.mdx index dd9d590dcb4..3c94b2cb046 100644 --- a/zh-CN/book/moving_around.md +++ b/src/content/docs/zh-cn/book/getting-started/moving_around.mdx @@ -1,16 +1,29 @@ -# 在系统中四处移动 +--- +title: 在系统中四处移动 +--- + +import { Code } from "@astrojs/starlight/components"; +import lsExample from "../../../snippets/moving_around/ls_example.nu?raw"; +import lsShallowGlobExample from "../../../snippets/moving_around/ls_shallow_glob_example.nu?raw"; +import lsDeepGlobExample from "../../../snippets/moving_around/ls_deep_glob_example.nu?raw"; +import cdExample from "../../../snippets/moving_around/cd_example.nu?raw"; +import cdWithoutCommandExample from "../../../snippets/moving_around/cd_without_command_example.nu?raw"; +import mvExample from "../../../snippets/moving_around/mv_example.nu?raw"; +import cpExample from "../../../snippets/moving_around/cp_example.nu?raw"; +import rmExample from "../../../snippets/moving_around/rm_example.nu?raw"; +import mkdirExample from "../../../snippets/moving_around/mkdir_example.nu?raw"; 早期的 Shell 允许你在文件系统中进行目录跳转并运行命令,而现代的 Shell 如 Nu 也允许你这样做。让我们来看看你在与系统交互时可能会用到的一些常用命令。 ## 查看目录内容 -@[code](@snippets/moving_around/ls_example.sh) +<Code code={lsExample} lang="nu" /> 正如我们在其他章节中所看到的,[`ls`](/commands/docs/ls.md) 是一个用于查看路径内容的命令。Nu 将以表格的形式返回内容并供我们使用。 [`ls`](/commands/docs/ls.md) 命令还需要一个可选的参数,以改变你想查看的内容。例如,我们可以列出以 `.md` 结尾的文件: -@[code](@snippets/moving_around/ls_shallow_glob_example.sh) +<Code code={lsShallowGlobExample} lang="nu" /> ## 通配符 @@ -20,7 +33,7 @@ Nu 也使用现代 Globs,它允许你访问更深的目录。比如,`ls **/*.md` 将递归地罗列当前目录下、所有后缀为 `.md` 的非隐藏文件: -@[code](@snippets/moving_around/ls_deep_glob_example.sh) +<Code code={lsDeepGlobExample} lang="nu" /> - `**` 表示“从这里开始的任何目录中”; - `*.md` 表示“任意后缀为 `.md` 的文件名”(不包括隐藏文件,要额外添加 `--all, -a` 选项); @@ -30,15 +43,15 @@ Nu 也使用现代 Globs,它允许你访问更深的目录。比如,`ls **/* ## 改变当前目录 -@[code](@snippets/moving_around/cd_example.sh) +<Code code={cdExample} lang="nu" /> 要从当前目录换到一个新目录,我们使用 [`cd`](/commands/docs/cd.md) 命令。就像在其他 Shells 中一样,我们可以使用目录的名称,或者如果我们想进入父目录,我们可以使用 `..` 的快捷方式。 如果 [`cd`](/commands/docs/cd.md) 被省略,只给出一个路径本身,也可以改变当前工作目录: -@[code](@snippets/moving_around/cd_without_command_example.sh) +<Code code={cdWithoutCommandExample} lang="nu" /> -:::warning +:::caution 用 [`cd`](/commands/docs/cd.md) 改变目录会改变 `PWD` 环境变量。这意味着目录的改变会保留到当前代码块中,一旦你退出这个代码块,你就会返回到以前的目录。你可以在 [环境篇](environment.md) 中了解更多关于这方面的信息。 ::: @@ -48,11 +61,11 @@ Nu 还提供了一些基本的文件系统命令,并且可以跨平台工作 我们可以使用 [`mv`](/commands/docs/mv.md) 命令将一个目录或文件从一个地方移动到另一个地方: -@[code](@snippets/moving_around/mv_example.sh) +<Code code={mvExample} lang="nu" /> 我们可以通过 [`cp`](/commands/docs/cp.md) 命令把一个目录或文件从一个地方复制到另一个地方: -@[code](@snippets/moving_around/cp_example.sh) +<Code code={cpExample} lang="nu" /> :::danger `cp` 在 Windows 系统,即使目标文件存在,命令也没有附加 `--force, -f`,目标文件仍会被覆盖! @@ -60,10 +73,10 @@ Nu 还提供了一些基本的文件系统命令,并且可以跨平台工作 我们也可以通过 [`rm`](/commands/docs/rm.md) 命令删除一个目录或文件: -@[code](@snippets/moving_around/rm_example.sh) +<Code code={rmExample} lang="nu" /> 这三个命令也可以使用我们先前看到的 [`ls`](/commands/docs/ls.md) 的 Glob 功能。 最后,我们可以使用 [`mkdir`](/commands/docs/mkdir.md) 命令创建一个新目录: -@[code](@snippets/moving_around/mkdir_example.sh) +<Code code={mkdirExample} lang="nu" /> diff --git a/zh-CN/book/README.md b/src/content/docs/zh-cn/book/getting-started/quick_tour.mdx similarity index 76% rename from zh-CN/book/README.md rename to src/content/docs/zh-cn/book/getting-started/quick_tour.mdx index efc2afe6bc2..521d0de9657 100644 --- a/zh-CN/book/README.md +++ b/src/content/docs/zh-cn/book/getting-started/quick_tour.mdx @@ -1,4 +1,20 @@ -# 介绍 +--- +title: 介绍 +--- + +import { Code } from "@astrojs/starlight/components"; +import lsExample from "../../../snippets/introduction/ls_example.nu?raw"; +import lsSortByReverseExample from "../../../snippets/introduction/ls_sort_by_reverse_example.nu?raw"; +import lsWhereExample from "../../../snippets/introduction/ls_where_example.nu?raw"; +import psExample from "../../../snippets/introduction/ps_example.nu?raw"; +import psWhereExample from "../../../snippets/introduction/ps_where_example.nu?raw"; +import dateExample from "../../../snippets/introduction/date_example.nu?raw"; +import dateTableExample from "../../../snippets/introduction/date_table_example.nu?raw"; +import sysExample from "../../../snippets/introduction/sys_example.nu?raw"; +import sysGetExample from "../../../snippets/introduction/sys_get_example.nu?raw"; +import sysGetNestedExample from "../../../snippets/introduction/sys_get_nested_example.nu?raw"; +import sysGetExternalEchoExample from "../../../snippets/introduction/sys_get_external_echo_example.nu?raw"; +import helpExample from "../../../snippets/introduction/help_example.nu?raw"; 你好,欢迎来到 Nushell 项目。这个项目的目标是继承 Unix Shell 中用管道把简单的命令连接在一起的理念,并将其带到更具现代风格的开发中。因此,Nushell 不是一个纯粹的 shell 或编程语言,而是通过将一种丰富的编程语言和功能齐全的 shell 结合到一个软件包中,实现了二者的连接。 @@ -12,51 +28,51 @@ Nu 汲取了很多常见领域的灵感:传统 Shell 比如 Bash、基于对 当你运行 [`ls`](/commands/docs/ls.md) 这样的命令时,你会注意到的第一件事是,你得到的不是一个文本块,而是一个结构化的表格: -@[code](@snippets/introduction/ls_example.sh) +<Code code={lsExample} lang="nu" /> 该表不仅仅是以不同的方式显示目录,就像电子表格中的表一样,它还允许我们以更加互动的方式来处理数据。 我们要做的第一件事是按大小对我们的表进行排序。要做到这一点,我们将从 [`ls`](/commands/docs/ls.md) 中获取输出,并将其输入到一个可以根据列的内容对表进行排序的命令中: -@[code](@snippets/introduction/ls_sort_by_reverse_example.sh) +<Code code={lsSortByReverseExample} lang="nu" /> 你可以看到,为了达到这个目的,我们没有向 [`ls`](/commands/docs/ls.md) 传递命令行参数。取而代之的是,我们使用了 Nu 提供的 [`sort-by`](/commands/docs/sort-by.md) 命令来对 [`ls`](/commands/docs/ls.md) 命令的输出进行排序。为了在顶部看到最大的文件,我们还使用了 [`reverse`](/commands/docs/reverse.md) 命令。 Nu 提供了许多可以对表进行操作的命令,例如,我们可以过滤 [`ls`](/commands/docs/ls.md) 表的内容,使其只显示超过 1 千字节的文件。 -@[code](@snippets/introduction/ls_where_example.sh) +<Code code={lsWhereExample} lang="nu" /> 就像在 Unix 哲学中一样,能够让命令相互对话给我们提供了在许多不同的组合中对命令进行混搭的方法。我们来看看一个不同的命令: -@[code](@snippets/introduction/ps_example.sh) +<Code code={psExample} lang="nu" /> 如果你使用过 Linux,你可能对 [`ps`](/commands/docs/ps.md) 命令很熟悉。通过它,我们可以得到一个当前系统正在运行的所有进程的列表,它们的状态是什么,以及它们的名字是什么,我们还可以看到这些进程的 CPU 负载。 如果我们想显示那些正在活跃使用 CPU 的进程呢?就像我们之前对 [`ls`](/commands/docs/ls.md) 命令所做的那样,我们也可以利用 [`ps`](/commands/docs/ps.md) 命令返回给我们的表格来做到: -@[code](@snippets/introduction/ps_where_example.sh) +<Code code={psWhereExample} lang="nu" /> 到目前为止,我们一直在使用 [`ls`](/commands/docs/ls.md) 和 [`ps`](/commands/docs/ps.md) 来列出文件和进程。Nu 还提供了其他可以创建有用信息表格的命令。接下来,让我们试一下 [`date`](/commands/docs/date.md) 和 [`sys`](/commands/docs/sys.md)。 运行 [`date now`](/commands/docs/date_now.md) 输出关于当前日期和时间的信息: -@[code](@snippets/introduction/date_example.sh) +<Code code={dateExample} lang="nu" /> 为了将获得的日期以表格形式展示,我们可以把它输入到 [`date to-table`](/commands/docs/date_to-table.md) 中: -@[code](@snippets/introduction/date_table_example.sh) +<Code code={dateTableExample} lang="nu" /> 运行 [`sys`](/commands/docs/sys.md) 可以得到 Nu 所运行的系统的信息: -@[code](@snippets/introduction/sys_example.sh) +<Code code={sysExample} lang="nu" /> 这与我们之前看到的表格有些不同。[`sys`](/commands/docs/sys.md) 命令输出了一个在单元格中包含结构化表格而非简单值的表格。要查看这些数据,我们需要**获取**([`get`](/commands/docs/get.md))待查看的列: -@[code](@snippets/introduction/sys_get_example.sh) +<Code code={sysGetExample} lang="nu" /> [`get`](/commands/docs/get.md) 命令让我们深入表的某一列内容中。在这里,我们要查看的是 `host` 列,它包含了 Nu 正在运行的主机的信息:操作系统名称、主机名、CPU,以及更多。让我们来获取系统上的用户名: -@[code](@snippets/introduction/sys_get_nested_example.sh) +<Code code={sysGetNestedExample} lang="nu" /> 现在,系统中只有一个名为 jt 的用户。你会注意到,我们可以传递一个列路径(`host.sessions.name` 部分),而不仅仅是简单的列名称。Nu 会接受列路径并输出表中相应的数据。 @@ -64,7 +80,7 @@ Nu 提供了许多可以对表进行操作的命令,例如,我们可以过 让我们看看字符串在 Nu 外部命令里面是如何工作的。我们以之前的例子为例,运行外部的 `echo` 命令(`^` 告诉 Nu 不要使用内置的 [`echo`](/commands/docs/echo.md) 命令): -@[code](@snippets/introduction/sys_get_external_echo_example.sh) +<Code code={sysGetExternalEchoExample} lang="nu" /> 敏锐的读者可能会发现这看起来和我们之前的非常相似!确实如此,但有一个重要的区别:我们用前面的值调用了 `^echo`。这允许我们把数据从 Nu 中传到外部命令 `echo`(或者 Nu 之外的任何命令,比如 `git`)。 @@ -72,4 +88,4 @@ Nu 提供了许多可以对表进行操作的命令,例如,我们可以过 任何 Nu 的内置命令的帮助文本都可以通过 [`help`](/commands/docs/help.md) 命令来找到。要查看所有命令,请运行 `help commands` 。你也可以通过执行 `help -f <topic>` 来搜索一个主题: -@[code](@snippets/introduction/help_example.sh) +<Code code={helpExample} lang="nu" /> diff --git a/zh-CN/book/thinking_in_nu.md b/src/content/docs/zh-cn/book/getting-started/thinking_in_nu.md similarity index 99% rename from zh-CN/book/thinking_in_nu.md rename to src/content/docs/zh-cn/book/getting-started/thinking_in_nu.md index 6a5e46db667..05dd5074597 100644 --- a/zh-CN/book/thinking_in_nu.md +++ b/src/content/docs/zh-cn/book/getting-started/thinking_in_nu.md @@ -1,4 +1,6 @@ -# 以 Nushell 的方式思考 +--- +title: 以 Nushell 的方式思考 +--- 为了帮助你理解并充分利用 Nushell,我们把这部分内容一起放入“以 Nushell 的方式思考”这一节。通过学习 Nushell 的思考方式,并使用它提供的模式,你会在开始时遇到更少的问题,并为接下来的成功做好准备。 @@ -34,8 +36,7 @@ Nushell 设计的一个重要部分,特别是它与许多动态语言不同的 例如,下面的代码作为 **[脚本](/zh-CN/book/scripts.md)** 将无法执行(当然,在**交互式模式**里一句句运行是可以的): -```nu -# compiled.nu +```nu title="compiled.nu" "def abc [] { 1 + 2 }" | save output.nu sleep 1sec # 延时 1 秒,但是并没有作用,因为是整体编译的。 source "output.nu" diff --git a/zh-CN/book/3rdpartyprompts.md b/src/content/docs/zh-cn/book/nu-as-a-shell/3rdpartyprompts.md similarity index 98% rename from zh-CN/book/3rdpartyprompts.md rename to src/content/docs/zh-cn/book/nu-as-a-shell/3rdpartyprompts.md index fa3cced03b4..e3e638e85de 100644 --- a/zh-CN/book/3rdpartyprompts.md +++ b/src/content/docs/zh-cn/book/nu-as-a-shell/3rdpartyprompts.md @@ -1,4 +1,6 @@ -# 配置第三方提示 +--- +title: 配置第三方提示 +--- ## Nerdfonts diff --git a/zh-CN/book/coloring_and_theming.md b/src/content/docs/zh-cn/book/nu-as-a-shell/coloring_and_theming.md similarity index 99% rename from zh-CN/book/coloring_and_theming.md rename to src/content/docs/zh-cn/book/nu-as-a-shell/coloring_and_theming.md index cb54e2d4482..578fe5b46e1 100644 --- a/zh-CN/book/coloring_and_theming.md +++ b/src/content/docs/zh-cn/book/nu-as-a-shell/coloring_and_theming.md @@ -1,4 +1,6 @@ -# Nu 的配色和主题 +--- +title: Nu 的配色和主题 +--- Nushell 界面的许多部分都可以定制它们的颜色,所有这些都可以在`config.nu`配置文件中设置。如果你在配置文件中看到 hash/hashtag/pound 符号 `#`,这意味着它后面的文字被注释掉了。 diff --git a/zh-CN/book/configuration.md b/src/content/docs/zh-cn/book/nu-as-a-shell/configuration.md similarity index 99% rename from zh-CN/book/configuration.md rename to src/content/docs/zh-cn/book/nu-as-a-shell/configuration.md index 28e1cd419ea..bc723ce46f1 100644 --- a/zh-CN/book/configuration.md +++ b/src/content/docs/zh-cn/book/nu-as-a-shell/configuration.md @@ -1,4 +1,6 @@ -# 配置 +--- +title: 配置 +--- ## Nushell 配置与`env.nu`和`config.nu` diff --git a/zh-CN/book/custom_completions.md b/src/content/docs/zh-cn/book/nu-as-a-shell/custom_completions.md similarity index 98% rename from zh-CN/book/custom_completions.md rename to src/content/docs/zh-cn/book/nu-as-a-shell/custom_completions.md index 370a2012a10..52303365886 100644 --- a/zh-CN/book/custom_completions.md +++ b/src/content/docs/zh-cn/book/nu-as-a-shell/custom_completions.md @@ -1,4 +1,6 @@ -# 自定义补全 +--- +title: 自定义补全 +--- 自定义补全允许你混合使用 Nushell 的两个功能:自定义命令和补全。有了它们,你就能够创建支持对位置参数和标志(Flags)参数进行自动补全的命令。这些自定义补全既适用于自定义命令,也适用于 [已知的外部或`extern`命令](externs.md)。 diff --git a/zh-CN/book/environment.md b/src/content/docs/zh-cn/book/nu-as-a-shell/environment.md similarity index 99% rename from zh-CN/book/environment.md rename to src/content/docs/zh-cn/book/nu-as-a-shell/environment.md index 5efc1d06e8e..39961a3ef79 100644 --- a/zh-CN/book/environment.md +++ b/src/content/docs/zh-cn/book/nu-as-a-shell/environment.md @@ -1,4 +1,6 @@ -# 环境 +--- +title: 环境 +--- Shell 中的一个常见任务是控制外部应用程序将使用的环境变量。这通常是自动完成的,因为环境被打包,并在外部应用程序启动时提供给它。但有时,我们希望更精确地控制一个应用程序看到的环境变量。 @@ -67,7 +69,7 @@ $env.PATH = ($env.PATH | prepend '/path/you/want/to/add') 单个环境变量是记录的一个字段,存储在 `$env` 变量中,可以用 `$env.VARIABLE` 读取: -``` +```nu > $env.FOO BAR ``` diff --git a/zh-CN/book/escaping.md b/src/content/docs/zh-cn/book/nu-as-a-shell/escaping.md similarity index 94% rename from zh-CN/book/escaping.md rename to src/content/docs/zh-cn/book/nu-as-a-shell/escaping.md index 6395343f12e..29328a2918e 100644 --- a/zh-CN/book/escaping.md +++ b/src/content/docs/zh-cn/book/nu-as-a-shell/escaping.md @@ -1,4 +1,6 @@ -# 转移到系统 +--- +title: 转移到系统 +--- Nu 提供了一套你可以在不同操作系统中使用的命令(也成为"内部"命令),而且具备这种一致性是很有帮助的。但有时,你需要运行一个与 Nu 内部命令同名的外部命令。例如,要运行外部的`ls`或`date`命令,你可以使用脱字符 (^) 命令。用 `^` 前缀 可以转移调用用户 PATH 中的命令(例如:`/bin/ls`,而不是 Nu 内部的 [`ls`](/commands/docs/ls.md) 命令)。 diff --git a/zh-CN/book/externs.md b/src/content/docs/zh-cn/book/nu-as-a-shell/externs.md similarity index 99% rename from zh-CN/book/externs.md rename to src/content/docs/zh-cn/book/nu-as-a-shell/externs.md index 40d0b2b3674..ffc33020856 100644 --- a/zh-CN/book/externs.md +++ b/src/content/docs/zh-cn/book/nu-as-a-shell/externs.md @@ -1,4 +1,6 @@ -# 外部命令 +--- +title: 外部命令 +--- 调用外部命令是将 Nushell 作为一个 Shell 使用的基本部分(通常也将 Nushell 作为一种语言使用)。但是有一个问题,对于 Nushell 之外的命令而言,Nushell 不能帮助寻找调用中的错误,或者自动补全,或者语法高亮。 diff --git a/zh-CN/book/hooks.md b/src/content/docs/zh-cn/book/nu-as-a-shell/hooks.md similarity index 99% rename from zh-CN/book/hooks.md rename to src/content/docs/zh-cn/book/nu-as-a-shell/hooks.md index 6768752ab83..33653347dfb 100644 --- a/zh-CN/book/hooks.md +++ b/src/content/docs/zh-cn/book/nu-as-a-shell/hooks.md @@ -1,4 +1,6 @@ -# 钩子 +--- +title: 钩子 +--- 钩子允许你在一些预定义的情况下运行一个代码片段。 它们只在交互式模式下可用([REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop)),如果你用脚本(`nu script.nu`)或命令(`nu -c "echo foo"`)参数运行 Nushell 则不起作用。 @@ -98,7 +100,7 @@ eggs 你可能很想做的一件事是,每当你进入一个目录时,就激活一个环境: -``` +```nu $env.config = ($env.config | upsert hooks { env_change: { PWD: [ diff --git a/zh-CN/book/line_editor.md b/src/content/docs/zh-cn/book/nu-as-a-shell/line_editor.md similarity index 99% rename from zh-CN/book/line_editor.md rename to src/content/docs/zh-cn/book/nu-as-a-shell/line_editor.md index d73072db627..76a6d50d090 100644 --- a/zh-CN/book/line_editor.md +++ b/src/content/docs/zh-cn/book/nu-as-a-shell/line_editor.md @@ -1,4 +1,6 @@ -# Reedline,Nu 的行编辑器 +--- +title: Reedline,Nu 的行编辑器 +--- Nushell 的行编辑器 [Reedline](https://github.com/nushell/reedline) 是一个跨平台的行读取器,它被设计为模块化且颇具灵活性的。该引擎的作用是负责控制命令历史,验证,自动补全,提示以及屏幕绘制。 @@ -149,7 +151,7 @@ $env.PROMPT_COMMAND = { create_left_prompt } $env.PROMPT_COMMAND_RIGHT = { create_right_prompt } ``` -::: tip +:::tip 你并非必须要用 Nushell 的函数来定义环境变量,也可以使用简单的字符串来定义它们。 ::: @@ -162,7 +164,7 @@ $env.PROMPT_INDICATOR_VI_NORMAL = "〉" $env.PROMPT_MULTILINE_INDICATOR = "::: " ``` -::: tip +:::tip 提示符是环境变量,它代表了提示的状态 ::: @@ -209,11 +211,11 @@ Reedline 按键绑定是一个强大的结构,它允许你建立一连串的 - edit - until -::: tip +:::tip 所有可用的修饰键、键码和事件都可以通过`keybindings list`命令找到。 ::: -::: tip +:::tip 添加到 `vi_insert` 模式中的按键绑定将在行编辑器处于插入模式(可以写入文本)时可用,而标有 `vi_normal` 模式的按键绑定将在正常模式下(当光标使用 h、j、k 或 l 移动时)可用。 ::: @@ -305,7 +307,7 @@ keybindings list | where type == events ... ``` -::: tip +:::tip 你可以用大写字母来命名事件的名称,键盘绑定解析器是不区分大小写的。 ::: diff --git a/zh-CN/book/shells_in_shells.md b/src/content/docs/zh-cn/book/nu-as-a-shell/shells_in_shells.md similarity index 98% rename from zh-CN/book/shells_in_shells.md rename to src/content/docs/zh-cn/book/nu-as-a-shell/shells_in_shells.md index 14ddbfc1e4f..542d3dbba4c 100644 --- a/zh-CN/book/shells_in_shells.md +++ b/src/content/docs/zh-cn/book/nu-as-a-shell/shells_in_shells.md @@ -1,4 +1,6 @@ -# Shell 中的 Shell +--- +title: Shell 中的 Shell +--- ## 在多个目录下工作 @@ -36,7 +38,7 @@ 我们可以用 `n`, `p` 和 `g` 的快捷命令在这些 Shell 之间跳转,这是 "next"、"previous" 和 "go" 的缩写: -``` +```nu /home/jonathant/Source/book(main)> n /home/jonathant/Source/nushell(main)> p /home/jonathant/Source/book(main)> g 2 diff --git a/zh-CN/book/stdout_stderr_exit_codes.md b/src/content/docs/zh-cn/book/nu-as-a-shell/stdout_stderr_exit_codes.md similarity index 98% rename from zh-CN/book/stdout_stderr_exit_codes.md rename to src/content/docs/zh-cn/book/nu-as-a-shell/stdout_stderr_exit_codes.md index b3ce6c9bee7..aba32785ca8 100644 --- a/zh-CN/book/stdout_stderr_exit_codes.md +++ b/src/content/docs/zh-cn/book/nu-as-a-shell/stdout_stderr_exit_codes.md @@ -1,4 +1,6 @@ -# 标准输入、输出和退出码 +--- +title: 标准输入、输出和退出码 +--- Nushell 和外部命令之间互操作的一个重要部分是与来自外部的标准数据流一起工作。 diff --git a/zh-CN/book/loading_data.md b/src/content/docs/zh-cn/book/nu-fundamentals/loading_data.mdx similarity index 94% rename from zh-CN/book/loading_data.md rename to src/content/docs/zh-cn/book/nu-fundamentals/loading_data.mdx index 48ee3b87d7b..a58def88309 100644 --- a/zh-CN/book/loading_data.md +++ b/src/content/docs/zh-cn/book/nu-fundamentals/loading_data.mdx @@ -1,4 +1,11 @@ -# 加载数据 +--- +title: 加载数据 +--- + +import { Code } from "@astrojs/starlight/components"; +import cargoToml from "../../../snippets/loading_data/cargo_toml.nu?raw"; +import vscode from "../../../snippets/loading_data/vscode.nu?raw"; +import rustLangFeed from "../../../snippets/loading_data/rust_lang_feed.nu?raw"; 之前我们使用了[`ls`](/commands/docs/ls.md)、[`ps`](/commands/docs/ps.md)、[`date`](/commands/docs/date.md)和[`sys`](/commands/docs/sys.md)等命令来加载关于文件、进程、日期时间和系统本身的信息。每条命令都会给我们提供一个信息表,以对其进行探索。我们也可以通过其他方式将数据载入表格以供使用。 @@ -6,13 +13,13 @@ Nu 在处理数据方面最强大的能力之一是[`open`](/commands/docs/open.md)命令。它是一个多功能命令,可以处理许多不同的数据格式。为了说明这一点让我们试着打开一个 JSON 文件: -@[code](@snippets/loading_data/vscode.sh) +<Code code={vscode} lang="nu" /> 与[`ls`](/commands/docs/ls.md)类似,打开一个 Nu 支持的文件类型,会返回一些不仅仅是文本(或一个字节流)的东西。这里我们打开了一个来自 JavaScript 项目的 "package.json" 文件。Nu 可以识别 JSON 文本并将其解析为一个数据表。 如果我们想查看当前项目的版本,我们可以使用[`get`](/commands/docs/get.md)命令: -``` +```nu > open editors/vscode/package.json | get version 1.0.0 ``` @@ -51,7 +58,7 @@ Nu 目前支持直接从以下格式加载表数据: 想象一下,我们得到了这个数据文件: -``` +```nu > open people.txt Octavia | Butler | Writer Bob | Ross | Painter @@ -62,7 +69,7 @@ Antonio | Vivaldi | Composer 当我们引入这个文件时,我们需要做的第一件事是确保后续每次只处理一行: -``` +```nu > open people.txt | lines ───┬────────────────────────────── 0 │ Octavia | Butler | Writer @@ -73,7 +80,7 @@ Antonio | Vivaldi | Composer 可以看到,我们正在处理这些行,因为我们又回到了一个列表中。下一步是看看是否可以把行分割成更有用的东西。为此,我们将使用[`split`](/commands/docs/split.md)命令。[`split`](/commands/docs/split.md),顾名思义,为我们提供了一种分割字符串的方法。我们将使用[`split`](/commands/docs/split.md)的`column`子命令,将内容分成多列。我们会告诉它分隔符是什么,剩下的就由它来完成: -``` +```nu > open people.txt | lines | split column "|" ───┬──────────┬───────────┬─────────── # │ column1 │ column2 │ column3 @@ -86,7 +93,7 @@ Antonio | Vivaldi | Composer 这看起来差不多了,只是还有一些额外的空白字符,让我们 [`trim`](/commands/docs/str_trim.md) 掉这些空格: -``` +```nu > open people.txt | lines | split column "|" | str trim ───┬─────────┬─────────┬────────── # │ column1 │ column2 │ column3 @@ -99,7 +106,7 @@ Antonio | Vivaldi | Composer 还不错,[`split`](/commands/docs/split.md)命令返回给我们可以使用的数据,还预设了默认的列名: -``` +```nu > open people.txt | lines | split column "|" | str trim | get column1 ───┬───────── 0 │ Octavia @@ -110,7 +117,7 @@ Antonio | Vivaldi | Composer 我们也可以用自定义的列名代替默认的: -``` +```nu > open people.txt | lines | split column "|" first_name last_name job | str trim ───┬────────────┬───────────┬────────── # │ first_name │ last_name │ job @@ -123,7 +130,7 @@ Antonio | Vivaldi | Composer 现在,我们的数据加载到一个表中了,我们可以使用之前对表所用的各种命令来处理它: -``` +```nu > open people.txt | lines | split column "|" first_name last_name job | str trim | sort-by first_name ───┬────────────┬───────────┬────────── # │ first_name │ last_name │ job @@ -153,7 +160,7 @@ version = "0.1.2" "Cargo.lock" 实际上是一个 .toml 文件,但是文件扩展名不是 .toml。没关系,我们可以使用 `from toml` 命令: -@[code](@snippets/loading_data/cargo-toml.sh) +<Code code={cargoToml} lang="nu" /> 每种 Nu 能打开并理解的结构化数据文本格式都有对应的 `from` 命令可以使用,只需要把支持的格式作为子命令传给 `from` 就可以了。 @@ -175,4 +182,4 @@ license = "MIT" 除了从文件系统中加载文件,你还可以通过使用[`http get`](/commands/docs/fetch.md)命令来加载 URLs。这将从互联网上获取 URL 的内容并返回: -@[code](@snippets/loading_data/rust-lang-feed.sh) +<Code code={rustLangFeed} lang="nu" /> diff --git a/zh-CN/book/pipelines.md b/src/content/docs/zh-cn/book/nu-fundamentals/pipelines.md similarity index 99% rename from zh-CN/book/pipelines.md rename to src/content/docs/zh-cn/book/nu-fundamentals/pipelines.md index 3848399a1cf..5357edf5de0 100644 --- a/zh-CN/book/pipelines.md +++ b/src/content/docs/zh-cn/book/nu-fundamentals/pipelines.md @@ -1,4 +1,6 @@ -# 管道 +--- +title: 管道 +--- Nu 的核心设计之一是管道,这个设计思想可以追溯到几十年前 Unix 背后的一些原始理念。正如 Nu 拓展了 Unix 的单一字符串数据类型一样,Nu 也扩展了管道的概念,使其不仅仅包含文本。 @@ -59,13 +61,13 @@ Nu 在两个外部命令之间以与其他 Shell 相同的方式处理数据管 实际上,该命令: -``` +```nu > ls ``` 和以下管道: -``` +```nu > ls | table ``` diff --git a/zh-CN/book/types_of_data.md b/src/content/docs/zh-cn/book/nu-fundamentals/types_of_data.md similarity index 98% rename from zh-CN/book/types_of_data.md rename to src/content/docs/zh-cn/book/nu-fundamentals/types_of_data.md index 42d716efa1f..6cb01ef464a 100644 --- a/zh-CN/book/types_of_data.md +++ b/src/content/docs/zh-cn/book/nu-fundamentals/types_of_data.md @@ -1,4 +1,6 @@ -# 数据类型 +--- +title: 数据类型 +--- 传统上,Unix Shell 命令之间使用字符串文本进行通信。一个命令通过标准输出(通常缩写为 "stdout")输出文本,另一个命令通过标准输入(或 "stdin")读入文本,以此来让两个命令进行通信。 @@ -10,7 +12,7 @@ Nu 在其命令中采用了这种方法,并将其扩展到包括其他类型 你可以通过 [`describe`](/commands/docs/describe.md) 命令获取一个值的类型: -``` +```nu > 42 | describe ``` @@ -38,7 +40,7 @@ Nu 在其命令中采用了这种方法,并将其扩展到包括其他类型 **双引号** -``` +```nu "my message" ``` @@ -46,7 +48,7 @@ Nu 在其命令中采用了这种方法,并将其扩展到包括其他类型 **单引号** -``` +```nu 'my message' ``` @@ -56,12 +58,12 @@ Nu 在其命令中采用了这种方法,并将其扩展到包括其他类型 Nushell 支持字符串插值,允许你在以`$`为前缀的字符串中运行子表达式。比如: -``` +```nu > echo $"6 x 7 = (6 * 7)" 6 x 7 = 42 ``` -``` +```nu > ls | each { |it| echo $"($it.name) is ($it.size)" } ───┬───────────────────── 0 │ genawait is 4.1 KB @@ -72,7 +74,7 @@ Nushell 支持字符串插值,允许你在以`$`为前缀的字符串中运行 **裸字符串** -``` +```nu > echo hello ``` @@ -80,7 +82,7 @@ Nushell 的一个独特特征是,你也可以创建一个没有任何引号的 上面的内容和如下写法是一样的: -``` +```nu > echo "hello" ``` @@ -198,7 +200,7 @@ Eg) `1wk`是一个星期的时间间隔。 你可以使用 `0x[...]` 、 `0b[...]` 或 `0o[...]` 的形式将二进制写成一个字面值: -``` +```nu > 0x[1F FF] # 十六进制 > 0b[1 1010] # 二进制 > 0o[377] # 八进制 @@ -214,7 +216,7 @@ Eg) `1wk`是一个星期的时间间隔。 记录(Records)持有键值对,很像 JSON 中的对象。由于这些记录有时会有很多字段,所以记录是从上到下打印的,而不是从左到右: -``` +```nu > echo {name: sam, rank: 10} ╭──────┬─────╮ │ name │ sam │ @@ -224,7 +226,7 @@ Eg) `1wk`是一个星期的时间间隔。 你可以将其转换到一个表然后遍历该记录: -``` +```nu > echo {name: sam, rank: 10} | transpose key value ╭───┬──────┬───────╮ │ # │ key │ value │ @@ -240,7 +242,7 @@ Eg) `1wk`是一个星期的时间间隔。 例如,一个字符串的列表: -``` +```nu > echo [sam fred george] ───┬──────── 0 │ sam @@ -255,7 +257,7 @@ Eg) `1wk`是一个星期的时间间隔。 我们可以创建自己的表,就像我们创建一个列表一样。因为表也包含列,而不仅仅是值,所以我们需要传入列的名称: -``` +```nu > echo [[column1, column2]; [Value1, Value2]] ───┬─────────┬───────── # │ column1 │ column2 @@ -266,7 +268,7 @@ Eg) `1wk`是一个星期的时间间隔。 我们还可以创建一个有多行数据的表格: -``` +```nu > echo [[column1, column2]; [Value1, Value2] [Value3, Value4]] ───┬─────────┬───────── # │ column1 │ column2 @@ -278,7 +280,7 @@ Eg) `1wk`是一个星期的时间间隔。 你也可以通过一个记录列表来创建表格: -``` +```nu > echo [{name: sam, rank: 10}, {name: bob, rank: 7}] ╭───┬──────┬──────╮ │ # │ name │ rank │ diff --git a/zh-CN/book/working_with_lists.md b/src/content/docs/zh-cn/book/nu-fundamentals/working_with_lists.md similarity index 99% rename from zh-CN/book/working_with_lists.md rename to src/content/docs/zh-cn/book/nu-fundamentals/working_with_lists.md index 9e8bb3c5aa5..8da17d2c7ec 100644 --- a/zh-CN/book/working_with_lists.md +++ b/src/content/docs/zh-cn/book/nu-fundamentals/working_with_lists.md @@ -1,4 +1,6 @@ -# 处理列表 +--- +title: 处理列表 +--- ## 创建列表 diff --git a/zh-CN/book/working_with_strings.md b/src/content/docs/zh-cn/book/nu-fundamentals/working_with_strings.md similarity index 99% rename from zh-CN/book/working_with_strings.md rename to src/content/docs/zh-cn/book/nu-fundamentals/working_with_strings.md index 54c9d3aba75..445c7fcef46 100644 --- a/zh-CN/book/working_with_strings.md +++ b/src/content/docs/zh-cn/book/nu-fundamentals/working_with_strings.md @@ -1,4 +1,6 @@ -# 处理字符串 +--- +title: 处理字符串 +--- Nushell 中的字符串用于保存文本数据以便后续使用,其中可以包括文件名、文件路径、列名以及更多。字符串是如此地普遍,以至于 Nushell 提供了几种处理它们的方法,你可以从中选择最合适的。 diff --git a/zh-CN/book/working_with_tables.md b/src/content/docs/zh-cn/book/nu-fundamentals/working_with_tables.md similarity index 99% rename from zh-CN/book/working_with_tables.md rename to src/content/docs/zh-cn/book/nu-fundamentals/working_with_tables.md index 47d2201a427..d923a941220 100644 --- a/zh-CN/book/working_with_tables.md +++ b/src/content/docs/zh-cn/book/nu-fundamentals/working_with_tables.md @@ -1,10 +1,12 @@ -# 处理表格 +--- +title: 处理表格 +--- 在 Nu 中查看数据的一种常见方式是通过表格。Nu 提供了许多处理表格的命令以方便找到你想要的内容以及将数据缩小到你需要的范围。 首先,让我们获得一个可用的表: -``` +```nu > ls ───┬───────────────┬──────┬─────────┬──────────── # │ name │ type │ size │ modified @@ -23,7 +25,7 @@ 我们可以通过调用[`sort-by`](/commands/docs/sort-by.md)命令对一个表进行排序,并指定需要排序的列。比如,按照文件的大小对表格进行排序: -``` +```nu > ls | sort-by size ───┬───────────────┬──────┬─────────┬──────────── # │ name │ type │ size │ modified @@ -44,7 +46,7 @@ 我们可以从表中通过选择特定的列或行来获得数据。让我们从表中选择([`select`](/commands/docs/select.md))几列吧: -``` +```nu > ls | select name size ───┬───────────────┬───────── # │ name │ size @@ -61,7 +63,7 @@ 这有助于创建一个更专注于我们所需的表格。接下来,假设我们只想看这个目录中最小的 5 个文件: -``` +```nu > ls | sort-by size | first 5 ───┬──────────────┬──────┬────────┬──────────── # │ name │ type │ size │ modified @@ -78,7 +80,7 @@ 你也可以跳过(`skip`)不需要的行,让我们跳过上面所得 5 行中的前两行: -``` +```nu > ls | sort-by size | first 5 | skip 2 ───┬───────────┬──────┬────────┬──────────── # │ name │ type │ size │ modified @@ -93,7 +95,7 @@ 让我们看看其他几个用于选择数据的命令。您可能想知道为什么选取表格的行是通过数字,这是选择单行数据的便捷方式。让我们按文件名对表进行排序,然后使用 `select` 命令通过行号来选择其中的一行: -``` +```nu > ls | sort-by name ───┬───────────────┬──────┬─────────┬──────────── # │ name │ type │ size │ modified @@ -119,7 +121,7 @@ 到目前为止,我们在处理表格时都是将表格修剪成我们需要的样子。有时我们可能想更进一步,只看单元格本身的值,而不是取整列。比如,我们只想得到一个包含所有文件名的列表。在此,我们使用[`get`](/commands/docs/get.md) 命令: -``` +```nu > ls | get name ───┬─────────────── 0 │ files.rs @@ -136,7 +138,7 @@ 这可能看起来很像我们之前使用的[`select`](/commands/docs/select.md)命令,所以也把它放在这里以便于比较: -``` +```nu > ls | select name ───┬─────────────── # │ name @@ -168,7 +170,7 @@ 我们可以使用[`append`](/commands/docs/append.md)将列名相同的表拼接起来: -``` +```nu > let $first = [[a b]; [1 2]] > let $second = [[a b]; [3 4]] > $first | append $second @@ -227,7 +229,7 @@ 我们可以使用[`insert`](/commands/docs/insert.md)命令在表中增加新列,让我们看一个例子: -``` +```nu > open rustfmt.toml ─────────┬────── edition │ 2018 @@ -236,7 +238,7 @@ 让我们添加一个名为 "next_edition" 的列并将 2021 作为值: -``` +```nu > open rustfmt.toml | insert next_edition 2021 ──────────────┬────── edition │ 2018 @@ -246,7 +248,7 @@ 注意,我们如果打开原始文件,会发现内容没变: -``` +```nu > open rustfmt.toml ─────────┬────── edition │ 2018 @@ -255,7 +257,7 @@ Nu 的更改是函数性更改,这意味着它们只在值上起作用,而不是试图引起永久性变更。这使我们可以在管道中进行许多不同类型的操作直到我们准备好将结果输出(如果我们选择这样做的话)。这里我们可以使用 [`save`](/commands/docs/save.md) 命令保存结果: -``` +```nu > open rustfmt.toml | insert next_edition 2021 | save rustfmt2.toml > open rustfmt2.toml ──────────────┬────── @@ -268,7 +270,7 @@ Nu 的更改是函数性更改,这意味着它们只在值上起作用,而 与[`insert`](/commands/docs/insert.md)命令类似,我们也可以使用[`update`](/commands/docs/update.md)命令将某一列的内容修改为新值。为了看看效果,让我们打开同一个文件: -``` +```nu > open rustfmt.toml ─────────┬────── edition │ 2018 @@ -277,7 +279,7 @@ Nu 的更改是函数性更改,这意味着它们只在值上起作用,而 现在,用我们希望支持的下一个版本更新 edition: -``` +```nu > open rustfmt.toml | update edition 2021 ─────────┬────── edition │ 2021 @@ -290,7 +292,7 @@ Nu 的更改是函数性更改,这意味着它们只在值上起作用,而 你可以使用`move`来移动表中的列。例如,如果想把`ls`中的 "name" 列移到 "size" 列之后,我们可以这样做: -``` +```nu > ls | move name --after size ╭────┬──────┬─────────┬───────────────────┬──────────────╮ │ # │ type │ size │ name │ modified │ @@ -307,7 +309,7 @@ Nu 的更改是函数性更改,这意味着它们只在值上起作用,而 你也可以通过`rename`命令对表中的列进行**重命名**。我们可以使用这个例子来运行`ls`并重命名这些列: -``` +```nu > ls | rename filename filetype filesize date ╭────┬───────────────────┬──────────┬──────────┬──────────────╮ │ # │ filename │ filetype │ filesize │ date │ diff --git a/zh-CN/book/aliases.md b/src/content/docs/zh-cn/book/programming-in-nu/aliases.md similarity index 97% rename from zh-CN/book/aliases.md rename to src/content/docs/zh-cn/book/programming-in-nu/aliases.md index ba1833e60e2..462a5d95a56 100644 --- a/zh-CN/book/aliases.md +++ b/src/content/docs/zh-cn/book/programming-in-nu/aliases.md @@ -1,4 +1,6 @@ -# 别名 +--- +title: 别名 +--- Nushell 中的别名提供了一种简单的文本替换方式,这允许你为一个较长的命令创建一个简写名称,包括其默认参数。 @@ -16,7 +18,7 @@ Nushell 中的别名提供了一种简单的文本替换方式,这允许你为 一旦我们这样做了,就如同我们输入了 `ls -l` 一样。这也允许我们传入标志或位置参数。例如,我们现在也可以这样写: -``` +```nu > ll -a ``` diff --git a/zh-CN/book/custom_commands.md b/src/content/docs/zh-cn/book/programming-in-nu/custom_commands.md similarity index 98% rename from zh-CN/book/custom_commands.md rename to src/content/docs/zh-cn/book/programming-in-nu/custom_commands.md index 68a6ebe4cdc..fdf7389f7bd 100644 --- a/zh-CN/book/custom_commands.md +++ b/src/content/docs/zh-cn/book/programming-in-nu/custom_commands.md @@ -1,4 +1,6 @@ -# 自定义命令 +--- +title: 自定义命令 +--- Nu 具备组合长管道的能力使你对数据和系统有很强的控制力,但它的代价是需要大量的键盘输入。不过理想情况下,你可以保存精心设计的管道以便反复使用。 @@ -22,14 +24,14 @@ def greet [name] { 当我们这样做的时候,就会得到输出,如同我们使用内置命令一样: -``` +```nu ───┬─────── 0 │ hello 1 │ world ───┴─────── ``` -::: tip +:::tip `echo`将其参数分别返回给管道。如果你想用它来生成一个单一的字符串,请在管道中添加` | str join`: ```nu @@ -89,7 +91,7 @@ greet world 如果我们尝试运行上述内容,Nushell 会告诉我们,类型不匹配: -``` +```nu error: Type Error ┌─ shell:6:7 │ @@ -136,7 +138,7 @@ def greet [name = "nushell"] { 你可以在没有参数的情况下调用这个命令,也可以指定一个值来覆盖默认值: -``` +```nu > greet hello nushell > greet world @@ -145,7 +147,7 @@ hello world 你也可以将默认值与[类型要求](#参数类型)相结合: -``` +```nu def congratulate [age: int = 18] { echo "Happy birthday! Wow you are " $age " years old now!" | str join } @@ -157,7 +159,7 @@ def congratulate [age: int = 18] { 默认情况下,位置参数(Positional Parameters)是必须的。如果没有传递位置参数,我们将遇到一个报错: -``` +```nu × Missing required positional argument. ╭─[entry #23:1:1] 1 │ greet @@ -228,7 +230,7 @@ def greet [ 或者甚至完全不使用标志: -``` +```nu > greet world ``` @@ -249,7 +251,7 @@ _注意:_ 标志是以其全称命名的,所以上面的例子的命令体 现在,我们可以使用缩写标志来调用这个新的定义: -``` +```nu > greet -a 10 hello ``` @@ -271,13 +273,13 @@ def greet [ 而这个定义可以通过如下方式调用: -``` +```nu > greet -a 10 --twice hello ``` 或者只是没有开关标志: -``` +```nu > greet -a 10 hello ``` @@ -331,7 +333,7 @@ def greet [ 一旦定义完毕,我们可以运行`help greet`来获得该命令的帮助信息: -``` +```nu Usage: > greet <name> {flags} @@ -361,7 +363,7 @@ def greet [ 现在,如果我们运行`help greet`,就会得到一些更友好的帮助文本: -``` +```nu A greeting command that can greet the caller Usage: @@ -416,7 +418,7 @@ def double [] { 现在,如果我们在一个管道中调用上述命令,就可以看到它对输入的处理结果: -``` +```nu > [1 2 3] | double ───┬───── 0 │ 2 diff --git a/zh-CN/book/modules.md b/src/content/docs/zh-cn/book/programming-in-nu/modules.md similarity index 98% rename from zh-CN/book/modules.md rename to src/content/docs/zh-cn/book/programming-in-nu/modules.md index 36052b3c185..5efc4af0f04 100644 --- a/zh-CN/book/modules.md +++ b/src/content/docs/zh-cn/book/programming-in-nu/modules.md @@ -1,4 +1,6 @@ -# 模块 +--- +title: 模块 +--- 与其他许多编程语言类似,Nushell 也有模块,可以让你将自定义的命令导入到当前作用域中。 然而,由于 Nushell 也是一个 Shell,模块还允许你导入环境变量,可以用来方便地激活/停用各种环境配置。 @@ -23,9 +25,7 @@ _注意! 目前对模块的实现是相当基本的,并将在未来进一步 或者在一个与你要创建的模块名相同的文件中: -```nu -# greetings.nu - +```nu title="greetings.nu" export def hello [name: string] { $"hello ($name)!" } @@ -81,9 +81,7 @@ hi there! Nushell 让你隐含地把一个源文件当作一个模块。 让我们先把模块定义的主体保存到一个文件中: -```nu -# greetings.nu - +```nu title="greetings.nu" export def hello [name: string] { $"hello ($name)!" } @@ -111,9 +109,7 @@ Nushell 会自动从文件名("greetings",没有".nu"扩展名)推断出 任何在模块中定义的自定义命令,如果没有`export`关键字,将只在该模块的作用域内工作: -```nu -# greetings.nu - +```nu title="greetings.nu" export def hello [name: string] { greetings-helper "hello" "world" } @@ -146,9 +142,7 @@ hi there! 到目前为止,我们只是用模块来导入自定义命令,用同样的方法导出环境变量也是可能的。 其语法与你可能习惯的直接修改 `$env` 或 [`load-env`](/commands/docs/load-env.md)等命令略有不同: -```nu -# greetings.nu - +```nu title="greetings.nu" export env MYNAME { "Arthur, King of the Britons" } export def hello [name: string] { diff --git a/zh-CN/book/operators.md b/src/content/docs/zh-cn/book/programming-in-nu/operators.md similarity index 99% rename from zh-CN/book/operators.md rename to src/content/docs/zh-cn/book/programming-in-nu/operators.md index 51ce2141d39..00a24635462 100644 --- a/zh-CN/book/operators.md +++ b/src/content/docs/zh-cn/book/programming-in-nu/operators.md @@ -1,4 +1,6 @@ -# 运算符 +--- +title: 运算符 +--- Nushell 支持以下常见的数学、逻辑和字符串操作的运算符: diff --git a/zh-CN/book/overlays.md b/src/content/docs/zh-cn/book/programming-in-nu/overlays.md similarity index 99% rename from zh-CN/book/overlays.md rename to src/content/docs/zh-cn/book/programming-in-nu/overlays.md index 74fee642f69..b0cdb85f4a4 100644 --- a/zh-CN/book/overlays.md +++ b/src/content/docs/zh-cn/book/programming-in-nu/overlays.md @@ -1,4 +1,6 @@ -# 覆层 +--- +title: 覆层 +--- 覆层(Overlays)作为各种定义(自定义命令、别名、环境变量)的"层",可以根据需要激活和停用。 它们类似于某些语言中的虚拟环境,如 Python。 @@ -116,7 +118,7 @@ eggs 覆层会记住你所添加的内容,即使你删除了它们,也会储存这些信息。 这可以让你在不同的上下文中反复切换。 -::: tip +:::tip 有时,在添加一个覆层后,你可能不希望自定义对象被添加到其中。 解决的办法是创建一个新的空的覆层,只用来记录自定义的变化: diff --git a/zh-CN/book/scripts.md b/src/content/docs/zh-cn/book/programming-in-nu/scripts.md similarity index 96% rename from zh-CN/book/scripts.md rename to src/content/docs/zh-cn/book/programming-in-nu/scripts.md index 43d04a3787d..35dc8496c23 100644 --- a/zh-CN/book/scripts.md +++ b/src/content/docs/zh-cn/book/programming-in-nu/scripts.md @@ -1,4 +1,6 @@ -# 脚本 +--- +title: 脚本 +--- 在 Nushell 中,你可以用 Nushell 语言编写和运行脚本。要运行一个脚本,你可以把它作为一个参数传递给`nu`命令行程序: @@ -14,8 +16,7 @@ 我们来看一个脚本文件的例子吧: -```nu -# myscript.nu +```nu title="myscript.nu" def greet [name] { echo "hello" $name } @@ -58,15 +59,13 @@ b; c | d 脚本文件可以选择性地包含一个特殊的 "main" 命令。`main`将在任何其他 Nu 代码之后运行,主要用于向脚本添加参数。你可以在脚本名称后面传递参数(`nu <script name> <script args>`)。比如: -```nu -# myscript.nu - +```nu title="myscript.nu" def main [x: int] { $x + 10 } ``` -``` +```nu > nu myscript.nu 100 110 ``` diff --git a/zh-CN/book/variables_and_subexpressions.md b/src/content/docs/zh-cn/book/programming-in-nu/variables_and_subexpressions.md similarity index 99% rename from zh-CN/book/variables_and_subexpressions.md rename to src/content/docs/zh-cn/book/programming-in-nu/variables_and_subexpressions.md index 41685691edd..cda57d0f3ce 100644 --- a/zh-CN/book/variables_and_subexpressions.md +++ b/src/content/docs/zh-cn/book/programming-in-nu/variables_and_subexpressions.md @@ -1,4 +1,6 @@ -# 变量和子表达式 +--- +title: 变量和子表达式 +--- 在 Nushell 中有两种类型的求值表达式:变量和子表达式。如果你看到一个以美元符号(`$`)开头的字符串的话,你就应该知道你看到的是一个求值表达式。这表明当 Nushell 运行到此处时需要执行一个求值操作来处理这个表达式并使用此结果值。这两种求值表达式都支持一个简单形式和一个"路径"形式,用于处理更复杂的数据。 diff --git a/src/content/docs/zh-cn/index.mdx b/src/content/docs/zh-cn/index.mdx new file mode 100755 index 00000000000..9d31f093c56 --- /dev/null +++ b/src/content/docs/zh-cn/index.mdx @@ -0,0 +1,46 @@ +--- +title: Nushell +description: 一种新的 Shell +template: splash +editUrl: true +lastUpdated: false +hero: + tagline: 一种新的 Shell + actions: + - text: Get Started + link: /introduction/ + icon: right-arrow + variant: primary + - text: View on GitHub + link: https://github.com/nushell/nushell.github.io + icon: external +--- + +import { Card, CardGrid } from "@astrojs/starlight/components"; + +<CardGrid> + <Card title="利用管道控制任意系统"> + Nu 可以在 Linux、macOS 和 Windows 上运行。一次学习,处处可用。 + </Card> + <Card title="一切皆数据"> + Nu + 管道使用结构化数据,你可以用同样的方式安全地选择,过滤和排序。停止解析字符串,开始解决问题。 + </Card> + <Card title="强大的插件系统">具备强大的插件系统,Nu 可以轻松扩展。</Card> +</CardGrid> + +<br /> + + + +### Nu 可以与现有数据一起工作 + +Nu 开箱即用支持 [JSON、YAML、SQLite、Excel 等](/zh-CN/book/loading_data.md)。无论是文件、数据库还是网络 API 中的数据,都可以很容易地引入 Nu 管道: + + + +### Nu 有很棒的错误反馈 + +Nu 在类型化的数据上操作,所以它能捕捉到其他 Shell 无法捕捉到的 Bug。当意外发生时,Nu 会告诉你确切的位置和原因: + + diff --git a/src/env.d.ts b/src/env.d.ts new file mode 100644 index 00000000000..acef35f175a --- /dev/null +++ b/src/env.d.ts @@ -0,0 +1,2 @@ +/// <reference path="../.astro/types.d.ts" /> +/// <reference types="astro/client" /> diff --git a/src/pages/blog.astro b/src/pages/blog.astro new file mode 100644 index 00000000000..cb376a5aa07 --- /dev/null +++ b/src/pages/blog.astro @@ -0,0 +1,30 @@ +--- +import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"; +import { LinkCard } from "@astrojs/starlight/components"; +import { getCollection } from "astro:content"; +const blogEntries = await getCollection("docs"); +--- + +<StarlightPage frontmatter={{ title: "Nu Blog", template: "splash" }}> + { + blogEntries + .filter((blogPostEntry) => { + const parts = blogPostEntry.slug.split("-"); + return ( + parts.length > 3 && !isNaN(Date.parse(parts.slice(0, 3).join("-"))) + ); + }) + .sort((a, b) => { + const dateA = new Date(a.slug.split("-").slice(0, 3).join("-")); + const dateB = new Date(b.slug.split("-").slice(0, 3).join("-")); + return dateB - dateA; + }) + .map((filteredBlogPostEntry) => ( + <LinkCard + title={filteredBlogPostEntry.data.title} + href={`${filteredBlogPostEntry.slug.replace("blog", "/blog")}`} + description={filteredBlogPostEntry.data.description} + /> + )) + } +</StarlightPage> diff --git a/src/styles/index.css b/src/styles/index.css new file mode 100644 index 00000000000..5346c0436b0 --- /dev/null +++ b/src/styles/index.css @@ -0,0 +1,32 @@ +@media (min-width: 50rem) { + .hero { + grid-template-columns: unset; + + > img { + order: unset; + margin-inline: unset; + } + } +} + +:where(p) { + text-wrap: pretty; +} + +:where(h1, h2, h3, h4, h5, h6) { + text-wrap: balance; +} + +/* Dark mode colors. */ +:root { + --sl-color-accent: #3aa675; + --sl-color-accent-high: #3aa675; + --sl-color-gray-3: #8b9eb0; + --sl-color-black: #22272e; +} + +/* Light mode colors. */ +:root[data-theme="light"] { + --sl-color-accent: #3eaf7c; + --sl-color-white: #17181c; +} diff --git a/tr/README.md b/tr/README.md deleted file mode 100644 index bbc71e2b894..00000000000 --- a/tr/README.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -home: true -heroImage: null -heroText: Nushell -tagline: A new type of shell. -actionText: Get Started → -actionLink: /tr/book/ -features: - - title: Pipelines to control any OS - details: Nu works on Linux, macOS, and Windows. Learn it once, then use it anywhere. - - title: Everything is data - details: Nu pipelines use structured data so you can safely select, filter, and sort the same way every time. Stop parsing strings and start solving problems. - - title: Powerful plugins - details: It's easy to extend Nu using a powerful plugin system. ---- - -<img src="https://www.nushell.sh/frontpage/ls-example.png" alt="Screenshot showing using the ls command" class="hero"/> - -### Nu works with existing data - -Please translate the home page here from README.md diff --git a/tr/book/README.md b/tr/book/README.md deleted file mode 100644 index f3d59784f9f..00000000000 --- a/tr/book/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Introduction - -Please translate the introduction page here from book/README.md diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000000..bcbf8b50906 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "astro/tsconfigs/strict" +} diff --git a/zh-CN/README.md b/zh-CN/README.md deleted file mode 100755 index a229eff92eb..00000000000 --- a/zh-CN/README.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -home: true -heroImage: null -heroText: Nushell -tagline: 一种新的 Shell -actionText: 点此了解更多 → -actionLink: /zh-CN/book/ -features: - - title: 利用管道控制任意系统 - details: Nu 可以在 Linux、macOS 和 Windows 上运行。一次学习,处处可用。 - - title: 一切皆数据 - details: Nu 管道使用结构化数据,你可以用同样的方式安全地选择,过滤和排序。停止解析字符串,开始解决问题。 - - title: 强大的插件系统 - details: 具备强大的插件系统,Nu 可以轻松扩展。 ---- - -<img src="https://www.nushell.sh/frontpage/ls-example.png" alt="Screenshot showing using the ls command" class="hero"/> - -### Nu 可以与现有数据一起工作 - -Nu 开箱即用支持 [JSON、YAML、SQLite、Excel 等](/zh-CN/book/loading_data.md)。无论是文件、数据库还是网络 API 中的数据,都可以很容易地引入 Nu 管道: - -<img src="https://www.nushell.sh/frontpage/fetch-example.png" alt="Screenshot showing fetch with a web API" class="hero"/> - -### Nu 有很棒的错误反馈 - -Nu 在类型化的数据上操作,所以它能捕捉到其他 Shell 无法捕捉到的 Bug。当意外发生时,Nu 会告诉你确切的位置和原因: - -<img src="https://www.nushell.sh/frontpage/miette-example.png" alt="Screenshot showing Nu catching a type error" class="hero"/> - -## 获取 Nu - -Nushell 可以通过 [你喜欢的软件包管理器](https://repology.org/project/nushell/versions) 来安装 [可下载的二进制文件](https://github.com/nushell/nushell/releases),可以在 [GitHub Action](https://github.com/marketplace/actions/setup-nu) 中使用,此外也可以以 [源码](https://github.com/nushell/nushell)方式获得。在此阅读 [详细的安装说明](/zh-CN/book/installation.md) 或直接开始: - -#### macOS / Linux: - -```shell -$ brew install nushell -``` - -#### Windows: - -```shell -$ winget install nushell -``` - -完成安装后,输入 `nu` 来启动 Nu。 - -## 社区 - -如果你有任何问题可以在 [Dicord](https://discord.gg/NtAbbGn) 上找到我们。 - -您可以通过 [意见反馈](https://github.com/nushell/nushell.github.io/issues) 或者 [贡献 PR](https://github.com/nushell/nushell.github.io/pulls) 来帮助我们完善此网站。 diff --git a/zh-CN/book/coming_from_bash.md b/zh-CN/book/coming_from_bash.md deleted file mode 100644 index 98cbca4eab0..00000000000 --- a/zh-CN/book/coming_from_bash.md +++ /dev/null @@ -1,60 +0,0 @@ -# 从 Bash 到 Nu - -如果你是来自 Windows 上的`Git Bash`用户,那么你习惯的外部命令(bash、grep 等)在`nu`中默认是不可用的(除非你在 Windows 路径环境变量中明确包含了它们)。 -要使这些命令在`nu`中可用,请在你的`config.nu`中添加以下一行,用`append`或`prepend`。 - -```nu -$env.Path = ($env.Path | prepend 'C:\Program Files\Git\usr\bin') -``` - -注意:本表针对 Nu 0.60.0 或更高版本。 - -| Bash | Nu | Task | -| ------------------------------------ | ------------------------------------------------ | ------------------------------------------ | -| `ls` | `ls` | 列出当前目录中的文件 | -| `ls <dir>` | `ls <dir>` | 列出给定目录中的文件 | -| `ls pattern*` | `ls pattern*` | 列出匹配给定模式的文件 | -| `ls -la` | `ls --long --all` or `ls -la` | 列出包含所有可用信息的文件,包括隐藏文件 | -| `ls -d */` | `ls \| where type == dir` | 列出目录 | -| `find . -name *.rs` | `ls **/*.rs` | 递归地查找匹配给定模式的所有文件 | -| `find . -name Makefile \| xargs vim` | `ls \*\*/Makefile \| get name \| vim $in` | 将值作为命令参数传递 | -| `cd <directory>` | `cd <directory>` | 切换到给定目录 | -| `cd` | `cd` | 切换到用户主目录 | -| `cd -` | `cd -` | 切换到前一个目录 | -| `mkdir <path>` | `mkdir <path>` | 创建给定的路径 | -| `mkdir -p <path>` | `mkdir <path>` | 创建给定的路径,如果父目录不存在则自动创建 | -| `touch test.txt` | `touch test.txt` | 新建文件 | -| `> <path>` | `\| save --raw <path>` | 保存字符串到给定文件 | -| `>> <path>` | `\| save --raw --append <path>` | 追加字符串到给定文件 | -| `cat <path>` | `open --raw <path>` | 显示给定文件的内容 | -| | `open <path>` | 将文件作为结构化数据读取 | -| `mv <source> <dest>` | `mv <source> <dest>` | 移动文件到新的位置 | -| `cp <source> <dest>` | `cp <source> <dest>` | 复制文件到新的位置 | -| `cp -r <source> <dest>` | `cp -r <source> <dest>` | 递归地将目录复制到一个新的位置 | -| `rm <path>` | `rm <path>` | 删除给定的文件 | -| | `rm -t <path>` | 将给定的文件移到系统垃圾箱 | -| `rm -rf <path>` | `rm -r <path>` | 递归地删除给定的路径 | -| `date -d <date>` | `"<date>" \| into datetime -f <format>` | 解析日期 ([日期格式文档](https://docs.rs/chrono/0.4.15/chrono/format/strftime/index.html)) | -| `sed` | `str replace` | 查找和替换一个字符串中的模式 | -| `grep <pattern>` | `where $it =~ <substring>` or `find <substring>` | 过滤包含特定字符串的字符串 | -| `man <command>` | `help <command>` | 获得特定命令的帮助信息 | -| | `help commands` | 列出所有可用的命令 | -| | `help --find <string>` | 在所有可用的命令中搜索 | -| `command1 && command2` | `command1; command2` | 运行一条命令,如果成功的话,再运行第二条 | -| `stat $(which git)` | `stat (which git).path` | 使用命令输出作为其他命令的参数 | -| `echo $PATH` | `echo $env.PATH` | 查看当前路径 | -| `<update ~/.bashrc>` | `vim $nu.config-path` | 永久地更新 PATH | -| `export PATH = $PATH:/usr/other/bin` | `$env.PATH = ($env.PATH \| append /usr/other/bin)` | 临时更新 PATH | -| `export` | `echo $env` | 列出当前的环境变量 | -| `<update ~/.bashrc>` | `vim $nu.config-path` | 永久地更新环境变量 | -| `FOO=BAR ./bin` | `FOO=BAR ./bin` | 临时修改环境变量 | -| `export FOO=BAR` | `$env.FOO = BAR` | 为当前会话设置环境变量 | -| `echo $FOO` | `echo $env.FOO` | 使用环境变量 | -| `unset FOO` | `hide FOO` | 取消对当前会话的环境变量设置 | -| `alias s="git status -sb"` | `alias s = git status -sb` | 临时定义一个别名 | -| `type FOO` | `which FOO` | 显示一个命令的信息(内置、别名或可执行) | -| `<update ~/.bashrc>` | `vim $nu.config-path` | 永久添加和编辑别名(新开Shell会话生效) | -| `bash -c <commands>` | `nu -c <commands>` | 运行一组命令(需要0.9.1或更高版本) | -| `bash <script file>` | `nu <script file>` | 运行一个脚本文件(需要0.9.1或更高版本) | -| `\` | `( <command> )` | 当命令被 `(` 和 `)` 包裹的时候可以跨多行 | -| `pwd` | `$env.PWD` | 显示当前目录 | diff --git a/zh-CN/book/nushell_map.md b/zh-CN/book/nushell_map.md deleted file mode 100644 index 64b5e0608aa..00000000000 --- a/zh-CN/book/nushell_map.md +++ /dev/null @@ -1,101 +0,0 @@ -# 从其他 Shell 或 DSL 到 Nu - -这个表格背后的想法是帮助你了解 Nu 的内置和插件所提供命令与其他已知的 Shell 和特定领域语言(DSL)的关系。我们试图制作一张所有 Nu 命令和它们在其他语言中的对应关系的表。欢迎大家参与贡献。 - -注意:此表针对 Nu 0.43 或更高版本。 - - -| Nushell | SQL | .Net LINQ (C#) | PowerShell (without external modules) | Bash | -| ---------------------- | ----------------------------- | ---------------------------------------------------- | ------------------------------------------ | ----------------------------------------------- | -| alias | - | - | alias | alias | -| append | - | Append | -Append | | -| args | - | - | | | -| autoview | - | - | | | -| math avg | avg | Average | Measure-Object, measure | | -| calc, `<math expression>` | math operators | Aggregate, Average, Count, Max, Min, Sum | | bc | -| cd | - | - | Set-Location, cd | cd | -| clear | - | - | Clear-Host | clear | -| compact | | | | | -| config | - | - | $Profile | vi .bashrc, .profile | -| cp | - | - | Copy-Item, cp, copy | cp | -| date | NOW() / getdate() | DateTime class | Get-Date | date | -| debug | | | | | -| default | | | | | -| drop | | | | | -| du | - | - | | du | -| each | cursor | | ForEach-Object, foreach, for | | -| echo | print, union all | - | Write-Output, write | echo | -| enter | - | - | | | -| exit | - | | exit | exit | -| first | top, limit | First, FirstOrDefault | Select-Object -First | head | -| format | | String.Format | String.Format | | -| from | import flatfile, openjson, cast(variable as xml) | - | Import/ConvertFrom-{Csv,Xml,Html,Json} | | -| get | | Select | (cmd).column | | -| group-by | group by | GroupBy, group | Group-Object, group | | -| headers | | | | | -| help | sp_help | - | Get-Help, help, man | man | -| histogram | - | - | | | -| history | - | - | Get-History, history | history | -| http(`*`) | - | HttpClient,WebClient, HttpWebRequest/Response | Invoke-WebRequest | wget | -| inc(`*`) | - | | - | - | -| is_empty | is null | String.InNullOrEmpty | String.InNullOrEmpty | | -| keep, =take | top, limit | Take | Select-Object -First | head | -| keep-until | | | | | -| keep-while | | TakeWhile | | | -| kill | - | - | Stop-Process, kill | kill | -| last | | Last, LastOrDefault | Select-Object -Last | tail | -| length | count | Count | Measure-Object, measure | wc | -| lines | - | - | File.ReadAllLines | | -| ls | - | - | Get-ChildItem, dir, ls | ls | -| match(`*`) | case when | Regex.IsMatch | [regex] | | -| merge | | | | | -| mkdir | - | - | mkdir, md | mkdir | -| mv | - | - | Move-Item, mv, move, mi | mv | -| next | | | | | -| nth | limit x offset y, rownumber = | ElementAt | [x], indexing operator, ElementAt | | -| open | | | Get-Content, gc, cat, type | cat | -| parse | | | | | -| transpose | pivot | - | | | -| post(`*`) | - | HttpClient,WebClient, HttpWebRequest/Response | Invoke-WebRequest | | -| prepend | | | | | -| prev | | | | | -| ps(`*`) | - | - | Get-Process, ps, gps | ps | -| pwd | - | - | Get-Location, pwd | pwd | -| range | | Range | 1..10, 'a'..'f' | | -| reduce | | Aggregate | | | -| reject | | | | | -| rename | - | - | Rename-Item, ren, rni | mv | -| reverse | | Reverse | [Array]::Reverse($var) | | -| rm | - | - | Remove-Item, del, erase, rd, ri, rm, rmdir | rm | -| save | - | - | Write-Output, Out-File | > foo.txt | -| select | select | Select | Select-Object, select | | -| shells | - | - | - | | -| shuffle | | Random | Sort-Object {Get-Random} | - | -| size | | | Measure-Object, measure | wc | -| skip | where row_number() | Skip | Select-Object -Skip | | -| skip until | | | | | -| skip while | | SkipWhile | | | -| sort-by | order by | OrderBy, OrderByDescending, ThenBy, ThenByDescending | Sort-Object, sort | | -| split-by | | Split | Split | | -| split column | | - | | | -| split row | | - | | | -| str(`*`) | string functions | String class | String class | | -| str join | concat_ws | Join | Join-String | | -| str trim | rtrim, ltrim | Trim, TrimStart, TrimEnd | Trim | | -| sum | sum | Sum | Measure-Object, measure | | -| sys(`*`) | - | - | Get-ComputerInfo | uname, lshw, lsblk, lscpu, lsusb, hdparam, free | -| table | | | Format-Table, ft, Format-List, fl | | -| tags | - | - | - | | -| textview(`*`) | - | - | Get-Content, cat | | -| tree(`*`) | - | - | tree | | -| to | - | - | Export/ConvertTo-{Csv,Xml,Html,Json} | | -| touch | - | - | Set-Content | touch | -| uniq | distinct | Distinct | Get-Unique, gu | uniq | -| upsert | As | - | | | -| version | select @@version | - | $PSVersionTable | | -| with_env | - | - | $env:FOO = 'bar' | export foo = "bar" | -| where | where | Where | Where-Object, where, "?" operator | | -| which | - | - | - | which | -| wrap | | | | | - -* `*` - 这些命令是标准插件的一部分 diff --git a/zh-CN/book/table_of_contents.md b/zh-CN/book/table_of_contents.md deleted file mode 100644 index 39efb4f81b5..00000000000 --- a/zh-CN/book/table_of_contents.md +++ /dev/null @@ -1,39 +0,0 @@ -# Table of Contents - -- [安装](installation.md) - 安装 Nushell -- [介绍](README.md) - 开始使用 -- [Nushell 开发思想](thinking_in_nushell.md) - Nushell 开发思想 -- [四处移动](moving_around.md) - 在 Nushell 里四处移动 -- [数据类型](types_of_data.md) - Nushell 中的数据类型 -- [加载数据](loading_data.md) - 加载及使用数据 -- [字符串](working_with_strings.md) - 字符串、转义字符和字符串插值 -- [使用列表](working_with_lists.md) - 使用 Nushell 的列表 -- [使用表格](working_with_tables.md) - 使用 Nushell 的表格 -- [管道](pipeline.md) - 管道是如何运作的 -- [配置](configuration.md) - 如何配置 Nushell -- [第三方命令行提示](3rdpartyprompts.md) - 如何配置第三方命令行提示 -- [自定义命令](custom_commands.md) - 创建你自己的命令 -- [别名](aliases.md) - 如何为命令添加别名 -- [运算符](operators.md) - Nushell 支持的运算符 -- [变量和子表达式](variables_and_subexpressions.md) - 使用变量和子表达式 -- [环境变量](environment.md) - 使用环境变量 -- [标准输出、错误和退出码](stdout_stderr_exit_codes.md) - 使用标准输出、错误和退出码 -- [模块](modules.md) - 创建和使用你自己的模块 -- [钩子](hooks.md) - 添加自动运行的代码片断 -- [脚本](scripts.md) - 创建你自己的脚本 -- [元数据](metadata.md) - 细说 Nushell 的元数据系统 -- [创建你自己的`错误`](creating_errors.md) - 创建你自己的错误信息 -- [Shells](shells_in_shells.md) - 同时在多个 Shell 里面工作 -- [命令转移](escaping.md) - 转移到同名的本机原生命令 -- [插件](plugins.md) - 通过插件增强 Nushell 并添加更多功能 -- [平行](parallelism.md) - 并行运行你的代码 -- [行编辑器](line_editor.md) - Nushell 的行编辑器 -- [数据帧](dataframes.md) - 在 Nushell 里使用数据帧 -- [配色和主题](coloring_and_theming.md) - 如何改变 Nushell 的颜色和主题 -- [正则表达式](regular_expressions.md) - 正则使用指南 -- [Bash 用户上手指南](coming_from_bash.md) - 帮助 Bash 用户快速上手 Nushell -- [从 shells/DSL 到 Nushell](nushell_map.md) - Nushell 与 SQL, Linq, PowerShell 及 Bash 的差异 -- [从命令式语言到 Nushell](nushell_map_imperative.md) - Nushell 与 Python, Kotlin, C++, C# 和 Rust 的差异 -- [从函数式编程语言到 Nushell](nushell_map_functional.md) - Nushell 与 Clojure, Tablecloth (Ocaml / Elm) 和 Haskell 的差异 -- [Nushell 运算符映射](nushell_operator_map.md) - 比较 Nushell 与通用编程语言中的运算符 -- [命令参考](command_reference.md) - Nushell 所有命令清单