Skip to content

Commit

Permalink
Process Markdown from all compendium items in Character UI
Browse files Browse the repository at this point in the history
  • Loading branch information
fmasa committed Nov 2, 2022
1 parent 53f7709 commit ec9630b
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import androidx.compose.material.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.halilibo.richtext.markdown.Markdown
import com.halilibo.richtext.ui.RichText
import cz.frantisekmasa.wfrp_master.common.core.domain.religion.Blessing
import cz.frantisekmasa.wfrp_master.common.core.ui.buttons.CloseButton
import cz.frantisekmasa.wfrp_master.common.core.ui.primitives.Spacing
Expand Down Expand Up @@ -39,7 +41,9 @@ fun BlessingDetail(
SingleLineTextValue(strings.labelTarget, blessing.target)
SingleLineTextValue(strings.labelDuration, blessing.duration)

Text(blessing.effect, Modifier.padding(top = 8.dp))
RichText(Modifier.padding(top = 8.dp)) {
Markdown(blessing.effect)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.halilibo.richtext.markdown.Markdown
import com.halilibo.richtext.ui.RichText
import cz.frantisekmasa.wfrp_master.common.core.domain.religion.Miracle
import cz.frantisekmasa.wfrp_master.common.core.ui.buttons.CloseButton
import cz.frantisekmasa.wfrp_master.common.core.ui.primitives.Spacing
Expand Down Expand Up @@ -54,7 +56,9 @@ fun MiracleDetail(
SingleLineTextValue(strings.labelTarget, miracle.target)
SingleLineTextValue(strings.labelDuration, miracle.duration)

Text(miracle.effect, Modifier.padding(top = 8.dp))
RichText(Modifier.padding(top = 8.dp)) {
Markdown(miracle.effect)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import androidx.compose.material.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.halilibo.richtext.markdown.Markdown
import com.halilibo.richtext.ui.RichText
import cz.frantisekmasa.wfrp_master.common.core.domain.localizedName
import cz.frantisekmasa.wfrp_master.common.core.domain.skills.Skill
import cz.frantisekmasa.wfrp_master.common.core.ui.buttons.CloseButton
Expand Down Expand Up @@ -47,10 +49,9 @@ fun SkillDetail(
value = strings.commonUi.boolean(skill.advanced),
)

Text(
text = skill.description,
modifier = Modifier.padding(top = 8.dp),
)
RichText(Modifier.padding(top = 8.dp)) {
Markdown(skill.description)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.unit.dp
import com.halilibo.richtext.markdown.Markdown
import com.halilibo.richtext.ui.RichText
import cz.frantisekmasa.wfrp_master.common.core.domain.spells.Spell
import cz.frantisekmasa.wfrp_master.common.core.ui.buttons.CloseButton
import cz.frantisekmasa.wfrp_master.common.core.ui.primitives.Spacing
Expand Down Expand Up @@ -63,10 +65,9 @@ fun SpellDetail(

SingleLineTextValue(strings.labelDuration, spell.duration)

Text(
text = spell.effect,
modifier = Modifier.padding(top = 8.dp),
)
RichText(Modifier.padding(top = 8.dp)) {
Markdown(spell.effect)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import androidx.compose.material.Text
import androidx.compose.material.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.halilibo.richtext.markdown.Markdown
import com.halilibo.richtext.ui.RichText
import cz.frantisekmasa.wfrp_master.common.core.domain.talents.Talent
import cz.frantisekmasa.wfrp_master.common.core.ui.buttons.CloseButton
import cz.frantisekmasa.wfrp_master.common.core.ui.primitives.Spacing
Expand All @@ -30,8 +32,8 @@ fun TalentDetail(
Column(Modifier.verticalScroll(rememberScrollState())) {
subheadBar()

Column(Modifier.padding(Spacing.bodyPadding)) {
Text(talent.description)
RichText(Modifier.padding(Spacing.bodyPadding)) {
Markdown(talent.description)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import androidx.compose.material.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.halilibo.richtext.markdown.Markdown
import com.halilibo.richtext.ui.RichText
import cz.frantisekmasa.wfrp_master.common.core.domain.traits.Trait
import cz.frantisekmasa.wfrp_master.common.core.ui.buttons.CloseButton
import cz.frantisekmasa.wfrp_master.common.core.ui.primitives.Spacing
Expand All @@ -32,7 +35,9 @@ fun TraitDetail(
) {
Column(Modifier.verticalScroll(rememberScrollState())) {
Column(Modifier.padding(Spacing.bodyPadding)) {
Text(trait.description)
RichText(Modifier.padding(top = 8.dp)) {
Markdown(trait.description)
}
}
}
}
Expand Down

0 comments on commit ec9630b

Please sign in to comment.