pytorch-lightning: Broken [Source] links in docs

📚 Documentation

Hello, I was browsing the docs, and out of curiosity, I wanted to check the source for LightningModule, and so I clicked on the [Source] link of the forward method. The link, however, sends to https://github.com/PyTorchLightning/PyTorch-Lightning/blob/pytorch_lightning/core/lightning/LightningModule.py, which is not right, as the repo name is “pytorch-lightning”.

I am not familiar with Sphinx, but I checked the docs and the conf file, and I think that the reason can be found here:

https://github.com/PyTorchLightning/pytorch-lightning/blob/ee4eae884b137054e10f21a44f0d1d427405e310/docs/source/conf.py#L59-L71

Since github-repo is set to project, which is, indeed, PyTorch-Lightning, as in the broken link.

If someone more familiar with Sphinx can confirm this, I’d be glad to submit a PR to fix this.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (14 by maintainers)

Most upvoted comments

so you say it’s a two step fix.

  1. replace linkcode with viewcode, which solves the problem with linked source code, but we lose methods source code
  2. add the custom css to the theme so we have methods properly linked

if it can consistently link all modules, classes, methods and functions, I think this is what we want.

@ydcjeff nice, could you make a draft PR so we can try it out?