Closed tboulogne closed 3 years ago
Hey @tboulogne , thanks for the contribution 👍
A few comments:
BaseGitSourceLinker
)Hey @NiklasRosenstein,
let me check this an back to you :-)
@NiklasRosenstein hello, check it now please.
Regards
Hey @tboulogne ,
Thanks for looking into it!
I did actually like the split into two different classes (GithubSourceLinker
and GiteaSourceLinker
) because I would prefer to write
type: gitea
repo: me/repo
as opposed to
type: github
flavor: gitea
host: gitea.com
repo: me/repo
I was suggesting that we create a BaseGitSourceLinker
that implements the generic logic of retrieving the SHA and constructing the URL, and then only override the URL_TEMPLATE in the subclass. 🙂 Something along the lines of
class GiteaSourceLinker(BaseGitSourceLinker):
host = Field(str, default='gitea.com') # Override the field from BaseGitSourceLinker with a different default
URL_TEMPLATE = 'https://{host}/{repo}/src/commit/{sha}/{path}#L{lineno}'
Sorry for not being clear enough! I can also make this change later if you don't get to it / want to do it
Cheers
@NiklasRosenstein no problem ;-)
i will look into this week :-) and back to you.
@NiklasRosenstein let me know if it's ok for you :-)
@NiklasRosenstein done.
Your mods are far away what you explains here https://github.com/NiklasRosenstein/pydoc-markdown/pull/158#issuecomment-717277180 ...
Well originally in my mind it was a bit simpler to implement than what it turned out to be 😁
@NiklasRosenstein definitely :-)
Hello,
Here a PR to add gitea source_linker. Github is not the only one :-).
Regards