From 1040288ca76e070445f1400df2fcc5a56310be28 Mon Sep 17 00:00:00 2001 From: Vadim Mishenev Date: Fri, 24 Feb 2023 17:44:24 +0200 Subject: Reorganize tabs for Classlike (#2764) --- core/src/main/kotlin/pages/ContentNodes.kt | 9 ++++++++- core/src/main/kotlin/pages/contentNodeProperties.kt | 20 +++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) (limited to 'core/src/main/kotlin/pages') diff --git a/core/src/main/kotlin/pages/ContentNodes.kt b/core/src/main/kotlin/pages/ContentNodes.kt index 3c6fa5ac..78760044 100644 --- a/core/src/main/kotlin/pages/ContentNodes.kt +++ b/core/src/main/kotlin/pages/ContentNodes.kt @@ -392,7 +392,14 @@ enum class TextStyle : Style { } enum class ContentStyle : Style { - RowTitle, TabbedContent, WithExtraAttributes, RunnableSample, InDocumentationAnchor, Caption, + RowTitle, + /** + * The style is used only for HTML. It is applied only for [ContentGroup]. + * Creating and rendering tabs is a part of a renderer. + */ + TabbedContent, + + WithExtraAttributes, RunnableSample, InDocumentationAnchor, Caption, Wrapped, Indented, KDocTag, Footnote } diff --git a/core/src/main/kotlin/pages/contentNodeProperties.kt b/core/src/main/kotlin/pages/contentNodeProperties.kt index cfd7f769..3c9bd422 100644 --- a/core/src/main/kotlin/pages/contentNodeProperties.kt +++ b/core/src/main/kotlin/pages/contentNodeProperties.kt @@ -6,9 +6,23 @@ class SimpleAttr(val extraKey: String, val extraValue: String) : ExtraProperty override val key: ExtraProperty.Key = SimpleAttrKey(extraKey) - companion object { - fun header(value: String) = SimpleAttr("data-togglable", value) - } +} + +enum class BasicTabbedContentType : TabbedContentType { + TYPE, CONSTRUCTOR, FUNCTION, PROPERTY, ENTRY, EXTENSION_PROPERTY, EXTENSION_FUNCTION +} + +/** + * It is used only to mark content for tabs in HTML format + */ +interface TabbedContentType + +/** + * @see TabbedContentType + */ +class TabbedContentTypeExtra(val value: TabbedContentType) : ExtraProperty { + companion object : ExtraProperty.Key + override val key: ExtraProperty.Key = TabbedContentTypeExtra } object HtmlContent : ExtraProperty, ExtraProperty.Key { -- cgit