gleam-lang / language-tour

👩🏽‍💻 Learn Gleam in your browser
https://tour.gleam.run/
82 stars 62 forks source link

What would it take to make the tour a library. #66

Open CrowdHailer opened 6 months ago

CrowdHailer commented 6 months ago

I would like to be able to write tours for other things, explained in Gleam. For example things I would personally like to write are.

It would be great if there was a way to something like the following

// my_tour.gleam
import gleam/tour

pub fn main() {
  tour.build("/build", pages())
}

fn pages() {
  [
    tour.Page(
      title: "Getting started with OTP",
      content: "First we need to introduce processes"
      code: "
        import gleam/otp

        // ..."
    )
  ]
}

I'm happy to help contribute to such a thing. But I think it needs a bit of design work to work out what the interface is and what should be exposed.

lpil commented 6 months ago

The tour hasn't really been designed to be used a library so it would be tricky, and OTP wouldn't be possible as it runs on JavaScript rather than Erlang.

CrowdHailer commented 6 months ago

Good point on OTP.

I understand that it was not designed this way. However if I found a way to make it more library friendly, would that be an interesting contribution. Or should I just be copy/pasting the code to my projects

lpil commented 6 months ago

Forking is probably the best for now as I'm not sure how we could make it into a library.