ci: Use `dprint` to format documentation + TOML files (#3426)

Adds Rust-based standardized markdown formatting and a CI step to catch unformatted files.
This commit is contained in:
Kevin Song 2022-01-20 02:32:09 -06:00 committed by GitHub
parent 9a4c1b5cdb
commit 0965667807
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 907 additions and 837 deletions

View File

@ -1,14 +1,14 @@
[advisories] [advisories]
ignore = [ ignore = [
# Out-of-bounds write in nix::unistd::getgrouplist # Out-of-bounds write in nix::unistd::getgrouplist
# Tracked in #3140 # Tracked in #3140
"RUSTSEC-2021-0119", "RUSTSEC-2021-0119",
# Potential segfault in the time crate # Potential segfault in the time crate
# chrono dependency, but vulnerable function is never called # chrono dependency, but vulnerable function is never called
# Tacked in #3163 # Tacked in #3163
"RUSTSEC-2020-0071", "RUSTSEC-2020-0071",
# chrono: Potential segfault in localtime_r invocations # chrono: Potential segfault in localtime_r invocations
# starship avoids setting any environment variables to avoid this issue # starship avoids setting any environment variables to avoid this issue
# Tracked in #3166 # Tracked in #3166
"RUSTSEC-2020-0159", "RUSTSEC-2020-0159",
] ]

43
.dprint.json Normal file
View File

@ -0,0 +1,43 @@
{
"incremental": true,
"typescript": {},
"json": {},
"markdown": {
"lineWidth": 100
},
"toml": {},
"includes": [
"docs/**/*.{ts,js,cjs,mjs}",
"**/*.{md,toml,json}"
],
"excludes": [
"**/node_modules",
"**/*-lock.json",
".github/*",
"docs/ar-SA/**",
"docs/ckb-IR/**",
"docs/de-DE/**",
"docs/es-ES/**",
"docs/fr-FR/**",
"docs/id-ID/**",
"docs/it-IT/**",
"docs/ja-JP/**",
"docs/ko-KR/**",
"docs/nl-NL/**",
"docs/pl-PL/**",
"docs/pt-BR/**",
"docs/pt-PT/**",
"docs/ru-RU/**",
"docs/tr-TR/**",
"docs/vi-VN/**",
"docs/zh-CN/**",
"docs/zh-TW/**",
"target/"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.62.0.wasm",
"https://plugins.dprint.dev/json-0.14.0.wasm",
"https://plugins.dprint.dev/markdown-0.12.0.wasm",
"https://plugins.dprint.dev/toml-0.5.3.wasm"
]
}

17
.github/workflows/format-workflow.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: Format + Docs Workflow
on:
push:
paths: ["docs/**","**.md","**.toml","**.js","**.json","**.ts"]
pull_request:
paths: ["docs/**","**.md","**.toml","**.js","**.json","**.ts"]
jobs:
# Run the dprint code formatter for documentation
dprint:
name: Dprint [Docs Formatter]
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v2.4.0
- name: Docs | Format
uses: dprint/check@v2.0

View File

@ -1,4 +1,3 @@
# Contributor Covenant Code of Conduct # Contributor Covenant Code of Conduct
## Our Pledge ## Our Pledge
@ -18,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our Examples of behavior that contributes to a positive environment for our
community include: community include:
* Demonstrating empathy and kindness toward other people - Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences - Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback - Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, - Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience and learning from the experience
* Focusing on what is best not just for us as individuals, but for the - Focusing on what is best not just for us as individuals, but for the
overall community overall community
Examples of unacceptable behavior include: Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or - The use of sexualized language or imagery, and sexual attention or
advances of any kind advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks - Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment - Public or private harassment
* Publishing others' private information, such as a physical or email - Publishing others' private information, such as a physical or email
address, without their explicit permission address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a - Other conduct which could reasonably be considered inappropriate in a
professional setting professional setting
## Enforcement Responsibilities ## Enforcement Responsibilities
@ -107,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban ### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community **Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals. individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within **Consequence**: A permanent ban from any sort of public interaction within
@ -119,11 +118,11 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at version 2.0, available at
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0]. [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
Community Impact Guidelines were inspired by Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available [https://www.contributor-covenant.org/faq][FAQ]. Translations are available
at [https://www.contributor-covenant.org/translations][translations]. at [https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org [homepage]: https://www.contributor-covenant.org

View File

@ -95,13 +95,24 @@ cargo clippy --all-targets --all-features
## Formatting ## Formatting
Starship source files are formatted with [rustfmt](https://crates.io/crates/rustfmt-nightly), using the default configuration. Rustfmt will be ran as part of CI. Unformatted code will fail a build, so it is suggested that you run rustfmt locally: Starship source files are formatted with [rustfmt](https://crates.io/crates/rustfmt-nightly). Markdown and TOML files (among others) are formatted with [dprint](https://github.com/dprint/dprint). Unformatted code will fail the CI, so it is suggested that you run these tools locally.
For rustfmt:
```sh ```sh
rustup component add rustfmt rustup component add rustfmt
cargo fmt cargo fmt
``` ```
For dprint:
```sh
cargo install dprint
dprint fmt
```
Editor plugins/functionality may help you run these automatically so that you don't accidentally create a PR that fails.
## Testing ## Testing
Testing is critical to making sure starship works as intended on systems big and small. Starship interfaces with many applications and system APIs when generating the prompt, so there's a lot of room for bugs to slip in. Testing is critical to making sure starship works as intended on systems big and small. Starship interfaces with many applications and system APIs when generating the prompt, so there's a lot of room for bugs to slip in.
@ -233,10 +244,10 @@ writing new modules low, starship provides a lot of functionality for a module,
which requires quite a few things be done. These are listed here to help which requires quite a few things be done. These are listed here to help
everyone remember what they are. Don't worry: most of them are quite simple! everyone remember what they are. Don't worry: most of them are quite simple!
- [ ] Add a section to `docs/config/README.md` describing the module, and - [ ] Add a section to `docs/config/README.md` describing the module, and
its configuration options/variables (more documentation is often its configuration options/variables (more documentation is often
appropriate--this is a bare minimum). appropriate--this is a bare minimum).
- [ ] Add the variable to the appropriate location in the "Default Prompt - [ ] Add the variable to the appropriate location in the "Default Prompt
Format" section of the documentation Format" section of the documentation
- [ ] Add an appropriate choice of options to each preset in `docs/presets/README.md` - [ ] Add an appropriate choice of options to each preset in `docs/presets/README.md`
- [ ] Create configs structs/traits in `src/configs/<module>.rs` and add the - [ ] Create configs structs/traits in `src/configs/<module>.rs` and add the
@ -250,4 +261,4 @@ everyone remember what they are. Don't worry: most of them are quite simple!
Finally, you should make sure to write your module's code in `src/modules` Finally, you should make sure to write your module's code in `src/modules`
and add any commands that need to be mocked when testing in `src/utils.rs`. and add any commands that need to be mocked when testing in `src/utils.rs`.
Command output can also be mocked in test by using `ModuleRenderer::cmd`. Command output can also be mocked in test by using `ModuleRenderer::cmd`.

View File

@ -1,21 +1,21 @@
[package] [package]
name = "starship" name = "starship"
version = "1.2.1" version = "1.2.1"
edition = "2021"
authors = ["Starship Contributors"] authors = ["Starship Contributors"]
homepage = "https://starship.rs"
documentation = "https://starship.rs/guide/"
repository = "https://github.com/starship/starship"
readme = "README.md"
license = "ISC"
keywords = ["prompt", "shell", "bash", "fish", "zsh"]
categories = ["command-line-utilities"]
build = "build.rs" build = "build.rs"
categories = ["command-line-utilities"]
documentation = "https://starship.rs/guide/"
edition = "2021"
homepage = "https://starship.rs"
# Keep `/` in front of `README.md` to exclude localized readmes
include = ["src/**/*", "build.rs", "Cross.toml", "LICENSE", "README.md"]
keywords = ["prompt", "shell", "bash", "fish", "zsh"]
license = "ISC"
readme = "README.md"
repository = "https://github.com/starship/starship"
description = """ description = """
The minimal, blazing-fast, and infinitely customizable prompt for any shell! 🌌 The minimal, blazing-fast, and infinitely customizable prompt for any shell! 🌌
""" """
# Keep `/` in front of `README.md` to exclude localized readmes
include = ["src/**/*", "build.rs", "Cross.toml", "LICENSE", "README.md"]
[badges] [badges]
is-it-maintained-issue-resolution = { repository = "starship/starship" } is-it-maintained-issue-resolution = { repository = "starship/starship" }
@ -27,61 +27,55 @@ default = ["battery"]
battery = ["starship-battery"] battery = ["starship-battery"]
[dependencies] [dependencies]
ansi_term = "0.12.1"
byte-unit = "4.0.13"
chrono = "0.4.19"
clap = { version = "3.0.10", features = ["derive", "cargo", "unicode"] } clap = { version = "3.0.10", features = ["derive", "cargo", "unicode"] }
clap_complete = "3.0.4" clap_complete = "3.0.4"
ansi_term = "0.12.1"
directories-next = "2.0.0" directories-next = "2.0.0"
gethostname = "0.2.2"
git2 = { version = "0.13.25", default-features = false } git2 = { version = "0.13.25", default-features = false }
toml = { version = "0.5.8", features = ["preserve_order"] } indexmap = { version = "1.8.0", features = ["serde"] }
rust-ini = "0.17.0"
serde_json = "1.0.75"
rayon = "1.5.1"
log = { version = "0.4.14", features = ["std"] } log = { version = "0.4.14", features = ["std"] }
notify-rust = { version = "4.5.5", optional = true }
once_cell = "1.9.0"
open = "2.0.2"
os_info = "3.1.0"
path-slash = "0.1.4"
pest = "2.1.3"
pest_derive = "2.1.0"
quick-xml = "0.22.0"
rand = "0.8.4"
rayon = "1.5.1"
regex = "1.5.4"
rust-ini = "0.17.0"
semver = "1.0.4"
serde = { version = "1.0.133", features = ["derive"] }
serde_json = "1.0.75"
sha-1 = "0.10.0"
shadow-rs = "0.8.1"
# battery is optional (on by default) because the crate doesn't currently build for Termux # battery is optional (on by default) because the crate doesn't currently build for Termux
# see: https://github.com/svartalf/rust-battery/issues/33 # see: https://github.com/svartalf/rust-battery/issues/33
starship-battery = { version = "0.7.9", optional = true } starship-battery = { version = "0.7.9", optional = true }
path-slash = "0.1.4"
unicode-segmentation = "1.8.0"
gethostname = "0.2.2"
once_cell = "1.9.0"
chrono = "0.4.19"
sys-info = "0.9.1"
byte-unit = "4.0.13"
starship_module_config_derive = { version = "0.2.1", path = "starship_module_config_derive" } starship_module_config_derive = { version = "0.2.1", path = "starship_module_config_derive" }
yaml-rust = "0.4.5"
pest = "2.1.3"
pest_derive = "2.1.0"
regex = "1.5.4"
os_info = "3.1.0"
urlencoding = "2.1.0"
open = "2.0.2"
unicode-width = "0.1.9"
terminal_size = "0.1.17"
quick-xml = "0.22.0"
rand = "0.8.4"
serde = { version = "1.0.133", features = ["derive"] }
indexmap = { version ="1.8.0", features = ["serde"] }
notify-rust = { version = "4.5.5", optional = true }
semver = "1.0.4"
which = "4.2.2"
shadow-rs = "0.8.1"
versions = "4.0.0"
strsim = "0.10.0" strsim = "0.10.0"
sha-1 = "0.10.0" sys-info = "0.9.1"
terminal_size = "0.1.17"
toml = { version = "0.5.8", features = ["preserve_order"] }
toml_edit = "0.13.0" toml_edit = "0.13.0"
unicode-segmentation = "1.8.0"
unicode-width = "0.1.9"
urlencoding = "2.1.0"
versions = "4.0.0"
which = "4.2.2"
yaml-rust = "0.4.5"
process_control = { version = "3.2.1", features = ["crossbeam-channel"] } process_control = { version = "3.2.1", features = ["crossbeam-channel"] }
shell-words = "1.0.0" shell-words = "1.0.0"
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.9", features = [ winapi = { version = "0.3.9", features = ["winuser", "securitybaseapi", "processthreadsapi", "handleapi", "impl-default"] }
"winuser",
"securitybaseapi",
"processthreadsapi",
"handleapi",
"impl-default",
] }
[target.'cfg(not(windows))'.dependencies] [target.'cfg(not(windows))'.dependencies]
nix = "0.23.1" nix = "0.23.1"
@ -90,8 +84,8 @@ nix = "0.23.1"
shadow-rs = "0.8.1" shadow-rs = "0.8.1"
[dev-dependencies] [dev-dependencies]
tempfile = "3.2.0"
mockall = "0.11" mockall = "0.11"
tempfile = "3.2.0"
[profile.release] [profile.release]
codegen-units = 1 codegen-units = 1

View File

@ -328,9 +328,9 @@ Add the following to the end of your Nushell configuration (find it by running `
```toml ```toml
startup = [ startup = [
"mkdir ~/.cache/starship", "mkdir ~/.cache/starship",
"starship init nu | save ~/.cache/starship/init.nu", "starship init nu | save ~/.cache/starship/init.nu",
"source ~/.cache/starship/init.nu" "source ~/.cache/starship/init.nu",
] ]
prompt = "starship_prompt" prompt = "starship_prompt"
``` ```

View File

@ -1,6 +1,6 @@
disallowed-methods = [ disallowed-methods = [
# std::process::Command::new may inadvertly run executables from the current working directory # std::process::Command::new may inadvertly run executables from the current working directory
"std::process::Command::new", "std::process::Command::new",
# Setting environment variables can cause issues with non-rust code # Setting environment variables can cause issues with non-rust code
"std::env::set_var" "std::env::set_var",
] ]

View File

@ -1,342 +1,352 @@
module.exports = { module.exports = {
locales: {
"/": {
lang: "en-US",
title: "Starship",
description: "The minimal, blazing-fast, and infinitely customizable prompt for any shell!"
},
"/de-DE/": {
lang: "de-DE",
title: "Starship",
description: "Minimale, super schnelle und unendlich anpassbare Prompt für jede Shell!"
},
"/es-ES/": {
lang: "es-ES",
title: "Starship",
description: "¡El prompt minimalista, ultrarápido e infinitamente personalizable para cualquier intérprete de comandos!"
},
"/fr-FR/": {
lang: "fr-FR",
title: "Starship",
description: "L'invite minimaliste, ultra-rapide et personnalisable à l'infini pour n'importe quel shell !"
},
"/id-ID/": {
lang: "id-ID",
title: "Starship",
description: "Prompt yang minimal, super cepat, dan dapat disesuaikan tanpa batas untuk shell apa pun!"
},
"/it-IT/": {
lang: "it-IT",
title: "Starship",
description: "Il prompt minimalista, super veloce e infinitamente personalizzabile per qualsiasi shell!"
},
"/ja-JP/": {
lang: "ja-JP",
title: "Starship",
description: "シェル用の最小限の、非常に高速で、無限にカスタマイズ可能なプロンプトです!"
},
"/pt-BR/": {
lang: "pt-BR",
title: "Starship",
description: "O prompt minimalista, extremamente rápido e infinitamente personalizável para qualquer shell!"
},
"/ru-RU/": {
lang: "ru-RU",
title: "Starship",
description: "Минималистичная, быстрая и бесконечно настраиваемая командная строка для любой оболочки!"
},
"/vi-VN/": {
lang: "vi-VN",
title: "Starship",
description: "Nhỏ gọn, cực nhanh, và khả năng tuỳ chỉnh vô hạn prompt cho bất kì shell nào!"
},
"/zh-CN/": {
lang: "zh-CN",
title: "Starship",
description: "轻量级、反应迅速,可定制的高颜值终端!"
},
"/zh-TW/": {
lang: "zh-TW",
title: "Starship",
description: "適合任何 shell 的最小、極速、無限客製化的提示字元!"
}
},
// prettier-ignore
head: [
["link", { rel: "icon", href: "/icon.png" }],
["meta", { property: "og:title", content: "Starship: Cross-Shell Prompt" }],
["meta", { property: "og:description", content: "Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and Powershell."}],
["meta", { property: "og:type", content: "website" }],
["meta", { property: "og:url", content: "https://starship.rs/" }],
["meta", { property: "og:image", content: "https://starship.rs/icon.png" }],
["meta", { name: "twitter:card", content: "summary"}],
["meta", { name: "twitter:title", content: "Starship: Cross-Shell Prompt"}],
["meta", { name: "twitter:description", content: "Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and Powershell."}],
["meta", { name: "twitter:image", content: "https://starship.rs/icon.png"}],
["meta", { name: "twitter:alt", content: "Starship: Cross-Shell Prompt"}],
],
theme: "default-prefers-color-scheme",
themeConfig: {
logo: "/icon.png",
// the GitHub repo path
repo: "starship/starship",
// the label linking to the repo
repoLabel: "GitHub",
// if your docs are not at the root of the repo:
docsDir: "docs",
// defaults to false, set to true to enable
editLinks: true,
// enables Algolia DocSearch
algolia: {
apiKey: "44118471f56286dcda7db941a043370d",
indexName: "starship",
appId: "M3XUO3SQOR"
},
locales: { locales: {
"/": { "/": {
// text for the language dropdown lang: "en-US",
selectText: "Languages", title: "Starship",
// label for this locale in the language dropdown description: "The minimal, blazing-fast, and infinitely customizable prompt for any shell!",
label: "English", },
// Custom text for edit link. Defaults to "Edit this page" "/de-DE/": {
editLinkText: "Edit this page on GitHub", lang: "de-DE",
// Custom navbar values title: "Starship",
nav: [{ text: "Configuration", link: "/config/" }], description: "Minimale, super schnelle und unendlich anpassbare Prompt für jede Shell!",
// Custom sidebar values },
sidebar: [ "/es-ES/": {
"/", lang: "es-ES",
["/guide/", "Guide"], title: "Starship",
["/installing/", "Advanced Installation"], description:
["/config/", "Configuration"], "¡El prompt minimalista, ultrarápido e infinitamente personalizable para cualquier intérprete de comandos!",
["/advanced-config/", "Advanced Configuration"], },
["/faq/", "Frequently Asked Questions"], "/fr-FR/": {
["/presets/", "Presets"], lang: "fr-FR",
["/migrating-to-0.45.0/", "Migrating to v0.45.0"] title: "Starship",
] description: "L'invite minimaliste, ultra-rapide et personnalisable à l'infini pour n'importe quel shell !",
}, },
"/de-DE/": { "/id-ID/": {
// text for the language dropdown lang: "id-ID",
selectText: "Sprachen", title: "Starship",
// label for this locale in the language dropdown description: "Prompt yang minimal, super cepat, dan dapat disesuaikan tanpa batas untuk shell apa pun!",
label: "Deutsch", },
// Custom text for edit link. Defaults to "Edit this page" "/it-IT/": {
editLinkText: "Bearbeite diese Seite auf GitHub", lang: "it-IT",
// Custom navbar values title: "Starship",
nav: [{ text: "Konfiguration", link: "/config/" }], description: "Il prompt minimalista, super veloce e infinitamente personalizzabile per qualsiasi shell!",
// Custom sidebar values },
sidebar: [ "/ja-JP/": {
"/de-DE/", lang: "ja-JP",
["/de-DE/guide/", "Anleitung"], title: "Starship",
["/de-DE/config/", "Konfiguration"], description: "シェル用の最小限の、非常に高速で、無限にカスタマイズ可能なプロンプトです!",
["/de-DE/advanced-config/", "Erweiterte Konfiguration"], },
["/de-DE/faq/", "Häufig gestellte Fragen"], "/pt-BR/": {
["/de-DE/presets/", "Konfigurations-Beispiele"] lang: "pt-BR",
] title: "Starship",
}, description:
"/es-ES/": { "O prompt minimalista, extremamente rápido e infinitamente personalizável para qualquer shell!",
// text for the language dropdown },
selectText: "Idiomas", "/ru-RU/": {
// label for this locale in the language dropdown lang: "ru-RU",
label: "Español", title: "Starship",
// Custom text for edit link. Defaults to "Edit this page" description: "Минималистичная, быстрая и бесконечно настраиваемая командная строка для любой оболочки!",
editLinkText: "Edita esta página en GitHub", },
// Custom navbar values "/vi-VN/": {
nav: [{ text: "Configuración", link: "/es-ES/config/" }], lang: "vi-VN",
// Custom sidebar values title: "Starship",
sidebar: [ description: "Nhỏ gọn, cực nhanh, và khả năng tuỳ chỉnh vô hạn prompt cho bất kì shell nào!",
"/es-ES/", },
["/es-ES/guide/", "Guía"], "/zh-CN/": {
["/es-ES/config/", "Configuración"], lang: "zh-CN",
["/es-ES/advanced-config/", "Configuración Avanzada"], title: "Starship",
["/es-ES/faq/", "Preguntas frecuentes"], description: "轻量级、反应迅速,可定制的高颜值终端!",
["/es-ES/presets/", "Ajustes predeterminados"] },
] "/zh-TW/": {
}, lang: "zh-TW",
"/fr-FR/": { title: "Starship",
// text for the language dropdown description: "適合任何 shell 的最小、極速、無限客製化的提示字元!",
selectText: "Langues", },
// label for this locale in the language dropdown
label: "Français",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "Éditez cette page sur GitHub",
// Custom navbar values
nav: [{ text: "Configuration", link: "/fr-FR/config/" }],
// Custom sidebar values
sidebar: [
"/fr-FR/",
["/fr-FR/guide/", "Guide"],
["/fr-FR/config/", "Configuration"],
["/fr-FR/advanced-config/", "Configuration avancée"],
["/fr-FR/faq/", "Foire aux questions"],
["/fr-FR/presets/", "Paramètres par défaut"]
]
},
"/id-ID/": {
// text for the language dropdown
selectText: "Languages",
// label for this locale in the language dropdown
label: "Bahasa Indonesia",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "Sunting halaman ini di Github",
// Custom navbar values
nav: [{ text: "Konfigurasi", link: "/id-ID/config/" }],
// Custom sidebar values
sidebar: [
"/id-ID/",
["/id-ID/guide/", "Petunjuk"],
["/id-ID/config/", "Konfigurasi"],
["/id-ID/advanced-config/", "Konfigurasi Lanjutan"],
["/id-ID/faq/", "Pertanyaan Umum"],
["/id-ID/presets/", "Prasetel"]
]
},
"/it-IT/": {
// text for the language dropdown
selectText: "Languages",
// label for this locale in the language dropdown
label: "Italiano",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "Modifica questa pagina in Github",
// Custom navbar values
nav: [{ text: "Configuration", link: "/it-IT/config/" }],
// Custom sidebar values
sidebar: [
"/it-IT/",
["/it-IT/guide/", "Guide"],
["/it-IT/config/", "Configurazione"],
["/it-IT/advanced-config/", "Configurazione Avanzata"],
["/it-IT/faq/", "FAQ"],
["/it-IT/presets/", "Preset"]
]
},
"/ja-JP/": {
// text for the language dropdown
selectText: "言語",
// label for this locale in the language dropdown
label: "日本語",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "GitHub で編集する",
// Custom navbar values
nav: [{ text: "設定", link: "/ja-JP/config/" }],
// Custom sidebar values
sidebar: [
"/ja-JP/",
["/ja-JP/guide/", "ガイド"],
["/ja-JP/config/", "設定"],
["/ja-JP/advanced-config/", "高度な設定"],
["/ja-JP/faq/", "FAQ"],
["/ja-JP/presets/", "準備するもの"],
["/ja-JP/migrating-to-0.45.0/", "v0.45への移行"]
]
},
"/pt-BR/": {
// text for the language dropdown
selectText: "Languages",
// label for this locale in the language dropdown
label: "Português do Brasil",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "Edite esta página no Github",
// Custom navbar values
nav: [{ text: "Configuração", link: "/pt-BR/config/" }],
// Custom sidebar values
sidebar: [
"/pt-BR/",
["/pt-BR/guide/", "Guia"],
["/pt-BR/config/", "Configuração"],
["/pt-BR/advanced-config/", "Configuração avançada"],
["/pt-BR/faq/", "Perguntas frequentes"],
["/pt-BR/presets/", "Predefinições"]
]
},
"/ru-RU/": {
// text for the language dropdown
selectText: "Языки",
// label for this locale in the language dropdown
label: "Русский",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "Редактировать эту страницу на GitHub",
// Custom navbar values
nav: [{ text: "Настройка", link: "/ru-RU/config/" }],
// Custom sidebar values
sidebar: [
"/ru-RU/",
["/ru-RU/guide/", "Руководство"],
["/ru-RU/config/", "Настройка"],
["/ru-RU/advanced-config/", "Расширенная Настройка"],
["/ru-RU/faq/", "Часто Задаваемые Вопросы"],
["/ru-RU/presets/", "Предустановки"]
]
},
"/vi-VN/": {
// text for the language dropdown
selectText: "Ngôn ngữ",
// label for this locale in the language dropdown
label: "Tiếng Việt",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "Chỉnh sửa trang này trên GitHub",
// Custom navbar values
nav: [{ text: "Cấu hình", link: "/vi-VN/config/" }],
// Custom sidebar values
sidebar: [
"/vi-VN/",
["/vi-VN/guide/", "Hướng dẫn"],
["/vi-VN/config/", "Cấu hình"],
["/vi-VN/advanced-config/", "Cấu hình nâng cao"],
["/vi-VN/faq/", "Các hỏi thường gặp"],
["/vi-VN/presets/", "Mẫu thiết lập"]
]
}
}, },
"/zh-TW/": { // prettier-ignore
// text for the language dropdown head: [
selectText: "語言", ["link", { rel: "icon", href: "/icon.png" }],
// label for this locale in the language dropdown ["meta", { property: "og:title", content: "Starship: Cross-Shell Prompt" }],
label: "繁體中文", ["meta", {
// Custom text for edit link. Defaults to "Edit this page" property: "og:description",
editLinkText: "在 GitHub 上修改此頁面", content:
// Custom navbar values "Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and Powershell.",
nav: [{ text: "設定", link: "/zh-TW/config/" }], }],
// Custom sidebar values ["meta", { property: "og:type", content: "website" }],
sidebar: [ ["meta", { property: "og:url", content: "https://starship.rs/" }],
"/zh-TW/", ["meta", { property: "og:image", content: "https://starship.rs/icon.png" }],
["/zh-TW/guide/", "指引"], ["meta", { name: "twitter:card", content: "summary" }],
["/zh-TW/config/", "設定"], ["meta", { name: "twitter:title", content: "Starship: Cross-Shell Prompt" }],
["/zh-TW/advanced-config/", "進階設定"] ["meta", {
] name: "twitter:description",
content:
"Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and Powershell.",
}],
["meta", { name: "twitter:image", content: "https://starship.rs/icon.png" }],
["meta", { name: "twitter:alt", content: "Starship: Cross-Shell Prompt" }],
],
theme: "default-prefers-color-scheme",
themeConfig: {
logo: "/icon.png",
// the GitHub repo path
repo: "starship/starship",
// the label linking to the repo
repoLabel: "GitHub",
// if your docs are not at the root of the repo:
docsDir: "docs",
// defaults to false, set to true to enable
editLinks: true,
// enables Algolia DocSearch
algolia: {
apiKey: "44118471f56286dcda7db941a043370d",
indexName: "starship",
appId: "M3XUO3SQOR",
},
locales: {
"/": {
// text for the language dropdown
selectText: "Languages",
// label for this locale in the language dropdown
label: "English",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "Edit this page on GitHub",
// Custom navbar values
nav: [{ text: "Configuration", link: "/config/" }],
// Custom sidebar values
sidebar: [
"/",
["/guide/", "Guide"],
["/installing/", "Advanced Installation"],
["/config/", "Configuration"],
["/advanced-config/", "Advanced Configuration"],
["/faq/", "Frequently Asked Questions"],
["/presets/", "Presets"],
["/migrating-to-0.45.0/", "Migrating to v0.45.0"],
],
},
"/de-DE/": {
// text for the language dropdown
selectText: "Sprachen",
// label for this locale in the language dropdown
label: "Deutsch",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "Bearbeite diese Seite auf GitHub",
// Custom navbar values
nav: [{ text: "Konfiguration", link: "/config/" }],
// Custom sidebar values
sidebar: [
"/de-DE/",
["/de-DE/guide/", "Anleitung"],
["/de-DE/config/", "Konfiguration"],
["/de-DE/advanced-config/", "Erweiterte Konfiguration"],
["/de-DE/faq/", "Häufig gestellte Fragen"],
["/de-DE/presets/", "Konfigurations-Beispiele"],
],
},
"/es-ES/": {
// text for the language dropdown
selectText: "Idiomas",
// label for this locale in the language dropdown
label: "Español",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "Edita esta página en GitHub",
// Custom navbar values
nav: [{ text: "Configuración", link: "/es-ES/config/" }],
// Custom sidebar values
sidebar: [
"/es-ES/",
["/es-ES/guide/", "Guía"],
["/es-ES/config/", "Configuración"],
["/es-ES/advanced-config/", "Configuración Avanzada"],
["/es-ES/faq/", "Preguntas frecuentes"],
["/es-ES/presets/", "Ajustes predeterminados"],
],
},
"/fr-FR/": {
// text for the language dropdown
selectText: "Langues",
// label for this locale in the language dropdown
label: "Français",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "Éditez cette page sur GitHub",
// Custom navbar values
nav: [{ text: "Configuration", link: "/fr-FR/config/" }],
// Custom sidebar values
sidebar: [
"/fr-FR/",
["/fr-FR/guide/", "Guide"],
["/fr-FR/config/", "Configuration"],
["/fr-FR/advanced-config/", "Configuration avancée"],
["/fr-FR/faq/", "Foire aux questions"],
["/fr-FR/presets/", "Paramètres par défaut"],
],
},
"/id-ID/": {
// text for the language dropdown
selectText: "Languages",
// label for this locale in the language dropdown
label: "Bahasa Indonesia",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "Sunting halaman ini di Github",
// Custom navbar values
nav: [{ text: "Konfigurasi", link: "/id-ID/config/" }],
// Custom sidebar values
sidebar: [
"/id-ID/",
["/id-ID/guide/", "Petunjuk"],
["/id-ID/config/", "Konfigurasi"],
["/id-ID/advanced-config/", "Konfigurasi Lanjutan"],
["/id-ID/faq/", "Pertanyaan Umum"],
["/id-ID/presets/", "Prasetel"],
],
},
"/it-IT/": {
// text for the language dropdown
selectText: "Languages",
// label for this locale in the language dropdown
label: "Italiano",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "Modifica questa pagina in Github",
// Custom navbar values
nav: [{ text: "Configuration", link: "/it-IT/config/" }],
// Custom sidebar values
sidebar: [
"/it-IT/",
["/it-IT/guide/", "Guide"],
["/it-IT/config/", "Configurazione"],
["/it-IT/advanced-config/", "Configurazione Avanzata"],
["/it-IT/faq/", "FAQ"],
["/it-IT/presets/", "Preset"],
],
},
"/ja-JP/": {
// text for the language dropdown
selectText: "言語",
// label for this locale in the language dropdown
label: "日本語",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "GitHub で編集する",
// Custom navbar values
nav: [{ text: "設定", link: "/ja-JP/config/" }],
// Custom sidebar values
sidebar: [
"/ja-JP/",
["/ja-JP/guide/", "ガイド"],
["/ja-JP/config/", "設定"],
["/ja-JP/advanced-config/", "高度な設定"],
["/ja-JP/faq/", "FAQ"],
["/ja-JP/presets/", "準備するもの"],
["/ja-JP/migrating-to-0.45.0/", "v0.45への移行"],
],
},
"/pt-BR/": {
// text for the language dropdown
selectText: "Languages",
// label for this locale in the language dropdown
label: "Português do Brasil",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "Edite esta página no Github",
// Custom navbar values
nav: [{ text: "Configuração", link: "/pt-BR/config/" }],
// Custom sidebar values
sidebar: [
"/pt-BR/",
["/pt-BR/guide/", "Guia"],
["/pt-BR/config/", "Configuração"],
["/pt-BR/advanced-config/", "Configuração avançada"],
["/pt-BR/faq/", "Perguntas frequentes"],
["/pt-BR/presets/", "Predefinições"],
],
},
"/ru-RU/": {
// text for the language dropdown
selectText: "Языки",
// label for this locale in the language dropdown
label: "Русский",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "Редактировать эту страницу на GitHub",
// Custom navbar values
nav: [{ text: "Настройка", link: "/ru-RU/config/" }],
// Custom sidebar values
sidebar: [
"/ru-RU/",
["/ru-RU/guide/", "Руководство"],
["/ru-RU/config/", "Настройка"],
["/ru-RU/advanced-config/", "Расширенная Настройка"],
["/ru-RU/faq/", "Часто Задаваемые Вопросы"],
["/ru-RU/presets/", "Предустановки"],
],
},
"/vi-VN/": {
// text for the language dropdown
selectText: "Ngôn ngữ",
// label for this locale in the language dropdown
label: "Tiếng Việt",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "Chỉnh sửa trang này trên GitHub",
// Custom navbar values
nav: [{ text: "Cấu hình", link: "/vi-VN/config/" }],
// Custom sidebar values
sidebar: [
"/vi-VN/",
["/vi-VN/guide/", "Hướng dẫn"],
["/vi-VN/config/", "Cấu hình"],
["/vi-VN/advanced-config/", "Cấu hình nâng cao"],
["/vi-VN/faq/", "Các hỏi thường gặp"],
["/vi-VN/presets/", "Mẫu thiết lập"],
],
},
},
"/zh-TW/": {
// text for the language dropdown
selectText: "語言",
// label for this locale in the language dropdown
label: "繁體中文",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "在 GitHub 上修改此頁面",
// Custom navbar values
nav: [{ text: "設定", link: "/zh-TW/config/" }],
// Custom sidebar values
sidebar: [
"/zh-TW/",
["/zh-TW/guide/", "指引"],
["/zh-TW/config/", "設定"],
["/zh-TW/advanced-config/", "進階設定"],
],
},
"/zh-CN/": {
// text for the language dropdown
selectText: "语言",
// label for this locale in the language dropdown
label: "简体中文",
// Custom text for edit link. Defaults to "Edit this page"
editLinkText: "在 GitHub 上修改此页",
// Custom navbar values
nav: [{ text: "配置", link: "/zh-CN/config/" }],
// Custom sidebar values
sidebar: [
"/zh-CN/",
["/zh-CN/guide/", "指南"],
["/zh-CN/config/", "配置"],
["/zh-CN/advanced-config/", "高级配置"],
["/zh-CN/faq/", "常见问题"],
["/zh-CN/presets/", "社区配置分享"],
],
},
}, },
"/zh-CN/": { plugins: [
// text for the language dropdown [
selectText: "语言", "@vuepress/google-analytics",
// label for this locale in the language dropdown {
label: "简体中文", ga: "UA-71160903-4",
// Custom text for edit link. Defaults to "Edit this page" },
editLinkText: "在 GitHub 上修改此页", ],
// Custom navbar values [
nav: [{ text: "配置", link: "/zh-CN/config/" }], "sitemap",
// Custom sidebar values {
sidebar: [ hostname: "https://starship.rs",
"/zh-CN/", },
["/zh-CN/guide/", "指南"], ],
["/zh-CN/config/", "配置"], ["vuepress-plugin-code-copy", true],
["/zh-CN/advanced-config/", "高级配置"],
["/zh-CN/faq/", "常见问题"],
["/zh-CN/presets/", "社区配置分享"]
]
}
},
plugins: [
[
"@vuepress/google-analytics",
{
ga: "UA-71160903-4"
}
], ],
[
"sitemap",
{
hostname: "https://starship.rs"
}
],
['vuepress-plugin-code-copy', true]
]
}; };

View File

@ -142,9 +142,9 @@ description: Starship is the minimal, blazing fast, and extremely customizable p
```toml ```toml
startup = [ startup = [
"mkdir ~/.cache/starship", "mkdir ~/.cache/starship",
"starship init nu | save ~/.cache/starship/init.nu", "starship init nu | save ~/.cache/starship/init.nu",
"source ~/.cache/starship/init.nu" "source ~/.cache/starship/init.nu",
] ]
prompt = "starship_prompt" prompt = "starship_prompt"
``` ```

View File

@ -62,7 +62,7 @@ starship_precmd_user_func="blastoff"
- To run a custom function right before a command runs, you can use the - To run a custom function right before a command runs, you can use the
[`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/). [`DEBUG` trap mechanism](https://jichu4n.com/posts/debug-trap-and-prompt_command-in-bash/).
However, you **must** trap the DEBUG signal *before* initializing Starship! However, you **must** trap the DEBUG signal _before_ initializing Starship!
Starship can preserve the value of the DEBUG trap, but if the trap is overwritten Starship can preserve the value of the DEBUG trap, but if the trap is overwritten
after starship starts up, some functionality will break. after starship starts up, some functionality will break.
@ -193,9 +193,9 @@ Note: `continuation_prompt` should be set to a literal string without any variab
Note: Continuation prompts are only available in the following shells: Note: Continuation prompts are only available in the following shells:
- `bash` - `bash`
- `zsh` - `zsh`
- `PowerShell` - `PowerShell`
### Example ### Example
@ -210,15 +210,15 @@ continuation_prompt = "▶▶"
Style strings are a list of words, separated by whitespace. The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). Each word can be one of the following: Style strings are a list of words, separated by whitespace. The words are not case sensitive (i.e. `bold` and `BoLd` are considered the same string). Each word can be one of the following:
- `bold` - `bold`
- `italic` - `italic`
- `underline` - `underline`
- `dimmed` - `dimmed`
- `inverted` - `inverted`
- `bg:<color>` - `bg:<color>`
- `fg:<color>` - `fg:<color>`
- `<color>` - `<color>`
- `none` - `none`
where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter. where `<color>` is a color specifier (discussed below). `fg:<color>` and `<color>` currently do the same thing, though this may change in the future. `inverted` swaps the background and foreground colors. The order of words in the string does not matter.
@ -226,11 +226,11 @@ The `none` token overrides all other tokens in a string if it is not part of a `
A color specifier can be one of the following: A color specifier can be one of the following:
- One of the standard terminal colors: `black`, `red`, `green`, `blue`, - One of the standard terminal colors: `black`, `red`, `green`, `blue`,
`yellow`, `purple`, `cyan`, `white`. You can optionally prefix these `yellow`, `purple`, `cyan`, `white`. You can optionally prefix these
with `bright-` to get the bright version (e.g. `bright-white`). with `bright-` to get the bright version (e.g. `bright-white`).
- A `#` followed by a six-digit hexadecimal number. This specifies an - A `#` followed by a six-digit hexadecimal number. This specifies an
[RGB color hex code](https://www.w3schools.com/colors/colors_hexadecimal.asp). [RGB color hex code](https://www.w3schools.com/colors/colors_hexadecimal.asp).
- A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png). - A number between 0-255. This specifies an [8-bit ANSI Color Code](https://i.stack.imgur.com/KTSQa.png).
If multiple colors are specified for foreground/background, the last one in the string will take priority. If multiple colors are specified for foreground/background, the last one in the string will take priority.

File diff suppressed because it is too large Load Diff

View File

@ -63,8 +63,7 @@ prompt, for example the version of a program or the current git status. To make
sure starship doesn't hang while trying to execute these commands we set a time sure starship doesn't hang while trying to execute these commands we set a time
limit, if a command takes longer than this limit starship will stop the limit, if a command takes longer than this limit starship will stop the
execution of the command and output the above warning, this is expected execution of the command and output the above warning, this is expected
behaviour. This time limit is configurable using the [`command_timeout` behaviour. This time limit is configurable using the [`command_timeout`key](/config/#prompt) so if you want you can increase the time limit. You can
key](/config/#prompt) so if you want you can increase the time limit. You can
also follow the debugging steps below to see which command is being slow and also follow the debugging steps below to see which command is being slow and
see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to see if you can optimise it. Finally you can set the `STARSHIP_LOG` env var to
`error` to hide these warnings. `error` to hide these warnings.

View File

@ -17,7 +17,7 @@ out!
### Prerequisites ### Prerequisites
Head over to the [Chocolatey installation page](https://chocolatey.org/install) and follow the instructions to install Chocolatey. Head over to the [Chocolatey installation page](https://chocolatey.org/install) and follow the instructions to install Chocolatey.
### Installation ### Installation

View File

@ -109,7 +109,7 @@ To configure the prompt to use the older `use_symbol_for_status = true` configur
error_symbol = "[✖](bold red)" error_symbol = "[✖](bold red)"
``` ```
*Note:* The `character` element automatically adds a space after, so unlike the other `format` strings, we specifically do not add one in the above examples. _Note:_ The `character` element automatically adds a space after, so unlike the other `format` strings, we specifically do not add one in the above examples.
#### Command Duration #### Command Duration

View File

@ -1,19 +1,19 @@
[package] [package]
name = "starship_module_config_derive" name = "starship_module_config_derive"
version = "0.2.1" version = "0.2.1"
edition = "2021"
authors = ["Matan Kushner <hello@matchai.me>"] authors = ["Matan Kushner <hello@matchai.me>"]
homepage = "https://starship.rs"
documentation = "https://starship.rs/guide/"
repository = "https://github.com/starship/starship"
readme = "README.md"
license = "ISC"
keywords = ["prompt", "shell", "bash", "fish", "zsh"]
categories = ["command-line-utilities"] categories = ["command-line-utilities"]
documentation = "https://starship.rs/guide/"
edition = "2021"
homepage = "https://starship.rs"
include = ["src/**/*", "LICENSE", "README.md"]
keywords = ["prompt", "shell", "bash", "fish", "zsh"]
license = "ISC"
readme = "README.md"
repository = "https://github.com/starship/starship"
description = """ description = """
The minimal, blazing-fast, and infinitely customizable prompt for any shell! 🌌 The minimal, blazing-fast, and infinitely customizable prompt for any shell! 🌌
""" """
include = ["src/**/*", "LICENSE", "README.md"]
[lib] [lib]
name = "starship_module_config_derive" name = "starship_module_config_derive"