From 04155cb751bf3aab87a8fd2f6c2caf01a593024f Mon Sep 17 00:00:00 2001 From: sholderbach Date: Sun, 22 Dec 2024 22:44:02 +0100 Subject: [PATCH] Add comments --- make_release/release-note/notes.nu | 3 +++ 1 file changed, 3 insertions(+) diff --git a/make_release/release-note/notes.nu b/make_release/release-note/notes.nu index 37918703..b1bb26ed 100755 --- a/make_release/release-note/notes.nu +++ b/make_release/release-note/notes.nu @@ -74,6 +74,7 @@ export def write-toc [file: path] { get line | split chars | take while { $in == '#' } | length } | insert nocomment { + # We assume that comments only have one `#` if ($in.level != 1) { return true } @@ -83,6 +84,8 @@ export def write-toc [file: path] { if ($known_h1s | any {|| $line =~ $in}) { return true } + + # We don't know so let's ask let user = ([Ignore Accept] | input list $"Is this a code comment or a markdown h1 heading:(char nl)(ansi blue)($line)(ansi reset)(char nl)Choose if we include it in the TOC!") match $user {