Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix description of samp and add strike tag #184

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 49 additions & 8 deletions api/kotlinx-html.api

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import kotlinx.html.js.packageJson
* -PversionTag - works together with "branch-build" profile and overrides "-SNAPSHOT" suffix of the version.
*/
plugins {
kotlin("multiplatform") version "1.9.10"
kotlin("multiplatform") version "1.9.21"
id("maven-publish")
id("signing")
}
Expand Down Expand Up @@ -92,7 +92,13 @@ kotlin {
}
js(IR) {
moduleName = project.name
browser()
browser {
testTask {
useKarma {
useChromeHeadless()
}
}
}

mavenPublication {
groupId = group as String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fun humanizeJoin(parts: Iterable<String>, separator: String): String {
filteredParts.add(cutPart)
}

return filteredParts.joinToString(separator = separator, transform = String::capitalize) + trailingParts.joinToString("", transform = String::capitalize)
return filteredParts.joinToString(separator = separator) { it.capitalize() } + trailingParts.joinToString("") { it.capitalize() }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was made since generation fails with exception:

* What went wrong:
Execution failed for task ':generate'.
> 'void kotlin.jvm.internal.FunctionReferenceImpl.<init>(int, java.lang.Class, java.lang.String, java.lang.String, int)'

}

private fun String.replaceMistakesAndUglyWords() : String =
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/resources/html_5.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@

<xsd:element ref="var"/>
<xsd:element ref="video"/>
<xsd:element ref="s"/>

</xsd:choice>
</xsd:group>
Expand Down Expand Up @@ -842,6 +843,7 @@
<xsd:element name="main" type="simplePhrasingContentElement"/>
<xsd:element name="mark" type="simplePhrasingContentElement"/>
<xsd:element name="math" type="simplePhrasingContentElement"/>
<xsd:element name="s" type="simplePhrasingContentElement"/>

<xsd:element name="progress">
<xsd:complexType mixed="true">
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/resources/htmltable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@
/>
<tag name = "samp"
helpref = "struct/text.html#edef-SAMP"
description = "strike-through text style"
description = "computer output text style"
startTag = "true"
endTag = "true"
empty = "false"
Expand Down
6 changes: 6 additions & 0 deletions src/commonMain/kotlin/generated/gen-consumer-tags.kt
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,12 @@ inline fun <T, C : TagConsumer<T>> C.ruby(classes : String? = null, crossinline
* Strike-through text style
*/
@HtmlTagMarker
inline fun <T, C : TagConsumer<T>> C.s(classes : String? = null, crossinline block : S.() -> Unit = {}) : T = S(attributesMapOf("class", classes), this).visitAndFinalize(this, block)

/**
* Computer output text style
*/
@HtmlTagMarker
inline fun <T, C : TagConsumer<T>> C.samp(classes : String? = null, crossinline block : SAMP.() -> Unit = {}) : T = SAMP(attributesMapOf("class", classes), this).visitAndFinalize(this, block)

@Deprecated("This tag doesn't support content or requires unsafe (try unsafe {})")
Expand Down
6 changes: 6 additions & 0 deletions src/commonMain/kotlin/generated/gen-tag-groups.kt
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ inline fun FlowContent.u(classes : String? = null, crossinline block : U.() -> U
@HtmlTagMarker
inline fun FlowContent.ul(classes : String? = null, crossinline block : UL.() -> Unit = {}) : Unit = UL(attributesMapOf("class", classes), consumer).visit(block)

/**
* Strike-through text style
*/
@HtmlTagMarker
inline fun FlowContent.s(classes : String? = null, crossinline block : S.() -> Unit = {}) : Unit = S(attributesMapOf("class", classes), consumer).visit(block)

/**
* Document base URI
*/
Expand Down
2 changes: 1 addition & 1 deletion src/commonMain/kotlin/generated/gen-tag-unions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ inline fun FlowOrPhrasingContent.q(classes : String? = null, crossinline block :
inline fun FlowOrPhrasingContent.ruby(classes : String? = null, crossinline block : RUBY.() -> Unit = {}) : Unit = RUBY(attributesMapOf("class", classes), consumer).visit(block)

/**
* Strike-through text style
* Computer output text style
*/
@HtmlTagMarker
inline fun FlowOrPhrasingContent.samp(classes : String? = null, crossinline block : SAMP.() -> Unit = {}) : Unit = SAMP(attributesMapOf("class", classes), consumer).visit(block)
Expand Down
11 changes: 11 additions & 0 deletions src/commonMain/kotlin/generated/gen-tags-s.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ import kotlinx.html.attributes.*
This file was generated by module generate
*******************************************************************************/

@Suppress("unused")
open class S(initialAttributes : Map<String, String>, override val consumer : TagConsumer<*>) : HTMLTag("s", consumer, initialAttributes, null, false, false), HtmlBlockInlineTag {

}
val S.asFlowContent : FlowContent
get() = this

val S.asPhrasingContent : PhrasingContent
get() = this


@Suppress("unused")
open class SAMP(initialAttributes : Map<String, String>, override val consumer : TagConsumer<*>) : HTMLTag("samp", consumer, initialAttributes, null, true, false), HtmlBlockInlineTag {

Expand Down
6 changes: 6 additions & 0 deletions src/jsMain/kotlin/generated/gen-consumer-tags-js.kt
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,12 @@ public inline fun TagConsumer<HTMLElement>.ruby(classes : String? = null, crossi
* Strike-through text style
*/
@HtmlTagMarker
public inline fun TagConsumer<HTMLElement>.s(classes : String? = null, crossinline block : S.() -> Unit = {}) : HTMLElement = S(attributesMapOf("class", classes), this).visitAndFinalize(this, block)

/**
* Computer output text style
*/
@HtmlTagMarker
public inline fun TagConsumer<HTMLElement>.samp(classes : String? = null, crossinline block : SAMP.() -> Unit = {}) : HTMLElement = SAMP(attributesMapOf("class", classes), this).visitAndFinalize(this, block)

@Deprecated("This tag doesn't support content or requires unsafe (try unsafe {})")
Expand Down