Skip to content

Commit

Permalink
Pr/jaredsburrows/remove custom html tag (#419)
Browse files Browse the repository at this point in the history
* prepare next development version

* apply ktlint 12.1.0

* remove custom html extension
  • Loading branch information
jaredsburrows authored Jan 30, 2024
1 parent 6fbc7bd commit d52bd93
Showing 1 changed file with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ package com.jaredsburrows.license.internal.report

import com.jaredsburrows.license.internal.LicenseHelper
import kotlinx.html.Entities
import kotlinx.html.HTML
import kotlinx.html.HtmlTagMarker
import kotlinx.html.TagConsumer
import kotlinx.html.a
import kotlinx.html.body
import kotlinx.html.br
Expand All @@ -14,15 +11,16 @@ import kotlinx.html.dt
import kotlinx.html.h3
import kotlinx.html.head
import kotlinx.html.hr
import kotlinx.html.html
import kotlinx.html.id
import kotlinx.html.lang
import kotlinx.html.li
import kotlinx.html.pre
import kotlinx.html.stream.appendHTML
import kotlinx.html.style
import kotlinx.html.title
import kotlinx.html.ul
import kotlinx.html.unsafe
import kotlinx.html.visitAndFinalize
import org.apache.maven.model.License
import org.apache.maven.model.Model

Expand Down Expand Up @@ -71,7 +69,8 @@ class HtmlReport(private val projects: List<Model>) : Report {
return buildString {
appendLine(DOCTYPE) // createHTMLDocument() add doctype and meta
appendHTML()
.html(lang = "en") {
.html {
lang = "en"
head {
unsafe { +META }
style {
Expand Down Expand Up @@ -184,7 +183,8 @@ class HtmlReport(private val projects: List<Model>) : Report {
buildString {
appendLine(DOCTYPE) // createHTMLDocument() add doctype and meta
appendHTML()
.html(lang = "en") {
.html {
lang = "en"
head {
unsafe { +META }
style {
Expand Down Expand Up @@ -216,18 +216,6 @@ class HtmlReport(private val projects: List<Model>) : Report {
} as String
}

@HtmlTagMarker
private inline fun <T, C : TagConsumer<T>> C.html(
lang: String,
namespace: String? = null,
crossinline block: HTML.() -> Unit = {},
): T =
HTML(
mapOf("lang" to lang),
this,
namespace,
).visitAndFinalize(this, block)

private companion object {
private const val EXTENSION = "html"
private const val NAME = "HTML"
Expand Down

0 comments on commit d52bd93

Please sign in to comment.