Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated HTML Injection #373

Open
chancyk opened this issue Nov 6, 2024 · 0 comments
Open

Generated HTML Injection #373

chancyk opened this issue Nov 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@chancyk
Copy link

chancyk commented Nov 6, 2024

Is your feature request related to a problem? Please describe. 🤔
rawHtml only accepts static strings.

Describe the solution you'd like 💡
An ergonomic means of injecting generated HTML, such as from a markdown parser.

Describe alternatives you've considered 💁‍♀️

  • Generating hpx files to be imported later.
  • tagFromString but for some reason an example like below only produces output for the heading:
serve "127.0.0.1", 5000:
  get "/":
    let md = markdown("""## Heading
Body of the *bold* paragraph. This is a [link](https://google.com).
""")
    let html = fmt"""<div style="color: red">{md}</div>"""
    buildHtml:
      tDiv:
        tagFromString(html)

Additional context
I'm looking for an ergonomic way to combine article style content with complex widgets such as small interactive charts in the same page. Nimib kind of supports this use case with Karax components, but it embeds the entire Nim JS runtime for every usage of nbKaraxCode.

@chancyk chancyk added the enhancement New feature or request label Nov 6, 2024
@chancyk chancyk changed the title New Feature 🔥 Generated HTML Injection Generated HTML Injection Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant