Skip to content

docs: Fix broken cross-references to Python objects across the codebase - #1679

Open
morning-verlu wants to merge 2 commits into
collective:mainfrom
morning-verlu:fix/broken-doc-references
Open

docs: Fix broken cross-references to Python objects across the codebase#1679
morning-verlu wants to merge 2 commits into
collective:mainfrom
morning-verlu:fix/broken-doc-references

Conversation

@morning-verlu

Copy link
Copy Markdown

Summary

This PR fixes broken Sphinx cross-references to Python objects throughout the source code, addressing issue #1158.

Changes

Short-form ~error. references → ~icalendar.error.

Fixed ~error.JCalParsingError, ~error.InvalidCalendar, and ~error.IncompleteComponent references to use the fully qualified ~icalendar.error. path in 28 files across src/icalendar/.

Re-exported ~icalendar.Component. references → ~icalendar.cal.component.Component.

Fixed 32 references that used the re-exported icalendar.Component path instead of the actual module path icalendar.cal.component.Component. Affected files include event.py, journal.py, todo.py, available.py, and others.

Unqualified class/method references

  • :class:BUSYTYPE → `:class:`~icalendar.enums.BUSYTYPE in enums.py
  • :class:FBTYPE → `:class:`~icalendar.enums.FBTYPE in enums.py
  • :class:vBoolean → `:class:`~icalendar.prop.boolean.vBoolean in boolean.py
  • :meth:Component.from_ical → `:meth:`~icalendar.cal.component.Component.from_ical in categories.py
  • :func:Component.from_jcal → `:func:`~icalendar.cal.component.Component.from_jcal in factory.py and component.py

Verification

All references now use fully qualified names so Sphinx can resolve them correctly in the generated documentation.

Contributes to #1158.

@github-actions github-actions Bot added the ai-suspicion This contribution is possibly created with lots of AI help without enough human understanding. label Aug 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request did not pass quality checks and AI use is suspected. Please review Contribute and make any necessary amendments.

@github-actions

Copy link
Copy Markdown
Contributor

Profile summary:

GitHub user: morning-verlu
🔴 Significant concerns found with user's profile.
🟡 Some concerns found with recent PR activity.
🟢 No concerns found with recent issue activity.

For a more detailed report, run `gh-profiler morning-verlu`.
Full profile
GitHub user: morning-verlu
🔴 Significant concerns found with user's profile.
   🟡 Account age: 6 months
   🔴 No profile information provided.

🟡 Some concerns found with recent PR activity.
   14 PRs opened in the last 21 days.
      0 opened against repos the user owns.
      0 opened against repos in publicly associated orgs.
      14 opened against external repos.

   🟡 3 of 14 external PRs closed without merging in the last 21 days.

🟢 No concerns found with recent issue activity.
   🟢 No new issues opened in the last 21 days.

@read-the-docs-community

read-the-docs-community Bot commented Aug 18, 2026

Copy link
Copy Markdown

@stevepiercy

Copy link
Copy Markdown
Member

@morning-verlu would you please address the failing CI checks? We don't review PRs until they pass all these checks.

@stevepiercy stevepiercy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for you contribution! It fixes several things, but I found a couple of instances that need special attention. Would you please take care?

@@ -0,0 +1 @@
Fixed broken Sphinx cross-references to Python objects throughout the codebase, including ``~error.``, ``~icalendar.Component.``, and unqualified class/method references.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that ~error.InvalidCalendar under a Raises section heading in a docstring is perfectly valid syntax and is not "broken." See https://icalendar.readthedocs.io/en/latest/reference/api/icalendar.cal.alarm.html#icalendar.cal.alarm.Alarm.new. This is a standardization.

However, AI is not intelligent despite its name, and will continue to force the issue, and I reckon that it's slightly more helpful to the reader of source code, so I'll go along with it.

Adjusted the news fragment accordingly, and give yourself credit.

Suggested change
Fixed broken Sphinx cross-references to Python objects throughout the codebase, including ``~error.``, ``~icalendar.Component.``, and unqualified class/method references.
Fixed broken and standardized Sphinx cross-references to Python objects throughout the code base, including ``~icalendar.Component.``, unqualified class and method references, and ``~error.``. @morning-verlu

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please rename this file to 1158.documentation.2 to automatically generate a link to the issue when the news fragments are compiled into the change log. Thank you!

