diff options
author | TheOnlyTails <theonlytails@theonlytails.com> | 2022-05-13 16:16:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-13 16:16:03 +0300 |
commit | c532003c71cc551ce0df797a8d6207c0edb8eaab (patch) | |
tree | e39c948c0d0e305dbb0a61be7744e517fd924367 /plugins/base/src/main | |
parent | 3e55be9954acc7e4cab11ed661cb62ed347e9b84 (diff) | |
download | dokka-c532003c71cc551ce0df797a8d6207c0edb8eaab.tar.gz dokka-c532003c71cc551ce0df797a8d6207c0edb8eaab.tar.bz2 dokka-c532003c71cc551ce0df797a8d6207c0edb8eaab.zip |
Render quotes as blockquotes instead of code blocks. (#2496)
Diffstat (limited to 'plugins/base/src/main')
3 files changed, 13 insertions, 3 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 7ce41866..9be7428a 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -128,6 +128,7 @@ open class HtmlRenderer( } node.hasStyle(TextStyle.Paragraph) -> p(additionalClasses) { childrenCallback() } node.hasStyle(TextStyle.Block) -> div(additionalClasses) { childrenCallback() } + node.hasStyle(TextStyle.Quotation) -> blockQuote(additionalClasses) { childrenCallback() } node.isAnchorable -> buildAnchor( node.anchor!!, node.anchorLabel!!, diff --git a/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt b/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt index 85b082ef..b46a7679 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt @@ -123,7 +123,15 @@ open class DocTagToContentConverter : CommentsToContentConverter { styles ) ) - is BlockQuote, is Pre, is CodeBlock -> listOf( + is BlockQuote -> listOf( + ContentGroup( + buildChildren(docTag), + dci, + sourceSets.toDisplaySourceSets(), + styles + TextStyle.Quotation, + ) + ) + is Pre, is CodeBlock -> listOf( ContentCodeBlock( buildChildren(docTag), docTag.params.getOrDefault("lang", ""), diff --git a/plugins/base/src/main/resources/dokka/styles/style.css b/plugins/base/src/main/resources/dokka/styles/style.css index 94200bd1..9bc9f07d 100644 --- a/plugins/base/src/main/resources/dokka/styles/style.css +++ b/plugins/base/src/main/resources/dokka/styles/style.css @@ -612,10 +612,11 @@ a small { } blockquote { - border-left: 1px solid #e5e5e5; + border-left: 1ch solid var(--default-gray); margin: 0; - padding: 0 0 0 20px; + padding-left: 1ch; font-style: italic; + color: var(--average-color); } pre { |