简体   繁体   中英

How to draw Composable Preview to HTML file

This is a general question, I'm looking for ideas. The goal is to write a documentation system.
So, I want to draw my Composable function on the HTML page.
What comes to my mind:

  1. @Preview already draws it somehow but I'm not sure that it's easy to adapt it to HTML. At the first glance, I haven't found such possibility.
  2. It's possible to draw the view on the emulator, take screenshot as Bitmap and upload this Bitmap. But this adds emulator dependency for generation which I'd like to avoid.

Perhaps, anyone has already worked on this problem? Appreciate any hints.

I don't think it's possible to render Composables for android in HTML as compose is targeting JVM.

Depending on your use case Compose for Web might be helpful for you

For removing the emulator from your process you might prefer Compose for Desktop

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM