diff --git a/_plugins/asciidoctor-extension.rb b/_plugins/asciidoctor-extension.rb index 9e65545b1d0..739e9752649 100644 --- a/_plugins/asciidoctor-extension.rb +++ b/_plugins/asciidoctor-extension.rb @@ -163,23 +163,33 @@ tree_processor do process do |doc| status = doc.attr('extension-status') + + if status.nil? || status.empty? + extension_statuses = doc.attr('extensions', '').split(',') + .map(&:strip) + .reject(&:empty?) + .map { |s| s.gsub(/[.:]/, '-') + '-extension-status' } + .map { |s| doc.attr(s, '') } + status = ['experimental', 'preview', 'deprecated'].find { |s| extension_statuses.include?(s) } + end if status && !status.empty? - tooltip = case status + explanation_inner_html = case status when 'experimental' - 'This extension requests early feedback to mature the idea' + '

The extension(s) discussed here request early feedback to mature the idea.

There is no guarantee of stability nor long term presence in the platform until the solution matures. Feedback is welcome on our mailing list or as issues in our GitHub issue tracker

.' when 'preview' - 'This extension\'s backward compatibility and presence in the ecosystem is not guaranteed' + '

The backward compatibility and presence in the ecosystem of extension(s) discussed here is not guaranteed.

Specific improvements might require changing configuration or APIs, and plans to become stable are under way. Feedback is welcome on our mailing list or as issues in our GitHub issue tracker.

' when 'stable' - 'This extension\'s backward compatibility and presence in the ecosystem are taken very seriously' + '

The backward compatibility and presence in the ecosystem of the extension(s) discussed here are taken very seriously.

' when 'deprecated' - 'This extension is likely to be replaced or removed in a future version' + '

The extension(s) discussed here is likely to be replaced or removed in a future version.

' else "" end - label_html = %(#{status}) - - label_block = create_pass_block doc, label_html, {} + label_html = %(
#{status}
) + explanation_inner_html = %(
#{explanation_inner_html}For a full list of possible statuses, check our FAQ entry.
) + staus_block_html = %(
#{label_html}#{explanation_inner_html}
) + label_block = create_pass_block doc, staus_block_html, {} doc.blocks.insert(0, label_block) end doc diff --git a/_sass/asciidoc.scss b/_sass/asciidoc.scss index 249dd7fdb05..9d01324f48f 100755 --- a/_sass/asciidoc.scss +++ b/_sass/asciidoc.scss @@ -149,10 +149,8 @@ pre.highlight { line-height: 1em; text-transform: uppercase; font-weight: bold; - text-decoration: none; display: inline-block; padding: 4px 12px; - margin-bottom: 35px; border-radius: 50px; } @@ -161,33 +159,33 @@ pre.highlight { background-color: var(--tag-stable-background-color); } -a.status-stable:hover, a.status-stable:active, a.status-stable:focus { - color: var(--tag-stable-text-color); -} - .status-preview { color: var(--tag-preview-text-color); background-color: var(--tag-preview-background-color); } -a.status-preview:hover, a.status-preview:active, a.status-preview:focus { - color: var(--tag-preview-text-color); -} - .status-deprecated { color: var(--tag-deprecated-text-color); background-color: var(--tag-deprecated-background-color); } -a.status-deprecated:hover, a.status-deprecated:active, a.status-deprecated:focus { - color: var(--tag-deprecated-text-color); -} - .status-experimental { color: var(--tag-experimental-text-color); background-color: var(--tag-experimental-background-color); } -a.status-experimental:hover, a.status-experimental:active, a.status-experimental:focus { - color: var(--tag-experimental-text-color); +.extension-status { + display: flex; + align-items: center; + padding-bottom: 1.25em; +} + +.extension-status-explanation { + border-left: 1px solid #aaa; + padding: 1.25em; + opacity: 0.8; +} + +.extension-status-icon { + padding: 1.25em; }