From 94880ba903a8ff562f2b077b9e9d47e4da185296 Mon Sep 17 00:00:00 2001 From: voyage200 Date: Sat, 23 Aug 2025 22:55:15 +0800 Subject: [PATCH] Fix tip breaking content layout in some file --- book/3rdpartyprompts.md | 7 ++++--- book/how_nushell_code_gets_run.md | 10 +++++++--- book/sorting.md | 3 ++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/book/3rdpartyprompts.md b/book/3rdpartyprompts.md index 22eaa144ea0..615ce95ed8d 100644 --- a/book/3rdpartyprompts.md +++ b/book/3rdpartyprompts.md @@ -7,8 +7,8 @@ Nerd Fonts are not required, but they can improve the prompt presentation throug > Nerd Fonts patches developer targeted fonts with a high number of glyphs (icons). > Specifically to add a high number of extra glyphs from popular ‘iconic fonts’ such as Font Awesome, Devicons, Octicons, and others. -* [Nerd Fonts website](https://www.nerdfonts.com) -* [Source Repository](https://github.com/ryanoasis/nerd-fonts) +- [Nerd Fonts website](https://www.nerdfonts.com) +- [Source Repository](https://github.com/ryanoasis/nerd-fonts) ## oh-my-posh @@ -66,7 +66,8 @@ Starship running without doing anything manual: - Starship will create its own configuration / environment setup script - you simply have to create it in `env.nu` and `use` it in `config.nu` - ::: + +::: Here's an example config section for Starship: diff --git a/book/how_nushell_code_gets_run.md b/book/how_nushell_code_gets_run.md index 40305f00436..f3978687eb8 100644 --- a/book/how_nushell_code_gets_run.md +++ b/book/how_nushell_code_gets_run.md @@ -6,6 +6,7 @@ next: text: (Not so) Advanced link: /book/advanced.md --- + # How Nushell Code Gets Run In [Thinking in Nu](./thinking_in_nu.md#think-of-nushell-as-a-compiled-language), we encouraged you to _"Think of Nushell as a compiled language"_ due to the way in which Nushell code is processed. We also covered several code examples that won't work in Nushell due that process. @@ -281,7 +282,8 @@ In the text below, we use the term _"constant"_ to refer to: - A `const` definition - The result of any command that outputs a constant value when provide constant inputs. - ::: + +::: By their nature, **_constants_** and constant values are known at Parse-time. This, of course, is in sharp contrast to _variable_ declarations and values. @@ -317,7 +319,8 @@ Let's analyze the Parse/Eval process for this version: - An `eval` adds additional parsing during evaluation - Parse-time constants do the opposite, adding additional evaluation to the parser. - ::: + +::: Also keep in mind that the evaluation allowed during parsing is **_very restricted_**. It is limited to only a small subset of what is allowed during a regular evaluation. @@ -364,7 +367,8 @@ There are two reasons for this: This isn't currently applicable to Nushell, since the parsed results (IR) are not stored beyond Evaluation. However, this has certainly been considered as a possible future feature. 2. As with Nushell's parse-time constant evaluations, these features help (safely) work around limitations caused by the absence of an `eval` function. - ::: + +::: ## Conclusion diff --git a/book/sorting.md b/book/sorting.md index 4f2b6a388a5..2c4fc112f41 100644 --- a/book/sorting.md +++ b/book/sorting.md @@ -224,7 +224,8 @@ The parameters are also passed to the custom closure as a two element list, so t - `{|a, b| $a < $b }` - `{ $in.0 < $in.1 }` - ::: + +::: Here's an example of a custom sort which couldn't be trivially written as a key sort. In this example, we have a queue of tasks with some amount of work time and a priority. We want to sort by priority (highest first). If a task has had zero work time, we want to schedule it immediately; otherwise, we ignore the work time.