From 89234e34e292861fccb8e5bdbefc695a7e443eea Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 9 Sep 2024 22:18:46 -0400 Subject: Document :by_line() --- docs/paths.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'docs') diff --git a/docs/paths.md b/docs/paths.md index f4cdb1f4..a2b7c519 100644 --- a/docs/paths.md +++ b/docs/paths.md @@ -88,6 +88,31 @@ The base name of the file or directory. --- +### `by_line` + +**Description:** +Returns an iterator that can be used to iterate over a file one line at a time. + +**Usage:** +```markdown +by_line(path: Path) -> func()->NextLine +``` + +**Parameters:** + +- `path`: The path of the file. + +**Returns:** +An iterator that can be used to get lines from a file one at a time. + +**Example:** +```markdown +for line in (/dev/stdin):by_line(): + say(line:upper()) +``` + +--- + ### `children` **Description:** -- cgit v1.2.3