mdit-py-plugins icon indicating copy to clipboard operation
mdit-py-plugins copied to clipboard

Add github / gitlab parsing of issues and pull requests

Open ClementPinard opened this issue 1 year ago • 1 comments

Context

Github and gitlab flavored markdown have their own parsing tools to detection links to issues with a simple #<number> or !<number> for gitlab's MR.

Example here : #103 #14 automatically add links to the corresponding issue and pull requests

Would it be interesting to have a dedicated plugin for myst ?

Many projects do have a CHANGELOG.md file, which uses this syntaxe and it would be nice to be able to convert it to a sphinx page with myst. See a changelog example here : https://github.com/github-tools/github-release-notes/blob/master/CHANGELOG.md

Also, note that there exists a project that tries to recreate the #{number} feel for changelog with sphinx, but it works directive that are then not parsed by github/gitlab : https://github.com/sloria/sphinx-issues .

In a sense, we want the other way around, to transform #{number} patterns into proper directives :smiley:

Proposal

Provide a plugin that you can parameter so that {character}{number} are substituted to links to the corresponding issue/PR of you own project {website}/{user}/{project}/{task}/{number}

for e.g. this project, the parameters would be :

website = "https://github.com/"
user = "exectuablebooks"
project = "mdit-py-plugins"
issue_character = "#"
issue_task = "issues"

For a project in gitlab the parameters would be :

website = "https://gitlab.com/"
user = "exectuablebooks"
project = "mdit-py-plugins"
issue_character = "#"
issue_task = "issues"
pull_request_character="!"
pull_request_task = "merge_requests"

Note that for github, there is a confusion between patterns for issues and pull requests, but that's ok since github automatically redirect to the right url. For example https://github.com/executablebooks/mdit-py-plugins/issues/105 automatically redirects to https://github.com/executablebooks/mdit-py-plugins/pull/105

Tasks and updates

No response

ClementPinard avatar Mar 20 '24 16:03 ClementPinard

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

welcome[bot] avatar Mar 20 '24 16:03 welcome[bot]