{"id":18622941,"url":"https://github.com/python-markdown/github-links","last_synced_at":"2025-04-11T12:23:02.767Z","repository":{"id":46273962,"uuid":"109892318","full_name":"Python-Markdown/github-links","owner":"Python-Markdown","description":"Python-Markdown GitHub Links Extension","archived":false,"fork":false,"pushed_at":"2023-12-22T19:53:20.000Z","size":28,"stargazers_count":11,"open_issues_count":0,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T08:42:37.756Z","etag":null,"topics":["github","markdown","python-markdown"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/mdx-gh-links/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Python-Markdown.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-07T21:22:03.000Z","updated_at":"2025-03-13T11:03:45.000Z","dependencies_parsed_at":"2024-06-19T09:57:50.685Z","dependency_job_id":"532c23a3-bb71-4314-8dc1-5cc23058f075","html_url":"https://github.com/Python-Markdown/github-links","commit_stats":{"total_commits":25,"total_committers":4,"mean_commits":6.25,"dds":"0.16000000000000003","last_synced_commit":"8175031e051d4580b74a4c5db6e3186cfd96902d"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Python-Markdown%2Fgithub-links","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Python-Markdown%2Fgithub-links/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Python-Markdown%2Fgithub-links/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Python-Markdown%2Fgithub-links/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Python-Markdown","download_url":"https://codeload.github.com/Python-Markdown/github-links/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248401272,"owners_count":21097327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","markdown","python-markdown"],"created_at":"2024-11-07T04:19:55.193Z","updated_at":"2025-04-11T12:23:02.731Z","avatar_url":"https://github.com/Python-Markdown.png","language":"Python","readme":"# Python-Markdown Github-Links Extension\n\nAn extension to Python-Markdown which adds support for shorthand links to GitHub\nusers, repositories, issues and commits.\n\n## Installation\n\nTo install the extension run the following command:\n\n```sh\npip install mdx-gh-links\n```\n\n## Usage\n\nTo use the extension simply include its name in the list of extensions passed to\nPython-Markdown.\n\n```python\nimport markdown\nmarkdown.markdown(src, extensions=['mdx_gh_links'])\n```\n\n### Configuration Options\n\nTo set configuration options, you may pass them to Markdown's `exension_configs`\nkeyword...\n\n```python\nmarkdown.markdown(\n    src,\n    extensions=['mdx_gh_links'],\n    extension_configs={\n        'mdx_gh_links': {'user': 'foo', 'repo': 'bar'}\n    }\n)\n```\n\n... or you may import and pass the configs directly to an instance of the\n`mdx_gh_links.GithubLinks` class...\n\n```python\nfrom mdx_gh_links import GithubLinks\nmarkdown.markdown(src, extensions=[GithubLinks(user='foo', repo='bar')])\n```\n\nThe following configuration options are available:\n\n#### user\n\nA GitHub user name or organization. If no user or organization is specified in\na GitHub link, then the value of this option will be used.\n\n#### repo\n\nA GitHub repository. If no repository is specified in a GitHub link, then the\nvalue of this option will be used.\n\n### domain\n\nThe domain of the host server for the repository. Defaults to\n`https://github.com`, but may be set to the root of a GitHub Enterprise Server.\n\n## Syntax\n\nThis extension implements shorthand to specify links to GitHub in various ways.\n\nAll links in the generated HTML are assigned a `gh-link` class as well as a class\nunique to that type of link. See each type for the specific class assigned.\n\n### Mentions\n\nLink directly to a GitHub user, organization or repository. Note that no\nverification is made that an actual user, organization or repository exists. As\nthe syntax does not differentiate between users and organizations, all\norganizations are assumed to be users. However, this assumption is only\nreflected in the title of a link.\n\nMentions use the format `@{user}` to link to a user or organization and\n`@{user}/{repo}` to link to a repository. The defaults defined in the\nconfiguration options are ignored by mentions. A mention may be escaped by\nadding a backslash immediately before the at sign (`@`).\n\nAll mentions are assigned the `gh-mention` class.\n\nThe following table provides some examples:\n\n| shorthand   | href                         | rendered result                                                                     |\n| ----------- | ---------------------------- | -------------------------------------------------------------------- |\n| `@foo`      | `https://github.com/foo`     | [@foo](https://github.com/foo \"GitHub User: @foo\")                   |\n| `@foo/bar`  | `https://github.com/foo/bar` | [@foo/bar](https://github.com/foo/bar \"GitHub Repository: @foo/bar\") |\n| `\\@foo`     |                              | @foo                                                                 |\n| `\\@foo/bar` |                              | @foo/bar                                                             |\n\n### Issues\n\nLink directly to a GitHub issue or pull request (PR). Note that no verification\nis made that an actual issue or PR exists. As the syntax does not differentiate\nbetween Issues and PRs, all URLs point to \"issues\". Fortunately, GitHub will\nproperly redirect an issue URL to a PR URL if appropriate.\n\nIssue links use the format `#{num}` or `{user}/{repo}#{num}`. `{num}` is the\nnumber assigned to the issue or PR. `{user}` and `{repo}` will use the\ndefaults defined in the configuration options if not provided. An issue link may\nbe escaped by adding a backslash immediately before the hash mark (`#`).\n\nAll issue links are assigned the `gh-issue` class.\n\nThe following table provides various examples (with the defaults set as\n`user='user', repo='repo'`):\n\n| shorthand      | href                                         | rendered result                                                                     |\n| -------------- | -------------------------------------------- | ----------------------------------------------------------------------------------- |\n| `#123`         | `https://github.com/user/repo/issues/123`    | [#123](https://github.com/user/repo/issues/123 \"GitHub Issue user/repo #123\")       |\n| `foo/bar#123`  | `https://github.com/foo/bar/issues/123`      | [foo/bar#123](https://github.com/foo/bar/issues/123 \"GitHub Issue foo/bar #123\")    |\n| `\\#123`        |                                              | #123                                                                                |\n| `foo/bar\\#123` |                                              | foo/bar#123                                                                         |\n\n### Commits\n\nLink directly to a GitHub Commit. Note that no verification is made that an\nactual commit exists.\n\nCommit links consist of a complete 40 character SHA hash and may optionally be\nprefaced by `{user}@` or `{user/repo}@`. `{user}` and `{repo}` will use the\ndefaults defined in the configuration options if not provided. To avoid a 40\ncharacter hash from being linked, wrap it in a code span.\n\nAll commit links are assigned the `gh-commit` class.\n\nThe following table provides various examples (with the defaults set as\n`user='user', repo='repo'`):\n\n| shorthand                                          | href                                                                              | rendered result                                                                                                                                                 |\n| -------------------------------------------------- | --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `72df691791fb36f00cf5363fefe757c8d3042656`         | `https://github.com/user/repo/commit/72df691791fb36f00cf5363fefe757c8d3042656`    | [72df691](https://github.com/user/repo/commit/72df691791fb36f00cf5363fefe757c8d3042656 \"GitHub Commit: user/repo@72df691791fb36f00cf5363fefe757c8d3042656\")     |\n| `foo@72df691791fb36f00cf5363fefe757c8d3042656`     | `https://github.com/foo/repo/commit/72df691791fb36f00cf5363fefe757c8d3042656`     | [foo@72df691](https://github.com/foo/repo/commit/72df691791fb36f00cf5363fefe757c8d3042656 \"GitHub Commit: foo/repo@72df691791fb36f00cf5363fefe757c8d3042656\")   |\n| `foo/bar@72df691791fb36f00cf5363fefe757c8d3042656` | `https://github.com/foo/bar/commit/72df691791fb36f00cf5363fefe757c8d3042656`      | [foo/bar@72df691](https://github.com/foo/bar/commit/72df691791fb36f00cf5363fefe757c8d3042656 \"GitHub Commit: foo/bar@72df691791fb36f00cf5363fefe757c8d3042656\") |\n| `` `72df691791fb36f00cf5363fefe757c8d3042656` ``   |                                                                                   | `72df691791fb36f00cf5363fefe757c8d3042656`                                                                                                                      |\n\n## License\n\nThe Python-Markdown Github-Links Extension is licensed under the [BSD License] as\ndefined in `LICENSE`.\n\n[BSD License]: http://opensource.org/licenses/BSD-3-Clause\n\n## Change Log\n\n### Version 0.4 (2023/12/22)\n\nAdd `domain` configuration option in order to support GitHub Enterprise Servers.\n\n### Version 0.3.1 (2023/07/28)\n\nInclude README in release.\n\n### Version 0.3 (2022/07/18)\n\nUpdate dependencies.\n\n### Version 0.2 (2018/03/09)\n\nIgnore mentions/issues/commits within Markdown links.\n\n### Version 0.1 (2017/11/10)\n\nThe initial release.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-markdown%2Fgithub-links","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpython-markdown%2Fgithub-links","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-markdown%2Fgithub-links/lists"}