diff --git a/content/en/functions/fmt/Warnf.md b/content/en/functions/fmt/Warnf.md index 6b3547553..f4fa22474 100644 --- a/content/en/functions/fmt/Warnf.md +++ b/content/en/functions/fmt/Warnf.md @@ -22,6 +22,8 @@ The `warnf` function evaluates the format string, then prints the result to the {{ warnf "The %q shortcode was unable to find %s. See %s" .Name $file .Position }} ``` +Use the [`warnidf`] function to allow optional suppression of specific warnings. + To prevent suppression of duplicate messages when using `warnf` for debugging, make each message unique with the [`math.Counter`] function. For example: @@ -32,3 +34,5 @@ To prevent suppression of duplicate messages when using `warnf` for debugging, m ``` [`math.Counter`]: /functions/math/counter/ + +[`warnidf`]: /functions/fmt/warnidf/ diff --git a/data/page_filters.yaml b/data/page_filters.yaml index e4a9ee37a..a4969e9b7 100644 --- a/data/page_filters.yaml +++ b/data/page_filters.yaml @@ -12,6 +12,7 @@ functions_fmt_logging: - /functions/fmt/errorf - /functions/fmt/erroridf - /functions/fmt/warnf + - /functions/fmt/warnidf functions_images_no_filters: - /functions/images/filter - /functions/images/config