-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Markdown actual styling to bridge/standalone packages (#379)
Having them all in the same package caused problems when trying to apply the style in the code; in particular, when your prod code uses bridge but the tests use standalone, you'd end up with both variants on the classpath, and it would be impossible to choose which one to use when. This moves all bridge theming to .bridge, and all standalone theming in .standalone, to clearly distinguish them. I also renamed the various theming files to fit the common naming pattern we use elsewhere in the library.
- Loading branch information
Showing
12 changed files
with
69 additions
and
52 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
14 changes: 14 additions & 0 deletions
14
...kotlin/org/jetbrains/jewel/intui/markdown/bridge/BridgeMarkdownBlockRendererExtensions.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,14 @@ | ||
package org.jetbrains.jewel.intui.markdown.bridge | ||
|
||
import org.jetbrains.jewel.intui.markdown.bridge.styling.create | ||
import org.jetbrains.jewel.markdown.extensions.MarkdownRendererExtension | ||
import org.jetbrains.jewel.markdown.rendering.DefaultMarkdownBlockRenderer | ||
import org.jetbrains.jewel.markdown.rendering.InlineMarkdownRenderer | ||
import org.jetbrains.jewel.markdown.rendering.MarkdownBlockRenderer | ||
import org.jetbrains.jewel.markdown.rendering.MarkdownStyling | ||
|
||
public fun MarkdownBlockRenderer.Companion.create( | ||
styling: MarkdownStyling = MarkdownStyling.create(), | ||
rendererExtensions: List<MarkdownRendererExtension> = emptyList(), | ||
inlineRenderer: InlineMarkdownRenderer = InlineMarkdownRenderer.default(), | ||
): MarkdownBlockRenderer = DefaultMarkdownBlockRenderer(styling, rendererExtensions, inlineRenderer) |
13 changes: 2 additions & 11 deletions
13
.../BridgeMarkdownBlockRendererExtensions.kt → ...wn/bridge/BridgeProvideMarkdownStyling.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
2 changes: 1 addition & 1 deletion
2
...markdown/styling/MarkdownBridgeStyling.kt → ...n/bridge/styling/BridgeMarkdownStyling.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
2 changes: 1 addition & 1 deletion
2
...github/alerts/GitHubAlertBridgeStyling.kt → ...github/alerts/BridgeGitHubAlertStyling.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
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
23 changes: 23 additions & 0 deletions
23
...lin/org/jetbrains/jewel/intui/markdown/standalone/IntUiMarkdownBlockRendererExtensions.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,23 @@ | ||
package org.jetbrains.jewel.intui.markdown.standalone | ||
|
||
import org.jetbrains.jewel.intui.markdown.standalone.styling.dark | ||
import org.jetbrains.jewel.intui.markdown.standalone.styling.light | ||
import org.jetbrains.jewel.markdown.extensions.MarkdownRendererExtension | ||
import org.jetbrains.jewel.markdown.rendering.DefaultMarkdownBlockRenderer | ||
import org.jetbrains.jewel.markdown.rendering.InlineMarkdownRenderer | ||
import org.jetbrains.jewel.markdown.rendering.MarkdownBlockRenderer | ||
import org.jetbrains.jewel.markdown.rendering.MarkdownStyling | ||
|
||
public fun MarkdownBlockRenderer.Companion.light( | ||
styling: MarkdownStyling = MarkdownStyling.light(), | ||
rendererExtensions: List<MarkdownRendererExtension> = emptyList(), | ||
inlineRenderer: InlineMarkdownRenderer = InlineMarkdownRenderer.default(), | ||
): MarkdownBlockRenderer = | ||
DefaultMarkdownBlockRenderer(styling, rendererExtensions, inlineRenderer) | ||
|
||
public fun MarkdownBlockRenderer.Companion.dark( | ||
styling: MarkdownStyling = MarkdownStyling.dark(), | ||
rendererExtensions: List<MarkdownRendererExtension> = emptyList(), | ||
inlineRenderer: InlineMarkdownRenderer = InlineMarkdownRenderer.default(), | ||
): MarkdownBlockRenderer = | ||
DefaultMarkdownBlockRenderer(styling, rendererExtensions, inlineRenderer) |
23 changes: 3 additions & 20 deletions
23
...n/IntUiMarkdownBlockRendererExtensions.kt → ...standalone/IntUiProvideMarkdownStyling.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
2 changes: 1 addition & 1 deletion
2
.../markdown/styling/MarkdownIntUiStyling.kt → ...tandalone/styling/IntUiMarkdownStyling.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
2 changes: 1 addition & 1 deletion
2
...ithub/alerts/GitHubAlertDefaultStyling.kt → .../github/alerts/IntUiGitHubAlertStyling.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
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