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/conf.yaml b/conf.yaml index ba91862ab20f7..01af121a89587 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: docs/en/observability/index.asciidoc + chunk: 4 + tags: Observability/Serverless/Stateful + subject: Observability + sources: + - + repo: observability-docs + path: docs/en - title: Serverless sections: - title: Serverless diff --git a/resources/asciidoctor/lib/care_admonition/extension.rb b/resources/asciidoctor/lib/care_admonition/extension.rb index 4be6e279d24ba..2be49a8efb182 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,22 +48,92 @@ 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 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. + 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 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. + 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 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. + 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 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 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 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 Cloud Serverless. + TEXT def activate(registry) [ - [:beta, 'beta', BETA_DEFAULT_TEXT], - [:dev, 'dev', DEV_DEFAULT_TEXT], - [:experimental, 'preview', PREVIEW_DEFAULT_TEXT], - [:preview, 'preview', PREVIEW_DEFAULT_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 + [: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', + DEPRECATED_SERVERLESS_TEXT, + ], + [:deprecated_ess, 'ESS: Deprecated', 'hello', DEPRECATED_ESS_TEXT], + [ + :discontinued_serverless, + 'Serverless: Removed', + 'serverless_removed', + DISCONTINUED_SERVERLESS_TEXT, + ], + [: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 @@ -46,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 @@ -97,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 @@ -109,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, } ) 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/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/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/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..d38c14e882365 --- /dev/null +++ b/resources/asciidoctor/lib/status_badge/extension.rb @@ -0,0 +1,150 @@ +# 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 == 'cloud_serverless' + deployment_long_name = 'Elastic Cloud Serverless' + elsif deployment_type == 'cloud_hosted' + deployment_long_name = 'Elastic Cloud Hosted' + elsif deployment_type == 'ece' + deployment_long_name = 'Elastic Cloud Enterprise' + elsif deployment_type == 'eck' + 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 + 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 == '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.' + 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 == '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 == 'stack_self_managed' + deployment_short_name = 'Self-managed' + elsif deployment_type == 'synthetics_cli' + deployment_short_name = 'Synthetics' + 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 = 'GA' + elsif availability_type == 'added' + availability_badge_text = 'Added' + 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_type == 'ga' and !version + text += '' + elsif 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/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..a83cff7b19b95 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,.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') + 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); @@ -422,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 9ad227cd23838..648338d597b83 100644 --- a/resources/web/style/admonishment.pcss +++ b/resources/web/style/admonishment.pcss @@ -1,40 +1,155 @@ #guide { + #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; + } + } + #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; - 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 #343741; } } - - &-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: 3px 6px 3px 3px; + border-radius: 3px; + color: #000; + background-color: #e6f1fa; + border: 1px solid #07C; + &:before { + transform: translateY(4px); + } + + &.Admonishment--preview, + &.Admonishment--beta { + background-color: #fff9e8; + border: 1px solid rgb(131, 101, 10); + white-space: nowrap; + } + + &.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, + &.Admonishment--added, { + background-color: #e6f9f7; + border: 1px solid rgb(0, 120, 113); + white-space: nowrap; + } + + &.Admonishment--ga { + &:before { + display: inline-block; + padding-right: 4px; + content: url('data:image/svg+xml;utf8,'); + } + } + + &.Admonishment--added { + &: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); + white-space: nowrap; + &:before { + display: inline-block; + padding-right: 4px; + content: url('data:image/svg+xml;utf8,'); + } + } + + &.Admonishment--unavailable { + background-color: #F1F4FA; + border: 1px solid #69707D; + white-space: nowrap; + &: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/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; */ } } 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; 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; } 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; } }