ai4co / rl4co

A PyTorch library for all things Reinforcement Learning (RL) for Combinatorial Optimization (CO)
https://rl4.co
MIT License
362 stars 67 forks source link

[BUG] Cannot click on "Open in Colab" badges #196

Open leonlan opened 2 months ago

leonlan commented 2 months ago

Describe the bug

I cannot click on "Open in Colab" badge in examples that are displayed in the documentation.

To Reproduce

System info

N/A

Additional context

I was trying to see how you implemented Colab notebooks for your examples and then I noticed this behavior :-).

Reason and Possible fixes

Instead of using HTML hyperlinks like this:

"<a href=\"https://colab.research.google.com/github/ai4co/rl4co/blob/main/examples/2-full-training.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"></a>\n"

I think it will work when you use Markdown-style rendering like this:

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ai4co/rl4co/blob/main/examples/2-full-training.ipynb)

That works for me when notebooks are rendered using nbsphinx. Not 100% sure though if this also fixes this issue.

Checklist

fedebotu commented 1 month ago

Thanks @leonlan for reporting! We noticed this as well before, it seems to be a problem with the compilation of Jupyter notebooks that "flatten" those buttons :thinking:

We are planning to go through the docs before the 0.5.0, possibly changing the template to something a better than the PyTorch Lightning docs one (maybe trying to copy-paste from your PyVRP ;) ). Similarly let's switch the main installer to poetry @cbhua , it is long due :rofl:

fedebotu commented 1 month ago

Latest version of the documentation is out!

https://rl4co.readthedocs.io/en/latest/

The Colab badge seems to work fine now ~

leonlan commented 4 weeks ago

docs looking good :-)

fedebotu commented 4 weeks ago

We imitated quite a bit PyVRP's style ;) (But we did in MkDocs which turned out to be... quite a bit harder than expected 🤣 )