Skip to content

Add github / gitlab parsing of issues and pull requests #106

Description

@ClementPinard

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 😃

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 #105 automatically redirects to #105

Tasks and updates

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions