Skip to content

Commit

Permalink
Expose lessonToJson: LessonContent -> String
Browse files Browse the repository at this point in the history
  • Loading branch information
ILIYANGERMANOV committed Dec 23, 2024
1 parent 437772d commit 4551f05
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android.nonTransitiveRClass=true
# Pomfile definitions
GROUP=com.ivy-apps
POM_ARTIFACT_ID=learn-content-dsl
VERSION_NAME=0.0.6
VERSION_NAME=0.0.7
SONATYPE_HOST=CENTRAL_PORTAL
RELEASE_SIGNING_ENABLED=true
POM_DESCRIPTION=Ivy Learn DSL for creating interactive lessons.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@ fun lessonJson(): Json = Json {
}

fun printLessonJson(lesson: LessonContent) {
println(lessonToJson(lesson))
}

fun lessonToJson(lesson: LessonContent): String {
validateIdsExistence(lesson)
validateIdsUniqueness(lesson)
println(lessonJson().encodeToString(lesson))
return lessonJson().encodeToString(lesson)
}

fun story(
Expand Down
5 changes: 5 additions & 0 deletions samples/src/jvmMain/kotlin/ivy/learn/Main.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package ivy.learn

fun main() {
println(nameToId("Time Complexity: What and Why?"))
}

0 comments on commit 4551f05

Please sign in to comment.