pietroppeter / nimib

nimib 🐳 - nim 👑 driven ⛵ publishing ✍
https://pietroppeter.github.io/nimib/
MIT License
175 stars 10 forks source link

Happyx support #212

Closed quimt closed 10 months ago

quimt commented 10 months ago

Created nbHappyxCode block and internal happyxRoutes for supporting the happyx framework.

Simple helloWorld:


  nbHappyxCode:
    let num = 4
    happyxRoutes:
      "/":
        for i in 1..num:
          tDiv(style="color:red;"): "Welcome to HappyX! "
HugoGranstrom commented 10 months ago

Hi, this looks really cool! I haven't looked too much into HappyX but it seems nice :D So thank you for contributing to nimib. :D

The CI error is unrelated to your code, so don't worry about it :)

The question is if this belongs in nimib or in nimibex. Or plan is to eventually move all non-core features to nimibex (for example nbKarax, nbPython). The two options are that either you open a PR to nimibex and close this one, or we merge this here and later when we have decided on how to do with nimibex we will move it over manually. @pietroppeter which one do you think we should do?

HugoGranstrom commented 10 months ago

The CI should be fixed now, so now you can merge our main branch into your and push it.

quimt commented 10 months ago

Alright, I'll work on pushing through the main branch. Go ahead and migrate to nimibex along with the Karax support. The supporting code for HappyX and Karax are in the same place, and are the same kind of thing, so can be treated the same way.

HugoGranstrom commented 10 months ago

Ah, no I was a bit unclear :sweat_smile: Merge our main branch into your happyx-support branch.

quimt commented 10 months ago

It is merged

HugoGranstrom commented 10 months ago

Great! Would you mind adding a simple example at the bottom of interactivity.nim? :D

quimt commented 10 months ago

Thanks for asking! I'll work on getting an example pushed . Should this be in a separate PR?

A near term goal was to do some documentation of the front end for happyX. Nimibis great for teaching and documenting the Nim ecosystem. Thanks for helping to develop and maintain this space!

HugoGranstrom commented 10 months ago

Thanks for asking! I'll work on getting an example pushed . Should this be in a separate PR?

Awesome! :D You can add it in this PR :+1: It doesn't have to be anything fancy, you could even just do the same thing as the other examples in interactivity.nim but in HappyX.

A near term goal was to do some documentation of the front end for happyX. Nimib is great for teaching and documenting the Nim ecosystem. Thanks for helping to develop and maintain this space!

That's exciting to hear that you want to use nimib for documentation :D It's knowing these kinds of things that keeps us excited to evolve nimib into something even better so everyone using nimib can benefit from them :star_struck:

quimt commented 10 months ago

Alright, I've commited an example. The current implementation doesn't perfectly match HappyX's interpetation of event handler blocks like @click:. My recommendation is to use parentheses to declare the call unambiguously, which have been doing with the pushed content in personal use. This is good enough for now, but another commit may be coming if a satisfactory solution is implemented.

pietroppeter commented 10 months ago

Hi, thanks this looks really nice! happyX looks very cool from a very quick look.

The question is if this belongs in nimib or in nimibex. Or plan is to eventually move all non-core features to nimibex (for example nbKarax, nbPython). The two options are that either you open a PR to nimibex and close this one, or we merge this here and later when we have decided on how to do with nimibex we will move it over manually. @pietroppeter which one do you think we should do?

it definitely belongs to nimibex but I do not seem a lot of harm on having this here and moving it later.

HugoGranstrom commented 10 months ago

The CI error is because we don't have HappyX installed. You will have to add it to the testDeps tasks in the nimble file.

quimt commented 10 months ago

Updated nimble file.

pietroppeter commented 10 months ago

thanks, all good for me, sorry for the delay in the review! if @HugoGranstrom does not have other remarks/requests, I am happy(x) to merge this!

HugoGranstrom commented 10 months ago

Looks good to me 😁👍

pietroppeter commented 10 months ago

thanks again @quimt for your work on this!

pietroppeter commented 10 months ago

(plan is to finalize the other PRs and make a release where this will be made available)