-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cd565c4
Showing
98 changed files
with
33,251 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 74412c388acbfb478764ab420c7b7a4a | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,230 @@ | ||
.. meta:: | ||
:author: Adam Korn | ||
:title: Sphinx README - Generate README.rst That Renders Beautifully on GitHub, PyPi, GitLab, BitBucket | ||
:description: Sphinx extension to generate reStructuredText README.rst files that render beautifully on GitHub, PyPi, GitLab, BitBucket | ||
|
||
.. only:: pypi | ||
|
||
Sphinx README - Generate Beautiful README.rst for GitHub, PyPi, GitLab, BitBucket | ||
-------------------------------------------------------------------------------------- | ||
|
||
.. image:: _static/logo_transparent.png | ||
:alt: Sphinx README: Generate Beautiful reStructuredText README.rst for GitHub, PyPi, GitLab, BitBucket | ||
:align: center | ||
:width: 25% | ||
|
||
.. raw:: html | ||
|
||
<div align="center"> | ||
|
||
.. only:: readme | ||
|
||
.. image:: _static/logo_readme.png | ||
:alt: Sphinx README: Generate Beautiful reStructuredText README.rst for GitHub, PyPi, GitLab, BitBucket | ||
:align: center | ||
:width: 25% | ||
|
||
.. only:: html | ||
|
||
.. image:: _static/logo_html.png | ||
:alt: Sphinx README: Generate Beautiful reStructuredText README.rst for GitHub, PyPi, GitLab, BitBucket | ||
:align: center | ||
:width: 25% | ||
|
||
.. only:: readme | ||
|
||
.. raw:: html | ||
|
||
<h1>Sphinx README</h1> | ||
|
||
|
||
.. only:: html | ||
|
||
.. raw:: html | ||
|
||
<span class="h1">Sphinx README</span> | ||
|
||
|
||
A Sphinx extension to generate ``README.rst`` files that render beautifully on GitHub, PyPi, GitLab, BitBucket | ||
|
||
.. only:: readme or pypi | ||
|
||
.. |RTD| replace:: **Explore the docs »** | ||
.. _RTD: https://sphinx-readme.readthedocs.io/en/latest/ | ||
|
||
|RTD|_ | ||
|
||
.. only:: pypi | ||
|
||
| | ||
.. image:: https://img.shields.io/pypi/v/sphinx-readme?color=eb5202 | ||
:target: https://pypi.org/project/sphinx-readme | ||
:alt: PyPI Project for Sphinx README: Generate Beautiful reStructuredText README.rst for GitHub, PyPi, GitLab, BitBucket | ||
|
||
.. image:: https://img.shields.io/badge/GitHub-sphinx--readme-4f1abc | ||
:target: https://github.com/tdkorn/sphinx-readme | ||
:alt: GitHub Repository for Sphinx README: Generate Beautiful reStructuredText README.rst for GitHub, PyPi, GitLab, BitBucket | ||
|
||
.. image:: https://static.pepy.tech/personalized-badge/sphinx-readme?period=total&units=none&left_color=grey&right_color=blue&left_text=Downloads | ||
:target: https://pepy.tech/project/sphinx-readme | ||
:alt: Downloads for Sphinx README | ||
|
||
.. image:: https://readthedocs.org/projects/sphinx-readme/badge/?version=latest | ||
:target: https://sphinx-readme.readthedocs.io/en/latest/?badge=latest | ||
:alt: Documentation for Sphinx README: Generate Beautiful reStructuredText README.rst for GitHub, PyPi, GitLab, BitBucket | ||
|
||
.. image:: https://img.shields.io/github/actions/workflow/status/TDKorn/sphinx-readme/tests.yml?label=build&color=33ce57 | ||
:target: https://github.com/TDKorn/sphinx-readme/actions/workflows/tests.yml | ||
:alt: Build Status | ||
|
||
.. image:: https://codecov.io/gh/TDKorn/sphinx-readme/graph/badge.svg?token=RZCUCGIU0Q | ||
:target: https://codecov.io/gh/TDKorn/sphinx-readme | ||
:alt: Code Coverage | ||
|
||
.. raw:: html | ||
|
||
</div> | ||
|
||
| | ||
About Sphinx README | ||
~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. admonition:: What's Sphinx README? | ||
:class: about | ||
|
||
``sphinx_readme`` is a ``reStructuredText`` parser that uses Sphinx | ||
to generate ``rst`` files that render beautifully on | ||
GitHub, PyPi, GitLab, and BitBucket. | ||
|
||
|
||
.. rubric:: With ``sphinx_readme``, there's no need to rewrite your ``README.rst`` as a ``README.md`` file | ||
|
||
Files generated by ``sphinx_readme`` have nearly identical appearance and functionality | ||
as ``html`` builds, including :mod:`sphinx.ext.autodoc` cross-references! | ||
|
||
.. only:: pypi | ||
|
||
| | ||
.. image:: _static/demo/demo.gif | ||
:alt: Demonstration of how reStructuredText README.rst files generated by Sphinx README render on GitHub, PyPi, GitLab, BitBucket | ||
:width: 75% | ||
|
||
|
||
📋 Features | ||
~~~~~~~~~~~~ | ||
|
||
``sphinx_readme`` adds support for the following ``sphinx`` and ``docutils`` directives and features: | ||
|
||
* :mod:`sphinx.ext.autodoc` cross-references (``:mod:``, ``:class:``, ``:meth:``, ``:func:``, and ``:attr:``) | ||
* Standard cross-reference roles (``:doc:`` and ``:ref:``) | ||
* Generic and Specific Admonitions | ||
* Only directives | ||
* Toctrees | ||
* Rubrics | ||
* Images | ||
|
||
|
||
⚙ Installation | ||
~~~~~~~~~~~~~~~~ | ||
|
||
Install using pip:: | ||
|
||
pip install sphinx-readme | ||
|
||
|
||
Add the extension to your ``conf.py``: | ||
|
||
.. code-block:: python | ||
extensions = [ | ||
'sphinx_readme', | ||
] | ||
🔧 Configuration | ||
~~~~~~~~~~~~~~~~~ | ||
|
||
.. only:: html or latex | ||
|
||
Please see :doc:`configuration/configuring` | ||
|
||
|
||
.. only:: readme or pypi | ||
|
||
Please see :doc:`configuration/configuring` for full documentation on configuration variables | ||
|
||
|
||
Mandatory ``conf.py`` Values | ||
================================== | ||
|
||
:confval:`html_context` | ||
A dictionary containing info about your repository (:external+sphinx:confval:`html_context`) | ||
|
||
**Type:** ``dict`` | ||
|
||
* At minimum, the username and repository name must be specified | ||
* Please see :ref:`HTML Context Settings <rtd:guides/edit-source-links-sphinx:github>` | ||
to determine the correct dictionary keys for your hosting platform | ||
|
||
|
||
| | ||
:confval:`html_baseurl` | ||
The base URL which points to the root of the HTML documentation (:confval:`sphinx:html_baseurl`) | ||
|
||
**Type:** ``str`` | ||
|
||
|
||
| | ||
:confval:`readme_src_files` | ||
An individual/list of ``rst`` source files to parse, or a dictionary of source files mapped to output files | ||
|
||
**Type:** ``Union[str, List[str], Dict[str,str]]`` | ||
|
||
.. important:: Filepaths should be specified relative to the source directory | ||
and :confval:`output directory <readme_out_dir>` | ||
|
||
| | ||
:confval:`readme_docs_url_type` | ||
The documentation source to link to when resolving :mod:`~.sphinx.ext.autodoc` cross-references | ||
|
||
**Type:** ``str`` | ||
|
||
Must be either ``"code"`` or ``"html"`` | ||
|
||
* ``"code"``: uses :mod:`sphinx.ext.linkcode` to replace references with links to highlighted source code | ||
|
||
**Example**: :meth:`~.parse_intersphinx_nodes` | ||
|
||
|
||
* ``"html"``: replaces references with links to HTML documentation entries | ||
|
||
**Example**: |parse_intersphinx_nodes_html|_ | ||
|
||
.. note:: If set to ``code``, non-external :code:`:attr:` cross-references will not be replaced with links | ||
|
||
* Instead, they'll be replaced with ``inline literals`` or left as is | ||
* Please see :confval:`readme_replace_attrs` and :confval:`readme_inline_markup` | ||
|
||
|
||
.. |parse_intersphinx_nodes_html| replace:: ``parse_intersphinx_nodes()`` | ||
.. _parse_intersphinx_nodes_html: http://sphinx-readme.readthedocs.io/en/latest/parser.html#sphinx_readme.parser.READMEParser.parse_intersphinx_nodes | ||
|
||
|
||
.. include:: configuration/sample_conf.rst | ||
|
||
|
||
📚 Documentation | ||
~~~~~~~~~~~~~~~~ | ||
|
||
Full documentation can be found on |docs|_ | ||
|
||
|
||
.. |docs| replace:: ``ReadTheDocs`` | ||
.. _docs: https://sphinx-readme.readthedocs.io/en/latest |
Oops, something went wrong.