Manage redirects in the ReadTheDocs admin, programmatically
Project description
Copyright (c) 2017-? Honza Javorek
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.
Description: rtd-redirects
=============
|PyPI version| |Build Status|
Manage redirects in the `ReadTheDocs <http://readthedocs.org/>`__ admin, programmatically.
Installation
------------
Requires **Python 3.6** and higher.
.. code:: sh
$ pip install rtd-redirects
Usage
-----
.. code:: sh
$ rtd-redirects project-name ./redirects.yml --username=honzajavorek
Uploads redirects defined in the ``redirects.yml`` file to ReadTheDocs redirects administration of the ``project-name`` project.
The tool uses ReadTheDocs' HTML interface (there's no official API for redirects), so you need to provide your username and password. HTTPS is used to transfer the credentials to ReadTheDocs.
``rtd-redirects`` tries to be idempotent, i.e. you can run it several times in row and it should always end with the same results. If there are any redirects with the same source path, the tool will replace them with whatever is defined in the ``redirects.yml`` file. Existing redirects which do not collide with contents of ``redirects.yml`` won't be affected.
redirects.yml
-------------
Only **page redirects** are supported at the moment. The format of the file is as follows:
.. code:: yaml
redirects:
# Following redirects have to be done because we've migrated from MkDocs to Sphinx
"/example/": "/example.html"
"/python/": "/python.html"
# Following pages has been removed in favor of sections
"/green.html": "/colors.html#green"
# Following redirects are only for convenience
"/praha.html": "/prague.html"
Why `YAML <https://en.wikipedia.org/wiki/YAML>`__? Because it's easy to read by humans, easy to write by humans, and above all, it has support for comments. Redirects are *corrections* and you should document why they're necessary.
License: MIT
------------
© 2017-? Honza Javorek mail@honzajavorek.cz
This work is licensed under `MIT
license <https://en.wikipedia.org/wiki/MIT_License>`__.
.. |PyPI version| image:: https://badge.fury.io/py/rtd-redirects.svg
:target: https://badge.fury.io/py/rtd-redirects
.. |Build Status| image:: https://travis-ci.org/honzajavorek/rtd-redirects.svg?branch=master
:target: https://travis-ci.org/honzajavorek/rtd-redirects
Keywords: readthedocs documentation redirects sphinx mkdocs
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Documentation
Classifier: Topic :: Documentation :: Sphinx
Classifier: Topic :: Software Development :: Documentation
Classifier: Topic :: Internet
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.
Description: rtd-redirects
=============
|PyPI version| |Build Status|
Manage redirects in the `ReadTheDocs <http://readthedocs.org/>`__ admin, programmatically.
Installation
------------
Requires **Python 3.6** and higher.
.. code:: sh
$ pip install rtd-redirects
Usage
-----
.. code:: sh
$ rtd-redirects project-name ./redirects.yml --username=honzajavorek
Uploads redirects defined in the ``redirects.yml`` file to ReadTheDocs redirects administration of the ``project-name`` project.
The tool uses ReadTheDocs' HTML interface (there's no official API for redirects), so you need to provide your username and password. HTTPS is used to transfer the credentials to ReadTheDocs.
``rtd-redirects`` tries to be idempotent, i.e. you can run it several times in row and it should always end with the same results. If there are any redirects with the same source path, the tool will replace them with whatever is defined in the ``redirects.yml`` file. Existing redirects which do not collide with contents of ``redirects.yml`` won't be affected.
redirects.yml
-------------
Only **page redirects** are supported at the moment. The format of the file is as follows:
.. code:: yaml
redirects:
# Following redirects have to be done because we've migrated from MkDocs to Sphinx
"/example/": "/example.html"
"/python/": "/python.html"
# Following pages has been removed in favor of sections
"/green.html": "/colors.html#green"
# Following redirects are only for convenience
"/praha.html": "/prague.html"
Why `YAML <https://en.wikipedia.org/wiki/YAML>`__? Because it's easy to read by humans, easy to write by humans, and above all, it has support for comments. Redirects are *corrections* and you should document why they're necessary.
License: MIT
------------
© 2017-? Honza Javorek mail@honzajavorek.cz
This work is licensed under `MIT
license <https://en.wikipedia.org/wiki/MIT_License>`__.
.. |PyPI version| image:: https://badge.fury.io/py/rtd-redirects.svg
:target: https://badge.fury.io/py/rtd-redirects
.. |Build Status| image:: https://travis-ci.org/honzajavorek/rtd-redirects.svg?branch=master
:target: https://travis-ci.org/honzajavorek/rtd-redirects
Keywords: readthedocs documentation redirects sphinx mkdocs
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Documentation
Classifier: Topic :: Documentation :: Sphinx
Classifier: Topic :: Software Development :: Documentation
Classifier: Topic :: Internet
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rtd-redirects-1.0.1.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for rtd_redirects-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb52cbffd6d16246942baf5d3442e8b72e42229a56e4a48193cd060e78375432 |
|
MD5 | 07967325700a038ccca4b57f41dd511d |
|
BLAKE2b-256 | b36adc0d014e9180b29d65ec06889af22aab22c88714ad2a0f9d6fd51096bca2 |