docs: fix broken cross-references in documentation#1369
Conversation
Fixes collective#1158 - Remove :py: prefix from cross-references in docstrings (:py:class: -> :class:, :py:mod: -> :mod:, :py:meth: -> :meth:) - Fix unqualified references to use fully qualified names (e.g. :class:`BUSYTYPE` -> :class:`icalendar.enums.BUSYTYPE`) - Use tilde-prefixed references for cleaner display (:class:`~icalendar.cal.todo.Todo`) - Affected files: calendar.py, lazy.py, todo.py, caselessdict.py, enums.py, parser/ical/lazy.py, parser/parameter.py, parser/property.py, parser/string.py, prop/dt/date.py, prop/dt/datetime.py, prop/dt/duration.py, prop/dt/time.py
Documentation build overview
22 files changed ·
|
|
@wahajahmed010 would you please:
For details, see https://icalendar.readthedocs.io/en/stable/contribute/index.html and https://icalendar.readthedocs.io/en/stable/contribute/development.html. Once you perform those tasks, then I'll do a review. Thank you! |
|
@stevepiercy Thanks for the review! I've addressed all your feedback:
Ready for another review! 🙏 |
| Minor changes | ||
| ~~~~~~~~~~~~~ | ||
|
|
||
| - Fix broken cross-references in documentation by replacing ``:py:`` prefixed roles with standard Sphinx roles and qualifying ambiguous references. See `#1158 <https://github.com/collective/icalendar/issues/1158>`_ |
There was a problem hiding this comment.
Please edit and move this to a new file at /news/1158.documentation. In v7.1.1, we migrated to an automated procedure to update CHANGES.rst, per https://icalendar.readthedocs.io/en/latest/contribute/index.html#change-log-entry-format. This also avoids merge conflicts and updating your PR repeatedly while waiting for it to get merged.
| - Fix broken cross-references in documentation by replacing ``:py:`` prefixed roles with standard Sphinx roles and qualifying ambiguous references. See `#1158 <https://github.com/collective/icalendar/issues/1158>`_ | |
| - Fix broken cross-references in documentation by removing ``:py`` prefixed roles and qualifying ambiguous references. @wahajahmed010 |
I'll perform a full review later.
stevepiercy
left a comment
There was a problem hiding this comment.
Thank you for your contribution! This is an improvement, but some things need to be reverted. I'll explain.
Python objects without a fully qualified path are in the context of the module, whether that's in docstrings or code, and it's not ambiguous. Adding a fully qualified path adds visual noise to readers of the source code, and it doesn't change how the link functions. Such links weren't broken and didn't need to be changed.
You did catch one incorrect and ambiguous reference, though, and that was well-spotted.
Would you please take care? Thank you!
| True | ||
|
|
||
| When you access all :attr:`subcomponents` of the calendar, | ||
| When you access all :attr:`~icalendar.cal.component.Component.subcomponents` of the calendar, |
There was a problem hiding this comment.
Good catch! It previously linked to https://icalendar.readthedocs.io/en/latest/reference/api/icalendar.cal.lazy.html#icalendar.cal.lazy.LazyCalendar.subcomponents, which is not the greater context of all components.
| r"""Unescape backslash sequences in iCalendar text. | ||
|
|
||
| Unlike :py:meth:`unescape_string`, this only handles actual backslash escapes | ||
| Unlike :meth:`unescape_string`, this only handles actual backslash escapes |
There was a problem hiding this comment.
This doesn't fix the link as is. See https://icalendar--1369.org.readthedocs.build/en/1369/reference/api/icalendar.parser.property.html#icalendar.parser.property.unescape_backslash. This should fix it.
| Unlike :meth:`unescape_string`, this only handles actual backslash escapes | |
| Unlike :meth:`~icalendar.parser.string.unescape_string`, this only handles actual backslash escapes |
|
|
||
| Returns: | ||
| :class:`Todo` | ||
| :class:`~icalendar.cal.todo.Todo` |
There was a problem hiding this comment.
Unnecessary. Please revert.
| :class:`~icalendar.cal.todo.Todo` | |
| :class:`Todo` |
| Call :meth:`~icalendar.parser.ical.lazy.LazySubcomponent.parse` to get the fully | ||
| parsed component. |
There was a problem hiding this comment.
Unnecessary. Please revert.
| Call :meth:`~icalendar.parser.ical.lazy.LazySubcomponent.parse` to get the fully | |
| parsed component. | |
| Call :meth:`parse` to get the fully parsed component. |
| Joins list items with the separator, applying | ||
| :func:`~icalendar.parser.parameter.dquote` to each item |
There was a problem hiding this comment.
Unnecessary. Please revert.
| Joins list items with the separator, applying | |
| :func:`~icalendar.parser.parameter.dquote` to each item | |
| Joins list items with the separator, applying :func:`dquote` to each item |
| Applies :func:`~icalendar.parser.string._unescape_string` to the value. If the value | ||
| is a list, |
There was a problem hiding this comment.
Unnecessary. Please revert.
| Applies :func:`~icalendar.parser.string._unescape_string` to the value. If the value | |
| is a list, | |
| Applies :func:`_unescape_string` to the value. If the value is a list, |
There was a problem hiding this comment.
Please revert all changes to this file. They aren't necessary. Private functions don't render as links. The one public function is not ambiguous and its link works as is.
There was a problem hiding this comment.
Pleasse revert all changes to this file. They aren't necessary.
There was a problem hiding this comment.
Pleasse revert all changes to this file. They aren't necessary.
See #1158
Changes
Remove
:py:prefix from cross-references in docstrings::py:class:→:class::py:mod:→:mod::py:meth:→:meth:Fix unqualified references to use fully qualified names:
:class:BUSYTYPE→ `:class:`icalendar.enums.BUSYTYPE:class:FBTYPE→ `:class:`icalendar.enums.FBTYPE:func:_escape_char→ `:func:`~icalendar.parser.string._escape_charUse tilde-prefixed references (
~) for cleaner displayed text while maintaining correct linking.Files changed (13)
src/icalendar/cal/calendar.pysrc/icalendar/cal/lazy.pysrc/icalendar/cal/todo.pysrc/icalendar/caselessdict.pysrc/icalendar/enums.pysrc/icalendar/parser/ical/lazy.pysrc/icalendar/parser/parameter.pysrc/icalendar/parser/property.pysrc/icalendar/parser/string.pysrc/icalendar/prop/dt/date.pysrc/icalendar/prop/dt/datetime.pysrc/icalendar/prop/dt/duration.pysrc/icalendar/prop/dt/time.pyThis PR was AI-assisted.
📚 Documentation preview 📚: https://icalendar--1369.org.readthedocs.build/