-
-
Notifications
You must be signed in to change notification settings - Fork 208
Fix link of uid via icalendar.attr.uid_property import
#1064
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
Pull Request Test Coverage Report for Build 20748744326Details
💛 - Coveralls |
|
Looks like a fix. Is uid part of the superclass Component? |
|
Ah, yes. For this uid, it would be this: because of The reason for the inconsistency here is that some properties are defined on all components according to later RFCs but RFC5545 for example only defines them on certain components. That is why there are not present in all Components. |
|
I found this, but I don't know whether that makes it 🦸 . hehe. icalendar/src/icalendar/cal/component.py Lines 9 to 20 in 6a8e974
icalendar/src/icalendar/cal/component.py Line 688 in 6a8e974
For the other attrs that don't link, should we do a similar treatment?
Also this issue turns out to be less about documentation and more about code and feature compliance with the RFCs. I get concerned about tests as well. I'd prefer to focus on documentation, and let a first-timer pick this up by giving enough direction for them to run with it. |
|
It looks like we had crossed GitHub comments, and I just noticed you opened #1066. The syntax you suggested doesn't work. The target must always resolve to a fully qualified dotted Python path. For this one, I'd go with markup that indicates in which class :attr:`icalendar.cal.component.Component.uid`or :attr:`Component.uid <icalendar.cal.component.Component.uid>`At this point, I'm not sure how to proceed. I pushed a commit so you can see the change. |
|
I think, just displaying |
|
I tried removing both the import and the variable that used the import. As a result, the only way that :attr:`Component.uid <icalendar.cal.component.Component.uid>`...which links to https://icalendar.readthedocs.io/en/latest/reference/api/icalendar.cal.component.html#icalendar.cal.component.Component.uid But it sounds like that's not what you want, and that you prefer it would link to: ...which only exists when there is the import and variable that uses the import. I don't have a preference for how to write something, other than the link and its label must align and have the proper context. If I were instead to do something like this in the Availability class: :attr:`~icalendar.cal.component.Component.uid`Then the link would go to a different context, outside of Availability and into Component. That's not aligned and would confuse readers. |
|
@niccokunzmann I pushed another revision. This links within the page, retaining context, and uses the short form. However the import and variable declaration are required to make the link work. Without these two lines, you have no without importwith importYou can also look at the right-hand in-page navigation to see what I'm talking about. |
|
Hm. I don't mind either way. One looks nicer and the other one is compact in code. They are both functionally valid. So, please choose how you like the docs. I start thinking that it is more compact then to rename these properties if they have multiple imports so they can be imported in the class like What about consistency and other methods like to_ical? A style can be tried out here and then an issue created for first timers to make it consistent across all classes. Is there a way some inherited functions and atrributes can be displayed? Is that desirable? |
Just to be clear, I'm saying that these two hyperlinks are not functionally valid as hyperlinks after Sphinx renders it to HTML. As Python code, they may be functionally valid, either with or without the two lines of the import and the variable assignment.
When there's a change in code, I don't think this is a personal preference, but an intentional design decision. That goes beyond mere appearance. I don't feel it's right for me to make a unilateral choice here.
I think it's confusing to write reStructuredText To back up a bit, I first noticed this when I resolved all the "duplicate object" warnings emitted by Sphinx in a separate recent PR. Even Sphinx was confused, ha! That has been cleared up, specifically by always using a full dotted Python path in the target. That leaves us with the question of what should be the actual target, either the superclass or subclass? I don't feel qualified to answer that question by myself. I don't actually use or develop in icalendar, although I've absorbed a basic understanding from just writing docs. That's where your experience, and that of other users and developers, is extremely valuable. I think it would be reasonable to say that if I were writing code, and I couldn't find Now imagine doing the same thing for an attribute that does appear, such as This difference causes a small dissonance for me as a documentarian, but this may be acceptable to users and developers.
Do you mean where
I'm not sure what you have in mind. Do you envision something like a list of inherited objects in a separate section, some way of marking them inline where they appear in the page, or something else? Here are some options.
|
|
From my perspective, either way does not make much of a difference:
Sometimes, we can take up a lot of time to decide on things that are almost equal in outcome. I would say, you choose the one that feels best for you. You look at it from the outside a bit more than I do. So, if it works for you, then perfect! Go for it :) When someone has an issue with it in the future, they can still change it. |
|
I think what would work well for me is to document the members that Component also has. But not the members that come before that. Would that solve the issue with the linking then? Hm. Maybe, I try my luck too at some point. |



Description
Resolve broken cross-reference links in
new()methods.Checklist
CHANGES.rst.