.. |.add_linkcode_class+styled with CSS| replace:: styled with CSS
.. _.add_linkcode_class+styled with CSS: https://sphinx-github-style.readthedocs.io/en/latest/add_linkcode_class.html
.. |.~.get_linkcode_resolve| replace:: get_linkcode_resolve()
.. _.~.get_linkcode_resolve: https://sphinx-github-style.readthedocs.io/en/latest/linkcode.html#sphinx_github_style.utils.linkcode.get_linkcode_resolve
.. |.linkcode_blob| replace:: linkcode_blob
.. _.linkcode_blob: https://sphinx-github-style.readthedocs.io/en/latest/index.html#confval-linkcode_blob
.. |.linkcode_link_text| replace:: linkcode_link_text
.. _.linkcode_link_text: https://sphinx-github-style.readthedocs.io/en/latest/index.html#confval-linkcode_link_text
.. |.linkcode_resolve| replace:: linkcode_resolve
.. _.linkcode_resolve: https://sphinx-github-style.readthedocs.io/en/latest/index.html#confval-linkcode_resolve
.. |.linkcode_url| replace:: linkcode_url
.. _.linkcode_url: https://sphinx-github-style.readthedocs.io/en/latest/index.html#confval-linkcode_url
.. |.sphinx+html_context| replace:: html_context
.. _.sphinx+html_context: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_context
.. |.sphinx.ext.linkcode| replace:: sphinx.ext.linkcode
.. _.sphinx.ext.linkcode: https://www.sphinx-doc.org/en/master/usage/extensions/linkcode.html#module-sphinx.ext.linkcode
.. |.sphinx.ext.viewcode| replace:: sphinx.ext.viewcode
.. _.sphinx.ext.viewcode: https://www.sphinx-doc.org/en/master/usage/extensions/viewcode.html#module-sphinx.ext.viewcode
.. Title: Sphinx Github Style
.. Description: A Sphinx extension to add GitHub source code links and syntax highlighting
.. Author: TDKorn (Adam Korn)
.. meta::
:title: Sphinx Github Style
:description: A Sphinx extension to add GitHub source code links and syntax highlighting
sphinx-github-style - GitHub source code links and syntax highlighting for Sphinx documentation
-------------------------------------------------------------------------------------------------
.. image:: https://raw.githubusercontent.com/TDKorn/sphinx-github-style/v1.2.2/docs/source/_static/logo_pypi.png
:alt: Sphinx GitHub Style: GitHub Integration and Pygments Style for Sphinx Documentation
:width: 50%
:align: center
GitHub source code links and syntax highlighting for Sphinx documentation
.. |docs| replace:: **Explore the docs ยป**
.. _docs: https://sphinx-github-style.readthedocs.io/en/latest/
|docs|_
|
.. image:: https://img.shields.io/pypi/v/sphinx-github-style?color=eb5202
:target: https://pypi.org/project/sphinx-github-style/
:alt: PyPI Version
.. image:: https://img.shields.io/badge/GitHub-sphinx--github--style-4f1abc
:target: https://github.com/tdkorn/sphinx-github-style/
:alt: GitHub Repository
.. image:: https://static.pepy.tech/personalized-badge/sphinx-github-style?period=total&units=none&left_color=grey&right_color=blue&left_text=Downloads
:target: https://pepy.tech/project/sphinx-github-style/
.. image:: https://readthedocs.org/projects/sphinx-github-style/badge/?version=latest
:target: https://sphinx-github-style.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
|
About
~~~~~~~~~~~~~
``sphinx-github-style`` is a Sphinx extension that links your documentation to GitHub source code.
It also adds syntax highlighting for code blocks similar to GitHub's pretty lights dark theme.
...
GitHub Source Code Links
===============================
Using |.sphinx.ext.linkcode|_, a ``View on GitHub`` link is added to the documentation of every class, method, function, and property:
|
.. image:: https://raw.githubusercontent.com/TDKorn/sphinx-github-style/v1.2.2/docs/source/_static/github_link.png
:alt: sphinx-github-style adds a "View on GitHub" link
They link to and highlight the corresponding code block in your GitHub repository:
|
.. image:: https://raw.githubusercontent.com/TDKorn/sphinx-github-style/v1.2.2/docs/source/_static/github_linked_code.png
:alt: The linked corresponding highlighted source code block on GitHub
.. list-table::
:header-rows: 1
* - ๐ Note
* - These links can be |.add_linkcode_class+styled with CSS|_ and used with/instead
of the links added by |.sphinx.ext.viewcode|_
Syntax Highlighting
====================
``sphinx-github-style`` also contains a ``Pygments`` style to highlight code blocks similar to GitHub:
.. image:: https://raw.githubusercontent.com/TDKorn/sphinx-github-style/v1.2.2/docs/source/_static/syntax_highlighting.png
:alt: A code block highlighted by the Pygments style. It looks identical to GitHub.
Installation
~~~~~~~~~~~~~~~~
To install using ``pip``::
pip install sphinx-github-style
Configuration
~~~~~~~~~~~~~~~
Add the extension to your ``conf.py``
.. code-block:: python
extensions = [
"sphinx_github_style",
]
Optional Configuration Variables
===================================
Add any (or none) of the following configuration variables to your ``conf.py``
|.linkcode_blob|_
The blob to link to on GitHub - any of ``"head"``, ``"last_tag"``, or ``"{blob}"``
**Type:** ``str``
**Default:** ``"head"``
* ``"head"`` (default): links to the most recent commit hash; if this commit is tagged, uses the tag instead
* ``"last_tag"``: links to the most recent commit tag on the currently checked out branch
* ``"blob"``: links to any blob you want, for example ``"master"`` or ``"v2.0.1"``
|
|.linkcode_url|_
The link to your GitHub repository formatted as ``https://github.com/user/repo``
**Type:** ``str``
**Default:** ``f"https://github.com/{html_context['github_user']}/{html_context['github_repo']}/{html_context['github_version']}"``
* If not provided, will attempt to create the link from the |.sphinx+html_context|_ dict
|
|.linkcode_link_text|_
The text to use for the linkcode link
**Type:** ``str``
**Default:** ``"View on GitHub"``
|
|.linkcode_resolve|_
A ``linkcode_resolve()`` function to use when resolving the link target with |.sphinx.ext.linkcode|_
**Type:** ``Callable``
**Default:** Return value from |.~.get_linkcode_resolve|_
Raw data
{
"_id": null,
"home_page": "https://github.com/tdkorn/sphinx-github-style",
"name": "sphinx-github-style",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "sphinx, sphinx-extension, sphinx-theme, pygments, pygments-style, github, linkcode",
"author": "Adam Korn",
"author_email": "hello@dailykitten.net",
"download_url": "https://files.pythonhosted.org/packages/02/27/f0d375d18c45ba795826070e03dd32c13575f3ec4fb7273654e33c12fb08/sphinx-github-style-1.2.2.tar.gz",
"platform": null,
"description": ".. |.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\nsphinx-github-style - GitHub source code links and syntax highlighting for Sphinx documentation\n-------------------------------------------------------------------------------------------------\n\n.. image:: https://raw.githubusercontent.com/TDKorn/sphinx-github-style/v1.2.2/docs/source/_static/logo_pypi.png\n :alt: Sphinx GitHub Style: GitHub Integration and Pygments Style for Sphinx Documentation\n :width: 50%\n :align: center\n\n\n\n\n\n\n\n\n\n\n\n\nGitHub source code links and syntax highlighting for Sphinx documentation\n\n\n.. |docs| replace:: **Explore the docs \u00bb**\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&units=none&left_color=grey&right_color=blue&left_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\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.. list-table::\n :header-rows: 1\n \n * - \ud83d\udcdd Note\n * - These links can be |.add_linkcode_class+styled with CSS|_ and used with/instead\n of the links added by |.sphinx.ext.viewcode|_\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\n\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "GitHub source code links and syntax highlighting for Sphinx documentation",
"version": "1.2.2",
"project_urls": {
"Download": "https://github.com/TDKorn/sphinx-github-style/tarball/master",
"Homepage": "https://github.com/tdkorn/sphinx-github-style"
},
"split_keywords": [
"sphinx",
" sphinx-extension",
" sphinx-theme",
" pygments",
" pygments-style",
" github",
" linkcode"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4f43a1aa363d38363f66a668a286691006c11866a6cb5cc75d7325a17395f337",
"md5": "c6f8e86058d0c1c04f25da23a2f38dd9",
"sha256": "8f6fd1a2c1a5878428a010050549c8353354a1ca9650f6bb01049c649935677d"
},
"downloads": -1,
"filename": "sphinx_github_style-1.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c6f8e86058d0c1c04f25da23a2f38dd9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 12324,
"upload_time": "2024-05-15T05:02:26",
"upload_time_iso_8601": "2024-05-15T05:02:26.833291Z",
"url": "https://files.pythonhosted.org/packages/4f/43/a1aa363d38363f66a668a286691006c11866a6cb5cc75d7325a17395f337/sphinx_github_style-1.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0227f0d375d18c45ba795826070e03dd32c13575f3ec4fb7273654e33c12fb08",
"md5": "c9573bce583b24b9e31eac1edc4b93b6",
"sha256": "aad6231fcc0a4f59df82531eb3a82dda8a461a94d9e304895c34ac1158d7347c"
},
"downloads": -1,
"filename": "sphinx-github-style-1.2.2.tar.gz",
"has_sig": false,
"md5_digest": "c9573bce583b24b9e31eac1edc4b93b6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11963,
"upload_time": "2024-05-15T05:02:28",
"upload_time_iso_8601": "2024-05-15T05:02:28.250783Z",
"url": "https://files.pythonhosted.org/packages/02/27/f0d375d18c45ba795826070e03dd32c13575f3ec4fb7273654e33c12fb08/sphinx-github-style-1.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-15 05:02:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tdkorn",
"github_project": "sphinx-github-style",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "sphinx-github-style"
}