Skip to content

Adds tech preview macro, updates experimental #2340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jan 20, 2022
25 changes: 19 additions & 6 deletions README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1629,17 +1629,30 @@ This param is in development and may change in the future.
[[new-feature]]
=== New experimental feature

experimental::[]
Experimental language is deprecated.

experimental::[https://github.com/elastic/docs/issues/505]
We decided on the much less raw sounding "technical preview".

experimental::[{issue}505]
See below.

experimental::["Custom text goes here."]
=== Using the technical `preview` admonition

experimental::["Custom text goes here.",https://github.com/elastic/docs/issues/505]
[source,asciidoc]
----
[[new-feature]]
=== New feature in technical preview

preview::[]

preview::[https://github.com/elastic/docs/issues/505]

preview::[{issue}505]

preview::["Custom text goes here."]

preview::["Custom text goes here.",https://github.com/elastic/docs/issues/505]

experimental::["Custom text goes here.",{issue}505]
preview::["Custom text goes here.",{issue}505]

Text about new feature...

Expand Down
2 changes: 1 addition & 1 deletion integtest/spec/single_book_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@
page_context 'chapter.html' do
it 'includes the experimental text' do
expect(body).to include(
'This functionality is experimental and may be changed or removed'
'This functionality is in technical preview and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.'
)
end
end
Expand Down
15 changes: 11 additions & 4 deletions resources/asciidoctor/lib/care_admonition/extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
require 'asciidoctor/extensions'

##
# Extensions for marking when something as `beta`, `dev`, or `experimental`.
# Extensions for marking when something as `beta`, `dev`, or technical `preview`.
#
# Usage
#
# beta::[]
# dev::[]
# experimental::[]
# preview::[]
# Foo beta:[]
# Foo dev:[]
# Foo experimental:[]
#
# !! experimental is deprecated, use preview
#


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.
Expand All @@ -22,14 +25,18 @@ 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
EXPERIMENTAL_DEFAULT_TEXT = <<~TEXT.strip
This functionality is experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.
This functionality is in technical preview and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but features in technical preview are 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 completely in a future release. Elastic will take a best effort approach to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
TEXT

def activate(registry)
[
[:beta, 'beta', BETA_DEFAULT_TEXT],
[:dev, 'dev', DEV_DEFAULT_TEXT],
[:experimental, 'experimental', EXPERIMENTAL_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
Expand Down
12 changes: 11 additions & 1 deletion resources/asciidoctor/spec/care_admonition_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,17 @@ def expect_inline_admonition(text)
let(:admon_class) { 'warning' }
let(:default_text) do
<<~TEXT.strip
This functionality is experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.
This functionality is in technical preview and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
TEXT
end
include_examples 'care admonition'
end
context 'preview' do
let(:key) { 'preview' }
let(:admon_class) { 'warning' }
let(:default_text) do
<<~TEXT.strip
This functionality is in technical preview and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
TEXT
end
include_examples 'care admonition'
Expand Down