From b5fdb24d4147a36b452be51fd7e57e9b4317424e Mon Sep 17 00:00:00 2001 From: Jason Stirnaman Date: Fri, 22 Jul 2022 16:53:00 -0500 Subject: [PATCH] Feat/api helpers (#4243) * feat: add ast to glossary * adding to 2.2 * hotfix(tasks): update duplicate-oss tag to fix broken icon render. * chore: make API ref shortcode regex non-greedy. - Make regex used to replace INFLUXDB_DOCS_URL shortcode in the API spec lazy so that it only matches each instance of the shortcode when more than appear in a description. * fix(glossary): simplify AST and fix agent. * feat(glossary): add RFC3339Nano entry to use with API docs. Co-authored-by: Sunbrye Ly Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> --- .../plugins/decorators/replace-shortcodes.js | 2 +- content/influxdb/v2.2/reference/glossary.md | 8 ++++++++ content/influxdb/v2.3/reference/glossary.md | 20 ++++++++++++++++--- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/api-docs/openapi/plugins/decorators/replace-shortcodes.js b/api-docs/openapi/plugins/decorators/replace-shortcodes.js index 4b43cc54c..402a70adc 100644 --- a/api-docs/openapi/plugins/decorators/replace-shortcodes.js +++ b/api-docs/openapi/plugins/decorators/replace-shortcodes.js @@ -5,7 +5,7 @@ function replaceDocsUrl(field) { /** Regex to match the URL "shortcode" {{% INFLUXDB_DOCS_URL %}}. * [^]* matches line breaks. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#using_regular_expression_on_multiple_lines */ - const shortcode = /\{\{[^]*%\s*[^]*INFLUXDB_DOCS_URL[^]*\s*[^]*%\}\}/g + const shortcode = /\{\{%([^]|\s)*?INFLUXDB_DOCS_URL([^]|\s)*?%\}\}/g let replacement = `/influxdb/${process.env.INFLUXDB_VERSION}`; return field.replaceAll(shortcode, replacement) .replaceAll('https://docs.influxdata.com/influxdb/', '/influxdb/'); diff --git a/content/influxdb/v2.2/reference/glossary.md b/content/influxdb/v2.2/reference/glossary.md index 0aaa29bab..23531c73b 100644 --- a/content/influxdb/v2.2/reference/glossary.md +++ b/content/influxdb/v2.2/reference/glossary.md @@ -13,6 +13,14 @@ influxdb/v2.2/tags: [glossary] ## A +### abstract syntax tree (AST) + +A tree representation of the abstract syntactic structure of source code. + +Each node of the tree denotes a construct occurring in the code. The syntax is +abstracted away and does not represent every detail appearing in the syntax, but +rather just the structural details. + ### agent A background process started by (or on behalf of) a user and typically requires user input. diff --git a/content/influxdb/v2.3/reference/glossary.md b/content/influxdb/v2.3/reference/glossary.md index ccb44e925..196c9d65e 100644 --- a/content/influxdb/v2.3/reference/glossary.md +++ b/content/influxdb/v2.3/reference/glossary.md @@ -13,9 +13,15 @@ influxdb/v2.3/tags: [glossary] ## A +### abstract syntax tree (AST) + +Tree representation of source code that shows the structure, content, and rules of programming statements and discards additional syntax elements. +The tree is hierarchical, with elements of program statements broken down into their parts. + +For more information about AST design, see [Abstract Syntax Tree on Wikipedia](https://en.wikipedia.org/wiki/Abstract_syntax_tree). ### agent -A background process started by (or on behalf of) a user and typically requires user input. +A background process started by (or on behalf of) a user that typically requires user input. Telegraf is an agent that requires user input (a configuration file) to gather metrics from declared input plugins and sends metrics to declared output plugins, based on the plugins enabled for a configuration. @@ -831,11 +837,19 @@ For more information about retention policies, see the Related entries: [retention period](#retention-period), ### RFC3339 timestamp -A timestamp that uses the human readable DateTime format proposed in +A timestamp that uses the human-readable DateTime format proposed in [RFC 3339](https://tools.ietf.org/html/rfc3339) (for example: `2020-01-01T00:00:00.00Z`). Flux and InfluxDB clients return query results with RFC3339 timestamps. -Related entries: [timestamp](#timestamp), [unix timestamp](#unix-timestamp) +Related entries: [RFC3339Nano timestamp](#rfc3339nano-timestamp), [timestamp](#timestamp), [unix timestamp](#unix-timestamp) + +### RFC3339Nano timestamp +A [Golang representation of the RFC 3339 DateTime format](https://go.dev/src/time/format.go) that uses nanosecond resolution--for example: +`2006-01-02T15:04:05.999999999Z07:00`. + +InfluxDB clients can return RFC3339Nano timestamps in log events and CSV-formatted query results. + +Related entries: [RFC3339 timestamp](#rfc3339-timestamp), [timestamp](#timestamp), [unix timestamp](#unix-timestamp) ## S