{"id":15048461,"url":"https://github.com/tdkorn/sphinx-github-style","last_synced_at":"2025-09-06T08:43:31.932Z","repository":{"id":79429812,"uuid":"603626933","full_name":"TDKorn/sphinx-github-style","owner":"TDKorn","description":"GitHub source code links and syntax highlighting for Sphinx docs","archived":false,"fork":false,"pushed_at":"2024-05-15T05:04:15.000Z","size":3708,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T22:03:01.789Z","etag":null,"topics":["pygments","pygments-lexer","pygments-style","sphinx","sphinx-doc","sphinx-extension","sphinxcontrib"],"latest_commit_sha":null,"homepage":"https://sphinx-github-style.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TDKorn.png","metadata":{"files":{"readme":"README.rst","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":"2023-02-19T04:42:16.000Z","updated_at":"2025-01-06T15:28:05.000Z","dependencies_parsed_at":"2024-01-21T05:23:35.769Z","dependency_job_id":"890f2b03-08c2-4b73-a6e1-2f5e13eec521","html_url":"https://github.com/TDKorn/sphinx-github-style","commit_stats":{"total_commits":32,"total_committers":1,"mean_commits":32.0,"dds":0.0,"last_synced_commit":"d31a448599806ede5c3b1c6364d39a59a327cb29"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TDKorn%2Fsphinx-github-style","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TDKorn%2Fsphinx-github-style/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TDKorn%2Fsphinx-github-style/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TDKorn%2Fsphinx-github-style/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TDKorn","download_url":"https://codeload.github.com/TDKorn/sphinx-github-style/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248138702,"owners_count":21053929,"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":["pygments","pygments-lexer","pygments-style","sphinx","sphinx-doc","sphinx-extension","sphinxcontrib"],"created_at":"2024-09-24T21:13:15.006Z","updated_at":"2025-04-10T01:23:41.448Z","avatar_url":"https://github.com/TDKorn.png","language":"Python","readme":".. |.add_linkcode_class+styled with CSS| replace:: styled with CSS\n.. _.add_linkcode_class+styled with CSS: https://sphinx-github-style.readthedocs.io/en/latest/add_linkcode_class.html\n.. |.~.get_linkcode_resolve| replace:: ``get_linkcode_resolve()``\n.. _.~.get_linkcode_resolve: https://sphinx-github-style.readthedocs.io/en/latest/linkcode.html#sphinx_github_style.utils.linkcode.get_linkcode_resolve\n.. |.linkcode_blob| replace:: ``linkcode_blob``\n.. _.linkcode_blob: https://sphinx-github-style.readthedocs.io/en/latest/index.html#confval-linkcode_blob\n.. |.linkcode_link_text| replace:: ``linkcode_link_text``\n.. _.linkcode_link_text: https://sphinx-github-style.readthedocs.io/en/latest/index.html#confval-linkcode_link_text\n.. |.linkcode_resolve| replace:: ``linkcode_resolve``\n.. _.linkcode_resolve: https://sphinx-github-style.readthedocs.io/en/latest/index.html#confval-linkcode_resolve\n.. |.linkcode_url| replace:: ``linkcode_url``\n.. _.linkcode_url: https://sphinx-github-style.readthedocs.io/en/latest/index.html#confval-linkcode_url\n.. |.sphinx+html_context| replace:: ``html_context``\n.. _.sphinx+html_context: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_context\n.. |.sphinx.ext.linkcode| replace:: ``sphinx.ext.linkcode``\n.. _.sphinx.ext.linkcode: https://www.sphinx-doc.org/en/master/usage/extensions/linkcode.html#module-sphinx.ext.linkcode\n.. |.sphinx.ext.viewcode| replace:: ``sphinx.ext.viewcode``\n.. _.sphinx.ext.viewcode: https://www.sphinx-doc.org/en/master/usage/extensions/viewcode.html#module-sphinx.ext.viewcode\n\n\n..  Title: Sphinx Github Style\n..  Description: A Sphinx extension to add GitHub source code links and syntax highlighting\n..  Author: TDKorn (Adam Korn)\n\n.. meta::\n   :title: Sphinx Github Style\n   :description: A Sphinx extension to add GitHub source code links and syntax highlighting\n\n\n\n\n\n.. raw:: html\n\n   \u003cdiv align=\"center\"\u003e\n\n\n.. image:: https://raw.githubusercontent.com/TDKorn/sphinx-github-style/v1.2.2/docs/source/_static/logo_square_grey_blue.png\n   :alt: Sphinx GitHub Style: GitHub Integration and Pygments Style for Sphinx Documentation\n   :width: 25%\n\n\n\n.. raw:: html\n\n   \u003ch1\u003eSphinx Github Style\u003c/h1\u003e\n\n\nGitHub source code links and syntax highlighting for Sphinx documentation\n\n\n.. |docs| replace:: **Explore the docs »**\n.. _docs: https://sphinx-github-style.readthedocs.io/en/latest/\n\n|docs|_\n\n\n\n\n.. image:: https://img.shields.io/pypi/v/sphinx-github-style?color=eb5202\n   :target: https://pypi.org/project/sphinx-github-style/\n   :alt: PyPI Version\n\n.. image:: https://img.shields.io/badge/GitHub-sphinx--github--style-4f1abc\n   :target: https://github.com/tdkorn/sphinx-github-style/\n   :alt: GitHub Repository\n\n.. image:: https://static.pepy.tech/personalized-badge/sphinx-github-style?period=total\u0026units=none\u0026left_color=grey\u0026right_color=blue\u0026left_text=Downloads\n    :target: https://pepy.tech/project/sphinx-github-style/\n\n.. image:: https://readthedocs.org/projects/sphinx-github-style/badge/?version=latest\n    :target: https://sphinx-github-style.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n.. raw:: html\n\n   \u003c/div\u003e\n   \u003cbr/\u003e\n   \u003cbr/\u003e\n\n\n\nAbout\n~~~~~~~~~~~~~\n\n``sphinx-github-style`` is a Sphinx extension that links your documentation to GitHub source code.\nIt also adds syntax highlighting for code blocks similar to GitHub's pretty lights dark theme.\n\n...\n\n\nGitHub Source Code Links\n===============================\n\n\nUsing |.sphinx.ext.linkcode|_,  a ``View on GitHub`` link is added to the documentation of every class, method, function, and property:\n\n\n\n\n\n.. image:: https://raw.githubusercontent.com/TDKorn/sphinx-github-style/v1.2.2/docs/source/_static/github_link.png\n   :alt: sphinx-github-style adds a \"View on GitHub\" link\n\n\nThey link to and highlight the corresponding code block in your GitHub repository:\n\n\n\n.. image:: https://raw.githubusercontent.com/TDKorn/sphinx-github-style/v1.2.2/docs/source/_static/github_linked_code.png\n   :alt: The linked corresponding highlighted source code block on GitHub\n\n\n\n.. raw:: html\n\n   \u003ctable\u003e\n       \u003ctr align=\"left\"\u003e\n           \u003cth\u003e\n\n📝 Note\n\n.. raw:: html\n\n   \u003c/th\u003e\n   \u003ctr\u003e\u003ctd\u003e\n\nThese links can be |.add_linkcode_class+styled with CSS|_ and used with/instead\nof the links added by |.sphinx.ext.viewcode|_\n\n.. raw:: html\n\n   \u003c/td\u003e\u003c/tr\u003e\n   \u003c/table\u003e\n\n\n\nSyntax Highlighting\n====================\n\n``sphinx-github-style`` also contains a ``Pygments`` style to highlight code blocks similar to GitHub:\n\n\n\n.. image:: https://raw.githubusercontent.com/TDKorn/sphinx-github-style/v1.2.2/docs/source/_static/syntax_highlighting.png\n   :alt: A code block highlighted by the Pygments style. It looks identical to GitHub.\n\n\n\nInstallation\n~~~~~~~~~~~~~~~~\n\nTo install using ``pip``::\n\n pip install sphinx-github-style\n\n\nConfiguration\n~~~~~~~~~~~~~~~\n\nAdd the extension to your ``conf.py``\n\n.. code-block:: python\n\n   extensions = [\n       \"sphinx_github_style\",\n   ]\n\nOptional Configuration Variables\n===================================\n\nAdd any (or none) of the following configuration variables to your ``conf.py``\n\n\n\n\n|.linkcode_blob|_\n The blob to link to on GitHub - any of ``\"head\"``, ``\"last_tag\"``, or ``\"{blob}\"``\n\n  **Type:** ``str``\n\n  **Default:** ``\"head\"``\n\n * ``\"head\"`` (default): links to the most recent commit hash; if this commit is tagged, uses the tag instead\n * ``\"last_tag\"``: links to the most recent commit tag on the currently checked out branch\n * ``\"blob\"``: links to any blob you want, for example ``\"master\"`` or ``\"v2.0.1\"``\n\n|\n\n|.linkcode_url|_\n The link to your GitHub repository formatted as ``https://github.com/user/repo``\n\n  **Type:** ``str``\n\n  **Default:** ``f\"https://github.com/{html_context['github_user']}/{html_context['github_repo']}/{html_context['github_version']}\"``\n\n * If not provided, will attempt to create the link from the |.sphinx+html_context|_ dict\n\n|\n\n|.linkcode_link_text|_\n The text to use for the linkcode link\n\n  **Type:** ``str``\n\n  **Default:** ``\"View on GitHub\"``\n\n|\n\n|.linkcode_resolve|_\n A ``linkcode_resolve()`` function to use when resolving the link target with |.sphinx.ext.linkcode|_\n\n  **Type:** ``Callable``\n\n  **Default:** Return value from |.~.get_linkcode_resolve|_\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdkorn%2Fsphinx-github-style","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftdkorn%2Fsphinx-github-style","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdkorn%2Fsphinx-github-style/lists"}