Generate Beautiful reStructuredText README.rst for GitHub, PyPi, GitLab, BitBucket
Project description
A Sphinx extension to generate README.rst files that render beautifully on GitHub, PyPi, GitLab, BitBucket
About Sphinx README
📚 What’s Sphinx README? |
---|
sphinx_readme is a reStructuredText parser that uses Sphinx to generate rst files that render beautifully on GitHub, PyPi, GitLab, and BitBucket. |
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 sphinx.ext.autodoc cross-references!
📋 Features
sphinx_readme adds support for the following sphinx and docutils directives and features:
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:
extensions = [
'sphinx_readme',
]
🔧 Configuration
Please see Extension Configuration for full documentation on configuration variables
Mandatory conf.py Values
- html_context
A dictionary containing info about your repository (html_context)
Type: dict
At minimum, the username and repository name must be specified
Please see HTML Context Settings to determine the correct dictionary keys for your hosting platform
- html_baseurl
The base URL which points to the root of the HTML documentation (html_baseurl)
Type: str
- readme_src_files
An individual or list of rst files to parse
Type: Union[str, List]
📢 Important |
---|
Filepaths should be specified relative to the source directory |
- readme_docs_url_type
The documentation source to link to when resolving autodoc cross-references
Type: str
Must be either "code" or "html"
"code": uses sphinx.ext.linkcode to replace references with links to highlighted source code
Example: parse_intersphinx_nodes()
"html": replaces references with links to HTML documentation entries
Example: parse_intersphinx_nodes()
📝 Note |
---|
If set to code, non-external
|
Sample conf.py
extensions = [
"sphinx_readme",
]
html_context = {
'display_github': True,
'github_user': 'TDKorn',
'github_repo': 'sphinx-readme',
}
html_baseurl = "https://sphinx-readme.readthedocs.io/en/latest"
readme_src_files = "README.rst"
readme_docs_url_type = "code"
📢 Important |
---|
For platforms that don’t support the raw directive (PyPi, GitLab, and BitBucket), be sure to disable readme_raw_directive:
|
📚 Documentation
Full documentation can be found on ReadTheDocs
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
Built Distribution
File details
Details for the file sphinx-readme-1.1.1.tar.gz
.
File metadata
- Download URL: sphinx-readme-1.1.1.tar.gz
- Upload date:
- Size: 26.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b19c2d0eed7b5affd00c32abd60500a73d5c069fc1efae73c1569727c2a117d5 |
|
MD5 | c7a52f96c1f6e9dd8c6edceef12d2aaa |
|
BLAKE2b-256 | fd03fe067242714999489ed588da8ad1eeeeaa2ff586050423959c9c221f300a |
File details
Details for the file sphinx_readme-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: sphinx_readme-1.1.1-py3-none-any.whl
- Upload date:
- Size: 27.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a5f77d36475320534baf3319600407f830795c249a529fc28d3d555ef5a672d |
|
MD5 | 49820fd6c4fd45e8c8a268d7c85f1659 |
|
BLAKE2b-256 | 75bb8ab305836292131d8e9f4d374ead24fe9c61c627a4724f5a4f62c9a9cb9a |