From 638c694de829074740ff30fc8d2edfc9c93db4a1 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Tue, 7 Nov 2023 13:56:49 -0700 Subject: [PATCH] Enhance Flux functions lists (#5221) * WIP flux function list * fix isset error with icon shortcode * Update content/flux/v0/spec/variables.md Co-authored-by: Jason Stirnaman --------- Co-authored-by: Jason Stirnaman --- assets/styles/layouts/article/_flux.scss | 11 +++++++++++ content/flux/v0/function-types.md | 4 ++++ content/flux/v0/spec/variables.md | 2 ++ content/flux/v0/stdlib/all-functions.md | 4 ++++ data/clockface.yml | 9 +++------ layouts/shortcodes/flux/list-all-functions.html | 9 +++++---- layouts/shortcodes/icon.html | 2 ++ 7 files changed, 31 insertions(+), 10 deletions(-) diff --git a/assets/styles/layouts/article/_flux.scss b/assets/styles/layouts/article/_flux.scss index 857fa8b30..05a8c4cae 100644 --- a/assets/styles/layouts/article/_flux.scss +++ b/assets/styles/layouts/article/_flux.scss @@ -12,6 +12,17 @@ h2,h3,h4 { } } +.function-list a.experimental::after { + content: '\e903'; + font-family: 'icomoon-v4'; + margin-left: .45rem; + color: rgba($article-text, .35); + // font-size: .75em; + font-style: normal; + display: inline-block; + vertical-align: middle; +} + #flux-group-keys-demo { table { margin-bottom: 1.25rem; diff --git a/content/flux/v0/function-types.md b/content/flux/v0/function-types.md index be56d2175..c12b827f8 100644 --- a/content/flux/v0/function-types.md +++ b/content/flux/v0/function-types.md @@ -53,6 +53,10 @@ and important function behaviors. - [Function types](#function-types) - [Function categories](#function-categories) +{{% note %}} +The {{% icon "experimental" %}} icon indicates the function is experimental. +{{% /note %}} + --- ## Function types diff --git a/content/flux/v0/spec/variables.md b/content/flux/v0/spec/variables.md index b71a1fe3a..4b744d4f0 100644 --- a/content/flux/v0/spec/variables.md +++ b/content/flux/v0/spec/variables.md @@ -9,6 +9,8 @@ weight: 104 aliases: - /influxdb/v2/reference/flux/language/variables/ - /influxdb/cloud/reference/flux/language/variables/ +related: + - /flux/v0/get-started/syntax-basics/#variables, Flux syntax basics - assign variables --- A **variable** represents a storage location for a single value. diff --git a/content/flux/v0/stdlib/all-functions.md b/content/flux/v0/stdlib/all-functions.md index 5773da931..657625bad 100644 --- a/content/flux/v0/stdlib/all-functions.md +++ b/content/flux/v0/stdlib/all-functions.md @@ -18,4 +18,8 @@ see [Flux function types and categories](/flux/v0/function-types/). {{< list-filters "flux" >}} +{{% note %}} +The {{% icon "experimental" %}} icon indicates the function is experimental. +{{% /note %}} + {{< flux/list-all-functions >}} diff --git a/data/clockface.yml b/data/clockface.yml index 7a2cfd25d..e49d17d78 100644 --- a/data/clockface.yml +++ b/data/clockface.yml @@ -1,12 +1,9 @@ influxdb: default: v4 cloud: v4 - v2.6: v4 - v2.4: v4 - v2.3: v3 - v2.2: v3 - v2.1: v3 - v2.0: v2 + +flux: + default: v4 enterprise_influxdb: default: v2 diff --git a/layouts/shortcodes/flux/list-all-functions.html b/layouts/shortcodes/flux/list-all-functions.html index ad1ee88a6..d1153c754 100644 --- a/layouts/shortcodes/flux/list-all-functions.html +++ b/layouts/shortcodes/flux/list-all-functions.html @@ -4,25 +4,26 @@ {{ $filterArr := split $filters ", "}} {{ $tagTaxonomy := print $section "/" $currentVersion "/tags" }} -
    +
      {{ range where $.Site.RegularPages.ByTitle "Section" $section }} - {{ $title := cond (isset .Page.Params "list_title") (replaceRE `\ function` "" .Page.Params.list_title) (replaceRE `\ function` "" .Title) }} + {{ $title := replaceRE `\ function` "" .Title }} {{ $deprecated := isset .Page.Params "deprecated" }} {{ $removed := isset .Page.Params "removed" }} + {{ $experimental := in .Page.RelPermalink "experimental" }} {{ $tagList := index .Page.Params $tagTaxonomy | default (slice "") }} {{ if ne $filters "" }} {{ if gt (len (intersect $filterArr (index .Page.Params $tagTaxonomy))) 0}} {{ if and (in .RelPermalink (print $section "/" $currentVersion "/")) (in .Title "() function") }}
    • - {{ $title }}{{ if $deprecated }} – (deprecated){{ end }} + {{ $title }}{{ if $deprecated }} – (deprecated){{ end }}
    • {{ end }} {{ end }} {{ else }} {{ if and (in .RelPermalink (print $section "/" $currentVersion "/")) (in .Title "() function") }}
    • - {{ $title }} + {{ $title }} {{ if $removed }} – (removed) {{ else if $deprecated }} – (deprecated){{ end }}
    • diff --git a/layouts/shortcodes/icon.html b/layouts/shortcodes/icon.html index 35b899843..8f7a81f77 100644 --- a/layouts/shortcodes/icon.html +++ b/layouts/shortcodes/icon.html @@ -253,5 +253,7 @@ {{- else if or (eq $icon "billing") (eq $icon "bill") -}} + {{- else if or (eq $icon "flask") (eq $icon "beaker") (eq $icon "experimental") -}} + {{- end -}} {{- end -}}