Skip to content

Commit

Permalink
Replace sphinx index.rst with READM.md. Fix broken link in examples. …
Browse files Browse the repository at this point in the history
…Update badges.
  • Loading branch information
mansenfranzen committed Apr 24, 2024
1 parent 8a3bab0 commit 4feb3ed
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 96 deletions.
34 changes: 16 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
![Autodoc Pydantic](https://raw.githubusercontent.com/mansenfranzen/autodoc_pydantic/main/docs/source/material/logo_black.svg)

![PyPI - Version](https://img.shields.io/pypi/v/autodoc_pydantic?style=for-the-badge&logo=python&logoColor=white&link=https%3A%2F%2Fpypi.org%2Fproject%2Fautodoc_pydantic%2F)
![Python](https://img.shields.io/badge/python-3.8+-blue.svg?style=for-the-badge&logo=python&logoColor=white)
![PyPI - Downloads](https://img.shields.io/pypi/dm/autodoc_pydantic?style=for-the-badge&logo=python&logoColor=white&color=blue&link=https%3A%2F%2Fwww.pepy.tech%2Fprojects%2Fautodoc_pydantic)


![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/mansenfranzen/autodoc_pydantic/tests-push-pr.yml?style=for-the-badge&logo=github&link=https%3A%2F%2Fgithub.com%2Fmansenfranzen%2Fautodoc_pydantic%2Factions)
![Codecov](https://img.shields.io/codecov/c/gh/mansenfranzen/autodoc_pydantic?style=for-the-badge&logo=codecov&link=https%3A%2F%2Fapp.codecov.io%2Fgh%2Fmansenfranzen%2Fautodoc_pydantic)
![Read the Docs (stable)](https://img.shields.io/readthedocs/autodoc_pydantic/stable?style=for-the-badge&logo=sphinx&label=Docs%20stable&link=https%3A%2F%2Fautodoc-pydantic.readthedocs.io%2Fen%2Fstable%2F)

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
![GitHub License](https://img.shields.io/github/license/mansenfranzen/autodoc_pydantic?style=for-the-badge&color=orange&logo=semanticscholar&logoColor=white)
![linting - ruff](https://img.shields.io/badge/Linting-orange?style=for-the-badge&logo=ruff&logoColor=white&label=ruff&link=https%3A%2F%2Fgithub.com%2Fastral-sh%2Fruff)
[![types - Mypy](https://img.shields.io/badge/types-Mypy-orange.svg?style=for-the-badge&logo=python&logoColor=white)](https://github.com/python/mypy)
[![All Contributors](https://img.shields.io/badge/all_contributors-49-orange.svg?style=for-the-badge&logo=iconify&logoColor=white)](#contributors)
[![PyPI - Version](https://img.shields.io/pypi/v/autodoc_pydantic?style=for-the-badge&logo=python&logoColor=white)](https://pypi.org/project/autodoc_pydantic/)
[![Python](https://img.shields.io/badge/python-3.8+-blue.svg?style=for-the-badge&logo=python&logoColor=white)](https://www.python.org/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/autodoc_pydantic?style=for-the-badge&logo=python&logoColor=white&color=blue)](https://pypistats.org/packages/autodoc-pydantic)

[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/mansenfranzen/autodoc_pydantic/tests-push-pr.yml?style=for-the-badge&logo=github)](https://github.com/mansenfranzen/autodoc_pydantic/actions)
[![Codecov](https://img.shields.io/codecov/c/gh/mansenfranzen/autodoc_pydantic?style=for-the-badge&logo=codecov)](https://app.codecov.io/gh/mansenfranzen/autodoc_pydantic)
[![Read the Docs (stable)](https://img.shields.io/readthedocs/autodoc_pydantic/stable?style=for-the-badge&logo=sphinx&label=Docs%20stable)](https://autodoc-pydantic.readthedocs.io/en/stable/)

[![GitHub License](https://img.shields.io/github/license/mansenfranzen/autodoc_pydantic?style=for-the-badge&color=orange&logo=semanticscholar&logoColor=white)](https://github.com/mansenfranzen/autodoc_pydantic/blob/main/LICENSE)
[![linting - ruff](https://img.shields.io/badge/Linting-orange?style=for-the-badge&logo=ruff&logoColor=white&label=ruff)](https://github.com/astral-sh/ruff)
[![types - Mypy](https://img.shields.io/badge/types-Mypy-orange.svg?style=for-the-badge&logo=python&logoColor=white)](https://github.com/python/mypy)<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-49-orange.svg?style=for-the-badge&logo=iconify&logoColor=white)](https://github.com/mansenfranzen/autodoc_pydantic/tree/main?tab=readme-ov-file#acknowledgements)
<!-- ALL-CONTRIBUTORS-BADGE:END -->


Expand All @@ -25,7 +23,7 @@ does not integrate too well with pydantic models 😕.

Don't worry - just `pip install autodoc_pydantic` ☺.

## Features
# 🌟 Features

- 💬 provides default values, alias and constraints for model fields
- 🔗 adds hyperlinks between validators and corresponding fields
Expand All @@ -38,19 +36,19 @@ Don't worry - just `pip install autodoc_pydantic` ☺.
- 🔨 allows complete configurability on global and per-model level
- 🍀 supports `pydantic >= 1.5.0` and `sphinx >= 4.0.0`

## 📄 Documentation
# 📄 Documentation

| Section | Description |
|-----------------------------------------|-----------------------------------------|
| [📑 Landing Page](https://autodoc-pydantic.readthedocs.io/en/stable/) | Guides and detailed information. |
| [🛠️ Installation](https://autodoc-pydantic.readthedocs.io/en/stable/users/installation.html) | Setup and installation procedures. |
| [🔧 Configuration](https://autodoc-pydantic.readthedocs.io/en/stable/users/configuration.html) | System or application settings. |
| [💡 Usage](https://autodoc-pydantic.readthedocs.io/en/stable/users/usage.html) | How to use the application or tool. |
| [🌐 Examples](https://autodoc-pydantic.readthedocs.io/en/stable/users/examples.html) | Code and usage examples. |
| [🌐 Examples](https://autodoc-pydantic.readthedocs.io/en/stable/users/examples.html) | Showcase and usage examples. |
| [👨‍💻 Developer Guide](https://autodoc-pydantic.readthedocs.io/en/stable/developers/setup.html) | In-depth guide for developers. |


## Acknowledgements
# 🙏 Acknowledgements

Thanks to great open source projects [sphinx](https://www.sphinx-doc.org/en/master/),
[pydantic](https://pydantic-docs.helpmanual.io/) and
Expand Down
84 changes: 9 additions & 75 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,43 +1,10 @@
============================================
Welcome to autodoc_pydantic's documentation!
============================================

**Seamlessly integrate pydantic models in your Sphinx documentation.**

|PyPIBadge|_ |PythonBadge|_ |CIBadge|_ |CoverageBadge|_ |ContributersBadge|_ |DownloadsBadge|_

You love `pydantic <https://pydantic-docs.helpmanual.io/>`_ 💖 and you want to
document your models and configuration settings with `sphinx`_?
Perfect, let's go. But wait, sphinx' `autodoc <https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html>`_
does not integrate too well with pydantic models 😕.
Don't worry - just :code:`pip install autodoc_pydantic` 😉.

Features
--------

- 💬 provides default values, alias and constraints for model fields
- 🔗 adds hyperlinks between validators and corresponding fields
- 📃 includes collapsable model json schema
- 🏄 natively integrates with autodoc and autosummary extensions
- 📎 defines explicit pydantic prefixes for models, settings, fields, validators and model config
- 📋 shows summary section for model configuration, fields and validators
- 👀 hides overloaded and redundant model class signature
- 🔱 visualizes entity-relationship-diagrams for class hierarchies
- 🔨 allows complete configurability on global and per-model level
- 🍀 supports `pydantic >= 1.5.0` and `sphinx >= 4.0.0`

To see those features in action, jump over to the :ref:`example <showcase>` section comparing
the appearance of standard sphinx autodoc with **autodoc_pydantic**.

.. note::

This documentation is based on ``autodoc_pydantic >= 2.0.1``. If you are
using pydantic v1 along with ``autodoc_pydantic < 2.0.0``, please find the
latest v1 documentation `here <https://autodoc-pydantic.readthedocs.io/en/main-1.x/>`_ .
.. include:: ../../README.md
:parser: myst_parser.sphinx_

.. toctree::
:maxdepth: 1
:caption: Users
:caption: 🙋 Users
:hidden:

users/installation
users/usage
Expand All @@ -47,7 +14,8 @@ the appearance of standard sphinx autodoc with **autodoc_pydantic**.

.. toctree::
:maxdepth: 1
:caption: Developers
:caption: 🧑‍💻 Developers
:hidden:

developers/setup
developers/design
Expand All @@ -56,42 +24,8 @@ the appearance of standard sphinx autodoc with **autodoc_pydantic**.

.. toctree::
:maxdepth: 1
:caption: Reference
:caption: 📖 Reference
:hidden:

reference/api
reference/changelog


Acknowledgements
----------------

Thanks to great open source projects

- `sphinx`_
- `pydantic <https://pydantic-docs.helpmanual.io/>`_
- `poetry <https://python-poetry.org/>`_
- `mermaid.js <https://mermaid-js.github.io/mermaid/#/>`_
- and many more involved

and all `contributors <https://github.com/mansenfranzen/autodoc_pydantic/tree/refactor_inspection#acknowledgements>`_ to **autodoc_pydantic** ❤!


.. _sphinx: https://www.sphinx-doc.org/en/master

.. |PyPIBadge| image:: https://img.shields.io/pypi/v/autodoc_pydantic?style=flat
.. _PyPIBadge: https://pypi.org/project/autodoc-pydantic/

.. |CIBadge| image:: https://img.shields.io/github/actions/workflow/status/mansenfranzen/autodoc_pydantic/tests.yml?branch=main&style=flat
.. _CIBadge: https://github.com/mansenfranzen/autodoc_pydantic/actions/workflows/tests.yml

.. |DownloadsBadge| image:: https://img.shields.io/pypi/dm/autodoc_pydantic?color=fe7d37&style=flat
.. _DownloadsBadge: https://pypistats.org/packages/autodoc-pydantic

.. |ContributersBadge| image:: https://img.shields.io/badge/all_contributors-47-orange.svg?style=flat
.. _ContributersBadge: https://github.com/mansenfranzen/autodoc_pydantic/tree/refactor_inspection#acknowledgements

.. |CoverageBadge| image:: https://img.shields.io/codecov/c/gh/mansenfranzen/autodoc_pydantic?style=flat
.. _CoverageBadge: https://app.codecov.io/gh/mansenfranzen/autodoc_pydantic

.. |PythonBadge| image:: https://img.shields.io/badge/python-3.8+-blue.svg?style=flat
.. _PythonBadge: http://www.python.org/
reference/changelog
6 changes: 3 additions & 3 deletions docs/source/users/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ In contrast, it also shows how standard sphinx autodoc displays the same example

.. tabs::

.. tab:: *rendered output pydantic*
.. tab:: *output autodoc_pydantic*

.. autopydantic_settings:: target.example_setting.ExampleSettings

.. tab:: *rendered output sphinx*
.. tab:: *output default sphinx*

.. autopydantic_settings:: target.example_setting.ExampleSettings
:members:
Expand Down Expand Up @@ -118,7 +118,7 @@ concepts such as model validators, required/optional fields or generic models.
Model validators
----------------

This example highlights how ``model validators <https://docs.pydantic.dev/latest/usage/validators/#model-validators>`_
This example highlights how `model validators <https://docs.pydantic.dev/latest/usage/validators/#model-validators>`_
(``@model_validator`` or ``@field_validator('*')``) are represented. Since they
validate all fields, their corresponding field reference is replaced with a
simple ``all fields`` marker which hyperlinks to the related model itself.
Expand Down

0 comments on commit 4feb3ed

Please sign in to comment.