Search code examples
pythongithubmkdocsmkdocstrings

mkdocs/mkdocstrings: add link back to GitHub source code


I am making docs for my Python code with mkdocs and mkdocstrings.

I would like to have link from the docs to the source code (page and line number on github).

Is there a way to automatic add that with function/class syntax (e.g., '::: identifier')?

I am looking for something similar to 'SciPy' docs, where they have [source] button (right of function heading). For an example: Poisson distribution


Solution

  • You can find inspiration in this archived repository: https://github.com/AI2Business/mkdocstrings-sourcelink. As of now (2023/07/06) there's no built-in way to achieve that. VCS support might happen in the future :) (source: am maintainer).