question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Edit link has wrong label

See original GitHub issue

Problem Description

I’m hosting my repo on GitLab, but the edit link says GitHub.

Steps to reproduce the behavior:

  1. Configure edit url:
pdoc.render.configure(
    edit_url_map={
        "codefs": "https://gitlab.com/dAnjou/fs-code/-/blob/main/src/codefs/",
    },
)
  1. Generate docs

Expected behavior

Edit link says Edit on GitLab.

Actual behavior

Edit link says Edit on GitHub.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mhilscommented, Jan 17, 2022

I still think it’d make sense to make the label configurable, because there’s already configuration needed for the button to show up.

I think @mrossinek already shared a good way how you can configure the label in https://github.com/mitmproxy/pdoc/issues/333#issuecomment-1013763332, and this approach will continue to work. I’ve set a relatively high bar for adding new CLI configuration switches to pdoc, my goal is to keep things simple where we can (you may be familiar with the German term Eierlegende Wollmilchsau — we try to avoid that here).

a20bee8 adds the “Edit on GitLab”/“Edit Source” wording, which should hopefully fix things for 99% of the use cases. Thank you two again for the feedback and for sharing your approaches! 😃 🍰

1reaction
mhilscommented, Jan 16, 2022

The “Edit on GitHub” phrasing originates from sphinx-rtd-theme, see for example on https://docs.readthedocs.io/en/stable/. The motivation for this button is that people can use it to propose changes to the page they are currently viewing with little effort. For example, here’s a PR where someone read the mitmproxy docs, spotted a typo, and immediately proposed a fix: https://github.com/mitmproxy/mitmproxy/pull/5062/. Having “GitHub” in the message signals to the reader that this will be a familiar and low-effort process (assuming they have a GitHub account). Long story short, I think there’s strong precedent for the “Edit [on GitHub]” wording and I would like to keep it that way.

I feel that a “Browse repo” button should much rather point to the repo root and not to individual files. The full source code is also already available as part of the pdoc page. I would be happy to also accomodate GitLab users here, but we want to optimize for the common case (GitHub), where I think the “Edit on GitHub” wording is better. Of course, you can always change it with a custom template. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Ghost links" in excel - Microsoft Community Hub
Dear all, I have a link in my excel (visible in data/edit links) but I cannot find in which cell this link exists....
Read more >
Hyperref links linking to the wrong label. - TeX
In Axioms and Operations after the third exercise, I have \label{exer3}. Later in exercise 6, I reference it twice with \ref{exer3}, however, ...
Read more >
Permanently Remove Update Links Alert in Microsoft Excel
Go to the 'Data' ribbon. In the 'Queries & Connections' section, select 'Edit Links' (if the 'Edit Links' button is grayed out, you're...
Read more >
Hyperlink in Excel: how to create, edit and remove - Ablebits
Removing hyperlinks in Excel is a two-click process. You simply right-click a link, and select Remove Hyperlink from the context menu. Removing ...
Read more >
Removing Phantom Excel Links - The Marquee Group
How to check for non-phantom links · Go to the Edit menu and select the Links option towards the bottom (if this option...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found