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
36 changes: 22 additions & 14 deletions README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1534,9 +1534,9 @@ deprecated::[0.90.4,Replace by `foo.baz`. See <<new-section>>]
Text about old functionality...

[[experimental]]
== Beta, Dev, and Experimental
== Beta, Dev, and Preview (experimental)

APIs or parameters that are in beta, in development, or experimental can be
APIs or parameters that are in beta, in development, or in technical preview (formerly experimental) can be
marked as such, using markup similar to that used in <<changes>>.

In the block format, you have the option of adding a related GitHub issue link.
Expand Down Expand Up @@ -1624,41 +1624,49 @@ This param is in development and may change in the future.

=== Using the `experimental` admonition

Experimental language is deprecated.

We decided on the much less raw sounding "technical preview".

See below.

=== Using the technical `preview` admonition

[source,asciidoc]
----
[[new-feature]]
=== New experimental feature
=== New feature in technical preview

experimental::[]
preview::[]

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

experimental::[{issue}505]
preview::[{issue}505]

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

experimental::["Custom text goes here.",https://github.com/elastic/docs/issues/505]
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...

[[old-feature]]
=== Established feature

This feature has been around for a while, but we're adding
a new experimental parameter:
a new preview parameter:

`established_param`::
This param has been around for ages and won't change.

`experimental_param`::
experimental:[]
This param is experimental and may change in the future.
preview:[]
This param is in technical preview and may change in the future.

`experimental_param`::
experimental:["Custom text goes here."]
This param is experimental and may change in the future.
preview:["Custom text goes here."]
This param is in technical preview and may change in the future.
----

[[images]]
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
18 changes: 11 additions & 7 deletions resources/asciidoctor/lib/care_admonition/extension.rb
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
# frozen_string_literal: true

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:[]
# Foo preview:[]
#
# !! `experimental:[]` is supported as deprecated alternative to `preview:[]`.
# !! But please use `preview:[]` instead.
#

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
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
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.
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],
[:experimental, 'experimental', 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
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