From 4dcb7dfe6f98aa6d61d1b52d6657faa376e85915 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Mon, 21 Nov 2022 15:44:14 -0700 Subject: [PATCH] InfluxDB get started (#4628) * WIP new influxdb get started * WIP get started tutorial * WIP get started * persist tab selection when navigating tutorials * WIP wrapped up query get-started * WIP small updated to query get-started * WIP influxdb get started * Apply suggestions from code review Co-authored-by: Jason Stirnaman * minor updates to get started started docs * Apply suggestions from code review Co-authored-by: Jason Stirnaman * fixed truncate behavior * centralize get-started credential storing * add suggestions from PR review * Get started processing and visualizing data (#4648) * remove draft from process and visualize * WIP get started processing data * updated get started processing data with PR feedback * add get started visualizing data content * udpated vis get started with PR feedback * added clockface v4 * last updates from PR review * ported get started content to 2.5 Co-authored-by: Jason Stirnaman --- CONTRIBUTING.md | 5 + assets/js/content-interactions.js | 93 +- assets/js/flux-group-keys.js | 2 +- assets/js/tabbed-content.js | 101 ++ assets/styles/layouts/_inline-icons.scss | 33 +- .../layouts/article/_html-diagrams.scss | 131 ++ .../layouts/article/_tabbed-content.scss | 21 + assets/styles/layouts/article/_tables.scss | 4 + assets/styles/layouts/article/_truncate.scss | 21 +- assets/styles/tools/_fonts.scss | 6 +- assets/styles/tools/_tooltips.scss | 2 +- .../icon-fonts/{_icon.scss => _icon-v3.scss} | 16 +- assets/styles/tools/icon-fonts/_icon-v4.scss | 295 ++++ content/example.md | 89 +- content/influxdb/v2.4/get-started.md | 71 - content/influxdb/v2.4/get-started/_index.md | 118 ++ content/influxdb/v2.4/get-started/process.md | 1275 +++++++++++++++++ content/influxdb/v2.4/get-started/query.md | 603 ++++++++ content/influxdb/v2.4/get-started/setup.md | 457 ++++++ .../influxdb/v2.4/get-started/visualize.md | 186 +++ content/influxdb/v2.4/get-started/write.md | 394 +++++ .../process-data/manage-tasks/create-task.md | 1 + .../execute-queries/query-sample-data.md | 4 +- .../v2.4/query-data/flux/flux-version.md | 2 +- .../v2.4/security/tokens/update-tokens.md | 2 +- content/influxdb/v2.5/get-started.md | 71 - content/influxdb/v2.5/get-started/_index.md | 118 ++ content/influxdb/v2.5/get-started/process.md | 1275 +++++++++++++++++ content/influxdb/v2.5/get-started/query.md | 603 ++++++++ content/influxdb/v2.5/get-started/setup.md | 457 ++++++ .../influxdb/v2.5/get-started/visualize.md | 186 +++ content/influxdb/v2.5/get-started/write.md | 394 +++++ .../process-data/manage-tasks/create-task.md | 1 + .../execute-queries/query-sample-data.md | 4 +- .../v2.5/query-data/flux/flux-version.md | 2 +- .../v2.5/security/tokens/update-tokens.md | 2 +- data/clockface.yml | 28 + layouts/partials/footer/javascript.html | 3 +- layouts/shortcodes/cli/influx-creds-note.html | 9 +- layouts/shortcodes/expand.html | 1 - layouts/shortcodes/flux/group-key.html | 3 +- layouts/shortcodes/icon.html | 162 ++- .../shortcodes/influxdb/line-protocol.html | 6 + .../shortcodes/influxdb/points-series.html | 87 ++ layouts/shortcodes/nav-icon.html | 145 +- layouts/shortcodes/page-nav.html | 5 +- layouts/shortcodes/truncate.html | 7 +- static/fonts/{icomoon.eot => icomoon-v3.eot} | Bin static/fonts/{icomoon.svg => icomoon-v3.svg} | 0 static/fonts/{icomoon.ttf => icomoon-v3.ttf} | Bin .../fonts/{icomoon.woff => icomoon-v3.woff} | Bin .../fonts/{icomoon.woff2 => icomoon-v3.woff2} | Bin static/fonts/icomoon-v4.eot | Bin 0 -> 15284 bytes static/fonts/icomoon-v4.ttf | Bin 0 -> 15120 bytes static/fonts/icomoon-v4.woff | Bin 0 -> 15196 bytes static/fonts/icomoon-v4.woff2 | Bin 0 -> 7156 bytes static/fonts/iconmoon-v4.svg | 98 ++ ...-4-get-started-visualize-query-builder.png | Bin 0 -> 72866 bytes .../2-4-get-started-visualize-time-range.png | Bin 0 -> 10511 bytes ...-get-started-visualize-variable-select.png | Bin 0 -> 24293 bytes 60 files changed, 7230 insertions(+), 369 deletions(-) create mode 100644 assets/js/tabbed-content.js rename assets/styles/tools/icon-fonts/{_icon.scss => _icon-v3.scss} (95%) create mode 100644 assets/styles/tools/icon-fonts/_icon-v4.scss delete mode 100644 content/influxdb/v2.4/get-started.md create mode 100644 content/influxdb/v2.4/get-started/_index.md create mode 100644 content/influxdb/v2.4/get-started/process.md create mode 100644 content/influxdb/v2.4/get-started/query.md create mode 100644 content/influxdb/v2.4/get-started/setup.md create mode 100644 content/influxdb/v2.4/get-started/visualize.md create mode 100644 content/influxdb/v2.4/get-started/write.md delete mode 100644 content/influxdb/v2.5/get-started.md create mode 100644 content/influxdb/v2.5/get-started/_index.md create mode 100644 content/influxdb/v2.5/get-started/process.md create mode 100644 content/influxdb/v2.5/get-started/query.md create mode 100644 content/influxdb/v2.5/get-started/setup.md create mode 100644 content/influxdb/v2.5/get-started/visualize.md create mode 100644 content/influxdb/v2.5/get-started/write.md create mode 100644 data/clockface.yml create mode 100644 layouts/shortcodes/influxdb/line-protocol.html create mode 100644 layouts/shortcodes/influxdb/points-series.html rename static/fonts/{icomoon.eot => icomoon-v3.eot} (100%) rename static/fonts/{icomoon.svg => icomoon-v3.svg} (100%) rename static/fonts/{icomoon.ttf => icomoon-v3.ttf} (100%) rename static/fonts/{icomoon.woff => icomoon-v3.woff} (100%) rename static/fonts/{icomoon.woff2 => icomoon-v3.woff2} (100%) create mode 100644 static/fonts/icomoon-v4.eot create mode 100644 static/fonts/icomoon-v4.ttf create mode 100644 static/fonts/icomoon-v4.woff create mode 100644 static/fonts/icomoon-v4.woff2 create mode 100644 static/fonts/iconmoon-v4.svg create mode 100644 static/img/influxdb/2-4-get-started-visualize-query-builder.png create mode 100644 static/img/influxdb/2-4-get-started-visualize-time-range.png create mode 100644 static/img/influxdb/2-4-get-started-visualize-variable-select.png diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 04a4ae736..1ba21bbb3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -527,6 +527,7 @@ The shortcode has the following parameters: - **next:** path of the next document _(optional)_ - **prevText:** override the button text linking to the previous document _(optional)_ - **nextText:** override the button text linking to the next document _(optional)_ +- **keepTab:** include the currently selected tab in the button link _(optional)_ The shortcode generates buttons that link to both the previous and next documents. By default, the shortcode uses either the `list_title` or the `title` of the linked @@ -539,6 +540,10 @@ document, but you can use `prevText` and `nextText` to override button text. {{ page-nav prev="/path/to/prev/" prevText="Previous" next="/path/to/next" nextText="Next" >}} + +{{ page-nav prev="/path/to/prev/" next="/path/to/next" keepTab=true>}} +``` + ### Keybinds Use the `{{< keybind >}}` shortcode to include OS-specific keybindings/hotkeys. The following parameters are available: diff --git a/assets/js/content-interactions.js b/assets/js/content-interactions.js index d7e6b4647..48a76dcb4 100644 --- a/assets/js/content-interactions.js +++ b/assets/js/content-interactions.js @@ -27,7 +27,6 @@ headingElements.each(function() { var elementWhiteList = [ ".tabs p a", ".code-tabs p a", - ".truncate-toggle", ".children-links a", ".list-links a", "a.url-trigger", @@ -75,91 +74,21 @@ $('#contents-toggle-btn').click(function(e) { $('#nav-tree').toggleClass('open'); }) -//////////////////////////////// Tabbed Content //////////////////////////////// - -function tabbedContent(container, tab, content) { - - // Add the active class to the first tab in each tab group, - // in case it wasn't already set in the markup. - $(container).each(function () { - $(tab, this).removeClass('is-active'); - $(tab + ':first', this).addClass('is-active'); - }); - - $(tab).on('click', function(e) { - e.preventDefault(); - - // Make sure the tab being clicked is marked as active, and make the rest inactive. - $(this).addClass('is-active').siblings().removeClass('is-active'); - - // Render the correct tab content based on the position of the tab being clicked. - const activeIndex = $(tab).index(this); - $(content).each(function(i) { - if (i === activeIndex) { - $(this).show(); - $(this).siblings(content).hide(); - } - }); - }); -} - -tabbedContent('.code-tabs-wrapper', '.code-tabs p a', '.code-tab-content'); -tabbedContent('.tabs-wrapper', '.tabs p a', '.tab-content'); - -// Retrieve the user's programming language (client library) preference. -function getApiLibPreference() { - return Cookies.get('influx-docs-api-lib') || ''; -} - -function getTabQueryParam() { - const queryParams = new URLSearchParams(window.location.search); - return $('