Skip to content

Improved documentation by adding code comments and ensuring consistency#1342

Open
Rohit1240 wants to merge 7 commits into
collective:mainfrom
Rohit1240:patch-1
Open

Improved documentation by adding code comments and ensuring consistency#1342
Rohit1240 wants to merge 7 commits into
collective:mainfrom
Rohit1240:patch-1

Conversation

@Rohit1240

@Rohit1240 Rohit1240 commented Apr 28, 2026

Copy link
Copy Markdown

…cy in code blocks

This PR improves documentation by:

  • Ensuring consistency in code block formatting
  • Adding helpful comments to code examples for better understanding

Closes issue

Replace ISSUE_NUMBER with the issue number that your pull request fixes. Then GitHub will link and automatically close the related issue.

  • Closes #ISSUE_NUMBER

Description

Write a description of the fixes or improvements.

Checklist

  • I've added a change log entry to CHANGES.rst.
  • I've added or updated tests if applicable.
  • I've run and ensured all tests pass locally by following Run tests.
  • I've added or edited documentation, both as docstrings to be rendered in the API documentation and narrative documentation, as necessary.

Additional information

Upload screenshots, videos, links to documentation, or any other relevant information.


📚 Documentation preview 📚: https://icalendar--1342.org.readthedocs.build/

…cy in code blocks

This PR improves documentation by:
- Ensuring consistency in code block formatting
- Adding helpful comments to code examples for better understanding
@Rohit1240 Rohit1240 requested a review from stevepiercy as a code owner April 28, 2026 17:28
@read-the-docs-community

read-the-docs-community Bot commented Apr 28, 2026

Copy link
Copy Markdown

Documentation build overview

📚 icalendar | 🛠️ Build #32486150 | 📁 Comparing e78cce2 against latest (0e7c6df)

  🔍 Preview build  

2 files changed
± 404.html
± how-to/usage.html

@Rohit1240

Copy link
Copy Markdown
Author

Hi, I worked on improving documentation by fixing references to Python objects using fully qualified names.
Additionally, I enhanced readability by adding comments to code examples and improving formatting consistency.
For example, I replaced incomplete references like :meth:add() with fully qualified names such as :meth:icalendar.cal.component.Component.add.
Please let me know if any changes are needed. This is my first open source contribution.

@niccokunzmann

Copy link
Copy Markdown
Member

Hi,

thanks for your contribution and time. We require to log the changes in the changelog file. Also, have a look at the failing tests. They need to run. If you have questiins, please ask us!

@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 your contribution! You caught a few things that were missed, some for over two decades. Would you please take a look at my suggestions?

Comment thread docs/how-to/usage.rst Outdated
Comment thread docs/how-to/usage.rst Outdated
Comment thread docs/how-to/usage.rst Outdated
Comment thread docs/how-to/usage.rst
Comment thread docs/how-to/usage.rst Outdated
Comment thread docs/how-to/usage.rst Outdated
Comment thread docs/how-to/usage.rst
Comment on lines +193 to +194
>>> cal = Calendar() # create a calendar object
>>> cal.add("dtstart", datetime(2005,4,4,8,0,0)) # set start date

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.

Inline comments should have a minimum of two spaces after the line of code.

Suggested change
>>> cal = Calendar() # create a calendar object
>>> cal.add("dtstart", datetime(2005,4,4,8,0,0)) # set start date
>>> cal = Calendar() # create a calendar object
>>> cal.add("dtstart", datetime(2005,4,4,8,0,0)) # set start date

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 suggestion was omitted.

@stevepiercy

Copy link
Copy Markdown
Member

Regarding the failing test, this is due to fixing the Sphinx directive, changing it from code to code-block, so that the test actually runs for the first time. The output in the documentation should be updated to match the actual Python console output.

@stevepiercy stevepiercy mentioned this pull request Apr 28, 2026
23 tasks
Rohit1240 and others added 6 commits April 30, 2026 20:10
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
@niccokunzmann

Copy link
Copy Markdown
Member

Hi, we created a new release, please move your edits in CHANGES.rst to the new section.

@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.

The failing tests are due to fixing the Sphinx directive, changing it from code to code-block, so that the test actually runs for the first time. The output in the documentation should be updated to match the actual Python console output. See https://icalendar.readthedocs.io/en/stable/contribute/documentation/build-check.html#test-code-snippets-and-docstrings.

Also please update your branch against main, then move the change log entry under the unreleased section.

Comment thread docs/how-to/usage.rst
Comment on lines +193 to +194
>>> cal = Calendar() # create a calendar object
>>> cal.add("dtstart", datetime(2005,4,4,8,0,0)) # set start date

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 suggestion was omitted.

@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.

@Rohit1240 there are several instances that need to be fixed. Would you please take care? Thank you!

Comment thread docs/how-to/usage.rst
After loading the example file, edit and save it.

.. code:: pycon
.. .. code-block:: pycon

@stevepiercy stevepiercy May 25, 2026

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 comments out the code-block directive, so the ensuing code block is not rendered correctly. Please change this and all other instances as shown.

Suggested change
.. .. code-block:: pycon
.. code-block:: pycon

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.

Alternatively, rebase your branch on main after #1412 is merged. Thank you!

@stevepiercy

Copy link
Copy Markdown
Member

@Rohit1240 also, would you please edit your description from Closes #ISSUE_NUMBER to Refs #626? Thank you!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants