-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Show "supported since version x" for functions in API documentation #3713
Comments
FWIW I think this is a great idea |
The docs wg has already discussed this idea before and we seemed to all agree it is a thing we want. We just haven't got to it yet. Contributions in that regard are absolutely welcome! 😄 |
There are tons of ways to visually display this. I just messed around with the dev tools and mocked this up to get the discussion going: Any other suggestions? As reference, the PHP docs have something similar - notice the Also, maybe we should consider supporting the few cases where the API for a given function have changed between two versions of node - e.g. |
I think we need to be more precise about the version number. Because we are following semver, a method could be added in v5.4. |
Maybe it makes sense to also include a short notice about the first (soft) deprecation of a module/ function. |
This is a great idea, I've actually had to figure it out manually several times in the past. Not fun. @watson's mockup looks great and keeping version numbers as precise as possible is definitely the right thing to do. Concerning deprecation versions: I do not think those are relevant information, since no functionality actually changes in those cases. |
How would this look in the markdown? Can get started on the generate.js tool once this has consensus. |
I would propose to just use something like
buf.indexOf(value[, byteOffset]) since v5.4
Operates similar to [...] |
@jwueller looks good! @tflanagan what does the generate.js tool do? |
@watson generate.js is our current doc generation tool. It turn markdown into html mostly. Note that it's pretty fragile and hasn't been touched in years. :) |
@Fishrock123 thanks for explaining 😃 So if I understand it correctly, the process would have to look something like this(?):
I don't mind making a PR with no 2 if we agree on the markdown format. @jwueller In my example I added the css style |
@watson If we were only ever using a generator script that compiles to HTML, there would be no need to do more than a single element (like However, I would ideally like to have this be readable in non-generate.js scenarios as well (e.g. the GitHub Markdown renderer). That is why I proposed emphasis in addition to |
Just as a side note, @jwueller, GitHub markdown does support the superscript tag. |
@jwueller yeah, it would be really nice if the markdown files are readable on GitHub as well. But I'm ok with the "since"-text being bold on GitHub. Most people are going to look at the docs on nodejs.org, so as long as we can tweak the the CSS there I think we're good 😃 |
@tflanagan Is there any special markup for it? I cannot seem to find anything. My original example used the @watson The emphasis in my example was only added to improve readability on GitHub. There is no way that I am aware of to un-bold text using Markdown syntax alone, so that is how it'll have to be. The CSS for the documentation pages can obviously improve this even more. |
+1 for this. People love to knock PHP, but its documentation has done a better job of communicating this information than any similar documentation I can think of. @targos @watson mentioned that they display some broad version information at the top of each page (it's not always just the major version number), but (as applicable) pages also include a Example:
|
This commit introduces the Documentation YAML metadata concept to the documentation. - Parses added or Added for HTML - Parses all data for JSON Ref: nodejs#3713 Ref: nodejs#6470
This commit introduces the Documentation YAML metadata concept to the documentation. - Parses added or Added for HTML - Parses all data for JSON Ref: #3867 Ref: #3713 Ref: #6470 PR-URL: #6495 Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
This commit introduces the Documentation YAML metadata concept to the documentation. - Parses added or Added for HTML - Parses all data for JSON Ref: #3867 Ref: #3713 Ref: #6470 PR-URL: #6495 Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Closing in favor of #6578. That issue is a duplicate of this. There is great progress being made on this front. Thanks! |
This commit introduces the Documentation YAML metadata concept to the documentation. - Parses added or Added for HTML - Parses all data for JSON Ref: nodejs#3867 Ref: nodejs#3713 Ref: nodejs#6470 PR-URL: nodejs#6495 Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
This commit introduces the Documentation YAML metadata concept to the documentation. - Parses added or Added for HTML - Parses all data for JSON Ref: #3867 Ref: #3713 Ref: #6470 PR-URL: #6495 Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
This commit introduces the Documentation YAML metadata concept to the documentation. - Parses added or Added for HTML - Parses all data for JSON Ref: #3867 Ref: #3713 Ref: #6470 PR-URL: #6495 Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
This commit introduces the Documentation YAML metadata concept to the documentation. - Parses added or Added for HTML - Parses all data for JSON Ref: #3867 Ref: #3713 Ref: #6470 PR-URL: #6495 Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
I think it would be useful to show from which version a given function in the API is supported, e.g.
Buffer.prototype.indexOf()
was added in v4.x, so if I'm creating a node module that should be backwards compatible with node v0.12, I shouldn't use that function.I'll happily make pull request with this change - and please comment if you have deeper knowlege of the documentation system in case there are ways to (semi-)automate this in some way.
The text was updated successfully, but these errors were encountered: