diff --git a/.github/scripts/generate_descriptor_pages.main.kts b/.github/scripts/generate_descriptor_pages.main.kts index 91d811c88..1adbc77da 100755 --- a/.github/scripts/generate_descriptor_pages.main.kts +++ b/.github/scripts/generate_descriptor_pages.main.kts @@ -266,6 +266,7 @@ fun StringBuilder.appendAttributes(attributeWrappers: List) { fun StringBuilder.appendAttribute(attribute: Attribute) { append("- `${attribute.name}`") appendAttributeRequirementAndAvailability(attribute) + appendAttributeDeprecationInfo(attribute) attribute.description?.trim()?.let { append(it.indentLines(level = 1)) } attribute.defaultValue?.trim()?.let { appendLine("
") @@ -302,6 +303,23 @@ fun StringBuilder.appendAttributeRequirementAndAvailability(attribute: Attribute } } +fun StringBuilder.appendAttributeDeprecationInfo(attribute: Attribute) { + val deprecatedSince = attribute.deprecatedSince + val deprecationNote = attribute.deprecationNote + if (deprecatedSince != null || deprecationNote != null) { + if (deprecatedSince != null) { + append("**_Deprecated since ${deprecatedSince}_**".indentLines(4)) + } else { + append("**_Deprecated_**") + } + if (deprecationNote != null) { + val noteWithoutLineBreaks = deprecationNote.replace('\n', ' ') + append(": $noteWithoutLineBreaks") + } + } + append("") +} + fun StringBuilder.appendChildren(parent: Element, parentPath: String) { if (parent.children.isEmpty() && parent.childrenDescription == null) return if (parent.childrenDescription != null) { @@ -454,6 +472,8 @@ data class Attribute( var name: String? = null, var since: String? = null, var until: String? = null, + var deprecatedSince: String? = null, + var deprecationNote: String? = null, var requirement: Requirement? = null, var description: String? = null, var defaultValue: String? = null,