Feliz.Bulma icon indicating copy to clipboard operation
Feliz.Bulma copied to clipboard

Improve the documentation to auto retrieve the lines of code without having to pass them as strings

Open MangelMaxime opened this issue 2 months ago • 1 comments

In Fulma,

we are able to write the documentation using Markdown and automatically injecting the F# code for the examples.

It would be nice to do something similar for Feliz.Bulma, as it ensure that the code examples works.

We could in theory, write an equivalent to custom-loader.js for Vite but there is also this feature which seems easier to use.

It means that we will need to fetch the sources files when displaying the documentation but that should be fine because text is small often. We could create a helper `

Some experimentation was started in this branch.

Ideally, we would want to use a vite plugin to inline the string and avoid additional requests but I was not able to make a quick POC for it.

MangelMaxime avatar Oct 14 '25 14:10 MangelMaxime

There is also Vite ?raw suffix that can help here

MangelMaxime avatar Oct 19 '25 09:10 MangelMaxime