- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 33.3k
gh-140212: Add html for year-month option in Calendar #140230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the  | 
| Note that the html produced in  I didn't do this at this stage because it would actually be a larger change, and I'm not sure this will be merged regardless. Let me know if I should extract the common code out. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a blurb and docs.
| @StanFromIreland I have added a blurb and updated documentation for Calendar's argparser. I was not sure if the blurb was supposed to go in  I have updated the docs as well. I think it's best to squash the commits before a hypothetical merging. I'll do so upon request. | 
| It should be in Library. Squash is done by the commiter, please don't force push, it only causes confusion. | 
| @StanFromIreland I have moved the blurb to Library. | 
Contributed by hugovk Co-authored-by: Hugo van Kemenade <[email protected]>
| Please could you also list this in What's New? | 
| @hugovk It's done (given that the entry is acceptable). | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
| @AA-Turner Let me know if there is anything I can do at this point to get this PR merged. | 
Running
python3.13 -m calendar 2025pretty-prints the calendar for all of 2025. If we add the month at the end, it only prints the month.python3.13 -m calendar 2025It is possible to get HTML output by using
python -m calendar -t html 2025, which gives the calender for 2025 in HTML format.However, if we add the month,
python -m calendar -t html 2025 10it fails:This PR simply adds support for HTML-formatting the year-month option.
A test is included, and one existing test is removed: a test verifying that the year month option fails.