Parameters:
categories: The :attr:`categories` of the Available component.
comments: The :attr:`~icalendar.Component.comments` of the Available
comments: The :attr:`~icalendar.cal.component.Component.comments` of the Available

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these parameters look much better now. Thank you!


Returns:
A new :class:`vBoolean` instance with the supplied property parameters.
A new :class:`~icalendar.prop.boolean.vBoolean` instance with the supplied property parameters.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is another example that standardizes the working link. Both forms are valid. See https://icalendar.readthedocs.io/en/latest/reference/api/icalendar.prop.boolean.html.

"""Parse a CATEGORIES value from iCalendar format.

This helper is normally called by :meth:`Component.from_ical`, which
This helper is normally called by :meth:`~icalendar.cal.component.Component.from_ical`, which

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original syntax didn't link, so well-spotted! However, here we want to preserve the display of the last two segments of the dotted path to disambiguate which from_ical is called throughout the code base.

Suggested change
This helper is normally called by :meth:`~icalendar.cal.component.Component.from_ical`, which
This helper is normally called by :meth:`Component.from_ical <icalendar.cal.component.Component.from_ical>`, which

Parameters:
ical: A list of category strings (preferred, as provided by
:meth:`Component.from_ical`), or a single comma-separated
:meth:`~icalendar.cal.component.Component.from_ical`), or a single comma-separated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:meth:`~icalendar.cal.component.Component.from_ical`), or a single comma-separated
:meth:`Component.from_ical <icalendar.cal.component.Component.from_ical>`), or a single comma-separated

``"date-time"`` for ``DTSTART`` or ``"duration"`` for ``TRIGGER``.
This is the value type a property uses when no explicit ``VALUE``
parameter is given, so it tells :func:`Component.from_jcal` whether a
parameter is given, so it tells :func:`~icalendar.cal.component.Component.from_jcal` whether a

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a method, being under a class.

Suggested change
parameter is given, so it tells :func:`~icalendar.cal.component.Component.from_jcal` whether a
parameter is given, so it tells :meth:`Component.from_ical <icalendar.cal.component.Component.from_ical>` whether a

@stevepiercy

Copy link
Copy Markdown
Member

@morning-verlu would you please resolve the merge conflicts as well? We can't merge until that's done. Thank you!

niccokunzmann
niccokunzmann previously approved these changes Aug 19, 2026

@niccokunzmann niccokunzmann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready for merge after @stevepiercy's suggestions. Since this covers a lot of places, let's get it merged quickly to avoid spending time on merge conflicts.

Fix unqualified and short-form Sphinx cross-references throughout the
codebase so that documentation links resolve correctly:

- Replace ~error.X with ~icalendar.error.X (JCalParsingError,
  InvalidCalendar, IncompleteComponent) in 28 source files
- Replace ~icalendar.Component.attr with
  ~icalendar.cal.component.Component.attr in 32 references
- Qualify :class:BUSYTYPE and :class:FBTYPE in enums.py
- Qualify :class:vBoolean in boolean.py
- Qualify :meth:Component.from_ical in categories.py
- Qualify :func:Component.from_jcal in factory.py and component.py

Contributes to collective#1158
@morning-verlu
morning-verlu force-pushed the fix/broken-doc-references branch from c3e9645 to 7057ca9 Compare September 2, 2026 08:29
@coveralls-official

Copy link
Copy Markdown

Coverage Status

coverage: 97.536%. remained the same — morning-verlu:fix/broken-doc-references into collective:main

@morning-verlu

Copy link
Copy Markdown
Author

Rebased onto the current main branch and resolved the merge conflicts. The refreshed documentation, ruff, test, fuzzing, and package checks are all passing now.

@niccokunzmann

Copy link
Copy Markdown
Member

@morning-verlu Please let us know when we should have another look! Are you still working on this or should we review? You can also let us know in the comments above if they have been addressed or if you have a question or idea.

@stevepiercy

Copy link
Copy Markdown
Member

@morning-verlu would you please address my review? See #1679 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-suspicion This contribution is possibly created with lots of AI help without enough human understanding. doc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants