Skip to content

Commit

Permalink
마크다운 lib 추가, favicon 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
kimmandoo committed Mar 6, 2025
1 parent 031b522 commit c44a71a
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 280 deletions.
2 changes: 2 additions & 0 deletions blog/composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ kotlin {
implementation(compose.components.uiToolingPreview)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation("com.mikepenz:multiplatform-markdown-renderer-m2:0.31.0")
implementation("com.mikepenz:multiplatform-markdown-renderer-code:0.31.0")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ import kotlinx.browser.document

@OptIn(ExperimentalComposeUiApi::class)
fun main() {
val link = document.querySelector("link[rel~='icon']")
?: document.createElement("link").apply {
setAttribute("rel", "icon")
document.head?.appendChild(this);
}
link.setAttribute("href", "https://raw.githubusercontent.com/JetBrains/kotlin-web-site/refs/heads/master/assets/images/favicon.ico");
ComposeViewport(document.body!!) {
App()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,42 @@ import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.kimmandoo.blog.markdown.MarkdownText
import androidx.compose.ui.graphics.Color
import com.kimmandoo.blog.readFileToString
import com.mikepenz.markdown.compose.components.markdownComponents
import com.mikepenz.markdown.compose.elements.MarkdownCodeBlock
import com.mikepenz.markdown.compose.elements.highlightedCodeBlock
import com.mikepenz.markdown.compose.elements.highlightedCodeFence
import com.mikepenz.markdown.compose.extendedspans.ExtendedSpans
import com.mikepenz.markdown.compose.extendedspans.RoundedCornerSpanPainter
import com.mikepenz.markdown.compose.extendedspans.SquigglyUnderlineSpanPainter
import com.mikepenz.markdown.compose.extendedspans.rememberSquigglyUnderlineAnimator
import com.mikepenz.markdown.m2.Markdown
import com.mikepenz.markdown.model.markdownExtendedSpans

@Composable
fun AboutScreen() {
var markdownContent by remember { mutableStateOf("") }

LaunchedEffect(Unit){
markdownContent = readFileToString("/md/aboutme.md")
markdownContent = readFileToString("/md/aboutme.md").trimIndent()
println(markdownContent)
}

Box(modifier = Modifier.fillMaxSize()){
SelectionContainer {
MarkdownText(markdown = markdownContent.trimIndent())
// Text(
// text = markdownContent,
// style = MaterialTheme.typography.body1
// )
Markdown(
content = markdownContent,
extendedSpans = markdownExtendedSpans {
val animator = rememberSquigglyUnderlineAnimator()
remember {
ExtendedSpans(
RoundedCornerSpanPainter(),
SquigglyUnderlineSpanPainter(animator = animator)
)
}
}
)
}
}
}
Binary file not shown.
Binary file removed docs/021a7f24cb1e620b463e.wasm
Binary file not shown.
Binary file added docs/6439a4285ef148a89204.wasm
Binary file not shown.
Binary file removed docs/88d24fef424614b157fc.wasm
Binary file not shown.
Binary file removed docs/b59bd3d64d8cb3a82a76.wasm
Binary file not shown.
273 changes: 2 additions & 271 deletions docs/composeApp.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/composeApp.js.map

Large diffs are not rendered by default.

File renamed without changes.
Binary file added docs/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>kimmandoo</title>
<link type="text/css" rel="stylesheet" href="styles.css">
<script src="main.js?v=1.0.0"></script>
<script type="application/javascript" src="composeApp.js"></script>
<script src="composeApp.js?v=1.0.0"></script>
</head>
<body>
</body>
Expand Down

0 comments on commit c44a71a

Please sign in to comment.