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
Add version info to API reference. #3452
Comments
This is a really cool idea! Have you estimated how many edits would need to be made to implement this across all of D3? Also the changelog might be a good source, instead of combing through commits. I'm curious what is your current workflow for researching what release included each method? |
@curran You won't have to comb through individual commits, sifting through the tagged releases will do. Back in 2016 I suggested the introduction of the links to the source code behind every method (Add links from API docs to source. #2922) which, I think, is comparable in time and effort. That feat was completed in roughly 3 weeks total (see checklist). Double that time to account for the extra effort for the main bundle and you are still facing a feasible task. Additionally, the source links might change over time, whereas the links to the version are static information. My current workflow for finding this information is basically a gut-based approach. Since I have closely followed the development of D3 over the past years I have a relatively precise feeling for when a feature was introduced to the code base. When it comes to finding the exact version, though, I always end up poking around in the version history. |
Got it. This sounds promising! Maybe open a PR that makes the change for just one method? Then we can try to get an audience with more D3 maintaners and ask for feedback on the formatting before doing it everywhere. I see a path forward as:
|
There is an effort to work the API in a more (data-) structured way:
It's not yet reached the point where it can be used to completely regenerate the API.md file, but it's close. Adding more info to that structure would be very useful. |
@Fil Sounds promising. I'll have a look into that. BTW, your second link is dead. |
two remarks:
PS: I've shared the second link. |
Fair enough, among others I also stumbled upon the points you mentioned: I realized the deviation from the generic syntax and I also tried out
That's a far more tricky one to answer and I am totally undecided on it. I'd love to hear some pros and cons on this. Two more things which came to my mind:
|
The more I think about those two options the more I tend to the latter. Knowing when a method was first added just by its name is not of much use if its signature has changed in the meantime. The typical use case would be to look when a method with the documented signature first became available in the API. To get the most out of it I suggest using the following syntax:
The Changed tag should only be used for changes to the signature, though. The decision about what tag to use should solely be made depending on the interface not the implementation. |
Yes, it makes sense this way. |
Just pushed an update incorporating the proposed changes for changed method signatures. |
I’d like to figure out a nice way of doing this for the new VitePress-powered documentation #3655 but I haven’t come up with one yet. |
Documenting the current API versions would be a one-time effort, but this request also presents an ongoing burden for any new or changed API on any future release. By my estimate, there are currently about 1,200 methods that would need version numbers. Possibly you could parse the release notes and look for links to new API methods of the form “Add d3.foo” and detect when new methods were added… maybe this would also work to detect when methods are changed (“Fix d3.foo”) or accept new options. But the release notes are primarily intended for humans and not machines, and thus any attempt to automatically parse them to understand API changes is unlikely to be robust. So, I think this is just too much work for me, sorry. |
Mainly while answering questions on StackOverflow I often find myself looking for information about when a method was added to the code base. It would be particularly helpful if we could have this information presented in the API docs themselves like this:
Ideally, the version info on the method would link directly to the tagged release version in the GitHub repository like in above example.
Obviously, this needs to be done twice for every method:
This is a one-time effort, though, as the information will not change in the future. Should we agree on this I would love to volunteer for assembling the information from the repository's history.
The text was updated successfully, but these errors were encountered: