From 908a589f75b0ebb30718317b92028b7ab2dcc0fe Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 6 Nov 2024 22:41:42 -0800 Subject: [PATCH 01/11] Add more admonitions --- .rubocop.yml | 2 +- README.asciidoc | 134 +++++------------- .../lib/care_admonition/extension.rb | 93 +++++++++++- .../lib/change_admonition/extension.rb | 12 ++ .../elastic_compat_preprocessor/extension.rb | 27 +++- .../spec/change_admonition_spec.rb | 9 +- .../spec/elastic_compat_preprocessor_spec.rb | 79 ++++++++++- resources/web/docs_js/index-v1.js | 2 +- resources/web/style/toc.pcss | 18 ++- 9 files changed, 262 insertions(+), 114 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 86a27b026501d..ce42d9dc458a8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -37,4 +37,4 @@ Metrics/ClassLength: Max: 120 Metrics/MethodLength: - Max: 20 + Max: 35 diff --git a/README.asciidoc b/README.asciidoc index b0ebc68c53f8c..f66b7c568bc3d 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -1399,23 +1399,16 @@ The path should be as specific as possible because we skip rebuilding books if changes to the referenced repository don't change the referenced path. [[changes]] -== Additions and deprecations +== Additions, deprecations, and discontinuations -Documentation is built for various branches, eg `0.90`, -`1.00`, `master`. However, we release versions -`0.90.0`, `0.90.1`, etc, which are all based on the -`0.90` branch. +When adding, deprecating, or discontinuing functionality, you can mark the change as +_coming_, _generally available_ (formerly _added_), _deprecated_, or _discontinued_. -When adding new functionality to a branch, or deprecating -existing functionality, you can mark the change as -_added_, _coming_ or _deprecated_. Use `coming` when the addition is -in an as yet unreleased version of the current branch, and `added` when -the functionality is already released. - -The `update_versions.pl` script can be used to change `coming` notices -to `added` notices when doing a new release, and can also be used -to remove `added`, `coming` and `deprecated` notices completely. +Use `coming` when the addition is in an as yet unreleased version of the current branch. +Use `generally_available` when the functionality is released and no longer in a beta, dev, or preview state. +For Elastic Serverless and Elasticsearch Service content, there currently isn't a public identifier for individual releases. +In other contexts, you can qualify the addition, deprecation, or discontinuation with a specific version number. === Inline notifications @@ -1425,33 +1418,20 @@ the addition or deprecation of individual parameters. [source,asciidoc] ---------------------------------- [horizontal] -`foo.bar`:: Does XYZ. added:[0.90.4] -`foo.bar`:: Does XYZ. coming:[0.90.4] -`foo.baz`:: Does XYZ. deprecated:[0.90.4] +`foo.bar`:: Does XYZ. ga_stack:[0.90.4] +`foo.bar`:: Does XYZ. coming:[0.90.4] coming_serverless:[] coming_ess:[] +`foo.baz`:: Does XYZ. deprecated:[0.90.4] deprecated_serverless:[] deprecated_ess:[] ---------------------------------- -[horizontal] -`foo.bar`:: Does XYZ. added:[0.90.4] -`foo.bar`:: Does XYZ. coming:[0.90.4] -`foo.baz`:: Does XYZ. deprecated:[0.90.4] - -You can also include details about additional -notes in the notifications which show up when the -user hovers over it: +Some annotations also enable you add custom notes that show up when the user hovers over it: [source,asciidoc] ---------------------------------- [horizontal] -`foo.bar`:: Does XYZ. added:[0.90.4,Replaces `foo.baz`] `foo.bar`:: Does XYZ. coming:[0.90.4,Replaces `foo.baz`] `foo.baz`:: Does XYZ. deprecated:[0.90.4,Replaced by `foo.bar`] ---------------------------------- -[horizontal] -`foo.bar`:: Does XYZ. added:[0.90.4,Replaces `foo.baz`] -`foo.bar`:: Does XYZ. coming:[0.90.4,Replaces `foo.baz`] -`foo.baz`:: Does XYZ. deprecated:[0.90.4,Replaced by `foo.bar`] - [NOTE] ==== If the details include a comma, you must use quotation marks. For example: @@ -1463,98 +1443,48 @@ deprecated::[1.1.0,"Span started automatically by <>] - -Text about new functionality... - [[coming-section]] ==== New section not yet released coming::[0.90.9,Replaces `foo.bar`. See <>] Text about new functionality... - -[[old-section]] -==== Old section - -deprecated::[0.90.4,Replace by `foo.baz`. See <>] - -Text about old functionality... ---------------------------------- -[[new-section]] -==== New section - -added::[0.90.4,Replaces `foo.bar`. See <>] - -Text about new functionality... - -[[old-section]] -==== Old section - -deprecated::[0.90.4,Replace by `foo.baz`. See <>] - -Text about old functionality... - [[experimental]] == Beta, Dev, and Preview (experimental) -APIs or parameters that are in beta, in development, or in technical preview (formerly experimental) can be +Functionality that is in beta, in development, or in technical preview (formerly experimental) can be marked as such, using markup similar to that used in <>. +Since a feature might be in different lifecycle stages in different contexts, there are multiple variations of each admonition (for example, `beta`, `beta_ess`, and `beta_serverless`). In the block format, you have the option of adding a related GitHub issue link. If both custom text and a GitHub link are provided, the GitHub link **must** be @@ -1570,15 +1500,15 @@ attribute in place of the GitHub issue link. beta::[] -beta::[https://github.com/elastic/docs/issues/505] +beta_serverless::[https://github.com/elastic/docs/issues/505] beta::[{issue}505] -beta::["Custom text goes here."] +beta_ess::["Custom text goes here."] beta::["Custom text goes here.",https://github.com/elastic/docs/issues/505] -beta::["Custom text goes here.",{issue}505] +beta_serverless::["Custom text goes here.",{issue}505] Text about new feature... @@ -1592,11 +1522,11 @@ a new parameter that's in beta: This param has been around for ages and won't change. `beta_param`:: -beta:[] +beta:[] This param is in beta and may change in the future. `beta_param`:: -beta:["Custom text goes here."] +beta_serverless:["Custom text goes here."] This param is in beta and may change in the future. ---- @@ -1609,15 +1539,15 @@ This param is in beta and may change in the future. dev::[] -dev::[https://github.com/elastic/docs/issues/505] +dev_serverless::[https://github.com/elastic/docs/issues/505] dev::[{issue}505] -dev::["Custom text goes here."] +dev_ess::["Custom text goes here."] dev::["Custom text goes here.",https://github.com/elastic/docs/issues/505] -dev::["Custom text goes here.",{issue}505] +dev_serverless::["Custom text goes here.",{issue}505] Text about feature in development... @@ -1635,7 +1565,7 @@ dev:[] This param is in development and may change in the future. `dev_param`:: -dev:["Custom text goes here."] +dev_ess:["Custom text goes here."] This param is in development and may change in the future. ---- @@ -1656,15 +1586,15 @@ See below. preview::[] -preview::[https://github.com/elastic/docs/issues/505] +preview_serverless::[https://github.com/elastic/docs/issues/505] preview::[{issue}505] -preview::["Custom text goes here."] +preview_ess::["Custom text goes here."] preview::["Custom text goes here.",https://github.com/elastic/docs/issues/505] -preview::["Custom text goes here.",{issue}505] +preview_serverless::["Custom text goes here.",{issue}505] Text about new feature... @@ -1682,7 +1612,7 @@ preview:[] This param is in technical preview and may change in the future. `experimental_param`:: -preview:["Custom text goes here."] +preview_ess:["Custom text goes here."] This param is in technical preview and may change in the future. ---- diff --git a/resources/asciidoctor/lib/care_admonition/extension.rb b/resources/asciidoctor/lib/care_admonition/extension.rb index 4be6e279d24ba..f88d9efacc5a6 100644 --- a/resources/asciidoctor/lib/care_admonition/extension.rb +++ b/resources/asciidoctor/lib/care_admonition/extension.rb @@ -3,16 +3,43 @@ require 'asciidoctor/extensions' ## -# Extensions for marking something as `beta`, `dev`, or technical `preview`. +# Extensions for marking something as `beta`, `beta_serverless`, `beta_ess`, +# `dev`, `dev_serverless`, `dev_ess`, technical `preview`, `preview_serverless`, +# `preview_ess`, `ga_serverless`, `ga_ess`. # # Usage # # beta::[] # dev::[] # preview::[] +# beta_ess::[] +# beta_serverless::[] +# dev_ess::[] +# dev_serverless::[] +# ga_serverless::[] +# deprecated_ess::[] +# deprecated_serverless::[] +# discontinued_ess::[] +# discontinued_serverless::[] +# coming_ess::[] +# coming_serverless::[] # Foo beta:[] # Foo dev:[] # Foo preview:[] +# Foo beta_ess:[] +# Foo beta_serverless:[] +# Foo dev_ess:[] +# Foo dev_serverless:[] +# Foo preview_ess:[] +# Foo preview_serverless:[] +# Foo ga_ess:[] +# Foo ga_serverless:[] +# Foo deprecated_ess:[] +# Foo deprecated_serverless:[] +# Foo discontinued_ess:[] +# Foo discontinued_serverless:[] +# Foo coming_ess:[] +# Foo coming_serverless::[] # # !! `experimental:[]` is supported as a deprecated alternative to `preview:[]`. # !! But please use `preview:[]` instead. @@ -21,19 +48,83 @@ class CareAdmonition < Asciidoctor::Extensions::Group BETA_DEFAULT_TEXT = <<~TEXT.strip This functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features. TEXT + BETA_SERVERLESS_TEXT = <<~TEXT.strip + This functionality is in beta in Elastic Serverless and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features. + TEXT + BETA_ESS_TEXT = <<~TEXT.strip + This functionality is in beta in Elasticsearch Service and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features. + TEXT DEV_DEFAULT_TEXT = <<~TEXT.strip This functionality is in development and may be changed or removed completely in a future release. These features are unsupported and not subject to the support SLA of official GA features. TEXT + DEV_SERVERLESS_TEXT = <<~TEXT.strip + This functionality is in development in Elastic Serverless and may be changed or removed completely in a future release. These features are unsupported and not subject to the support SLA of official GA features. + TEXT + DEV_ESS_TEXT = <<~TEXT.strip + This functionality is in development in Elasticsearch Service and may be changed or removed completely in a future release. These features are unsupported and not subject to the support SLA of official GA features. + TEXT PREVIEW_DEFAULT_TEXT = <<~TEXT.strip This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. TEXT + PREVIEW_SERVERLESS_TEXT = <<~TEXT.strip + This functionality is in technical preview in Elastic Serverless and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + TEXT + PREVIEW_ESS_TEXT = <<~TEXT.strip + This functionality is in technical in preview in Elasticsearch Service and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + TEXT + DEPRECATED_ESS_TEXT = <<~TEXT.strip + This functionality is deprecated in Elasticsearch Service and will be removed in a future release. + TEXT + DEPRECATED_SERVERLESS_TEXT = <<~TEXT.strip + This functionality is deprecated in Elastic Serverless and will be removed in a future release. + TEXT + DISCONTINUED_ESS_TEXT = <<~TEXT.strip + This functionality is discontinued in Elasticsearch Service. + TEXT + DISCONTINUED_SERVERLESS_TEXT = <<~TEXT.strip + This functionality is discontinued in Elastic Serverless. + TEXT + COMING_ESS_TEXT = <<~TEXT.strip + This functionality is coming in Elasticsearch Service. + TEXT + COMING_SERVERLESS_TEXT = <<~TEXT.strip + This functionality is coming in Elastic Serverless. + TEXT + GA_ESS_TEXT = <<~TEXT.strip + This functionality is generally available in Elasticsearch Service. + TEXT + GA_SERVERLESS_TEXT = <<~TEXT.strip + This functionality is generally available in Elastic Serverless. + TEXT def activate(registry) [ [:beta, 'beta', BETA_DEFAULT_TEXT], + [:beta_serverless, 'Serverless:beta', BETA_SERVERLESS_TEXT], + [:beta_ess, 'ESS:beta', BETA_ESS_TEXT], [:dev, 'dev', DEV_DEFAULT_TEXT], + [:dev_serverless, 'Serverless:dev', DEV_SERVERLESS_TEXT], + [:dev_ess, 'ESS:dev', DEV_ESS_TEXT], [:experimental, 'preview', PREVIEW_DEFAULT_TEXT], [:preview, 'preview', PREVIEW_DEFAULT_TEXT], + [:preview_serverless, 'Serverless:preview', PREVIEW_SERVERLESS_TEXT], + [:preview_ess, 'ESS:preview', PREVIEW_ESS_TEXT], + [ + :deprecated_serverless, + 'Serverless:deprecated', + DEPRECATED_SERVERLESS_TEXT, + ], + [:deprecated_ess, 'ESS:deprecated', DEPRECATED_ESS_TEXT], + [ + :discontinued_serverless, + 'Serverless:discontinued', + DISCONTINUED_SERVERLESS_TEXT, + ], + [:discontinued_ess, 'ESS:discontinued', DISCONTINUED_ESS_TEXT], + [:coming_serverless, 'Serverless:coming', COMING_SERVERLESS_TEXT], + [:coming_ess, 'ESS:coming', COMING_ESS_TEXT], + [:ga_serverless, 'Serverless:GA', GA_SERVERLESS_TEXT], + [:ga_ess, 'ESS:GA', GA_ESS_TEXT], ].each do |(name, role, default_text)| registry.block_macro ChangeAdmonitionBlock.new(role, default_text), name registry.inline_macro ChangeAdmonitionInline.new(role, default_text), name diff --git a/resources/asciidoctor/lib/change_admonition/extension.rb b/resources/asciidoctor/lib/change_admonition/extension.rb index 24ee71e07bec8..648073011a23a 100644 --- a/resources/asciidoctor/lib/change_admonition/extension.rb +++ b/resources/asciidoctor/lib/change_admonition/extension.rb @@ -9,17 +9,29 @@ # Usage # # added::[6.0.0-beta1] +# ga_stack::[8.10] # coming::[6.0.0-beta1] # deprecated::[6.0.0-beta1] +# discontinued_stack::[9.0.0] # Foo added:[6.0.0-beta1] # Foo coming:[6.0.0-beta1] # Foo deprecated:[6.0.0-beta1] +# Foo ga_stack:[8.10] +# Foo discontinued_stack:[9.0.0] # class ChangeAdmonition < Asciidoctor::Extensions::Group MACRO_CONF = [ [:added, 'added', 'note', 'Added in', nil], [:coming, 'changed', 'note', 'Coming in', nil], [:deprecated, 'deleted', 'warning', 'Deprecated in', ' u-strikethrough'], + [:ga_stack, 'added', 'note', 'Generally available in Elack Stack in', nil], + [ + :discontinued_stack, + 'deleted', + 'warning', + 'Discontinued in', + ' u-strikethrough', + ], ].freeze def activate(registry) MACRO_CONF.each do |(name, revisionflag, tag, message, title_class)| diff --git a/resources/asciidoctor/lib/elastic_compat_preprocessor/extension.rb b/resources/asciidoctor/lib/elastic_compat_preprocessor/extension.rb index d0a0e7f83d248..c40bdc541a2e9 100644 --- a/resources/asciidoctor/lib/elastic_compat_preprocessor/extension.rb +++ b/resources/asciidoctor/lib/elastic_compat_preprocessor/extension.rb @@ -12,10 +12,14 @@ # added[6.0.0-beta1] # coming[6.0.0-beta1] # deprecated[6.0.0-beta1] +# discontinued-stack[9.0.0] +# ga_stack[8.10] # Into # added::[6.0.0-beta1] # coming::[6.0.0-beta1] # deprecated::[6.0.0-beta1] +# discontinued-stack[9.0.0] +# ga_stack::[8.10] # Because `::` is required by asciidoctor to invoke block macros but isn't # required by asciidoc. # @@ -23,10 +27,14 @@ # words words added[6.0.0-beta1] # words words changed[6.0.0-beta1] # words words deprecated[6.0.0-beta1] +# words words discontinued[9.0.0] +# words words ga_stack[8.10] # Into # words words added:[6.0.0-beta1] # words words changed:[6.0.0-beta1] # words words deprecated:[6.0.0-beta1] +# words words discontinued:[9.0.0] +# words words ga_stack:[8.10] # Because `:` is required by asciidoctor to invoke inline macros but isn't # required by asciidoc. # @@ -116,9 +124,17 @@ class ElasticCompatPreprocessor < Asciidoctor::Extensions::Preprocessor /^\["source", ?"[^"]+", ?subs="(#{Asciidoctor::CC_ANY}+)"\]$/ CODE_BLOCK_RX = /^-----*$/ SNIPPET_RX = %r{^//\s*(AUTOSENSE|KIBANA|CONSOLE|SENSE:[^\n<]+)$} - LEGACY_MACROS = 'added|beta|coming|deprecated|dev|experimental' - LEGACY_BLOCK_MACRO_RX = /^\s*(#{LEGACY_MACROS})\[(.*)\]\s*$/ - LEGACY_INLINE_MACRO_RX = /(#{LEGACY_MACROS})\[(.*)\]/ + LEGACY = 'added|experimental' + BETA = 'beta|beta_serverless|beta_ess' + COMING = 'coming|coming_serverless|coming_ess' + DEP = 'deprecated|deprecated_serverless|deprecated_ess' + DEV = 'dev|dev_serverless|dev_ess' + DISC = 'discontinued_stack|discontinued_ess|discontinued_serverless' + GA = 'ga_stack|ga_serverless|ga_ess' + PREV = 'preview_serverless|preview_ess' + MACROS = "#{LEGACY}|#{BETA}|#{COMING}|#{DEP}|#{DEV}|#{DISC}|#{GA}|#{PREV}" + BLOCK_MACRO_RX = /^\s*(#{MACROS})\[(.*)\]\s*$/ + INLINE_MACRO_RX = /(#{MACROS})\[(.*)\]/ def process(_document, reader) reader.extend ReaderExtension @@ -205,11 +221,10 @@ def postprocess(line) # First convert the "block" version of these macros. We convert them # to block macros because they are alone on a line - line.gsub!(LEGACY_BLOCK_MACRO_RX, '\1::[\2]') + line.gsub!(BLOCK_MACRO_RX, '\1::[\2]') # Then convert the "inline" version of these macros. We convert them # to inline macros because they are *not* at the start of the line.... - line.gsub!(LEGACY_INLINE_MACRO_RX, '\1:[\2]') - + line.gsub!(INLINE_MACRO_RX, '\1:[\2]') # Transform Elastic's traditional comment based marking for # AUTOSENSE/KIBANA/CONSOLE snippets into a marker that we can pick # up during tree processing to turn the snippet into a marked up diff --git a/resources/asciidoctor/spec/change_admonition_spec.rb b/resources/asciidoctor/spec/change_admonition_spec.rb index db13a31db1cd2..2722217de0a0f 100644 --- a/resources/asciidoctor/spec/change_admonition_spec.rb +++ b/resources/asciidoctor/spec/change_admonition_spec.rb @@ -40,7 +40,7 @@ def expect_block_admonition(body) HTML end end - context 'without content' do + context 'with version content' do let(:input) do <<~ASCIIDOC #{key}::[7.0.0-beta1] @@ -209,4 +209,11 @@ def expect_inline_admonition(version, text) let(:extra_class) { ' u-strikethrough' } include_examples 'change admonition' end + context 'discontinued in stack' do + let(:key) { 'discontinued_stack' } + let(:admon_class) { 'warning' } + let(:message) { 'Discontinued' } + let(:extra_class) { ' u-strikethrough' } + include_examples 'change admonition' + end end diff --git a/resources/asciidoctor/spec/elastic_compat_preprocessor_spec.rb b/resources/asciidoctor/spec/elastic_compat_preprocessor_spec.rb index 2c32438469eaa..d96ecb3d93526 100644 --- a/resources/asciidoctor/spec/elastic_compat_preprocessor_spec.rb +++ b/resources/asciidoctor/spec/elastic_compat_preprocessor_spec.rb @@ -116,19 +116,36 @@ let(:block_admon_class) { 'note' } let(:inline_admon_class) { 'change' } end + context 'for ga in stack' do + include_context 'change admonition' + let(:name) { 'ga_stack' } + let(:block_admon_class) { 'note' } + let(:inline_admon_class) { 'change' } + end context 'for coming' do include_context 'change admonition' let(:name) { 'coming' } let(:block_admon_class) { 'note' } let(:inline_admon_class) { 'change' } end + context 'for coming in serverless' do + include_context 'change admonition' + let(:name) { 'coming' } + let(:block_admon_class) { 'note' } + let(:inline_admon_class) { 'change' } + end + context 'for coming in ESS' do + include_context 'change admonition' + let(:name) { 'coming' } + let(:block_admon_class) { 'note' } + let(:inline_admon_class) { 'change' } + end context 'for deprecated' do include_context 'change admonition' let(:name) { 'deprecated' } let(:block_admon_class) { 'warning' } let(:inline_admon_class) { 'change' } end - shared_examples 'care admonition' do include_examples 'admonition' let(:invocation) { "#{name}[]" } @@ -140,16 +157,76 @@ let(:name) { 'beta' } let(:inline_admon_class) { 'beta' } end + context 'for beta in serverless' do + include_context 'care admonition' + let(:name) { 'beta_serverless' } + let(:inline_admon_class) { 'Serverless:beta' } + end + context 'for beta in ESS' do + include_context 'care admonition' + let(:name) { 'beta_ess' } + let(:inline_admon_class) { 'ESS:beta' } + end context 'for dev' do include_context 'care admonition' let(:name) { 'dev' } let(:inline_admon_class) { 'dev' } end + context 'for dev in serverless' do + include_context 'care admonition' + let(:name) { 'dev_serverless' } + let(:inline_admon_class) { 'Serverless:dev' } + end + context 'for dev in ESS' do + include_context 'care admonition' + let(:name) { 'dev_ess' } + let(:inline_admon_class) { 'ESS:dev' } + end context 'for experimental' do include_context 'care admonition' let(:name) { 'experimental' } let(:inline_admon_class) { 'preview' } end + context 'for preview in serverless' do + include_context 'care admonition' + let(:name) { 'preview_serverless' } + let(:inline_admon_class) { 'Serverless:preview' } + end + context 'for preview in ESS' do + include_context 'care admonition' + let(:name) { 'preview_ess' } + let(:inline_admon_class) { 'ESS:preview' } + end + context 'for ga in serverless' do + include_context 'care admonition' + let(:name) { 'ga_serverless' } + let(:inline_admon_class) { 'Serverless:GA' } + end + context 'for ga in ESS' do + include_context 'care admonition' + let(:name) { 'ga_ess' } + let(:inline_admon_class) { 'ESS:GA' } + end + context 'for discontinued in serverless' do + include_context 'care admonition' + let(:name) { 'discontinued_serverless' } + let(:inline_admon_class) { 'Serverless:discontinued' } + end + context 'for discontinued in ESS' do + include_context 'care admonition' + let(:name) { 'discontinued_ess' } + let(:inline_admon_class) { 'ESS:discontinued' } + end + context 'for deprecated in serverless' do + include_context 'care admonition' + let(:name) { 'deprecated_serverless' } + let(:inline_admon_class) { 'Serverless:deprecated' } + end + context 'for deprecated in ESS' do + include_context 'care admonition' + let(:name) { 'deprecated_ess' } + let(:inline_admon_class) { 'ESS:deprecated' } + end end context 'when the document contains include-tagged::' do diff --git a/resources/web/docs_js/index-v1.js b/resources/web/docs_js/index-v1.js index b8d6f31a988fc..2b5c3cf951a08 100644 --- a/resources/web/docs_js/index-v1.js +++ b/resources/web/docs_js/index-v1.js @@ -87,7 +87,7 @@ export function init_headers(sticky_content, lang_strings) { // Build list items for all headings except the page title if (0 < items++) { - title_container.find('a,.added,.coming,.deprecated,.experimental') + title_container.find('a,.added,.ga_stack,.ga_serverless,.ga_ess,.coming,.coming_serverless,.coming_ess,.deprecated,.deprecated_serverless,.deprecated_ess,.experimental,.preview_serverless,.preview_ess,.beta,.beta_serverless,.beta_ess,.dev,.dev_serverless,.dev_ess,.discontinued_stack,.discontinued_ess,.discontinued_serverless') .remove(); var text = title_container.html(); if (hLevel !== null) { diff --git a/resources/web/style/toc.pcss b/resources/web/style/toc.pcss index 090b1aff39d09..5aa1463d5c8c1 100644 --- a/resources/web/style/toc.pcss +++ b/resources/web/style/toc.pcss @@ -118,11 +118,27 @@ } .added, + .ga_stack, + .ga_serverless, + .ga_ess, .beta, + .beta_serverless, + .beta_ess, .coming, + .coming_serverless, + .coming_ess, .deprecated, + .deprecated_serverless, + .deprecated_ess, + .discontinued_stack, + .discontinued_serverless, + .discontinued_ess, .dev, - .experimental { + .dev_serverless, + .dev_ess, + .experimental, + .experimental_serverless, + .experimental_ess{ display: none; } } From 6313e5cf5c8b1734c60bcc85025bd25a3fe1c89b Mon Sep 17 00:00:00 2001 From: Liam Thompson Date: Tue, 12 Nov 2024 17:47:24 +0100 Subject: [PATCH 02/11] Use term: Elastic Cloud Serverless --- .../asciidoctor/lib/care_admonition/extension.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/resources/asciidoctor/lib/care_admonition/extension.rb b/resources/asciidoctor/lib/care_admonition/extension.rb index f88d9efacc5a6..9aaaebe953cbd 100644 --- a/resources/asciidoctor/lib/care_admonition/extension.rb +++ b/resources/asciidoctor/lib/care_admonition/extension.rb @@ -49,7 +49,7 @@ class CareAdmonition < Asciidoctor::Extensions::Group This functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features. TEXT BETA_SERVERLESS_TEXT = <<~TEXT.strip - This functionality is in beta in Elastic Serverless and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features. + This functionality is in beta in Elastic Cloud Serverless and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features. TEXT BETA_ESS_TEXT = <<~TEXT.strip This functionality is in beta in Elasticsearch Service and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features. @@ -58,7 +58,7 @@ class CareAdmonition < Asciidoctor::Extensions::Group This functionality is in development and may be changed or removed completely in a future release. These features are unsupported and not subject to the support SLA of official GA features. TEXT DEV_SERVERLESS_TEXT = <<~TEXT.strip - This functionality is in development in Elastic Serverless and may be changed or removed completely in a future release. These features are unsupported and not subject to the support SLA of official GA features. + This functionality is in development in Elastic Cloud Serverless and may be changed or removed completely in a future release. These features are unsupported and not subject to the support SLA of official GA features. TEXT DEV_ESS_TEXT = <<~TEXT.strip This functionality is in development in Elasticsearch Service and may be changed or removed completely in a future release. These features are unsupported and not subject to the support SLA of official GA features. @@ -67,7 +67,7 @@ class CareAdmonition < Asciidoctor::Extensions::Group This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. TEXT PREVIEW_SERVERLESS_TEXT = <<~TEXT.strip - This functionality is in technical preview in Elastic Serverless and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + This functionality is in technical preview in Elastic Cloud Serverless and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. TEXT PREVIEW_ESS_TEXT = <<~TEXT.strip This functionality is in technical in preview in Elasticsearch Service and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. @@ -76,25 +76,25 @@ class CareAdmonition < Asciidoctor::Extensions::Group This functionality is deprecated in Elasticsearch Service and will be removed in a future release. TEXT DEPRECATED_SERVERLESS_TEXT = <<~TEXT.strip - This functionality is deprecated in Elastic Serverless and will be removed in a future release. + This functionality is deprecated in Elastic Cloud Serverless and will be removed in a future release. TEXT DISCONTINUED_ESS_TEXT = <<~TEXT.strip This functionality is discontinued in Elasticsearch Service. TEXT DISCONTINUED_SERVERLESS_TEXT = <<~TEXT.strip - This functionality is discontinued in Elastic Serverless. + This functionality is discontinued in Elastic Cloud Serverless. TEXT COMING_ESS_TEXT = <<~TEXT.strip This functionality is coming in Elasticsearch Service. TEXT COMING_SERVERLESS_TEXT = <<~TEXT.strip - This functionality is coming in Elastic Serverless. + This functionality is coming in Elastic Cloud Serverless. TEXT GA_ESS_TEXT = <<~TEXT.strip This functionality is generally available in Elasticsearch Service. TEXT GA_SERVERLESS_TEXT = <<~TEXT.strip - This functionality is generally available in Elastic Serverless. + This functionality is generally available in Elastic Cloud Serverless. TEXT def activate(registry) From c1b3221ecd85201af01db7dcf26a9009414be194 Mon Sep 17 00:00:00 2001 From: Colleen McGinnis Date: Tue, 19 Nov 2024 09:00:38 -0600 Subject: [PATCH 03/11] add new status_badge extension --- .../lib/docbook_compat/convert_admonition.rb | 6 +- resources/asciidoctor/lib/extensions.rb | 2 + .../asciidoctor/lib/status_badge/extension.rb | 147 ++++++++++++++++++ resources/web/docs_js/index-v1.js | 5 +- resources/web/style/admonishment.pcss | 114 ++++++++++++-- resources/web/style/heading.pcss | 5 + 6 files changed, 257 insertions(+), 22 deletions(-) create mode 100644 resources/asciidoctor/lib/status_badge/extension.rb diff --git a/resources/asciidoctor/lib/docbook_compat/convert_admonition.rb b/resources/asciidoctor/lib/docbook_compat/convert_admonition.rb index 7b4fb4a6ed55e..8833536026585 100644 --- a/resources/asciidoctor/lib/docbook_compat/convert_admonition.rb +++ b/resources/asciidoctor/lib/docbook_compat/convert_admonition.rb @@ -59,9 +59,9 @@ def convert_inline_admonition_for_real(node) title_classes = "Admonishment-#{node.attr 'title_type'} #{node.attr 'title_class'}" [ - %(), - %([#{node.attr 'title'}]), - '', + %(), + %(#{node.attr 'title'}), + %(), node.text, '', '', diff --git a/resources/asciidoctor/lib/extensions.rb b/resources/asciidoctor/lib/extensions.rb index cd958f7da9d5e..1986d7bd5e429 100644 --- a/resources/asciidoctor/lib/extensions.rb +++ b/resources/asciidoctor/lib/extensions.rb @@ -15,6 +15,7 @@ require_relative 'lang_override/extension' require_relative 'open_in_widget/extension' require_relative 'relativize_link/extension' +require_relative 'status_badge/extension' Asciidoctor::Extensions.register do # Enable storing the source locations so we can look at them. This is required @@ -42,3 +43,4 @@ include_processor GlobIncludeProcessor end Asciidoctor::Extensions.register AlternativeLanguageLookup +Asciidoctor::Extensions.register StatusBadge diff --git a/resources/asciidoctor/lib/status_badge/extension.rb b/resources/asciidoctor/lib/status_badge/extension.rb new file mode 100644 index 0000000000000..5e2c0aec66754 --- /dev/null +++ b/resources/asciidoctor/lib/status_badge/extension.rb @@ -0,0 +1,147 @@ +# frozen_string_literal: true + +require 'asciidoctor/extensions' + +class StatusBadge < Asciidoctor::Extensions::Group + def activate(registry) + registry.inline_macro StatusBadgeInline.new(), :status_badge + end + + class StatusBadgeInline < Asciidoctor::Extensions::InlineMacroProcessor + use_dsl + name_positional_attributes :deployment_type, :availability, :version + + def initialize() + super(nil) + end + + def generate_tooltip_text(deployment_type, availability_type, version) + # Deployment type + if deployment_type == 'serverless' + deployment_long_name = 'Elastic Cloud Serverless' + elsif deployment_type == 'hosted' + deployment_long_name = 'Elastic Cloud Hosted' + elsif deployment_type == 'stack' + deployment_long_name = 'Elastic Stack' + elsif deployment_type == 'cloud' + deployment_long_name = 'Elastic Cloud' + elsif deployment_type == 'ece' + deployment_long_name = 'Elastic Cloud Enterprise' + elsif deployment_type == 'eck' + deployment_long_name = 'Elastic Cloud Kubernetes' + elsif deployment_type == 'self_managed' + deployment_long_name = 'Self-managed' + end + + # Availability + if availability_type == 'preview' + availability_tooltip_text = ' is in technical preview' + availability_long_description = 'This functionality may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.' + elsif availability_type == 'beta' + availability_tooltip_text = ' is in beta' + availability_long_description = 'This functionality is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.' + elsif availability_type == 'ga' + availability_tooltip_text = ' is generally available' + availability_long_description = '' + elsif availability_type == 'coming' + availability_tooltip_text = ' is coming soon' + availability_long_description = 'This functionality is expected in an upcoming version, but is not guaranteed.' + elsif availability_type == 'deprecated' + availability_tooltip_text = ' is deprecated' + availability_long_description = 'This will be removed in a future release.' + elsif availability_type == 'discontinued' + availability_tooltip_text = ' was discontinued' + availability_long_description = '' + elsif availability_type == 'unavailable' + availability_tooltip_text = ' is unavailable' + availability_long_description = '' + else + availability_tooltip_text = ' is available' + availability_long_description = '' + end + + text = 'This functionality' + text += availability_tooltip_text + text += ' in ' + text += deployment_long_name + if version + text += ' starting in ' + text += version + end + text += '. ' + text += availability_long_description + text + end + + def generate_badge_text(deployment_type, availability_type, version) + # Deployment/product type + if deployment_type == 'serverless' + deployment_short_name = 'Serverless' + elsif deployment_type == 'hosted' + deployment_short_name = 'Hosted' + elsif deployment_type == 'stack' + deployment_short_name = 'Elastic Stack' + elsif deployment_type == 'cloud' + deployment_short_name = 'Elastic Cloud' + elsif deployment_type == 'ece' + deployment_short_name = 'ECE' + elsif deployment_type == 'eck' + deployment_short_name = 'ECK' + elsif deployment_type == 'self_managed' + deployment_short_name = 'Self-managed' + end + + # Availability + if availability_type == 'preview' + availability_badge_text = 'Technical preview' + elsif availability_type == 'beta' + availability_badge_text = 'Beta' + # elsif availability_type == 'ga' + # availability_badge_text = '' + elsif availability_type == 'coming' + availability_badge_text = 'Coming soon' + elsif availability_type == 'deprecated' + availability_badge_text = 'Deprecated' + elsif availability_type == 'discontinued' + availability_badge_text = 'Discontinued' + elsif availability_type == 'unavailable' + availability_badge_text + end + + text = deployment_short_name + if availability_badge_text + text += ': ' + text += availability_badge_text + end + if version + text += ' (' + text += version + text += ')' + end + text + end + + def process(parent, _target, attrs) + badge_text = generate_badge_text(attrs[:deployment_type], attrs[:availability], attrs[:version]) + text = generate_tooltip_text(attrs[:deployment_type], attrs[:availability], attrs[:version]) + classes = ' Admonishment--' + attrs[:deployment_type] + tooltip_id = 'tooltip--' + tooltip_id += attrs[:deployment_type] + if attrs[:availability] + classes += ' Admonishment--' + attrs[:availability] + tooltip_id += '_' + attrs[:availability] + end + if attrs[:version] + tooltip_id += '_' + attrs[:version] + end + Asciidoctor::Inline.new( + parent, :admonition, text, type: :status_badge, attributes: { + 'title_type' => 'title', + 'title_class' => classes, + 'title' => badge_text, + 'tooltip_id' => tooltip_id + } + ) + end + end +end \ No newline at end of file diff --git a/resources/web/docs_js/index-v1.js b/resources/web/docs_js/index-v1.js index 2b5c3cf951a08..0ad27135f8bab 100644 --- a/resources/web/docs_js/index-v1.js +++ b/resources/web/docs_js/index-v1.js @@ -87,9 +87,10 @@ export function init_headers(sticky_content, lang_strings) { // Build list items for all headings except the page title if (0 < items++) { - title_container.find('a,.added,.ga_stack,.ga_serverless,.ga_ess,.coming,.coming_serverless,.coming_ess,.deprecated,.deprecated_serverless,.deprecated_ess,.experimental,.preview_serverless,.preview_ess,.beta,.beta_serverless,.beta_ess,.dev,.dev_serverless,.dev_ess,.discontinued_stack,.discontinued_ess,.discontinued_serverless') + // title_container.find('a,.added,.ga_stack,.ga_serverless,.ga_ess,.coming,.coming_serverless,.coming_ess,.deprecated,.deprecated_serverless,.deprecated_ess,.experimental,.preview_serverless,.preview_ess,.beta,.beta_serverless,.beta_ess,.dev,.dev_serverless,.dev_ess,.discontinued_stack,.discontinued_ess,.discontinued_serverless') + title_container.find('a,.Admonishment.Admonishment--status_badge,.added,.coming,.deprecated,.Admonishment--Experimental,.Admonishment--Preview,.Admonishment--Beta,.Admonishment--Dev') .remove(); - var text = title_container.html(); + let text = title_container.html(); if (hLevel !== null) { const li = '
  • ' + text + '
  • '; ul.append(li); diff --git a/resources/web/style/admonishment.pcss b/resources/web/style/admonishment.pcss index 9ad227cd23838..8d8848a7f514d 100644 --- a/resources/web/style/admonishment.pcss +++ b/resources/web/style/admonishment.pcss @@ -5,36 +5,116 @@ &:hover { color: black; transition: all 0.3s ease; + .Admonishment-detail { z-index: 10000; - left: -5em; - opacity: 1; - color: #555; - transition: color 0.5s ease; + visibility: visible; + height: auto; + min-width: 250px; + bottom: 30px; + left: -6em; + padding: 8px; + border: 1px solid #69707D; } } - &-title, &-version { - font-size: 0.8em; - border-bottom: 1px dashed #00a9e5; - } - + &[role="tooltip"], &-detail { - min-width: 250px; + height: 0; + width: 0; position: absolute; - padding: 15px; - border: 3px solid #e8e8e8; - background: white; - opacity: 0; + background: #343741; + visibility: collapse; color: white; - left: -20000px; - bottom: 20px; line-height: 1.2em; + left: 50%; + right: 50%; + font-size: 14px; + font-weight: 400; + border-radius: 3px; + &:after { + content: ""; + position: absolute; + top: 100%; + left: 50%; + margin-left: -5px; + border-width: 5px; + border-style: solid; + border-color: #343741 transparent transparent transparent; + } + } + + .Admonishment-title { + cursor: pointer; + font-size: 13px; + font-weight: 500; + padding: 4px 6px 4px 4px; + border-radius: 3px; + color: #000; + background-color: #e6f1fa; + border: 1px solid #07C; + &:before { + transform: translateY(3px); + } + + &.Admonishment--preview, + &.Admonishment--beta { + background-color: #fff9e8; + border: 1px solid rgb(131, 101, 10); + } + + &.Admonishment--preview { + &:before { + display: inline-block; + padding-right: 4px; + content: url('data:image/svg+xml;utf8,'); + } + } + + &.Admonishment--beta { + &:before { + display: inline-block; + padding-right: 4px; + content: url('data:image/svg+xml;utf8,'); + } + } + + &.Admonishment--ga { + background-color: #e6f9f7; + border: 1px solid rgb(0, 120, 113); + &:before { + display: inline-block; + padding-right: 4px; + content: url('data:image/svg+xml;utf8,'); + } + } + + &.Admonishment--deprecated, + &.Admonishment--discontinued { + background-color: #f8e9e9; + border: 1px solid rgb(189, 39, 30); + &:before { + display: inline-block; + padding-right: 4px; + content: url('data:image/svg+xml;utf8,'); + } + } + + &.Admonishment--unavailable { + background-color: #F1F4FA; + border: 1px solid #69707D; + &:before { + display: inline-block; + padding-right: 4px; + content: url('data:image/svg+xml;utf8,') + } + } } } + .admon { font-weight: normal; - background: #fbfbfb; + background-color: #F1F4FA; padding: 10px; min-height: 70px; margin: 15px 0 24px; diff --git a/resources/web/style/heading.pcss b/resources/web/style/heading.pcss index e1bec88bfce9c..129d6f37bfcad 100644 --- a/resources/web/style/heading.pcss +++ b/resources/web/style/heading.pcss @@ -18,6 +18,11 @@ background-position: 0% 50%; background-image: inline("img/link.png"); } + .Admonishment.Admonishment--status_badge { + display: inline-block; + margin-left: 6px; + transform: translateY(-0.3rem); + } } h2 { font-size: 29px; From 615324db4d8e5f3cc29457b30b547648ee5cc315 Mon Sep 17 00:00:00 2001 From: Colleen McGinnis Date: Tue, 19 Nov 2024 09:01:03 -0600 Subject: [PATCH 04/11] make other badges backward compatible --- .../lib/care_admonition/extension.rb | 56 +++++++++++-------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/resources/asciidoctor/lib/care_admonition/extension.rb b/resources/asciidoctor/lib/care_admonition/extension.rb index 9aaaebe953cbd..2be49a8efb182 100644 --- a/resources/asciidoctor/lib/care_admonition/extension.rb +++ b/resources/asciidoctor/lib/care_admonition/extension.rb @@ -99,35 +99,41 @@ class CareAdmonition < Asciidoctor::Extensions::Group def activate(registry) [ - [:beta, 'beta', BETA_DEFAULT_TEXT], - [:beta_serverless, 'Serverless:beta', BETA_SERVERLESS_TEXT], - [:beta_ess, 'ESS:beta', BETA_ESS_TEXT], - [:dev, 'dev', DEV_DEFAULT_TEXT], - [:dev_serverless, 'Serverless:dev', DEV_SERVERLESS_TEXT], - [:dev_ess, 'ESS:dev', DEV_ESS_TEXT], - [:experimental, 'preview', PREVIEW_DEFAULT_TEXT], - [:preview, 'preview', PREVIEW_DEFAULT_TEXT], - [:preview_serverless, 'Serverless:preview', PREVIEW_SERVERLESS_TEXT], - [:preview_ess, 'ESS:preview', PREVIEW_ESS_TEXT], + [:beta, 'Beta', 'beta', BETA_DEFAULT_TEXT], + [:beta_serverless, 'Serverless: Beta', 'serverless_beta', BETA_SERVERLESS_TEXT], + [:beta_ess, 'ESS: Beta', 'ess_beta', BETA_ESS_TEXT], + [:dev, 'dev', 'dev', DEV_DEFAULT_TEXT], + [:dev_serverless, 'Serverless: Dev', 'serverless_dev', DEV_SERVERLESS_TEXT], + [:dev_ess, 'ESS: Dev', 'ess_dev', DEV_ESS_TEXT], + [:experimental, 'preview', 'preview', PREVIEW_DEFAULT_TEXT], + [:preview, 'Preview', 'preview', PREVIEW_DEFAULT_TEXT], + [:preview_serverless, 'Serverless: Preview', 'serverless_preview', PREVIEW_SERVERLESS_TEXT], + [:preview_ess, 'ESS: Preview', 'ess_preview', PREVIEW_ESS_TEXT], [ :deprecated_serverless, - 'Serverless:deprecated', + 'Serverless: Deprecated', + 'serverless_deprecated', DEPRECATED_SERVERLESS_TEXT, ], - [:deprecated_ess, 'ESS:deprecated', DEPRECATED_ESS_TEXT], + [:deprecated_ess, 'ESS: Deprecated', 'hello', DEPRECATED_ESS_TEXT], [ :discontinued_serverless, - 'Serverless:discontinued', + 'Serverless: Removed', + 'serverless_removed', DISCONTINUED_SERVERLESS_TEXT, ], - [:discontinued_ess, 'ESS:discontinued', DISCONTINUED_ESS_TEXT], - [:coming_serverless, 'Serverless:coming', COMING_SERVERLESS_TEXT], - [:coming_ess, 'ESS:coming', COMING_ESS_TEXT], - [:ga_serverless, 'Serverless:GA', GA_SERVERLESS_TEXT], - [:ga_ess, 'ESS:GA', GA_ESS_TEXT], - ].each do |(name, role, default_text)| - registry.block_macro ChangeAdmonitionBlock.new(role, default_text), name - registry.inline_macro ChangeAdmonitionInline.new(role, default_text), name + [:discontinued_ess, 'ESS: Removed', 'ess_removed', DISCONTINUED_ESS_TEXT], + [:coming_serverless, 'Serverless: Coming soon', 'serverless_coming', COMING_SERVERLESS_TEXT], + [:coming_ess, 'ESS: Coming soon', 'ess_coming', COMING_ESS_TEXT], + [:ga_serverless, 'Serverless: GA', 'serverless_ga', GA_SERVERLESS_TEXT], + [:ga_ess, 'ESS: GA', 'ess_ga', GA_ESS_TEXT], + [:serverless_available, 'Serverless', 'serverless_available', GA_SERVERLESS_TEXT], + [:ess_available, 'ESS', 'ess_available', GA_ESS_TEXT], + [:serverless_unavailable, 'Serverless', 'serverless_unavailable', 'This functionality is not available in Elastic Cloud Serverless.'], + [:ess_unavailable, 'ESS', 'ess_unavailable', 'This functionality is not available in Elasticsearch Service.'], + ].each do |(name, role, classname, default_text)| + registry.block_macro ChangeAdmonitionBlock.new(role, classname, default_text), name + registry.inline_macro ChangeAdmonitionInline.new(role, classname, default_text), name end end @@ -137,9 +143,10 @@ class ChangeAdmonitionBlock < Asciidoctor::Extensions::BlockMacroProcessor use_dsl name_positional_attributes :passtext, :issue_url - def initialize(role, default_text) + def initialize(role, classname, default_text) super(nil) @role = role + @classname = classname @default_text = default_text end @@ -188,9 +195,10 @@ class ChangeAdmonitionInline < Asciidoctor::Extensions::InlineMacroProcessor name_positional_attributes :text format :short - def initialize(role, default_text) + def initialize(role, classname, default_text) super(nil) @role = role + @classname = 'Admonishment--' + classname @default_text = default_text end @@ -200,7 +208,7 @@ def process(parent, _target, attrs) Asciidoctor::Inline.new( parent, :admonition, text, type: @role, attributes: { 'title_type' => 'title', - 'title_class' => 'u-mono', + 'title_class' => @classname, 'title' => @role, } ) From 05157fe0cb67719df51139e37512b72f6a443f8b Mon Sep 17 00:00:00 2001 From: Colleen McGinnis Date: Tue, 19 Nov 2024 09:43:41 -0600 Subject: [PATCH 05/11] temporarily comment out non obs docs sources --- conf.yaml | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/conf.yaml b/conf.yaml index d452d60351a2e..2b1a77f429900 100644 --- a/conf.yaml +++ b/conf.yaml @@ -439,31 +439,31 @@ contents: - repo: observability-docs path: docs/en - - - repo: ingest-docs - path: docs/en - - - repo: apm-server - path: docs - exclude_branches: [ 8.11, 8.10, 8.9, 8.8, 8.7, 8.6, 8.5, 8.4, 8.3, 8.2, 8.1, 8.0, 7.17, 7.16, 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1, 6.0, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0 ] - - - repo: apm-server - path: changelogs - exclude_branches: [ 8.11, 8.10, 8.9, 8.8, 8.7, 8.6, 8.5, 8.4, 8.3, 8.2, 8.1, 8.0, 7.17, 7.16, 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1, 6.0, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0 ] - - - repo: apm-server - path: CHANGELOG.asciidoc - exclude_branches: [ 8.11, 8.10, 8.9, 8.8, 8.7, 8.6, 8.5, 8.4, 8.3, 8.2, 8.1, 8.0, 7.17, 7.16, 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1, 6.0, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0 ] - - - repo: beats - path: libbeat/docs - exclude_branches: [ 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1, 6.0, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0 ] - - - repo: docs - path: shared/versions/stack/{version}.asciidoc - - - repo: docs - path: shared/attributes.asciidoc + # - + # repo: ingest-docs + # path: docs/en + # - + # repo: apm-server + # path: docs + # exclude_branches: [ 8.11, 8.10, 8.9, 8.8, 8.7, 8.6, 8.5, 8.4, 8.3, 8.2, 8.1, 8.0, 7.17, 7.16, 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1, 6.0, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0 ] + # - + # repo: apm-server + # path: changelogs + # exclude_branches: [ 8.11, 8.10, 8.9, 8.8, 8.7, 8.6, 8.5, 8.4, 8.3, 8.2, 8.1, 8.0, 7.17, 7.16, 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1, 6.0, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0 ] + # - + # repo: apm-server + # path: CHANGELOG.asciidoc + # exclude_branches: [ 8.11, 8.10, 8.9, 8.8, 8.7, 8.6, 8.5, 8.4, 8.3, 8.2, 8.1, 8.0, 7.17, 7.16, 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1, 6.0, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0 ] + # - + # repo: beats + # path: libbeat/docs + # exclude_branches: [ 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1, 6.0, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0 ] + # - + # repo: docs + # path: shared/versions/stack/{version}.asciidoc + # - + # repo: docs + # path: shared/attributes.asciidoc - title: Application Performance Monitoring (APM) base_dir: en/apm toc_extra: extra/apm_docs_landing.html From eed714de6f1321a59adbbf853dc41a52b0631564 Mon Sep 17 00:00:00 2001 From: Colleen McGinnis Date: Tue, 19 Nov 2024 09:50:51 -0600 Subject: [PATCH 06/11] make separate test book --- conf.yaml | 65 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 25 deletions(-) diff --git a/conf.yaml b/conf.yaml index 2b1a77f429900..a06e79c0b1065 100644 --- a/conf.yaml +++ b/conf.yaml @@ -125,6 +125,21 @@ variables: toc_extra: extra/docs_landing.html contents: + - title: Observability (Serverless + Stateful) + sections: + - title: Observability (Serverless + Stateful) + prefix: en/observability-combo + current: status-badges + branches: [ status-badges ] + live: [ status-badges ] + index: observability/index.asciidoc + chunk: 4 + tags: Serverless/Guide + subject: Serverless + sources: + - + repo: observability-docs + path: docs/en/serverless - title: Serverless sections: - title: Serverless @@ -439,31 +454,31 @@ contents: - repo: observability-docs path: docs/en - # - - # repo: ingest-docs - # path: docs/en - # - - # repo: apm-server - # path: docs - # exclude_branches: [ 8.11, 8.10, 8.9, 8.8, 8.7, 8.6, 8.5, 8.4, 8.3, 8.2, 8.1, 8.0, 7.17, 7.16, 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1, 6.0, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0 ] - # - - # repo: apm-server - # path: changelogs - # exclude_branches: [ 8.11, 8.10, 8.9, 8.8, 8.7, 8.6, 8.5, 8.4, 8.3, 8.2, 8.1, 8.0, 7.17, 7.16, 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1, 6.0, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0 ] - # - - # repo: apm-server - # path: CHANGELOG.asciidoc - # exclude_branches: [ 8.11, 8.10, 8.9, 8.8, 8.7, 8.6, 8.5, 8.4, 8.3, 8.2, 8.1, 8.0, 7.17, 7.16, 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1, 6.0, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0 ] - # - - # repo: beats - # path: libbeat/docs - # exclude_branches: [ 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1, 6.0, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0 ] - # - - # repo: docs - # path: shared/versions/stack/{version}.asciidoc - # - - # repo: docs - # path: shared/attributes.asciidoc + - + repo: ingest-docs + path: docs/en + - + repo: apm-server + path: docs + exclude_branches: [ 8.11, 8.10, 8.9, 8.8, 8.7, 8.6, 8.5, 8.4, 8.3, 8.2, 8.1, 8.0, 7.17, 7.16, 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1, 6.0, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0 ] + - + repo: apm-server + path: changelogs + exclude_branches: [ 8.11, 8.10, 8.9, 8.8, 8.7, 8.6, 8.5, 8.4, 8.3, 8.2, 8.1, 8.0, 7.17, 7.16, 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1, 6.0, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0 ] + - + repo: apm-server + path: CHANGELOG.asciidoc + exclude_branches: [ 8.11, 8.10, 8.9, 8.8, 8.7, 8.6, 8.5, 8.4, 8.3, 8.2, 8.1, 8.0, 7.17, 7.16, 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1, 6.0, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0 ] + - + repo: beats + path: libbeat/docs + exclude_branches: [ 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1, 6.0, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0 ] + - + repo: docs + path: shared/versions/stack/{version}.asciidoc + - + repo: docs + path: shared/attributes.asciidoc - title: Application Performance Monitoring (APM) base_dir: en/apm toc_extra: extra/apm_docs_landing.html From f6e67933820f248fec920ac3b76bab976d574e2d Mon Sep 17 00:00:00 2001 From: Colleen McGinnis Date: Tue, 19 Nov 2024 09:52:21 -0600 Subject: [PATCH 07/11] fix conf --- conf.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf.yaml b/conf.yaml index a06e79c0b1065..90257015f46b9 100644 --- a/conf.yaml +++ b/conf.yaml @@ -134,12 +134,12 @@ contents: live: [ status-badges ] index: observability/index.asciidoc chunk: 4 - tags: Serverless/Guide - subject: Serverless + tags: Observability/Serverless/Stateful + subject: Observability sources: - repo: observability-docs - path: docs/en/serverless + path: docs/en/observability - title: Serverless sections: - title: Serverless From 5506b884786c1732fa306d81a3ceef9f74880687 Mon Sep 17 00:00:00 2001 From: Colleen McGinnis Date: Tue, 19 Nov 2024 10:07:18 -0600 Subject: [PATCH 08/11] really fix config --- conf.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf.yaml b/conf.yaml index 90257015f46b9..26df7fdd12df9 100644 --- a/conf.yaml +++ b/conf.yaml @@ -132,14 +132,14 @@ contents: current: status-badges branches: [ status-badges ] live: [ status-badges ] - index: observability/index.asciidoc + index: docs/en/observability/index.asciidoc chunk: 4 tags: Observability/Serverless/Stateful subject: Observability sources: - repo: observability-docs - path: docs/en/observability + path: docs/en - title: Serverless sections: - title: Serverless From e7e3b8a861242a23f02758e1bcf0313fc1d97541 Mon Sep 17 00:00:00 2001 From: Colleen McGinnis Date: Tue, 19 Nov 2024 13:48:26 -0600 Subject: [PATCH 09/11] format page-level status badges --- resources/web/docs_js/index-v1.js | 12 ++++++ resources/web/style/admonishment.pcss | 59 +++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/resources/web/docs_js/index-v1.js b/resources/web/docs_js/index-v1.js index 0ad27135f8bab..a83cff7b19b95 100644 --- a/resources/web/docs_js/index-v1.js +++ b/resources/web/docs_js/index-v1.js @@ -423,6 +423,18 @@ $(function() { }) } + $('.availability-note').prepend('') + $('.availability-note').append('Unless explicitly noted, all features described on this page are available in the following conditions.'); + + $('.availability-note-icon').hover( + function (e) { + $('.availability-note-tooltip').addClass('show') + }, + function (e) { + $('.availability-note-tooltip').removeClass('show') + } + ) + // Move rtp container to top right and make visible var sticky_content = $('#sticky_content'); // Left column that contains the TOC diff --git a/resources/web/style/admonishment.pcss b/resources/web/style/admonishment.pcss index 8d8848a7f514d..267956af80f61 100644 --- a/resources/web/style/admonishment.pcss +++ b/resources/web/style/admonishment.pcss @@ -1,4 +1,63 @@ #guide { + p { + &:has(> span.availability-note) { + padding-bottom: 20px; + border-bottom: 1px solid #dee2e6; + } + } + .availability-note { + font-weight: 600; + font-size: 14px; + position: relative; + display: inline-block; + /* padding-right: 3px; */ + &:before { + content: url('data:image/svg+xml;utf8,'); + transform: translateY(3px); + margin-right: 3px; + display: inline-block; + pointer-events: none; + } + .availability-note-icon { + display: inline-block; + width: 20px; + height: 20px; + position: absolute; + left: 0; + bottom: 0; + cursor: pointer; + } + .availability-note-tooltip { + display: none; + left: -92px; + top: -90px; + position: absolute; + background: #343741; + color: white; + line-height: 1.2em; + font-size: 14px; + font-weight: 400; + border-radius: 3px; + z-index: 10000; + visibility: visible; + width: 200px; + padding: 8px; + /* border: 1px solid #69707D; */ + &:after { + content: ""; + position: absolute; + top: 100%; + left: 50%; + margin-left: -5px; + border-width: 5px; + border-style: solid; + border-color: #343741 transparent transparent transparent; + } + &.show { + display: block; + } + } + } .Admonishment { position: relative; From 765f9c3c324f8890f87ae374c9f0ff812cde7760 Mon Sep 17 00:00:00 2001 From: Colleen McGinnis Date: Tue, 26 Nov 2024 10:18:56 -0600 Subject: [PATCH 10/11] update terms, page annotation style --- .../asciidoctor/lib/status_badge/extension.rb | 32 +++----- resources/web/style/admonishment.pcss | 78 +++++-------------- resources/web/style/docbook.pcss | 2 +- 3 files changed, 34 insertions(+), 78 deletions(-) diff --git a/resources/asciidoctor/lib/status_badge/extension.rb b/resources/asciidoctor/lib/status_badge/extension.rb index 5e2c0aec66754..3ae6dcea0fa6e 100644 --- a/resources/asciidoctor/lib/status_badge/extension.rb +++ b/resources/asciidoctor/lib/status_badge/extension.rb @@ -17,20 +17,16 @@ def initialize() def generate_tooltip_text(deployment_type, availability_type, version) # Deployment type - if deployment_type == 'serverless' + if deployment_type == 'cloud_serverless' deployment_long_name = 'Elastic Cloud Serverless' - elsif deployment_type == 'hosted' + elsif deployment_type == 'cloud_hosted' deployment_long_name = 'Elastic Cloud Hosted' - elsif deployment_type == 'stack' - deployment_long_name = 'Elastic Stack' - elsif deployment_type == 'cloud' - deployment_long_name = 'Elastic Cloud' elsif deployment_type == 'ece' deployment_long_name = 'Elastic Cloud Enterprise' elsif deployment_type == 'eck' - deployment_long_name = 'Elastic Cloud Kubernetes' - elsif deployment_type == 'self_managed' - deployment_long_name = 'Self-managed' + deployment_long_name = 'Elastic Cloud on Kubernetes' + elsif deployment_type == 'stack_self_managed' + deployment_long_name = 'Elastic Stack Self-managed' end # Availability @@ -75,19 +71,15 @@ def generate_tooltip_text(deployment_type, availability_type, version) def generate_badge_text(deployment_type, availability_type, version) # Deployment/product type - if deployment_type == 'serverless' - deployment_short_name = 'Serverless' - elsif deployment_type == 'hosted' - deployment_short_name = 'Hosted' - elsif deployment_type == 'stack' - deployment_short_name = 'Elastic Stack' - elsif deployment_type == 'cloud' - deployment_short_name = 'Elastic Cloud' + if deployment_type == 'cloud_serverless' + deployment_short_name = 'Cloud Serverless' + elsif deployment_type == 'cloud_hosted' + deployment_short_name = 'Cloud Hosted' elsif deployment_type == 'ece' deployment_short_name = 'ECE' elsif deployment_type == 'eck' deployment_short_name = 'ECK' - elsif deployment_type == 'self_managed' + elsif deployment_type == 'stack_self_managed' deployment_short_name = 'Self-managed' end @@ -96,8 +88,8 @@ def generate_badge_text(deployment_type, availability_type, version) availability_badge_text = 'Technical preview' elsif availability_type == 'beta' availability_badge_text = 'Beta' - # elsif availability_type == 'ga' - # availability_badge_text = '' + elsif availability_type == 'ga' + availability_badge_text = 'GA' elsif availability_type == 'coming' availability_badge_text = 'Coming soon' elsif availability_type == 'deprecated' diff --git a/resources/web/style/admonishment.pcss b/resources/web/style/admonishment.pcss index 267956af80f61..25948b952ec39 100644 --- a/resources/web/style/admonishment.pcss +++ b/resources/web/style/admonishment.pcss @@ -1,70 +1,31 @@ #guide { - p { - &:has(> span.availability-note) { + #content > .section > .titlepage + p { + padding-top: 30px; + border-top: 1px solid #dee2e6; + &:has(> .Admonishment--status_badge) { + padding-top: 0; + border-top: none; padding-bottom: 20px; border-bottom: 1px solid #dee2e6; + margin-bottom: 30px; } } - .availability-note { - font-weight: 600; - font-size: 14px; - position: relative; - display: inline-block; - /* padding-right: 3px; */ - &:before { - content: url('data:image/svg+xml;utf8,'); - transform: translateY(3px); - margin-right: 3px; - display: inline-block; - pointer-events: none; - } - .availability-note-icon { - display: inline-block; - width: 20px; - height: 20px; - position: absolute; - left: 0; - bottom: 0; - cursor: pointer; - } - .availability-note-tooltip { - display: none; - left: -92px; - top: -90px; - position: absolute; - background: #343741; - color: white; - line-height: 1.2em; - font-size: 14px; - font-weight: 400; - border-radius: 3px; - z-index: 10000; - visibility: visible; - width: 200px; - padding: 8px; - /* border: 1px solid #69707D; */ - &:after { - content: ""; - position: absolute; - top: 100%; - left: 50%; - margin-left: -5px; - border-width: 5px; - border-style: solid; - border-color: #343741 transparent transparent transparent; - } - &.show { - display: block; - } + #content > .chapter > .titlepage + p { + padding-top: 30px; + border-top: 1px solid #dee2e6; + &:has(> .Admonishment--status_badge) { + padding-top: 0; + border-top: none; + padding-bottom: 20px; + border-bottom: 1px solid #dee2e6; + margin-bottom: 30px; } } .Admonishment { position: relative; - &:hover { color: black; transition: all 0.3s ease; - .Admonishment-detail { z-index: 10000; visibility: visible; @@ -73,10 +34,9 @@ bottom: 30px; left: -6em; padding: 8px; - border: 1px solid #69707D; + border: 1px solid #343741; } } - &[role="tooltip"], &-detail { height: 0; @@ -120,6 +80,7 @@ &.Admonishment--beta { background-color: #fff9e8; border: 1px solid rgb(131, 101, 10); + white-space: nowrap; } &.Admonishment--preview { @@ -141,6 +102,7 @@ &.Admonishment--ga { background-color: #e6f9f7; border: 1px solid rgb(0, 120, 113); + white-space: nowrap; &:before { display: inline-block; padding-right: 4px; @@ -152,6 +114,7 @@ &.Admonishment--discontinued { background-color: #f8e9e9; border: 1px solid rgb(189, 39, 30); + white-space: nowrap; &:before { display: inline-block; padding-right: 4px; @@ -162,6 +125,7 @@ &.Admonishment--unavailable { background-color: #F1F4FA; border: 1px solid #69707D; + white-space: nowrap; &:before { display: inline-block; padding-right: 4px; diff --git a/resources/web/style/docbook.pcss b/resources/web/style/docbook.pcss index 86827b03d4b92..606356b6f9157 100644 --- a/resources/web/style/docbook.pcss +++ b/resources/web/style/docbook.pcss @@ -11,7 +11,7 @@ .book div.part, .book div.chapter, .chapter div.section { - margin-top: 2em; + /* margin-top: 2em; */ } } From e2efc28d2afc33be2499aa2a4cb38a1fe94d76c4 Mon Sep 17 00:00:00 2001 From: Colleen McGinnis Date: Tue, 26 Nov 2024 17:45:15 -0600 Subject: [PATCH 11/11] add added --- .../asciidoctor/lib/status_badge/extension.rb | 13 ++++++++++++- resources/web/style/admonishment.pcss | 18 +++++++++++++++--- resources/web/style/table.pcss | 4 ++-- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/resources/asciidoctor/lib/status_badge/extension.rb b/resources/asciidoctor/lib/status_badge/extension.rb index 3ae6dcea0fa6e..d38c14e882365 100644 --- a/resources/asciidoctor/lib/status_badge/extension.rb +++ b/resources/asciidoctor/lib/status_badge/extension.rb @@ -27,6 +27,8 @@ def generate_tooltip_text(deployment_type, availability_type, version) deployment_long_name = 'Elastic Cloud on Kubernetes' elsif deployment_type == 'stack_self_managed' deployment_long_name = 'Elastic Stack Self-managed' + elsif deployment_type == 'synthetics_cli' + deployment_long_name = 'Elastic Synthetics' end # Availability @@ -39,6 +41,9 @@ def generate_tooltip_text(deployment_type, availability_type, version) elsif availability_type == 'ga' availability_tooltip_text = ' is generally available' availability_long_description = '' + elsif availability_type == 'added' + availability_tooltip_text = ' was added' + availability_long_description = '' elsif availability_type == 'coming' availability_tooltip_text = ' is coming soon' availability_long_description = 'This functionality is expected in an upcoming version, but is not guaranteed.' @@ -81,6 +86,8 @@ def generate_badge_text(deployment_type, availability_type, version) deployment_short_name = 'ECK' elsif deployment_type == 'stack_self_managed' deployment_short_name = 'Self-managed' + elsif deployment_type == 'synthetics_cli' + deployment_short_name = 'Synthetics' end # Availability @@ -90,6 +97,8 @@ def generate_badge_text(deployment_type, availability_type, version) availability_badge_text = 'Beta' elsif availability_type == 'ga' availability_badge_text = 'GA' + elsif availability_type == 'added' + availability_badge_text = 'Added' elsif availability_type == 'coming' availability_badge_text = 'Coming soon' elsif availability_type == 'deprecated' @@ -101,7 +110,9 @@ def generate_badge_text(deployment_type, availability_type, version) end text = deployment_short_name - if availability_badge_text + if availability_type == 'ga' and !version + text += '' + elsif availability_badge_text text += ': ' text += availability_badge_text end diff --git a/resources/web/style/admonishment.pcss b/resources/web/style/admonishment.pcss index 25948b952ec39..648338d597b83 100644 --- a/resources/web/style/admonishment.pcss +++ b/resources/web/style/admonishment.pcss @@ -67,13 +67,13 @@ cursor: pointer; font-size: 13px; font-weight: 500; - padding: 4px 6px 4px 4px; + padding: 3px 6px 3px 3px; border-radius: 3px; color: #000; background-color: #e6f1fa; border: 1px solid #07C; &:before { - transform: translateY(3px); + transform: translateY(4px); } &.Admonishment--preview, @@ -99,10 +99,14 @@ } } - &.Admonishment--ga { + &.Admonishment--ga, + &.Admonishment--added, { background-color: #e6f9f7; border: 1px solid rgb(0, 120, 113); white-space: nowrap; + } + + &.Admonishment--ga { &:before { display: inline-block; padding-right: 4px; @@ -110,6 +114,14 @@ } } + &.Admonishment--added { + &:before { + display: inline-block; + padding-right: 4px; + content: url('data:image/svg+xml;utf8,'); + } + } + &.Admonishment--deprecated, &.Admonishment--discontinued { background-color: #f8e9e9; diff --git a/resources/web/style/table.pcss b/resources/web/style/table.pcss index fe4586a25ca86..a320675c16ed3 100644 --- a/resources/web/style/table.pcss +++ b/resources/web/style/table.pcss @@ -4,7 +4,7 @@ * their containing width, and end up under the nav bar. With this they * are harmlessly "contained". They might look ugly this way, but the * damage is minimized. */ - overflow: auto; + /* overflow: auto; */ } table { margin-bottom:2em; @@ -51,7 +51,7 @@ } } - .monospaced { + .monospaced { td p, th { font-family: Consolas, Menlo, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Lucida Console", monospace; }