gonzalezreal / swift-markdown-ui

Display and customize Markdown text in SwiftUI
MIT License
2.25k stars 268 forks source link

Cannot Customize MarkdownStyle details #91

Closed kikimaxs closed 2 years ago

kikimaxs commented 2 years ago

I have example string markdown :

"\n#### Paket yang dipilih\n### **Paket Mobile** \n\n#### Waktu berakhir paket\n### Kamis, 11 Februari 2021 02:10 WIB \n\n**Keuntungan yang Anda dapatkan jika berlangganan:**\n- Jelajahi dan nikmati konten Mola tanpa batasan\n- Menonton tanpa Iklan\n- Dapat menonton di Aplikasi Mobile atau Browser PC atau Laptop Anda\n\nSegera perpanjang masa paket Anda agar dapat menikmati keuntungannya. " .

I just follow your reference but i can't make as expected, example code :

                Markdown(inboxDetailsVm.inboxDetailsGetVM?.attribute.template.lang.first?.message ?? "")
                            .markdownStyle(
                                MarkdownStyle(
                                    font: .custom("OpenSans-Light", size: 14),
                                    foregroundColor: .white,
                                    measurements: .init(
                                        codeFontScale: 0.8,
                                        headingSpacing: 0.5
                                    )

                                )
                            )
                            .multilineTextAlignment(.leading)  

there is my reality like the following picture:

Screen Shot 2022-02-11 at 11 16 55 AM

and the expectations are like the following picture:

Screen Shot 2022-02-09 at 12 18 53 PM

how to use markdownStyle in detail ? but i want custom style color and fontsize,fontname,linespacing,padding,width,height by part H1,H2,H3,H4,H5,H6 and then blockquote, and list, etc. I think that the reference you have attached is incomplete in the explanation of the example, I'm so confused and hope you can answer my question and give me a solution. Thank you :)

gonzalezreal commented 2 years ago

Hi,

Which part of MarkdownStyle is not working for you? Is it the font, the color, or something else?

I am happy to clarify any doubts, but you can find plenty of documentation in the code.

kikimaxs commented 2 years ago

Hi @gonzalezreal, Can you please take a look at my previous comment ? I have edited my previous comment so you could understood my current issue

gonzalezreal commented 2 years ago

Hi, At the moment, MarkdownUI doesn't support styling blocks or inlines. I will consider adding more styling options in a future release. In the meantime, have a look at the inline documentation in the following files to know what you can style now: