{"id":34017610,"url":"https://github.com/j-moralejo-pinas/sphinx-linkfix","last_synced_at":"2025-12-13T14:42:55.262Z","repository":{"id":316452311,"uuid":"1063436302","full_name":"j-moralejo-pinas/sphinx-linkfix","owner":"j-moralejo-pinas","description":"Sphinx extension that rewrites GitHub-style links into proper Sphinx references.","archived":false,"fork":false,"pushed_at":"2025-09-24T16:56:16.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-24T18:22:42.339Z","etag":null,"topics":["github","links","references","sphinx","sphinx-extension"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/j-moralejo-pinas.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.rst","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-24T16:13:01.000Z","updated_at":"2025-09-24T16:34:24.000Z","dependencies_parsed_at":"2025-09-24T18:22:43.894Z","dependency_job_id":"8145f802-d680-41a2-8f12-3e1423862cd0","html_url":"https://github.com/j-moralejo-pinas/sphinx-linkfix","commit_stats":null,"previous_names":["j-moralejo-pinas/sphinx-linkfix"],"tags_count":null,"template":false,"template_full_name":"j-moralejo-pinas/python-boilerplate","purl":"pkg:github/j-moralejo-pinas/sphinx-linkfix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j-moralejo-pinas%2Fsphinx-linkfix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j-moralejo-pinas%2Fsphinx-linkfix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j-moralejo-pinas%2Fsphinx-linkfix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j-moralejo-pinas%2Fsphinx-linkfix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/j-moralejo-pinas","download_url":"https://codeload.github.com/j-moralejo-pinas/sphinx-linkfix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j-moralejo-pinas%2Fsphinx-linkfix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27707369,"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","status":"online","status_checked_at":"2025-12-13T02:00:09.769Z","response_time":147,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","links","references","sphinx","sphinx-extension"],"created_at":"2025-12-13T14:42:54.480Z","updated_at":"2025-12-13T14:42:55.254Z","avatar_url":"https://github.com/j-moralejo-pinas.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"==============\nsphinx-linkfix\n==============\n\n.. image:: https://img.shields.io/badge/python-3.9+-blue.svg\n    :target: https://www.python.org/downloads/\n    :alt: Python Version\n\n.. image:: https://img.shields.io/badge/license-MIT-green.svg\n    :alt: License\n\nRender your links both in GitHub and in the built documentation seamlessly!\n\nSphinx extension that rewrites GitHub-style links into proper Sphinx references at build time.\n\n**Project Description**\n-----------------------\n\nI like to have links in the ``README`` that point to other sections of the documentation,\nso you can navigate the docs easily from the GitHub repo itself. However, Sphinx does not\nunderstand GitHub-style links (e.g., ```reference \u003c/docs/reference.rst\u003e`_``), so links break\nwhen building the docs. If you write links using Sphinx syntax instead, they work in the built docs but\nnot on GitHub.\n\nThis extension solves this problem by rewriting GitHub-style links into proper Sphinx references\nduring the Sphinx build process. It scans the document for links that point to local files\nand rewrites them to use Sphinx's internal referencing system.\n\n**Key Features**\n----------------\n\n- **Transform GitHub-style links**: Automatically rewrite links in the documentation to use Sphinx's internal referencing system.\n- **Ignores external links**: Only processes local file links, leaving external URLs untouched.\n- **Configurable prefixes**: Specify path prefixes to strip from links for cleaner references.\n- **Support for multiple file extensions**: Configure which file extensions to process (e.g., ``.rst``, ``.md``).\n- **Easy integration**: Simple setup and configuration in ``conf.py``.\n\n**Before Building Documentation**\n\n.. image:: docs/images/code_before.png\n    :alt: Documentation before applying sphinx-linkfix\n    :align: center\n\n\n**After Building Documentation**\n\n.. image:: docs/images/code_after.png\n    :alt: Documentation after applying sphinx-linkfix\n    :align: center\n\n**Links working both on GitHub and Sphinx**\n\n.. image:: docs/images/github_link.gif\n    :alt: Links working on GitHub\n    :align: center\n\n.. image:: docs/images/sphinx_link.gif\n    :alt: Links working in Sphinx\n    :align: center\n\n**Images working both on GitHub and Sphinx**\n\n.. image:: docs/images/github_image.gif\n    :alt: Images working in GitHub\n    :align: center\n\n.. image:: docs/images/sphinx_image.jpg\n    :alt: Images working in Sphinx\n    :align: center\n\n**Quick Start Guide**\n---------------------\n\n1. Install the extension using pip:\n\n.. code-block:: bash\n\n    pip install sphinx-linkfix\n\n2. Add the extension to your Sphinx ``conf.py`` file:\n\n.. code-block:: python\n\n    extensions = [\n        ...,\n        'sphinx_linkfix',\n    ]\n\n3. (Optional) Configure the extension in ``conf.py``:\n\n.. code-block:: python\n\n    # List of path prefixes to strip from links\n    # If the file you are referencing lives in the docs/ directory of your project,\n    # when the link is processed it should point to the root of the docs/ directory,\n    # thus, we strip the 'docs/' prefix from the link.\n    # E.g., `Reference \u003c/docs/REFERENCE.rst\u003e`_ becomes href=\"REFERENCE.html\"\n    docs_relative_path = 'docs/'\n\n    # List of file extensions to process\n    sphinx_linkfix_file_extensions = ('.rst', '.md')\n\n4. Write absolute links in your documentation using GitHub-style syntax, e.g., ```Reference \u003c/REFERENCE.rst\u003e`_``. (You can use the repository ``README.rst`` as an example)\n\n5. If the referenced files live in the root directory of the project, make sure to include a file with the same name in the docs folder, referencing the original file. E.g., ``/docs/REFERENCE.rst`` with:\n\n.. code-block:: rst\n\n    .. include:: ../REFERENCE.rst\n\n6. During the Sphinx build process, the extension scans the documents for links that point to local files and rewrites them to use Sphinx's internal referencing system.\n\n\n**Documentation**\n-----------------\n\n**Essential Guides:**\n\n- `Installation Guide \u003c/docs/installation.rst\u003e`_ - Setup instructions and requirements\n- `Contributing Guidelines \u003c/CONTRIBUTING.rst\u003e`_ - Development standards and contribution process\n- `License \u003c/LICENSE.txt\u003e`_ - License terms and usage rights\n- `Authors \u003c/AUTHORS.rst\u003e`_ - Project contributors and maintainers\n- `Changelog \u003c/CHANGELOG.rst\u003e`_ - Project history and version changes\n- `Code of Conduct \u003c/CODE_OF_CONDUCT.rst\u003e`_ - Guidelines for participation and conduct\n- `Read The Docs \u003chttps://sphinx-linkfix.readthedocs.io/en/latest/\u003e`_ - Comprehensive online documentation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj-moralejo-pinas%2Fsphinx-linkfix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj-moralejo-pinas%2Fsphinx-linkfix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj-moralejo-pinas%2Fsphinx-linkfix/lists"}