-
Notifications
You must be signed in to change notification settings - Fork 162
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
Migrate to mdoc.js #741
Migrate to mdoc.js #741
Conversation
Do we track the current scala-js-dom version in the build file? I want to inject it in the docs using mdoc, but I can't seem to find the value. |
We use the sbt dynver plugin, you can use the Make sure that the git tags are up to date in your local clone :) |
Next error, I am trying to get interactive scala JS to work, I made a
|
Hum, why did you add |
Oh oops, I read the instructions for mdoc:js modifiers wrong, thank you :P |
Alright I got console logging working from the I need to improve the examples I think. |
🎉
Do you mean the ones in the existing documentation? Maybe, haven't looked at them recently 😂 even if we just start by porting them
Agree about docusaurus. I have to think about this, open to ideas too. Maybe we can steal the html/theme from the scala-js.org website which uses jekyll. |
I'll try to port them over!
Yea I think we can just create a stylesheet based off of the main website. At the very least to get us started. |
I am converting the examples and I see this piece of code: def main(pre: html.Pre) = {
import scala.concurrent
.ExecutionContext
.Implicits
.global
import js.Thenable.Implicits._
val url =
"https://www.boredapi.com/api/activity"
val responseText = for {
response <- dom.fetch(url)
text <- response.text()
} yield {
text
}
for (text <- responseText)
pre.textContent = text
} Is an |
Strictly speaking, no. It's only necessary if you convert the |
Is it correct that
The code: def fetchBoredApi(element: html.Pre) = {
val url =
"https://www.boredapi.com/api/activity"
val responseText = for {
response <- fetch(url)
text <- response.text()
} yield {
text
}
for (text <- responseText)
pre.textContent = text
} |
Yes, you need a |
docs/readme.md
Outdated
```scala mdoc:js:invisible | ||
<button class="button-run">Run</button | ||
<div id="outer-container"></div> | ||
<button id="demo1" class="button-run">Run</button> | ||
--- | ||
document.getElementById("demo1").addEventListener("click", (ev: Event) => { | ||
appendElement(document.getElementById("outer-container").asInstanceOf[html.Div]) | ||
}) | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Entirely unsure if this is a nice way to do runnable examples.
229db1c
to
f679c6a
Compare
Closing this to hide my shameful Git skills! New PR will be up soon(TM) |
Currently running against: