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 <sunbryely@Sunbryes-MacBook-Pro.local>
Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com>
pull/4250/head
Jason Stirnaman 2022-07-22 16:53:00 -05:00 committed by GitHub
parent 1034a75369
commit b5fdb24d41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 4 deletions

View File

@ -5,7 +5,7 @@ function replaceDocsUrl(field) {
/** Regex to match the URL "shortcode" {{% INFLUXDB_DOCS_URL %}}. /** 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 * [^]* 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}`; let replacement = `/influxdb/${process.env.INFLUXDB_VERSION}`;
return field.replaceAll(shortcode, replacement) return field.replaceAll(shortcode, replacement)
.replaceAll('https://docs.influxdata.com/influxdb/', '/influxdb/'); .replaceAll('https://docs.influxdata.com/influxdb/', '/influxdb/');

View File

@ -13,6 +13,14 @@ influxdb/v2.2/tags: [glossary]
## A ## 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 ### 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 and typically requires user input.

View File

@ -13,9 +13,15 @@ influxdb/v2.3/tags: [glossary]
## A ## 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 ### 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. 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), Related entries: [retention period](#retention-period),
### RFC3339 timestamp ### 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`). [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. 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 ## S