-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup paragraphs and tables in GFM renderer (#1946)
* GFM renderer: cleanup paragraphs * GFM renderer: cleanup tables * GFM renderer: add tests for wrong header in table Table with extra cell in row is really generated by `all-modules-page` plugin * Remove commented-out lines * Add BriefCommentPreprocessor which inserts a line break between a signature and a brief comment Fixed a bug with `mapTransform` function which replaces table headers with their contents Co-authored-by: Kamil Doległo <[email protected]>
- Loading branch information
1 parent
c2182b7
commit 46b3371
Showing
12 changed files
with
379 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/renderer/BriefCommentPreprocessor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,16 @@ | ||
package org.jetbrains.dokka.gfm.renderer | ||
|
||
import org.jetbrains.dokka.pages.* | ||
import org.jetbrains.dokka.transformers.pages.PageTransformer | ||
|
||
class BriefCommentPreprocessor : PageTransformer { | ||
override fun invoke(input: RootPageNode) = input.transformContentPagesTree { contentPage -> | ||
contentPage.modified(content = contentPage.content.recursiveMapTransform<ContentGroup, ContentNode> { | ||
if (it.dci.kind == ContentKind.BriefComment) { | ||
it.copy(style = it.style setOf(TextStyle.Block)) | ||
} else { | ||
it | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.