Metadata-Version: 2.1
Name: sphinx-redirect-by-id
Version: 0.1.3
Summary: A Sphinx extension to provide redirection to an entity by its ID.
Author-email: Jakob Lykke Andersen <Jakob@caput.dk>
License: License for Sphinx
        ==================
        
        Unless otherwise indicated, all code in the Sphinx project is licenced under the
        two clause BSD licence below.
        
        Copyright (c) 2007-2022 by the Sphinx team (see AUTHORS file).
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are
        met:
        
        * Redistributions of source code must retain the above copyright
          notice, this list of conditions and the following disclaimer.
        
        * Redistributions in binary form must reproduce the above copyright
          notice, this list of conditions and the following disclaimer in the
          documentation and/or other materials provided with the distribution.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
        "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
        LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
        A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
        HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
        SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
        LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
        DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
        THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
        (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
        
        Licenses for incorporated software
        ==================================
        
        The included smartypants module, included as sphinx.util.smartypants,
        is available under the following license:
        
        ----------------------------------------------------------------------
        SmartyPants_ license::
        
            Copyright (c) 2003 John Gruber
            (https://daringfireball.net/projects/smartypants/)
            All rights reserved.
        
            Redistribution and use in source and binary forms, with or without
            modification, are permitted provided that the following conditions
            are met:
        
            *   Redistributions of source code must retain the above copyright
                notice, this list of conditions and the following disclaimer.
        
            *   Redistributions in binary form must reproduce the above
                copyright notice, this list of conditions and the following
                disclaimer in the documentation and/or other materials
                provided with the distribution.
        
            *   Neither the name "SmartyPants" nor the names of its
                contributors may be used to endorse or promote products
                derived from this software without specific prior written
                permission.
        
            This software is provided by the copyright holders and
            contributors "as is" and any express or implied warranties,
            including, but not limited to, the implied warranties of
            merchantability and fitness for a particular purpose are
            disclaimed. In no event shall the copyright owner or contributors
            be liable for any direct, indirect, incidental, special,
            exemplary, or consequential damages (including, but not limited
            to, procurement of substitute goods or services; loss of use,
            data, or profits; or business interruption) however caused and on
            any theory of liability, whether in contract, strict liability, or
            tort (including negligence or otherwise) arising in any way out of
            the use of this software, even if advised of the possibility of
            such damage.
        
        
        smartypants.py license::
        
            smartypants.py is a derivative work of SmartyPants.
        
            Redistribution and use in source and binary forms, with or without
            modification, are permitted provided that the following conditions
            are met:
        
            *   Redistributions of source code must retain the above copyright
                notice, this list of conditions and the following disclaimer.
        
            *   Redistributions in binary form must reproduce the above
                copyright notice, this list of conditions and the following
                disclaimer in the documentation and/or other materials
                provided with the distribution.
        
            This software is provided by the copyright holders and
            contributors "as is" and any express or implied warranties,
            including, but not limited to, the implied warranties of
            merchantability and fitness for a particular purpose are
            disclaimed. In no event shall the copyright owner or contributors
            be liable for any direct, indirect, incidental, special,
            exemplary, or consequential damages (including, but not limited
            to, procurement of substitute goods or services; loss of use,
            data, or profits; or business interruption) however caused and on
            any theory of liability, whether in contract, strict liability, or
            tort (including negligence or otherwise) arising in any way out of
            the use of this software, even if advised of the possibility of
            such damage.
        ----------------------------------------------------------------------
        
        The included JQuery JavaScript library is available under the MIT
        license:
        
        ----------------------------------------------------------------------
        Copyright (c) 2008 John Resig, https://jquery.com/
        
        Permission is hereby granted, free of charge, to any person obtaining
        a copy of this software and associated documentation files (the
        "Software"), to deal in the Software without restriction, including
        without limitation the rights to use, copy, modify, merge, publish,
        distribute, sublicense, and/or sell copies of the Software, and to
        permit persons to whom the Software is furnished to do so, subject to
        the following conditions:
        
        The above copyright notice and this permission notice shall be
        included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
        EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
        MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
        NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
        LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
        OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
        WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        ----------------------------------------------------------------------
        
        The included Underscore JavaScript library is available under the MIT
        license:
        
        ----------------------------------------------------------------------
        Copyright (c) 2009 Jeremy Ashkenas, DocumentCloud
        
        Permission is hereby granted, free of charge, to any person
        obtaining a copy of this software and associated documentation
        files (the "Software"), to deal in the Software without
        restriction, including without limitation the rights to use,
        copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the
        Software is furnished to do so, subject to the following
        conditions:
        
        The above copyright notice and this permission notice shall be
        included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
        EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
        OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
        NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
        HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
        WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
        FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
        OTHER DEALINGS IN THE SOFTWARE.
        
        -------------------------------------------------------------------------------
        
        The included implementation of NumpyDocstring._parse_numpydoc_see_also_section
        was derived from code under the following license:
        
        -------------------------------------------------------------------------------
        
        Copyright (C) 2008 Stefan van der Walt <stefan@mentat.za.net>, Pauli Virtanen <pav@iki.fi>
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are
        met:
        
         1. Redistributions of source code must retain the above copyright
            notice, this list of conditions and the following disclaimer.
         2. Redistributions in binary form must reproduce the above copyright
            notice, this list of conditions and the following disclaimer in
            the documentation and/or other materials provided with the
            distribution.
        
        THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
        IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
        WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
        INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
        (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
        HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
        STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
        IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
        POSSIBILITY OF SUCH DAMAGE.
        
        -------------------------------------------------------------------------------
        
Project-URL: Homepage, https://github.com/jakobandersen/sphinx-redirect-by-id
Project-URL: Bug Tracker, https://github.com/jakobandersen/sphinx-redirect-by-id/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Framework :: Sphinx :: Extension
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

# Redirect By ID for Sphinx

This extension originated as part of the discussion in
https://github.com/sphinx-doc/sphinx/issues/9574.

When building a Sphinx project into HTML, the permalinks on entities still
contains the specific page the entity is located on, along with the ID of the
entity. If the pages are later restructured and entities are moved to different
pages, the old permalinks will be dead.

This extension adds a new page `redirect.html` which can be given an ID. The
page will use the existing search index of the project to redirect to the page
where the entity is located.
For example, if you have a page `api.html` where a Python function `f` is
documented, then its permalink may be `https://example.com/api.html#f`. If you
then browse to `https://example.api.html?q=f` you will be redirected to 
`https://example.com/api.html#f`.

## Installation

1. Install the extension:

     python3 -m pip install sphinx-redirect-by-id

2. Add it to `conf.py`:

   ```py
   extensions = [
       'sphinx_redirect_by_id',
   ]
   ```
