-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release 0.17.6
- Loading branch information
Showing
10 changed files
with
214 additions
and
43 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- Removes restrictions on filenames that can be used for assets. CSS assets no longer requires a `.css` extension, and | ||
likewise JavaScript assets no longer require a `.js` extension. It's up to you to make sure an asset is valid or not | ||
before it gets added to the page. | ||
- When creating a Reference to a file that is not a child of the base dir, remove relative path segments so that it will | ||
be copied properly to the rendered site, and not outside of the build dir. | ||
- Adds `kotlinPlayground` component to the `OrchidSyntaxHighlighter` artifact, for converting Kotlin code snippets into | ||
runnable playgrounds. |
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
50 changes: 50 additions & 0 deletions
50
...main/kotlin/com/eden/orchid/languages/highlighter/components/KotlinPlaygroundComponent.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,50 @@ | ||
package com.eden.orchid.languages.highlighter.components | ||
|
||
import com.eden.orchid.api.OrchidContext | ||
import com.eden.orchid.api.options.annotations.Description | ||
import com.eden.orchid.api.options.annotations.Option | ||
import com.eden.orchid.api.options.annotations.StringDefault | ||
import com.eden.orchid.api.theme.components.OrchidComponent | ||
import javax.inject.Inject | ||
|
||
@Description( | ||
"Add the Kotlin Playground to your pages, to convert Kotlin code snippets into interactive, embedded " + | ||
"development playgrounds.", | ||
name = "Kotlin Playground" | ||
) | ||
class KotlinPlaygroundComponent | ||
@Inject | ||
constructor( | ||
context: OrchidContext | ||
) : OrchidComponent(context, "kotlinPlayground", 100) { | ||
|
||
@Option | ||
@Description("The base URL to load Kotlin Playground JS files from.") | ||
@StringDefault("https://unpkg.com/kotlin-playground@1") | ||
lateinit var kotlinPlaygroundSource: String | ||
|
||
@Option | ||
@Description("Select which elements on the page are converted. Defaults to markdown code blocks with the " + | ||
"`run-kotlin` language." | ||
) | ||
@StringDefault("pre code[class='language-run-kotlin']") | ||
lateinit var selector: String | ||
|
||
@Option | ||
@Description("The URL to a self-hosted server instance for running code snippets.") | ||
lateinit var server: String | ||
|
||
override fun loadAssets() { | ||
addJs(kotlinPlaygroundSource).apply { | ||
attrs["data-selector"] = selector | ||
|
||
if (server.isNotBlank()) { | ||
attrs["data-server"] = server | ||
} | ||
} | ||
} | ||
|
||
override fun isHidden(): Boolean { | ||
return true | ||
} | ||
} |
Oops, something went wrong.