Skip to content

Embedding yew components in an existing page #3593

Answered by Timmmm
Timmmm asked this question in Q&A
Discussion options

You must be logged in to vote

I got this to work. Basically do this:

  1. In the Asciidoc add divs for where you want to insert the components:
++++
<div id="embed_0"></div>
++++

...

++++
<div id="embed_1"></div>
++++
  1. Make a Trunk.toml to run Asciidoc:
[[hooks]]
stage = "pre_build"
command = "asciidoctor"
command_arguments = ["src/index.adoc", "--out-file", "target/index_adoc.html"]
  1. In Trunk's index.html add the HTML inline:
<!DOCTYPE html>
<html lang="en">
    <head>
        <link href="/src/style.css" rel="css" data-trunk/>
    </head>
    <body>
        <link href="/target/index_adoc.html" rel="inline" data-trunk/>
    </body>
</html>
  1. In your fn main():
fn main() {
    wasm_logger::init(wasm_logger::Config:…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Timmmm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant