Skip to content

feature: Option to link source #253

Open
@reteps

Description

@reteps

Is your feature request related to a problem? Please describe.

I would like to give users a way to view the source, but viewing it inline isn't that helpful; linking back to GitHub so they can see the version history is. Additionally, some extremely large functions benefit from this style, as an inline block takes up a lot of space.

Describe the solution you'd like

I have added a hook with this functionality upstream that overrides view_source for functions and classes, but I was unsure how to easily configure the base repo URL (which should happen outside of mkdocsstrings)

Here is the template override: https://github.com/PrairieLearn/PrairieLearn/blob/master/docs/mkdocstrings/python/material/function.html.jinja#L19

Context

You can see an example here: https://prairielearn.readthedocs.io/en/latest/python-reference/prairielearn/core/

Image

Request

A link_source option that does what I want.

Metadata

Metadata

Assignees

Labels

featureNew feature or requestinsidersCandidate for Insiders

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions