JuliaReinforcementLearning / ReinforcementLearningAnIntroduction.jl

Julia code for the book Reinforcement Learning An Introduction
https://juliareinforcementlearning.org/ReinforcementLearningAnIntroduction.jl/
MIT License
309 stars 58 forks source link

Setup github action to generate preview automatically #41

Closed findmyway closed 2 years ago

findmyway commented 3 years ago

Ideally, we should use https://github.com/JuliaPluto/static-export-template in the future. (This is not related to the css issue though)

kir0ul commented 3 years ago

Was starting to look into this, and it seems automatically exporting the notebooks to HTML using ExportPluto.yaml looks pretty straightforward :slightly_smiling_face:

What I'm less sure about is what would happen to the notebooks on the blog, like https://juliareinforcementlearning.org/blog/notebooks_for_reinforcement_learning_an_introduction/Chapter01_Tic_Tac_Toe.jl/ (which look manually copied inside https://github.com/JuliaReinforcementLearning/JuliaReinforcementLearning.github.io/tree/master/blog/notebooks_for_reinforcement_learning_an_introduction)? :thinking:

Possible solutions (maybe there are others?):

Any thoughts on this?

findmyway commented 3 years ago

Thanks for looking into it!

I prefer to simply set up a CI to push these generated htmls into the gh-pages branch in this repo. And update the link in that blog.

(We don't need to keep this repo updated to the master branch of RL.jl, cause generating all those htmls would consume a lot of resources I think. We just need to update the dependency once there are new minor releases 😃 )

kir0ul commented 3 years ago

This is the page I'm referring to: https://juliareinforcementlearning.org/blog/ where there are all the links to the notebooks.

So you mean instead of having a link on the blog that points to https://juliareinforcementlearning.org/blog/notebooks_for_reinforcement_learning_an_introduction/Chapter01_Tic_Tac_Toe.jl/, instead it would point to the gh-pages URL: https://JuliaReinforcementLearning.github.io/ReinforcementLearningAnIntroduction.jl/notebooks/Chapter01_Tic_Tac_Toe.html?

If I understand correctly, I believe there's no way for the gh-pages URL to redirect to this kind of domain: https://juliareinforcementlearning.org/blog/notebooks_for_reinforcement_learning_an_introduction/, it has to be a top level domain.

findmyway commented 3 years ago

So you mean instead of having a link on the blog that points to https://juliareinforcementlearning.org/blog/notebooks_for_reinforcement_learning_an_introduction/Chapter01_Tic_Tac_Toe.jl/, instead it would point to the gh-pages URL: https://JuliaReinforcementLearning.github.io/ReinforcementLearningAnIntroduction.jl/notebooks/Chapter01_Tic_Tac_Toe.html?

Exactly!

In theory, we could still upload generated html pages under https://juliareinforcementlearning.org/blog/notebooks_for_reinforcement_learning_an_introduction . All we need to do is to clone those generated html pages from the gh-pages branch after the following step:

https://github.com/JuliaReinforcementLearning/ReinforcementLearning.jl/blob/9185c8548197dd4a6ef0cd7c84c3531c491e6447/.github/workflows/ci.yml#L103

But I'm afraid that's not necessary.

kir0ul commented 2 years ago

So it's been published correctly here: https://juliareinforcementlearning.org/ReinforcementLearningAnIntroduction.jl/, but there's an error when running using ReinforcementLearning:

ArgumentError: Package ReinforcementLearning is required but does not seem to be installed

My guess is it's missing the following at the beginning of each notebook:

Pkg.add([
        Pkg.PackageSpec(name="ReinforcementLearning"),
    ])
    using ReinforcementLearning
kir0ul commented 2 years ago
findmyway commented 2 years ago

Nice work!

It seems I missed the install step:

https://juliareinforcementlearning.org/ReinforcementLearningAnIntroduction.jl/notebooks/Chapter01_Tic_Tac_Toe.html

I'll have a try later today.

findmyway commented 2 years ago

Should be fixed in https://github.com/JuliaReinforcementLearning/ReinforcementLearningAnIntroduction.jl/pull/72

🎉

kir0ul commented 2 years ago

Cool! 😎