From 1f61fd6be1127d5baf907ccede65673a693d5bec Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Sun, 31 Aug 2025 12:01:38 -0700 Subject: [PATCH] content: Add seed examples to collections.D --- assets/css/styles.css | 3 ++- content/en/functions/collections/D.md | 20 +++++++++++++++++--- content/en/quick-reference/glossary/seed.md | 6 ++++++ 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 content/en/quick-reference/glossary/seed.md diff --git a/assets/css/styles.css b/assets/css/styles.css index 4e77e5e03..17cfabfb5 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -131,6 +131,7 @@ body { } /* Code spans within paragraphs. */ -p > code { +p > code, +td > code { white-space: nowrap; } diff --git a/content/en/functions/collections/D.md b/content/en/functions/collections/D.md index 6bc6bbcef..f864888f3 100644 --- a/content/en/functions/collections/D.md +++ b/content/en/functions/collections/D.md @@ -11,10 +11,12 @@ params: {{< new-in 0.149.0 />}} -The `collections.D` function returns a slice of `N` sequentially ordered unique random integers in the half-open [interval](g) [0, `HIGH`) using the provided `SEED` value. This function implements J. S. Vitter's Method D[^1] for sequential random sampling, a fast and efficient algorithm for this task. +The `collections.D` function returns a slice of `N` sequentially ordered unique random integers in the half-open [interval](g) [0, `HIGH`) using the provided [`SEED`](g) value. This function implements J. S. Vitter's Method D[^1] for sequential random sampling, a fast and efficient algorithm for this task. See [this article][] for a detailed explanation. +## Examples + ```go-html-template {{ collections.D 6 7 42 }} → [4, 9, 10, 20, 22, 24, 41] ``` @@ -33,7 +35,7 @@ A common use case is the selection of random pages from a page collection. For e ```go-html-template