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 = %() + explanation_inner_html = %(